From 4d30edc5d3c1c6494514d5f55412d6046299ead2 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 17 Sep 2024 01:41:50 +0000 Subject: default account --- lib/payments.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/payments.ts b/lib/payments.ts index bcb567c4..075cfab8 100644 --- a/lib/payments.ts +++ b/lib/payments.ts @@ -363,6 +363,7 @@ export let decode = async (hex) => { export let sendOnchain = async (params) => { let { account, hex, rate, user, signed } = params; + if (!account) account = user.id; if (!hex) ({ hex } = await build(params)); let { tx, type } = await decode(hex); @@ -625,7 +626,8 @@ export let build = async ({ user, }) => { let type = await getAddressType(address); - let node = + if (!account) account = user.id; + let node = account === user.id ? rpc(config[type]) : rpc({ ...config[type], wallet: account }); -- cgit v1.2.3