summaryrefslogtreecommitdiff
path: root/impls/monero.ts/src
diff options
context:
space:
mode:
Diffstat (limited to 'impls/monero.ts/src')
-rw-r--r--impls/monero.ts/src/symbols.ts1
-rw-r--r--impls/monero.ts/src/wallet.ts6
2 files changed, 5 insertions, 2 deletions
diff --git a/impls/monero.ts/src/symbols.ts b/impls/monero.ts/src/symbols.ts
index 2c34a6e..ca321b8 100644
--- a/impls/monero.ts/src/symbols.ts
+++ b/impls/monero.ts/src/symbols.ts
@@ -1548,6 +1548,7 @@ export const moneroSymbols = {
],
},
MONERO_Wallet_createTransactionMultDest: {
+ optional: true,
nonblocking: true,
result: "pointer",
parameters: [
diff --git a/impls/monero.ts/src/wallet.ts b/impls/monero.ts/src/wallet.ts
index 673ccab..92832da 100644
--- a/impls/monero.ts/src/wallet.ts
+++ b/impls/monero.ts/src/wallet.ts
@@ -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,
@@ -301,6 +301,8 @@ export class Wallet {
CString(preferredInputs.join(SEPARATOR)),
C_SEPARATOR,
);
+
+ if (!pendingTxPtr) return null;
return PendingTransaction.new(pendingTxPtr as PendingTransactionPtr);
}