diff --git a/expo/src/api/GnoNativeApi.ts b/expo/src/api/GnoNativeApi.ts index 4f90a605..f57a72ff 100644 --- a/expo/src/api/GnoNativeApi.ts +++ b/expo/src/api/GnoNativeApi.ts @@ -40,6 +40,8 @@ import { SetPasswordResponse, SetRemoteRequest, SetRemoteResponse, + UpdatePasswordRequest, + UpdatePasswordResponse, } from '@buf/gnolang_gnonative.bufbuild_es/gnonativetypes_pb'; import { GnoNativeService } from '@buf/gnolang_gnonative.connectrpc_es/rpc_connect'; import { PromiseClient } from '@connectrpc/connect'; @@ -228,6 +230,12 @@ export class GnoNativeApi implements GnoKeyApi, GoBridgeInterface { return response; } + async updatePassword(newPassword: string): Promise { + const client = await this.#getClient(); + const response = await client.setPassword(new UpdatePasswordRequest({ newPassword })); + return response; + } + async getActiveAccount(): Promise { const client = await this.#getClient(); const response = await client.getActiveAccount(new GetActiveAccountRequest()); diff --git a/expo/src/api/types.ts b/expo/src/api/types.ts index 82d7601d..9df5e894 100644 --- a/expo/src/api/types.ts +++ b/expo/src/api/types.ts @@ -10,6 +10,7 @@ import { SetChainIDResponse, SetPasswordResponse, SetRemoteResponse, + UpdatePasswordResponse, KeyInfo, } from '@buf/gnolang_gnonative.bufbuild_es/gnonativetypes_pb'; @@ -46,6 +47,7 @@ export interface GnoKeyApi { getKeyInfoByNameOrAddress: (nameOrBech32: string) => Promise; selectAccount: (nameOrBech32: string) => Promise; setPassword: (password: string) => Promise; + updatePassword: (password: string) => Promise; getActiveAccount: () => Promise; queryAccount: (address: Uint8Array) => Promise; deleteAccount: (