From 99782c121e9c681ed34448030f15f4f5829aa11f Mon Sep 17 00:00:00 2001 From: Jeff Thompson Date: Fri, 23 Aug 2024 15:41:08 +0200 Subject: [PATCH] fix: In GnoNativeApi, add missing updatePassword Signed-off-by: Jeff Thompson --- expo/src/api/GnoNativeApi.ts | 8 ++++++++ expo/src/api/types.ts | 2 ++ 2 files changed, 10 insertions(+) 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: (