@tcswap/wallets 4.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-6dcwbjsg.js +5 -0
- package/dist/chunk-6dcwbjsg.js.map +10 -0
- package/dist/chunk-78m70510.js +5 -0
- package/dist/chunk-78m70510.js.map +9 -0
- package/dist/chunk-vb4wtm2w.js +4 -0
- package/dist/chunk-vb4wtm2w.js.map +9 -0
- package/dist/chunk-y6rjn578.js +4 -0
- package/dist/chunk-y6rjn578.js.map +10 -0
- package/dist/src/bitget.cjs +4 -0
- package/dist/src/bitget.cjs.map +10 -0
- package/dist/src/bitget.js +4 -0
- package/dist/src/bitget.js.map +10 -0
- package/dist/src/coinbase/index.cjs +4 -0
- package/dist/src/coinbase/index.cjs.map +11 -0
- package/dist/src/coinbase/index.js +4 -0
- package/dist/src/coinbase/index.js.map +11 -0
- package/dist/src/cosmostation.cjs +4 -0
- package/dist/src/cosmostation.cjs.map +10 -0
- package/dist/src/cosmostation.js +4 -0
- package/dist/src/cosmostation.js.map +10 -0
- package/dist/src/ctrl.cjs +4 -0
- package/dist/src/ctrl.cjs.map +10 -0
- package/dist/src/ctrl.js +4 -0
- package/dist/src/ctrl.js.map +10 -0
- package/dist/src/evm-extensions.cjs +4 -0
- package/dist/src/evm-extensions.cjs.map +10 -0
- package/dist/src/evm-extensions.js +4 -0
- package/dist/src/evm-extensions.js.map +10 -0
- package/dist/src/index.cjs +4 -0
- package/dist/src/index.cjs.map +11 -0
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +11 -0
- package/dist/src/keepkey-bex.cjs +4 -0
- package/dist/src/keepkey-bex.cjs.map +10 -0
- package/dist/src/keepkey-bex.js +4 -0
- package/dist/src/keepkey-bex.js.map +10 -0
- package/dist/src/keepkey.cjs +4 -0
- package/dist/src/keepkey.cjs.map +10 -0
- package/dist/src/keepkey.js +4 -0
- package/dist/src/keepkey.js.map +10 -0
- package/dist/src/keplr.cjs +4 -0
- package/dist/src/keplr.cjs.map +10 -0
- package/dist/src/keplr.js +4 -0
- package/dist/src/keplr.js.map +10 -0
- package/dist/src/keystore.cjs +4 -0
- package/dist/src/keystore.cjs.map +10 -0
- package/dist/src/keystore.js +4 -0
- package/dist/src/keystore.js.map +10 -0
- package/dist/src/ledger.cjs +4 -0
- package/dist/src/ledger.cjs.map +10 -0
- package/dist/src/ledger.js +4 -0
- package/dist/src/ledger.js.map +10 -0
- package/dist/src/near-wallet-selector/index.cjs +4 -0
- package/dist/src/near-wallet-selector/index.cjs.map +10 -0
- package/dist/src/near-wallet-selector/index.js +4 -0
- package/dist/src/near-wallet-selector/index.js.map +10 -0
- package/dist/src/okx.cjs +4 -0
- package/dist/src/okx.cjs.map +10 -0
- package/dist/src/okx.js +4 -0
- package/dist/src/okx.js.map +10 -0
- package/dist/src/onekey.cjs +4 -0
- package/dist/src/onekey.cjs.map +10 -0
- package/dist/src/onekey.js +4 -0
- package/dist/src/onekey.js.map +10 -0
- package/dist/src/passkeys/index.cjs +4 -0
- package/dist/src/passkeys/index.cjs.map +10 -0
- package/dist/src/passkeys/index.js +4 -0
- package/dist/src/passkeys/index.js.map +10 -0
- package/dist/src/phantom.cjs +4 -0
- package/dist/src/phantom.cjs.map +10 -0
- package/dist/src/phantom.js +4 -0
- package/dist/src/phantom.js.map +10 -0
- package/dist/src/polkadotjs.cjs +4 -0
- package/dist/src/polkadotjs.cjs.map +10 -0
- package/dist/src/polkadotjs.js +4 -0
- package/dist/src/polkadotjs.js.map +10 -0
- package/dist/src/radix/index.cjs +4 -0
- package/dist/src/radix/index.cjs.map +10 -0
- package/dist/src/radix/index.js +4 -0
- package/dist/src/radix/index.js.map +10 -0
- package/dist/src/talisman.cjs +4 -0
- package/dist/src/talisman.cjs.map +10 -0
- package/dist/src/talisman.js +4 -0
- package/dist/src/talisman.js.map +10 -0
- package/dist/src/trezor.cjs +4 -0
- package/dist/src/trezor.cjs.map +10 -0
- package/dist/src/trezor.js +4 -0
- package/dist/src/trezor.js.map +10 -0
- package/dist/src/tronlink.cjs +4 -0
- package/dist/src/tronlink.cjs.map +10 -0
- package/dist/src/tronlink.js +4 -0
- package/dist/src/tronlink.js.map +10 -0
- package/dist/src/vultisig.cjs +4 -0
- package/dist/src/vultisig.cjs.map +10 -0
- package/dist/src/vultisig.js +4 -0
- package/dist/src/vultisig.js.map +10 -0
- package/dist/src/walletconnect/index.cjs +4 -0
- package/dist/src/walletconnect/index.cjs.map +13 -0
- package/dist/src/walletconnect/index.js +4 -0
- package/dist/src/walletconnect/index.js.map +13 -0
- package/dist/src/xaman/index.cjs +4 -0
- package/dist/src/xaman/index.cjs.map +12 -0
- package/dist/src/xaman/index.js +4 -0
- package/dist/src/xaman/index.js.map +12 -0
- package/dist/types/bitget.d.ts +2 -0
- package/dist/types/bitget.d.ts.map +1 -0
- package/dist/types/coinbase/index.d.ts +14 -0
- package/dist/types/coinbase/index.d.ts.map +1 -0
- package/dist/types/coinbase/signer.d.ts +313 -0
- package/dist/types/coinbase/signer.d.ts.map +1 -0
- package/dist/types/cosmostation.d.ts +2 -0
- package/dist/types/cosmostation.d.ts.map +1 -0
- package/dist/types/ctrl.d.ts +2 -0
- package/dist/types/ctrl.d.ts.map +1 -0
- package/dist/types/evm-extensions.d.ts +2 -0
- package/dist/types/evm-extensions.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/keepkey-bex.d.ts +2 -0
- package/dist/types/keepkey-bex.d.ts.map +1 -0
- package/dist/types/keepkey.d.ts +2 -0
- package/dist/types/keepkey.d.ts.map +1 -0
- package/dist/types/keplr.d.ts +2 -0
- package/dist/types/keplr.d.ts.map +1 -0
- package/dist/types/keystore.d.ts +2 -0
- package/dist/types/keystore.d.ts.map +1 -0
- package/dist/types/ledger.d.ts +2 -0
- package/dist/types/ledger.d.ts.map +1 -0
- package/dist/types/near-wallet-selector/index.d.ts +16 -0
- package/dist/types/near-wallet-selector/index.d.ts.map +1 -0
- package/dist/types/okx.d.ts +2 -0
- package/dist/types/okx.d.ts.map +1 -0
- package/dist/types/onekey.d.ts +2 -0
- package/dist/types/onekey.d.ts.map +1 -0
- package/dist/types/passkeys/index.d.ts +17 -0
- package/dist/types/passkeys/index.d.ts.map +1 -0
- package/dist/types/phantom.d.ts +2 -0
- package/dist/types/phantom.d.ts.map +1 -0
- package/dist/types/polkadotjs.d.ts +2 -0
- package/dist/types/polkadotjs.d.ts.map +1 -0
- package/dist/types/radix/index.d.ts +14 -0
- package/dist/types/radix/index.d.ts.map +1 -0
- package/dist/types/talisman.d.ts +2 -0
- package/dist/types/talisman.d.ts.map +1 -0
- package/dist/types/trezor.d.ts +2 -0
- package/dist/types/trezor.d.ts.map +1 -0
- package/dist/types/tronlink.d.ts +2 -0
- package/dist/types/tronlink.d.ts.map +1 -0
- package/dist/types/types.d.ts +92 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/utils.d.ts +4 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/vultisig.d.ts +2 -0
- package/dist/types/vultisig.d.ts.map +1 -0
- package/dist/types/walletconnect/constants.d.ts +89 -0
- package/dist/types/walletconnect/constants.d.ts.map +1 -0
- package/dist/types/walletconnect/evmSigner.d.ts +28 -0
- package/dist/types/walletconnect/evmSigner.d.ts.map +1 -0
- package/dist/types/walletconnect/helpers.d.ts +7 -0
- package/dist/types/walletconnect/helpers.d.ts.map +1 -0
- package/dist/types/walletconnect/index.d.ts +25 -0
- package/dist/types/walletconnect/index.d.ts.map +1 -0
- package/dist/types/walletconnect/namespaces.d.ts +10 -0
- package/dist/types/walletconnect/namespaces.d.ts.map +1 -0
- package/dist/types/walletconnect/types.d.ts +7 -0
- package/dist/types/walletconnect/types.d.ts.map +1 -0
- package/dist/types/xaman/helpers.d.ts +59 -0
- package/dist/types/xaman/helpers.d.ts.map +1 -0
- package/dist/types/xaman/index.d.ts +17 -0
- package/dist/types/xaman/index.d.ts.map +1 -0
- package/dist/types/xaman/types.d.ts +24 -0
- package/dist/types/xaman/types.d.ts.map +1 -0
- package/dist/types/xaman/walletMethods.d.ts +19 -0
- package/dist/types/xaman/walletMethods.d.ts.map +1 -0
- package/package.json +220 -0
- package/src/bitget.ts +1 -0
- package/src/coinbase/index.ts +48 -0
- package/src/coinbase/signer.ts +81 -0
- package/src/cosmostation.ts +1 -0
- package/src/ctrl.ts +1 -0
- package/src/evm-extensions.ts +1 -0
- package/src/index.ts +3 -0
- package/src/keepkey-bex.ts +1 -0
- package/src/keepkey.ts +1 -0
- package/src/keplr.ts +1 -0
- package/src/keystore.ts +1 -0
- package/src/ledger.ts +1 -0
- package/src/near-wallet-selector/index.ts +116 -0
- package/src/okx.ts +1 -0
- package/src/onekey.ts +1 -0
- package/src/passkeys/index.ts +187 -0
- package/src/phantom.ts +1 -0
- package/src/polkadotjs.ts +1 -0
- package/src/radix/index.ts +198 -0
- package/src/talisman.ts +1 -0
- package/src/trezor.ts +1 -0
- package/src/tronlink.ts +1 -0
- package/src/types.ts +94 -0
- package/src/utils.ts +59 -0
- package/src/vultisig.ts +1 -0
- package/src/walletconnect/constants.ts +109 -0
- package/src/walletconnect/evmSigner.ts +129 -0
- package/src/walletconnect/helpers.ts +77 -0
- package/src/walletconnect/index.ts +396 -0
- package/src/walletconnect/namespaces.ts +84 -0
- package/src/walletconnect/types.ts +6 -0
- package/src/xaman/helpers.ts +58 -0
- package/src/xaman/index.ts +66 -0
- package/src/xaman/types.ts +26 -0
- package/src/xaman/walletMethods.ts +114 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modifications © 2025 Horizontal Systems.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { type AssetValue, Chain, USwapError } from "@tcswap/helpers";
|
|
6
|
+
import type { Xumm } from "xumm";
|
|
7
|
+
import { sendXamanTransaction } from "./walletMethods";
|
|
8
|
+
|
|
9
|
+
interface GetWalletForChainParams {
|
|
10
|
+
chain: Chain;
|
|
11
|
+
address: string;
|
|
12
|
+
xumm: Xumm;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function getWalletForChain({ xumm, chain, address }: GetWalletForChainParams) {
|
|
16
|
+
switch (chain) {
|
|
17
|
+
case Chain.Ripple: {
|
|
18
|
+
const { getRippleToolbox } = await import("@tcswap/toolboxes/ripple");
|
|
19
|
+
|
|
20
|
+
// const api = apis?.[chain]; // Unused for now
|
|
21
|
+
const toolbox = await getRippleToolbox({});
|
|
22
|
+
|
|
23
|
+
// Override transfer method to use Xaman transaction flow
|
|
24
|
+
const transfer = async (params: { assetValue: AssetValue; recipient: string; memo?: string }) => {
|
|
25
|
+
const { recipient, assetValue, memo } = params;
|
|
26
|
+
|
|
27
|
+
// Create and subscribe to payment via Xaman
|
|
28
|
+
const paymentResult = await sendXamanTransaction(xumm, {
|
|
29
|
+
amount: assetValue.getValue("string"),
|
|
30
|
+
destination: recipient,
|
|
31
|
+
from: address,
|
|
32
|
+
memo: memo,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// If not successful or no transaction ID, throw error
|
|
36
|
+
if (!(paymentResult.result.success && paymentResult.result.transactionId)) {
|
|
37
|
+
throw new USwapError("wallet_xaman_transaction_failed");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Return the transaction ID string
|
|
41
|
+
return paymentResult.result.transactionId;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
...toolbox,
|
|
46
|
+
address,
|
|
47
|
+
// Expose Xaman-specific methods
|
|
48
|
+
createAndSubscribePayment: sendXamanTransaction,
|
|
49
|
+
disconnect: xumm.logout,
|
|
50
|
+
getAddress: () => address,
|
|
51
|
+
transfer,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
default:
|
|
56
|
+
throw new USwapError("wallet_chain_not_supported", { chain, wallet: "Xaman" });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modifications © 2025 Horizontal Systems.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Chain, filterSupportedChains, USwapConfig, USwapError, WalletOption } from "@tcswap/helpers";
|
|
6
|
+
import { createWallet, getWalletSupportedChains } from "@tcswap/wallet-core";
|
|
7
|
+
import { Xumm } from "xumm";
|
|
8
|
+
import { getWalletForChain } from "./helpers";
|
|
9
|
+
import type { XamanConfig } from "./types";
|
|
10
|
+
import { connectXamanWallet as connectXamanWalletMethod } from "./walletMethods";
|
|
11
|
+
|
|
12
|
+
export const xamanWallet = createWallet({
|
|
13
|
+
connect: ({ addChain, supportedChains: walletSupportedChains, walletType }) =>
|
|
14
|
+
function connectXamanWallet(chains: Chain[], xamanConfigOverwrite?: XamanConfig) {
|
|
15
|
+
const supportedChains = filterSupportedChains({ chains, supportedChains: walletSupportedChains, walletType });
|
|
16
|
+
|
|
17
|
+
const { xaman: xamanApiKey } = USwapConfig.get("apiKeys");
|
|
18
|
+
const apiKey = xamanConfigOverwrite?.apiKey || xamanApiKey;
|
|
19
|
+
|
|
20
|
+
if (!apiKey) {
|
|
21
|
+
throw new USwapError("wallet_missing_api_key", { wallet: "Xaman" });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const xumm = new Xumm(apiKey);
|
|
25
|
+
|
|
26
|
+
return new Promise<boolean>((resolve, reject) => {
|
|
27
|
+
xumm.on("success", async () => {
|
|
28
|
+
try {
|
|
29
|
+
const address = await connectXamanWalletMethod(xumm);
|
|
30
|
+
|
|
31
|
+
const promises = supportedChains.map(async (chain) => {
|
|
32
|
+
const walletMethods = await getWalletForChain({ address, chain, xumm });
|
|
33
|
+
|
|
34
|
+
addChain({
|
|
35
|
+
...walletMethods,
|
|
36
|
+
address,
|
|
37
|
+
balance: [],
|
|
38
|
+
chain,
|
|
39
|
+
disconnect: xumm.logout,
|
|
40
|
+
walletType: WalletOption.XAMAN,
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
await Promise.all(promises);
|
|
45
|
+
resolve(true);
|
|
46
|
+
} catch (error) {
|
|
47
|
+
reject(error);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
xumm.on("error", (error) => {
|
|
52
|
+
reject(error);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
xumm.authorize();
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
name: "connectXaman",
|
|
59
|
+
supportedChains: [Chain.Ripple],
|
|
60
|
+
walletType: WalletOption.XAMAN,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export const XAMAN_SUPPORTED_CHAINS = getWalletSupportedChains(xamanWallet);
|
|
64
|
+
export type XamanSupportedChain = (typeof XAMAN_SUPPORTED_CHAINS)[number];
|
|
65
|
+
|
|
66
|
+
export type { XamanConfig } from "./types";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface XamanConfig {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export interface XamanPaymentParams {
|
|
6
|
+
destination: string;
|
|
7
|
+
from: string;
|
|
8
|
+
amount: string;
|
|
9
|
+
memo?: string;
|
|
10
|
+
destinationTag?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface XamanPaymentResult {
|
|
14
|
+
payloadId: string;
|
|
15
|
+
qrCode: string;
|
|
16
|
+
deepLink: string;
|
|
17
|
+
websocketUrl: string;
|
|
18
|
+
result: XamanTransactionResult;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface XamanTransactionResult {
|
|
22
|
+
success: boolean;
|
|
23
|
+
transactionId?: string;
|
|
24
|
+
account?: string;
|
|
25
|
+
reason?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modifications © 2025 Horizontal Systems.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { USwapError } from "@tcswap/helpers";
|
|
6
|
+
import type { Xumm } from "xumm";
|
|
7
|
+
import type { XamanPaymentParams } from "./types";
|
|
8
|
+
|
|
9
|
+
export const connectXamanWallet = async (xumm: Xumm) => {
|
|
10
|
+
if (!xumm) {
|
|
11
|
+
throw new USwapError("wallet_xaman_not_configured");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const user = await xumm.user;
|
|
16
|
+
const account = await user?.account;
|
|
17
|
+
|
|
18
|
+
if (account) {
|
|
19
|
+
return account;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
throw new USwapError("wallet_xaman_auth_failed");
|
|
23
|
+
} catch (error) {
|
|
24
|
+
console.error("Xaman wallet connection failed:", error);
|
|
25
|
+
throw new USwapError("wallet_xaman_connection_failed");
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const sendXamanTransaction = async (xumm: Xumm, params: XamanPaymentParams) => {
|
|
30
|
+
try {
|
|
31
|
+
// Validate required parameters
|
|
32
|
+
if (!(params.destination && params.amount && params.from)) {
|
|
33
|
+
throw new USwapError("wallet_xaman_connection_failed");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Convert XRP to drops (1 XRP = 1,000,000 drops)
|
|
37
|
+
const amountInDrops = (Number.parseFloat(params.amount) * 1000000).toString();
|
|
38
|
+
|
|
39
|
+
// Create transaction object
|
|
40
|
+
const transaction = {
|
|
41
|
+
Account: params.from,
|
|
42
|
+
Amount: amountInDrops,
|
|
43
|
+
Destination: params.destination,
|
|
44
|
+
TransactionType: "Payment" as const,
|
|
45
|
+
...(params.destinationTag !== undefined && { DestinationTag: params.destinationTag }),
|
|
46
|
+
...(params.memo && {
|
|
47
|
+
Memos: [{ Memo: { MemoData: Buffer.from(params.memo, "utf8").toString("hex").toUpperCase() } }],
|
|
48
|
+
}),
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// Create and subscribe to payload following the official example
|
|
52
|
+
const subscription = await xumm.payload?.createAndSubscribe(transaction, (event) => {
|
|
53
|
+
if ("signed" in event.data) {
|
|
54
|
+
// Return event.data to close subscription and resolve promise
|
|
55
|
+
return event.data; // { signed: true|false, payload_uuidv4: '...' }
|
|
56
|
+
}
|
|
57
|
+
return undefined;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (!subscription) {
|
|
61
|
+
throw new USwapError("wallet_xaman_transaction_failed");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const { created } = subscription;
|
|
65
|
+
|
|
66
|
+
// Handle payload presentation based on runtime environment
|
|
67
|
+
if (xumm.runtime?.xapp) {
|
|
68
|
+
xumm.xapp?.openSignRequest(created);
|
|
69
|
+
} else if (typeof window !== "undefined") {
|
|
70
|
+
const url =
|
|
71
|
+
created.pushed && created.next?.no_push_msg_received ? created.next.no_push_msg_received : created.next?.always;
|
|
72
|
+
if (url) window.open(url);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Wait until the user signed/rejected
|
|
76
|
+
const resolved = await subscription.resolved;
|
|
77
|
+
|
|
78
|
+
if (!resolved || typeof resolved !== "object" || !("signed" in resolved) || !resolved.signed) {
|
|
79
|
+
throw new USwapError("wallet_xaman_transaction_failed");
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Fetch the full payload result using the UUID from resolved data
|
|
83
|
+
const payloadDetails = await xumm.payload?.get((resolved as any).payload_uuidv4);
|
|
84
|
+
|
|
85
|
+
if (!payloadDetails) {
|
|
86
|
+
throw new USwapError("wallet_xaman_monitoring_failed");
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Extract transaction ID from response
|
|
90
|
+
const transactionId = payloadDetails.response?.txid || "";
|
|
91
|
+
const account = payloadDetails.response?.account || "";
|
|
92
|
+
|
|
93
|
+
if (!transactionId) {
|
|
94
|
+
throw new USwapError("wallet_xaman_transaction_failed");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Return comprehensive result
|
|
98
|
+
return {
|
|
99
|
+
deepLink: created.next?.always || "",
|
|
100
|
+
// Initial payload info for QR codes, deep links, etc.
|
|
101
|
+
payloadId: created.uuid || "",
|
|
102
|
+
qrCode: created.refs?.qr_png || "",
|
|
103
|
+
// Final transaction result - SUCCESS with tx hash
|
|
104
|
+
result: { account, reason: undefined, success: true, transactionId },
|
|
105
|
+
websocketUrl: created.refs?.websocket_status || "",
|
|
106
|
+
};
|
|
107
|
+
} catch (error) {
|
|
108
|
+
console.error("Xaman payment creation and subscription failed:", error);
|
|
109
|
+
if (error instanceof USwapError) {
|
|
110
|
+
throw error;
|
|
111
|
+
}
|
|
112
|
+
throw new USwapError("wallet_xaman_transaction_failed");
|
|
113
|
+
}
|
|
114
|
+
};
|