Skip to content

Commit

Permalink
feat!(monero.ts): make createTransactionMultDest optionally return …
Browse files Browse the repository at this point in the history
…`null`
  • Loading branch information
Im-Beast committed Dec 19, 2024
1 parent e70a8a9 commit 2d9cfaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions impls/monero.ts/src/symbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1548,6 +1548,7 @@ export const moneroSymbols = {
],
},
MONERO_Wallet_createTransactionMultDest: {
optional: true,
nonblocking: true,
result: "pointer",
parameters: [
Expand Down
6 changes: 4 additions & 2 deletions impls/monero.ts/src/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ export class Wallet {
preferredInputs: string[] = [],
mixinCount = 0,
paymentId = "",
): Promise<PendingTransaction> {
const pendingTxPtr = await fns.Wallet_createTransactionMultDest(
): Promise<PendingTransaction | null> {
const pendingTxPtr = await fns.Wallet_createTransactionMultDest?.(
this.#ptr,
CString(destinationAddresses.join(SEPARATOR)),
C_SEPARATOR,
Expand All @@ -301,6 +301,8 @@ export class Wallet {
CString(preferredInputs.join(SEPARATOR)),
C_SEPARATOR,
);

if (!pendingTxPtr) return null;
return PendingTransaction.new(pendingTxPtr as PendingTransactionPtr);
}

Expand Down

0 comments on commit 2d9cfaa

Please sign in to comment.