Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions expo/src/api/GnoNativeApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -228,6 +230,12 @@ export class GnoNativeApi implements GnoKeyApi, GoBridgeInterface {
return response;
}

async updatePassword(newPassword: string): Promise<UpdatePasswordResponse> {
const client = await this.#getClient();
const response = await client.setPassword(new UpdatePasswordRequest({ newPassword }));
return response;
}

async getActiveAccount(): Promise<GetActiveAccountResponse> {
const client = await this.#getClient();
const response = await client.getActiveAccount(new GetActiveAccountRequest());
Expand Down
2 changes: 2 additions & 0 deletions expo/src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
SetChainIDResponse,
SetPasswordResponse,
SetRemoteResponse,
UpdatePasswordResponse,
KeyInfo,
} from '@buf/gnolang_gnonative.bufbuild_es/gnonativetypes_pb';

Expand Down Expand Up @@ -46,6 +47,7 @@ export interface GnoKeyApi {
getKeyInfoByNameOrAddress: (nameOrBech32: string) => Promise<KeyInfo | undefined>;
selectAccount: (nameOrBech32: string) => Promise<SelectAccountResponse>;
setPassword: (password: string) => Promise<SetPasswordResponse>;
updatePassword: (password: string) => Promise<UpdatePasswordResponse>;
getActiveAccount: () => Promise<GetActiveAccountResponse>;
queryAccount: (address: Uint8Array) => Promise<QueryAccountResponse>;
deleteAccount: (
Expand Down