Skip to content

Commit

Permalink
Add to nodejs
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Nov 7, 2023
1 parent 6b29c75 commit 3090a35
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bindings/nodejs/lib/types/wallet/bridge/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ export type __ImplicitAccountCreationAddressMethod__ = {
name: 'implicitAccountCreationAddress';
};

export type __AccountsMethod__ = {
name: 'accounts';
};

export type __ImplicitAccountsMethod__ = {
name: 'implicitAccounts';
};
Expand Down
2 changes: 2 additions & 0 deletions bindings/nodejs/lib/types/wallet/bridge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import type {
__OutputsMethod__,
__PendingTransactionsMethod__,
__ImplicitAccountCreationAddressMethod__,
__AccountsMethod__,
__ImplicitAccountsMethod__,
__IncomingTransactionsMethod__,
__TransactionsMethod__,
Expand Down Expand Up @@ -99,6 +100,7 @@ export type __AccountMethod__ =
| __OutputsMethod__
| __PendingTransactionsMethod__
| __ImplicitAccountCreationAddressMethod__
| __AccountsMethod__
| __ImplicitAccountsMethod__
| __IncomingTransactionsMethod__
| __TransactionsMethod__
Expand Down
17 changes: 17 additions & 0 deletions bindings/nodejs/lib/wallet/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,23 @@ export class Account {
return JSON.parse(response).payload;
}

/**
* Returns the accounts of the wallet.
*
* @returns The accounts of the wallet.
*/
async accounts(): Promise<OutputData[]> {
const response = await this.methodHandler.callAccountMethod(
this.meta.index,
{
name: 'accounts',
},
);

const parsed = JSON.parse(response) as Response<OutputData[]>;
return plainToInstance(OutputData, parsed.payload);
}

/**
* Returns the implicit accounts of the wallet.
*
Expand Down

0 comments on commit 3090a35

Please sign in to comment.