Skip to content

Commit

Permalink
Add to nodejs bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Nov 6, 2023
1 parent 9b40b8c commit 769d416
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 __ImplicitAccountsMethod__ = {
name: 'implicitAccounts';
};

export type __IncomingTransactionsMethod__ = {
name: 'incomingTransactions';
};
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__,
__ImplicitAccountsMethod__,
__IncomingTransactionsMethod__,
__TransactionsMethod__,
__UnspentOutputsMethod__,
Expand Down Expand Up @@ -98,6 +99,7 @@ export type __AccountMethod__ =
| __OutputsMethod__
| __PendingTransactionsMethod__
| __ImplicitAccountCreationAddressMethod__
| __ImplicitAccountsMethod__
| __IncomingTransactionsMethod__
| __TransactionsMethod__
| __UnspentOutputsMethod__
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 implicit accounts of the wallet.
*
* @returns The implicit accounts of the wallet.
*/
async implicitAccounts(): Promise<OutputData[]> {
const response = await this.methodHandler.callAccountMethod(
this.meta.index,
{
name: 'implicitAccounts',
},
);

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

/**
* List all incoming transactions of the account.
*
Expand Down

0 comments on commit 769d416

Please sign in to comment.