@0xsquid/react-hooks 8.8.1-beta-canton.4 → 8.8.1-beta-wallet-verification.0
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/core/client/index.d.ts +0 -1
- package/dist/core/connectors/bitcoin/wallets/keplr.d.ts +2 -1
- package/dist/core/connectors/bitcoin/wallets/unisat.d.ts +3 -0
- package/dist/core/connectors/xrpl/CrossMark.d.ts +12 -0
- package/dist/core/connectors/xrpl/Xaman.d.ts +14 -0
- package/dist/core/connectors/xrpl/XamanQr.d.ts +20 -0
- package/dist/core/connectors/xrpl/XrplMetamaskSnap.d.ts +12 -0
- package/dist/core/connectors/xrpl/walletVerification.d.ts +2 -0
- package/dist/core/constants.d.ts +0 -2
- package/dist/core/types/bitcoin.d.ts +1 -0
- package/dist/core/types/config.d.ts +1 -0
- package/dist/core/types/event.d.ts +4 -1
- package/dist/core/types/index.d.ts +3 -2
- package/dist/core/types/solana.d.ts +11 -1
- package/dist/core/types/sui.d.ts +2 -1
- package/dist/core/types/wallet.d.ts +6 -9
- package/dist/core/types/walletVerificationSignature/bitcoin.d.ts +10 -0
- package/dist/core/types/walletVerificationSignature/chainTypes.d.ts +19 -0
- package/dist/core/types/walletVerificationSignature/cosmos.d.ts +10 -0
- package/dist/core/types/walletVerificationSignature/evm.d.ts +10 -0
- package/dist/core/types/walletVerificationSignature/index.d.ts +18 -0
- package/dist/core/types/walletVerificationSignature/request.d.ts +3 -0
- package/dist/core/types/walletVerificationSignature/sharedResult.d.ts +20 -0
- package/dist/core/types/walletVerificationSignature/solana.d.ts +10 -0
- package/dist/core/types/walletVerificationSignature/stellar.d.ts +10 -0
- package/dist/core/types/walletVerificationSignature/sui.d.ts +10 -0
- package/dist/core/types/walletVerificationSignature/types.d.ts +69 -0
- package/dist/core/types/walletVerificationSignature/xrpl.d.ts +12 -0
- package/dist/core/types/walletVerificationSignature.d.ts +1 -0
- package/dist/core/types/xrpl.d.ts +14 -0
- package/dist/hooks/chains/useSquidChains.d.ts +0 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/store/useDepositAddressStore.d.ts +5 -23
- package/dist/hooks/store/useWalletStore.d.ts +1 -0
- package/dist/hooks/swap/useDepositAddress.d.ts +7 -6
- package/dist/hooks/tokens/useSquidTokens.d.ts +0 -1
- package/dist/hooks/wallet/useMultiChainWallet.d.ts +18 -44
- package/dist/hooks/wallet/useSigner.d.ts +1 -1
- package/dist/hooks/wallet/useWallet.d.ts +18 -48
- package/dist/hooks/wallet/useWalletVerificationSignature.d.ts +22 -0
- package/dist/hooks/wallet/useWalletVerificationSignature.test.d.ts +1 -0
- package/dist/hooks/wallet/walletVerification/signers/bitcoin.d.ts +2 -0
- package/dist/hooks/wallet/walletVerification/signers/cosmos.d.ts +2 -0
- package/dist/hooks/wallet/walletVerification/signers/evm.d.ts +2 -0
- package/dist/hooks/wallet/walletVerification/signers/index.d.ts +3 -0
- package/dist/hooks/wallet/walletVerification/signers/solana.d.ts +2 -0
- package/dist/hooks/wallet/walletVerification/signers/stellar.d.ts +2 -0
- package/dist/hooks/wallet/walletVerification/signers/sui.d.ts +2 -0
- package/dist/hooks/wallet/walletVerification/signers/types.d.ts +33 -0
- package/dist/hooks/wallet/walletVerification/signers/xrpl.d.ts +2 -0
- package/dist/{index-D5QOR7JT.js → index-CtXS5uny.js} +1424 -560
- package/dist/index-CtXS5uny.js.map +1 -0
- package/dist/{index-mgE1SeE-.js → index-z1nGQX9p.js} +1440 -560
- package/dist/index-z1nGQX9p.js.map +1 -0
- package/dist/{index.es-Cq4mUT_n.js → index.es-CBWh71yD.js} +2 -2
- package/dist/{index.es-Cq4mUT_n.js.map → index.es-CBWh71yD.js.map} +1 -1
- package/dist/{index.es-3JPbTFKq.js → index.es-D8CAnRf1.js} +2 -2
- package/dist/{index.es-3JPbTFKq.js.map → index.es-D8CAnRf1.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +30 -6
- package/dist/index.js.map +1 -1
- package/dist/{secretService-DOOg6zVn.js → secretService-B2i6U8uo.js} +2 -2
- package/dist/{secretService-DOOg6zVn.js.map → secretService-B2i6U8uo.js.map} +1 -1
- package/dist/{secretService-DWq78rM5.js → secretService-BFehLMb_.js} +2 -2
- package/dist/{secretService-DWq78rM5.js.map → secretService-BFehLMb_.js.map} +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.esm.js +1 -8
- package/dist/server.esm.js.map +1 -1
- package/dist/server.js +0 -8
- package/dist/server.js.map +1 -1
- package/dist/services/external/index.d.ts +1 -1
- package/dist/services/external/xaman.d.ts +31 -11
- package/dist/services/external/xaman.test.d.ts +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/internal/assetsService.d.ts +1 -10
- package/dist/services/internal/encodingService.d.ts +8 -0
- package/dist/services/internal/encodingService.test.d.ts +1 -0
- package/dist/services/internal/eventService.d.ts +3 -3
- package/dist/services/internal/evmService.d.ts +1 -0
- package/dist/services/internal/transactionService.d.ts +1 -5
- package/dist/{stellarService.client-C-pOt34O.js → stellarService.client-D20h9JPG.js} +2 -2
- package/dist/{stellarService.client-C-pOt34O.js.map → stellarService.client-D20h9JPG.js.map} +1 -1
- package/dist/{stellarService.client-DBROJ4yf.js → stellarService.client-yWCDuq6S.js} +2 -2
- package/dist/{stellarService.client-DBROJ4yf.js.map → stellarService.client-yWCDuq6S.js.map} +1 -1
- package/package.json +2 -2
- package/dist/core/types/canton.d.ts +0 -2
- package/dist/core/types/cosmos.d.ts +0 -5
- package/dist/hooks/transaction/useDepositTransactionStatus.d.ts +0 -25
- package/dist/hooks/transaction/useSwapStatusQuery.d.ts +0 -26
- package/dist/index-D5QOR7JT.js.map +0 -1
- package/dist/index-mgE1SeE-.js.map +0 -1
- package/dist/services/internal/cantonService.d.ts +0 -2
package/dist/server.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CHAIN_IDS, chainTypeToNativeTokenAddressMap, chainTypeToZeroAddressMap, nativeBitcoinTokenAddress,
|
|
1
|
+
export { CHAIN_IDS, chainTypeToNativeTokenAddressMap, chainTypeToZeroAddressMap, nativeBitcoinTokenAddress, nativeCosmosTokenAddress, nativeEvmTokenAddress, nativeSolanaTokenAddress, nativeStellarTokenAddress, nativeSuiTokenAddress, nativeXrplTokenAddress, } from "./core/constants";
|
package/dist/server.esm.js
CHANGED
|
@@ -7,8 +7,6 @@ const solanaZeroAddress = "11111111111111111111111111111111";
|
|
|
7
7
|
const suiZeroAddress = "0x0000000000000000000000000000000000000000";
|
|
8
8
|
const xrplZeroAddress = "rrrrrrrrrrrrrrrrrrrrrhoLvTp";
|
|
9
9
|
const stellarZeroAddress = "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF";
|
|
10
|
-
// TODO: check
|
|
11
|
-
const cantonZeroAddress = "none::12200000000000000000000000000000000000000000000000000000000000000000";
|
|
12
10
|
const chainTypeToZeroAddressMap = {
|
|
13
11
|
[ChainType.EVM]: zeroAddress,
|
|
14
12
|
[ChainType.COSMOS]: cosmosZeroAddress,
|
|
@@ -17,7 +15,6 @@ const chainTypeToZeroAddressMap = {
|
|
|
17
15
|
[ChainType.SUI]: suiZeroAddress,
|
|
18
16
|
[ChainType.XRPL]: xrplZeroAddress,
|
|
19
17
|
[ChainType.STELLAR]: stellarZeroAddress,
|
|
20
|
-
[ChainType.CANTON]: cantonZeroAddress,
|
|
21
18
|
};
|
|
22
19
|
const nativeEvmTokenAddress = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
23
20
|
const nativeCosmosTokenAddress = "uosmo";
|
|
@@ -26,7 +23,6 @@ const nativeBitcoinTokenAddress = "satoshi";
|
|
|
26
23
|
const nativeSuiTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
27
24
|
const nativeXrplTokenAddress = "xrp";
|
|
28
25
|
const nativeStellarTokenAddress = "CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA";
|
|
29
|
-
const nativeCantonTokenAddress = "DSO::1220b1431ef217342db44d516bb9befde802be7d8899637d290895fa58880f19accc";
|
|
30
26
|
const CHAIN_IDS = {
|
|
31
27
|
// Cosmos
|
|
32
28
|
OSMOSIS: "osmosis-1",
|
|
@@ -78,7 +74,6 @@ const CHAIN_IDS = {
|
|
|
78
74
|
XRPL_TESTNET: "xrpl-testnet",
|
|
79
75
|
STELLAR: "stellar-mainnet",
|
|
80
76
|
STELLAR_TESTNET: "stellar-testnet",
|
|
81
|
-
CANTON: "canton",
|
|
82
77
|
};
|
|
83
78
|
({
|
|
84
79
|
[ChainType.EVM]: CHAIN_IDS.ETHEREUM,
|
|
@@ -88,7 +83,6 @@ const CHAIN_IDS = {
|
|
|
88
83
|
[ChainType.SUI]: CHAIN_IDS.SUI,
|
|
89
84
|
[ChainType.XRPL]: CHAIN_IDS.XRPL,
|
|
90
85
|
[ChainType.STELLAR]: CHAIN_IDS.STELLAR,
|
|
91
|
-
[ChainType.CANTON]: CHAIN_IDS.CANTON,
|
|
92
86
|
});
|
|
93
87
|
const chainTypeToNativeTokenAddressMap = {
|
|
94
88
|
[ChainType.EVM]: nativeEvmTokenAddress,
|
|
@@ -98,7 +92,6 @@ const chainTypeToNativeTokenAddressMap = {
|
|
|
98
92
|
[ChainType.SUI]: nativeSuiTokenAddress,
|
|
99
93
|
[ChainType.XRPL]: nativeXrplTokenAddress,
|
|
100
94
|
[ChainType.STELLAR]: nativeStellarTokenAddress,
|
|
101
|
-
[ChainType.CANTON]: nativeCantonTokenAddress,
|
|
102
95
|
};
|
|
103
96
|
var EvmPriorityConnectors;
|
|
104
97
|
(function (EvmPriorityConnectors) {
|
|
@@ -106,5 +99,5 @@ var EvmPriorityConnectors;
|
|
|
106
99
|
EvmPriorityConnectors["LedgerLive"] = "ledgerLive";
|
|
107
100
|
})(EvmPriorityConnectors || (EvmPriorityConnectors = {}));
|
|
108
101
|
|
|
109
|
-
export { CHAIN_IDS, chainTypeToNativeTokenAddressMap, chainTypeToZeroAddressMap, nativeBitcoinTokenAddress,
|
|
102
|
+
export { CHAIN_IDS, chainTypeToNativeTokenAddressMap, chainTypeToZeroAddressMap, nativeBitcoinTokenAddress, nativeCosmosTokenAddress, nativeEvmTokenAddress, nativeSolanaTokenAddress, nativeStellarTokenAddress, nativeSuiTokenAddress, nativeXrplTokenAddress };
|
|
110
103
|
//# sourceMappingURL=server.esm.js.map
|
package/dist/server.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.esm.js","sources":["../src/core/constants.ts"],"sourcesContent":["\"use client\";\n\nimport { ChainType } from \"@0xsquid/squid-types\";\nimport { zeroAddress as evmZeroAddress } from \"viem\";\nimport { squidApiBaseUrl } from \"./externalLinks\";\nimport type { AppConfig, SlippageOption } from \"./types/config\";\n\nexport const WALLETCONNECT_PROJECT_ID = \"db6a4f6ff58e4172b2fd52f01360bc49\";\nexport const WALLETCONNECT_WALLET_IDS = {\n joey: \"d9f5432e932c6fad8e19a0cea9d4a3372a84aed16e98a52e6655dd2821a63404\",\n girin: \"994824d1e0b935f48ec3570c9d51fe5af9bbd9246b6f57210906f8b853ad2196\",\n bifrost: \"37a686ab6223cd42e2886ed6e5477fce100a4fb565dcd57ed4f81f7c12e93053\",\n} as const;\nexport const DEFAULT_LOCALE = \"en-US\";\nexport const SQUID_METADATA = {\n name: \"Squid\",\n url: \"https://app.squidrouter.com\",\n icon: \"https://squidrouter.com/favicon.ico\",\n description: \"Swap, send, and bridge across chains.\",\n};\n\nconst bitcoinZeroAddress = \"1111111111111111111114oLvT2\";\nconst cosmosZeroAddress =\n \"osmo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq65mj83\";\nconst solanaZeroAddress = \"11111111111111111111111111111111\";\nconst suiZeroAddress = \"0x0000000000000000000000000000000000000000\";\nconst xrplZeroAddress = \"rrrrrrrrrrrrrrrrrrrrrhoLvTp\";\nconst stellarZeroAddress =\n \"GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF\";\n
|
|
1
|
+
{"version":3,"file":"server.esm.js","sources":["../src/core/constants.ts"],"sourcesContent":["\"use client\";\n\nimport { ChainType } from \"@0xsquid/squid-types\";\nimport { zeroAddress as evmZeroAddress } from \"viem\";\nimport { squidApiBaseUrl } from \"./externalLinks\";\nimport type { AppConfig, SlippageOption } from \"./types/config\";\n\nexport const WALLETCONNECT_PROJECT_ID = \"db6a4f6ff58e4172b2fd52f01360bc49\";\nexport const WALLETCONNECT_WALLET_IDS = {\n joey: \"d9f5432e932c6fad8e19a0cea9d4a3372a84aed16e98a52e6655dd2821a63404\",\n girin: \"994824d1e0b935f48ec3570c9d51fe5af9bbd9246b6f57210906f8b853ad2196\",\n bifrost: \"37a686ab6223cd42e2886ed6e5477fce100a4fb565dcd57ed4f81f7c12e93053\",\n} as const;\nexport const DEFAULT_LOCALE = \"en-US\";\nexport const SQUID_METADATA = {\n name: \"Squid\",\n url: \"https://app.squidrouter.com\",\n icon: \"https://squidrouter.com/favicon.ico\",\n description: \"Swap, send, and bridge across chains.\",\n};\n\nconst bitcoinZeroAddress = \"1111111111111111111114oLvT2\";\nconst cosmosZeroAddress =\n \"osmo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq65mj83\";\nconst solanaZeroAddress = \"11111111111111111111111111111111\";\nconst suiZeroAddress = \"0x0000000000000000000000000000000000000000\";\nconst xrplZeroAddress = \"rrrrrrrrrrrrrrrrrrrrrhoLvTp\";\nconst stellarZeroAddress =\n \"GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF\";\n\nexport const chainTypeToZeroAddressMap: Record<ChainType, string> = {\n [ChainType.EVM]: evmZeroAddress,\n [ChainType.COSMOS]: cosmosZeroAddress,\n [ChainType.BTC]: bitcoinZeroAddress,\n [ChainType.SOLANA]: solanaZeroAddress,\n [ChainType.SUI]: suiZeroAddress,\n [ChainType.XRPL]: xrplZeroAddress,\n [ChainType.STELLAR]: stellarZeroAddress,\n};\n\nexport const nativeEvmTokenAddress =\n \"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\";\nexport const nativeCosmosTokenAddress = \"uosmo\";\nexport const nativeSolanaTokenAddress =\n \"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\";\nexport const nativeBitcoinTokenAddress = \"satoshi\";\nexport const nativeSuiTokenAddress =\n \"0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI\";\nexport const nativeXrplTokenAddress = \"xrp\";\nexport const nativeStellarTokenAddress =\n \"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA\";\n\n// by setting slippage to undefined, it's set to \"auto\"\nexport const defaultSlippage: SlippageOption = undefined;\nexport const destinationAddressResetValue = \"null\";\nexport const fallbackAddressResetValue = \"null\";\nexport const gasRefundMultiplier = 25;\nexport const internalSquidApiBaseUrl = \"https://app.squidrouter.com/api\";\nexport const XAMAN_API_URL = `${internalSquidApiBaseUrl}/xaman/`;\nexport const TOKEN_PRICE_API_URL = `${internalSquidApiBaseUrl}/coingecko`;\nexport const DEFAULT_ROUTE_REFETCH_INTERVAL = 30_000;\n\nexport const SOLANA_RPC_URL =\n \"https://meredith-ute2ko-fast-mainnet.helius-rpc.com\";\nexport const INTEGRATOR_ID =\n \"squid-widget-playground-local-cd33cba6-7e12-4fcc-8d5d-35e286f655ea\";\n\nexport const DEFAULT_COUNTRY_CODE = \"US\";\n\nexport const CHAIN_IDS = {\n // Cosmos\n OSMOSIS: \"osmosis-1\",\n INJECTIVE: \"injective-1\",\n SECRET: \"secret-4\",\n ARCHWAY: \"archway-1\",\n XION: \"xion-mainnet-1\",\n NOBLE: \"noble-1\",\n AGORIC: \"agoric-3\",\n\n // EVM\n ETHEREUM: \"1\",\n ETHEREUM_SEPOLIA: \"11155111\",\n ARBITRUM: \"42161\",\n BSC: \"56\",\n BASE: \"8453\",\n OPTIMISM: \"10\",\n LINEA: \"59144\",\n BLAST: \"81457\",\n CELO: \"42220\",\n POLYGON: \"137\",\n AVALANCHE: \"43114\",\n IMMUTABLE: \"13371\",\n SCROLL: \"534352\",\n MOONBEAM: \"1284\",\n MANTLE: \"5000\",\n FANTOM: \"250\",\n KAVA: \"2222\",\n FILECOIN: \"314\",\n BERACHAIN: \"80094\",\n SAGA_EVM: \"5464\",\n XRPL_EVM: \"1440000\",\n XRPL_EVM_TESTNET: \"1449000\",\n GNOSIS: \"100\",\n SONIC: \"146\",\n HYPER_EVM: \"999\",\n DCHAIN: \"2716446429837000\",\n SONEIUM: \"1868\",\n PEAQ: \"3338\",\n HEDERA: \"295\",\n MANTRA: \"5888\",\n CITREA: \"4114\",\n TEMPO: \"4217\",\n\n // others\n BITCOIN: \"bitcoin\",\n SOLANA: \"solana-mainnet-beta\",\n SUI: \"sui-mainnet\",\n SUI_TESTNET: \"sui-testnet\",\n XRPL: \"xrpl-mainnet\",\n XRPL_TESTNET: \"xrpl-testnet\",\n STELLAR: \"stellar-mainnet\",\n STELLAR_TESTNET: \"stellar-testnet\",\n} as const;\n\nexport const chainTypeToDefaultChainIdMap: Record<ChainType, string> = {\n [ChainType.EVM]: CHAIN_IDS.ETHEREUM,\n [ChainType.COSMOS]: CHAIN_IDS.OSMOSIS,\n [ChainType.BTC]: CHAIN_IDS.BITCOIN,\n [ChainType.SOLANA]: CHAIN_IDS.SOLANA,\n [ChainType.SUI]: CHAIN_IDS.SUI,\n [ChainType.XRPL]: CHAIN_IDS.XRPL,\n [ChainType.STELLAR]: CHAIN_IDS.STELLAR,\n};\n\nexport const chainTypeToNativeTokenAddressMap: Record<ChainType, string> = {\n [ChainType.EVM]: nativeEvmTokenAddress,\n [ChainType.COSMOS]: nativeCosmosTokenAddress,\n [ChainType.BTC]: nativeBitcoinTokenAddress,\n [ChainType.SOLANA]: nativeSolanaTokenAddress,\n [ChainType.SUI]: nativeSuiTokenAddress,\n [ChainType.XRPL]: nativeXrplTokenAddress,\n [ChainType.STELLAR]: nativeStellarTokenAddress,\n};\n\nexport const defaultConfigValues: AppConfig = {\n integratorId: INTEGRATOR_ID,\n slippage: defaultSlippage,\n apiUrl: squidApiBaseUrl,\n xamanApiUrl: XAMAN_API_URL,\n priceImpactWarnings: {\n warning: 3,\n critical: 5,\n },\n};\n\nexport enum EvmPriorityConnectors {\n Safe = \"safe\",\n LedgerLive = \"ledgerLive\",\n}\n\n// Success\nconst cctpSuccessStatuses = [\"complete\"];\nconst chainflipSuccessStatuses = [\"COMPLETE\"];\nconst solanaSameChainSuccessStatuses = [\"finalized\"];\nconst axelarSuccessStatuses = [\n \"destination_executed\",\n \"executed\",\n \"express_executed\",\n \"success\",\n];\n\n// Error\nconst axelarErrorStatuses = [\n \"error_fetching_status\",\n \"error\",\n \"failed_on_destination\",\n];\nconst chainflipErrorStatuses = [\"BROADCAST_ABORTED\"];\n\n// Refunded\nexport const transactionRefundedStatuses = [\"refunded\"];\n\nexport const transactionErrorStatuses = [\n ...axelarErrorStatuses,\n ...chainflipErrorStatuses,\n];\nexport const transactionSuccessStatuses = [\n ...cctpSuccessStatuses,\n ...axelarSuccessStatuses,\n ...chainflipSuccessStatuses,\n ...solanaSameChainSuccessStatuses,\n];\nexport const transactionEndStatuses = [\n ...transactionSuccessStatuses,\n ...transactionRefundedStatuses,\n ...transactionErrorStatuses,\n];\n"],"names":["evmZeroAddress"],"mappings":";;;AAqBA,MAAM,kBAAkB,GAAG,6BAA6B;AACxD,MAAM,iBAAiB,GACrB,iEAAiE;AACnE,MAAM,iBAAiB,GAAG,kCAAkC;AAC5D,MAAM,cAAc,GAAG,4CAA4C;AACnE,MAAM,eAAe,GAAG,6BAA6B;AACrD,MAAM,kBAAkB,GACtB,0DAA0D;AAE/C,MAAA,yBAAyB,GAA8B;AAClE,IA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AAC,SAAS,CAAC,GAAG,GAAG,qBAAqB;AACtC,IAAA,CAAC,SAAS,CAAC,MAAM,GAAG,wBAAwB;AAC5C,IAAA,CAAC,SAAS,CAAC,GAAG,GAAG,yBAAyB;AAC1C,IAAA,CAAC,SAAS,CAAC,MAAM,GAAG,wBAAwB;AAC5C,IAAA,CAAC,SAAS,CAAC,GAAG,GAAG,qBAAqB;AACtC,IAAA,CAAC,SAAS,CAAC,IAAI,GAAG,sBAAsB;AACxC,IAAA,CAAC,SAAS,CAAC,OAAO,GAAG,yBAAyB;;AAchD,IAAY,qBAGX;AAHD,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,qBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AAC3B,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,GAGhC,EAAA,CAAA,CAAA;;;;"}
|
package/dist/server.js
CHANGED
|
@@ -9,8 +9,6 @@ const solanaZeroAddress = "11111111111111111111111111111111";
|
|
|
9
9
|
const suiZeroAddress = "0x0000000000000000000000000000000000000000";
|
|
10
10
|
const xrplZeroAddress = "rrrrrrrrrrrrrrrrrrrrrhoLvTp";
|
|
11
11
|
const stellarZeroAddress = "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF";
|
|
12
|
-
// TODO: check
|
|
13
|
-
const cantonZeroAddress = "none::12200000000000000000000000000000000000000000000000000000000000000000";
|
|
14
12
|
const chainTypeToZeroAddressMap = {
|
|
15
13
|
[squidTypes.ChainType.EVM]: viem.zeroAddress,
|
|
16
14
|
[squidTypes.ChainType.COSMOS]: cosmosZeroAddress,
|
|
@@ -19,7 +17,6 @@ const chainTypeToZeroAddressMap = {
|
|
|
19
17
|
[squidTypes.ChainType.SUI]: suiZeroAddress,
|
|
20
18
|
[squidTypes.ChainType.XRPL]: xrplZeroAddress,
|
|
21
19
|
[squidTypes.ChainType.STELLAR]: stellarZeroAddress,
|
|
22
|
-
[squidTypes.ChainType.CANTON]: cantonZeroAddress,
|
|
23
20
|
};
|
|
24
21
|
const nativeEvmTokenAddress = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
25
22
|
const nativeCosmosTokenAddress = "uosmo";
|
|
@@ -28,7 +25,6 @@ const nativeBitcoinTokenAddress = "satoshi";
|
|
|
28
25
|
const nativeSuiTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
29
26
|
const nativeXrplTokenAddress = "xrp";
|
|
30
27
|
const nativeStellarTokenAddress = "CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA";
|
|
31
|
-
const nativeCantonTokenAddress = "DSO::1220b1431ef217342db44d516bb9befde802be7d8899637d290895fa58880f19accc";
|
|
32
28
|
const CHAIN_IDS = {
|
|
33
29
|
// Cosmos
|
|
34
30
|
OSMOSIS: "osmosis-1",
|
|
@@ -80,7 +76,6 @@ const CHAIN_IDS = {
|
|
|
80
76
|
XRPL_TESTNET: "xrpl-testnet",
|
|
81
77
|
STELLAR: "stellar-mainnet",
|
|
82
78
|
STELLAR_TESTNET: "stellar-testnet",
|
|
83
|
-
CANTON: "canton",
|
|
84
79
|
};
|
|
85
80
|
({
|
|
86
81
|
[squidTypes.ChainType.EVM]: CHAIN_IDS.ETHEREUM,
|
|
@@ -90,7 +85,6 @@ const CHAIN_IDS = {
|
|
|
90
85
|
[squidTypes.ChainType.SUI]: CHAIN_IDS.SUI,
|
|
91
86
|
[squidTypes.ChainType.XRPL]: CHAIN_IDS.XRPL,
|
|
92
87
|
[squidTypes.ChainType.STELLAR]: CHAIN_IDS.STELLAR,
|
|
93
|
-
[squidTypes.ChainType.CANTON]: CHAIN_IDS.CANTON,
|
|
94
88
|
});
|
|
95
89
|
const chainTypeToNativeTokenAddressMap = {
|
|
96
90
|
[squidTypes.ChainType.EVM]: nativeEvmTokenAddress,
|
|
@@ -100,7 +94,6 @@ const chainTypeToNativeTokenAddressMap = {
|
|
|
100
94
|
[squidTypes.ChainType.SUI]: nativeSuiTokenAddress,
|
|
101
95
|
[squidTypes.ChainType.XRPL]: nativeXrplTokenAddress,
|
|
102
96
|
[squidTypes.ChainType.STELLAR]: nativeStellarTokenAddress,
|
|
103
|
-
[squidTypes.ChainType.CANTON]: nativeCantonTokenAddress,
|
|
104
97
|
};
|
|
105
98
|
var EvmPriorityConnectors;
|
|
106
99
|
(function (EvmPriorityConnectors) {
|
|
@@ -112,7 +105,6 @@ exports.CHAIN_IDS = CHAIN_IDS;
|
|
|
112
105
|
exports.chainTypeToNativeTokenAddressMap = chainTypeToNativeTokenAddressMap;
|
|
113
106
|
exports.chainTypeToZeroAddressMap = chainTypeToZeroAddressMap;
|
|
114
107
|
exports.nativeBitcoinTokenAddress = nativeBitcoinTokenAddress;
|
|
115
|
-
exports.nativeCantonTokenAddress = nativeCantonTokenAddress;
|
|
116
108
|
exports.nativeCosmosTokenAddress = nativeCosmosTokenAddress;
|
|
117
109
|
exports.nativeEvmTokenAddress = nativeEvmTokenAddress;
|
|
118
110
|
exports.nativeSolanaTokenAddress = nativeSolanaTokenAddress;
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sources":["../src/core/constants.ts"],"sourcesContent":["\"use client\";\n\nimport { ChainType } from \"@0xsquid/squid-types\";\nimport { zeroAddress as evmZeroAddress } from \"viem\";\nimport { squidApiBaseUrl } from \"./externalLinks\";\nimport type { AppConfig, SlippageOption } from \"./types/config\";\n\nexport const WALLETCONNECT_PROJECT_ID = \"db6a4f6ff58e4172b2fd52f01360bc49\";\nexport const WALLETCONNECT_WALLET_IDS = {\n joey: \"d9f5432e932c6fad8e19a0cea9d4a3372a84aed16e98a52e6655dd2821a63404\",\n girin: \"994824d1e0b935f48ec3570c9d51fe5af9bbd9246b6f57210906f8b853ad2196\",\n bifrost: \"37a686ab6223cd42e2886ed6e5477fce100a4fb565dcd57ed4f81f7c12e93053\",\n} as const;\nexport const DEFAULT_LOCALE = \"en-US\";\nexport const SQUID_METADATA = {\n name: \"Squid\",\n url: \"https://app.squidrouter.com\",\n icon: \"https://squidrouter.com/favicon.ico\",\n description: \"Swap, send, and bridge across chains.\",\n};\n\nconst bitcoinZeroAddress = \"1111111111111111111114oLvT2\";\nconst cosmosZeroAddress =\n \"osmo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq65mj83\";\nconst solanaZeroAddress = \"11111111111111111111111111111111\";\nconst suiZeroAddress = \"0x0000000000000000000000000000000000000000\";\nconst xrplZeroAddress = \"rrrrrrrrrrrrrrrrrrrrrhoLvTp\";\nconst stellarZeroAddress =\n \"GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF\";\n
|
|
1
|
+
{"version":3,"file":"server.js","sources":["../src/core/constants.ts"],"sourcesContent":["\"use client\";\n\nimport { ChainType } from \"@0xsquid/squid-types\";\nimport { zeroAddress as evmZeroAddress } from \"viem\";\nimport { squidApiBaseUrl } from \"./externalLinks\";\nimport type { AppConfig, SlippageOption } from \"./types/config\";\n\nexport const WALLETCONNECT_PROJECT_ID = \"db6a4f6ff58e4172b2fd52f01360bc49\";\nexport const WALLETCONNECT_WALLET_IDS = {\n joey: \"d9f5432e932c6fad8e19a0cea9d4a3372a84aed16e98a52e6655dd2821a63404\",\n girin: \"994824d1e0b935f48ec3570c9d51fe5af9bbd9246b6f57210906f8b853ad2196\",\n bifrost: \"37a686ab6223cd42e2886ed6e5477fce100a4fb565dcd57ed4f81f7c12e93053\",\n} as const;\nexport const DEFAULT_LOCALE = \"en-US\";\nexport const SQUID_METADATA = {\n name: \"Squid\",\n url: \"https://app.squidrouter.com\",\n icon: \"https://squidrouter.com/favicon.ico\",\n description: \"Swap, send, and bridge across chains.\",\n};\n\nconst bitcoinZeroAddress = \"1111111111111111111114oLvT2\";\nconst cosmosZeroAddress =\n \"osmo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq65mj83\";\nconst solanaZeroAddress = \"11111111111111111111111111111111\";\nconst suiZeroAddress = \"0x0000000000000000000000000000000000000000\";\nconst xrplZeroAddress = \"rrrrrrrrrrrrrrrrrrrrrhoLvTp\";\nconst stellarZeroAddress =\n \"GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF\";\n\nexport const chainTypeToZeroAddressMap: Record<ChainType, string> = {\n [ChainType.EVM]: evmZeroAddress,\n [ChainType.COSMOS]: cosmosZeroAddress,\n [ChainType.BTC]: bitcoinZeroAddress,\n [ChainType.SOLANA]: solanaZeroAddress,\n [ChainType.SUI]: suiZeroAddress,\n [ChainType.XRPL]: xrplZeroAddress,\n [ChainType.STELLAR]: stellarZeroAddress,\n};\n\nexport const nativeEvmTokenAddress =\n \"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\";\nexport const nativeCosmosTokenAddress = \"uosmo\";\nexport const nativeSolanaTokenAddress =\n \"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\";\nexport const nativeBitcoinTokenAddress = \"satoshi\";\nexport const nativeSuiTokenAddress =\n \"0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI\";\nexport const nativeXrplTokenAddress = \"xrp\";\nexport const nativeStellarTokenAddress =\n \"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA\";\n\n// by setting slippage to undefined, it's set to \"auto\"\nexport const defaultSlippage: SlippageOption = undefined;\nexport const destinationAddressResetValue = \"null\";\nexport const fallbackAddressResetValue = \"null\";\nexport const gasRefundMultiplier = 25;\nexport const internalSquidApiBaseUrl = \"https://app.squidrouter.com/api\";\nexport const XAMAN_API_URL = `${internalSquidApiBaseUrl}/xaman/`;\nexport const TOKEN_PRICE_API_URL = `${internalSquidApiBaseUrl}/coingecko`;\nexport const DEFAULT_ROUTE_REFETCH_INTERVAL = 30_000;\n\nexport const SOLANA_RPC_URL =\n \"https://meredith-ute2ko-fast-mainnet.helius-rpc.com\";\nexport const INTEGRATOR_ID =\n \"squid-widget-playground-local-cd33cba6-7e12-4fcc-8d5d-35e286f655ea\";\n\nexport const DEFAULT_COUNTRY_CODE = \"US\";\n\nexport const CHAIN_IDS = {\n // Cosmos\n OSMOSIS: \"osmosis-1\",\n INJECTIVE: \"injective-1\",\n SECRET: \"secret-4\",\n ARCHWAY: \"archway-1\",\n XION: \"xion-mainnet-1\",\n NOBLE: \"noble-1\",\n AGORIC: \"agoric-3\",\n\n // EVM\n ETHEREUM: \"1\",\n ETHEREUM_SEPOLIA: \"11155111\",\n ARBITRUM: \"42161\",\n BSC: \"56\",\n BASE: \"8453\",\n OPTIMISM: \"10\",\n LINEA: \"59144\",\n BLAST: \"81457\",\n CELO: \"42220\",\n POLYGON: \"137\",\n AVALANCHE: \"43114\",\n IMMUTABLE: \"13371\",\n SCROLL: \"534352\",\n MOONBEAM: \"1284\",\n MANTLE: \"5000\",\n FANTOM: \"250\",\n KAVA: \"2222\",\n FILECOIN: \"314\",\n BERACHAIN: \"80094\",\n SAGA_EVM: \"5464\",\n XRPL_EVM: \"1440000\",\n XRPL_EVM_TESTNET: \"1449000\",\n GNOSIS: \"100\",\n SONIC: \"146\",\n HYPER_EVM: \"999\",\n DCHAIN: \"2716446429837000\",\n SONEIUM: \"1868\",\n PEAQ: \"3338\",\n HEDERA: \"295\",\n MANTRA: \"5888\",\n CITREA: \"4114\",\n TEMPO: \"4217\",\n\n // others\n BITCOIN: \"bitcoin\",\n SOLANA: \"solana-mainnet-beta\",\n SUI: \"sui-mainnet\",\n SUI_TESTNET: \"sui-testnet\",\n XRPL: \"xrpl-mainnet\",\n XRPL_TESTNET: \"xrpl-testnet\",\n STELLAR: \"stellar-mainnet\",\n STELLAR_TESTNET: \"stellar-testnet\",\n} as const;\n\nexport const chainTypeToDefaultChainIdMap: Record<ChainType, string> = {\n [ChainType.EVM]: CHAIN_IDS.ETHEREUM,\n [ChainType.COSMOS]: CHAIN_IDS.OSMOSIS,\n [ChainType.BTC]: CHAIN_IDS.BITCOIN,\n [ChainType.SOLANA]: CHAIN_IDS.SOLANA,\n [ChainType.SUI]: CHAIN_IDS.SUI,\n [ChainType.XRPL]: CHAIN_IDS.XRPL,\n [ChainType.STELLAR]: CHAIN_IDS.STELLAR,\n};\n\nexport const chainTypeToNativeTokenAddressMap: Record<ChainType, string> = {\n [ChainType.EVM]: nativeEvmTokenAddress,\n [ChainType.COSMOS]: nativeCosmosTokenAddress,\n [ChainType.BTC]: nativeBitcoinTokenAddress,\n [ChainType.SOLANA]: nativeSolanaTokenAddress,\n [ChainType.SUI]: nativeSuiTokenAddress,\n [ChainType.XRPL]: nativeXrplTokenAddress,\n [ChainType.STELLAR]: nativeStellarTokenAddress,\n};\n\nexport const defaultConfigValues: AppConfig = {\n integratorId: INTEGRATOR_ID,\n slippage: defaultSlippage,\n apiUrl: squidApiBaseUrl,\n xamanApiUrl: XAMAN_API_URL,\n priceImpactWarnings: {\n warning: 3,\n critical: 5,\n },\n};\n\nexport enum EvmPriorityConnectors {\n Safe = \"safe\",\n LedgerLive = \"ledgerLive\",\n}\n\n// Success\nconst cctpSuccessStatuses = [\"complete\"];\nconst chainflipSuccessStatuses = [\"COMPLETE\"];\nconst solanaSameChainSuccessStatuses = [\"finalized\"];\nconst axelarSuccessStatuses = [\n \"destination_executed\",\n \"executed\",\n \"express_executed\",\n \"success\",\n];\n\n// Error\nconst axelarErrorStatuses = [\n \"error_fetching_status\",\n \"error\",\n \"failed_on_destination\",\n];\nconst chainflipErrorStatuses = [\"BROADCAST_ABORTED\"];\n\n// Refunded\nexport const transactionRefundedStatuses = [\"refunded\"];\n\nexport const transactionErrorStatuses = [\n ...axelarErrorStatuses,\n ...chainflipErrorStatuses,\n];\nexport const transactionSuccessStatuses = [\n ...cctpSuccessStatuses,\n ...axelarSuccessStatuses,\n ...chainflipSuccessStatuses,\n ...solanaSameChainSuccessStatuses,\n];\nexport const transactionEndStatuses = [\n ...transactionSuccessStatuses,\n ...transactionRefundedStatuses,\n ...transactionErrorStatuses,\n];\n"],"names":["ChainType","evmZeroAddress"],"mappings":";;;;;AAqBA,MAAM,kBAAkB,GAAG,6BAA6B;AACxD,MAAM,iBAAiB,GACrB,iEAAiE;AACnE,MAAM,iBAAiB,GAAG,kCAAkC;AAC5D,MAAM,cAAc,GAAG,4CAA4C;AACnE,MAAM,eAAe,GAAG,6BAA6B;AACrD,MAAM,kBAAkB,GACtB,0DAA0D;AAE/C,MAAA,yBAAyB,GAA8B;AAClE,IAAA,CAACA,oBAAS,CAAC,GAAG,GAAGC,gBAAc;AAC/B,IAAA,CAACD,oBAAS,CAAC,MAAM,GAAG,iBAAiB;AACrC,IAAA,CAACA,oBAAS,CAAC,GAAG,GAAG,kBAAkB;AACnC,IAAA,CAACA,oBAAS,CAAC,MAAM,GAAG,iBAAiB;AACrC,IAAA,CAACA,oBAAS,CAAC,GAAG,GAAG,cAAc;AAC/B,IAAA,CAACA,oBAAS,CAAC,IAAI,GAAG,eAAe;AACjC,IAAA,CAACA,oBAAS,CAAC,OAAO,GAAG,kBAAkB;;AAGlC,MAAM,qBAAqB,GAChC;AACK,MAAM,wBAAwB,GAAG;AACjC,MAAM,wBAAwB,GACnC;AACK,MAAM,yBAAyB,GAAG;AAClC,MAAM,qBAAqB,GAChC;AACK,MAAM,sBAAsB,GAAG;AAC/B,MAAM,yBAAyB,GACpC;AAmBW,MAAA,SAAS,GAAG;;AAEvB,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,SAAS,EAAE,aAAa;AACxB,IAAA,MAAM,EAAE,UAAU;AAClB,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,IAAI,EAAE,gBAAgB;AACtB,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,MAAM,EAAE,UAAU;;AAGlB,IAAA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A,oBAAS,CAAC,GAAG,GAAG,SAAS,CAAC,QAAQ;AACnC,IAAA,CAACA,oBAAS,CAAC,MAAM,GAAG,SAAS,CAAC,OAAO;AACrC,IAAA,CAACA,oBAAS,CAAC,GAAG,GAAG,SAAS,CAAC,OAAO;AAClC,IAAA,CAACA,oBAAS,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM;AACpC,IAAA,CAACA,oBAAS,CAAC,GAAG,GAAG,SAAS,CAAC,GAAG;AAC9B,IAAA,CAACA,oBAAS,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI;AAChC,IAAA,CAACA,oBAAS,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO;;AAG3B,MAAA,gCAAgC,GAA8B;AACzE,IAAA,CAACA,oBAAS,CAAC,GAAG,GAAG,qBAAqB;AACtC,IAAA,CAACA,oBAAS,CAAC,MAAM,GAAG,wBAAwB;AAC5C,IAAA,CAACA,oBAAS,CAAC,GAAG,GAAG,yBAAyB;AAC1C,IAAA,CAACA,oBAAS,CAAC,MAAM,GAAG,wBAAwB;AAC5C,IAAA,CAACA,oBAAS,CAAC,GAAG,GAAG,qBAAqB;AACtC,IAAA,CAACA,oBAAS,CAAC,IAAI,GAAG,sBAAsB;AACxC,IAAA,CAACA,oBAAS,CAAC,OAAO,GAAG,yBAAyB;;AAchD,IAAY,qBAGX;AAHD,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,qBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AAC3B,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,GAGhC,EAAA,CAAA,CAAA;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { EnsService } from "./ens";
|
|
2
|
-
export { getXummClient, isXamanXAppContext } from "./xaman";
|
|
2
|
+
export { XAMAN_OWNERSHIP_CHALLENGE_MEMO_TYPE, getXummClient, isXamanXAppContext, } from "./xaman";
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import type { Xumm } from "xumm";
|
|
2
2
|
import { XamanXrplNetwork, XrplNetwork, XrplTransaction } from "../../core/types/xrpl";
|
|
3
|
+
export declare const XAMAN_OWNERSHIP_CHALLENGE_MEMO_TYPE: "squid-history-challenge";
|
|
3
4
|
interface XamanQrDataResponse {
|
|
4
5
|
qrMatrix: boolean[][];
|
|
5
6
|
wsStatusUrl: string;
|
|
6
7
|
deepLinkUrl: string;
|
|
7
8
|
}
|
|
9
|
+
export interface XamanSignInResponse {
|
|
10
|
+
response: {
|
|
11
|
+
account: string | null;
|
|
12
|
+
hex: string | null;
|
|
13
|
+
signer?: string | null;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare function getXamanNetwork(network: XrplNetwork): XamanXrplNetwork;
|
|
17
|
+
type XamanClientOptions = {
|
|
18
|
+
baseUrl?: string;
|
|
19
|
+
};
|
|
8
20
|
/**
|
|
9
21
|
* Client to interact with the Xaman backend through a Squid proxy.
|
|
10
22
|
* Retrieves the QR code data for the following methods:
|
|
@@ -12,21 +24,29 @@ interface XamanQrDataResponse {
|
|
|
12
24
|
* - get user session
|
|
13
25
|
* - send tx
|
|
14
26
|
*/
|
|
15
|
-
export declare
|
|
16
|
-
static
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
export declare class XamanClient {
|
|
28
|
+
static defaultBaseUrl: string;
|
|
29
|
+
private readonly baseUrl;
|
|
30
|
+
constructor({ baseUrl }?: XamanClientOptions);
|
|
31
|
+
signIn(signal?: AbortSignal): Promise<XamanQrDataResponse>;
|
|
32
|
+
userSession(payload: string, signal?: AbortSignal): Promise<XamanSignInResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Requests a Xaman SignIn payload for wallet ownership verification.
|
|
35
|
+
*
|
|
36
|
+
* Expected proxy endpoint: POST /xaman/sign-ownership-message with
|
|
37
|
+
* `{ message }`, returning the same QR/deeplink/websocket shape as sign-in.
|
|
38
|
+
* The backend should create a SignIn payload whose signed Memo contains:
|
|
39
|
+
* - MemoType: UTF-8 hex for the Xaman ownership challenge memo
|
|
40
|
+
* - MemoData: UTF-8 hex for the challenge message
|
|
41
|
+
*/
|
|
42
|
+
signOwnershipMessage(message: string, signal?: AbortSignal): Promise<XamanQrDataResponse>;
|
|
43
|
+
sendTx({ tx, signal, network, }: {
|
|
24
44
|
tx: XrplTransaction;
|
|
25
45
|
signal?: AbortSignal;
|
|
26
46
|
network: XrplNetwork;
|
|
27
47
|
}): Promise<XamanQrDataResponse>;
|
|
28
|
-
|
|
29
|
-
|
|
48
|
+
fetch<T>(endpoint: string, body?: Record<string, any>, signal?: AbortSignal): Promise<T>;
|
|
49
|
+
createUrl(endpoint: string): URL;
|
|
30
50
|
}
|
|
31
51
|
export declare function isXamanXAppContext(): boolean;
|
|
32
52
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/services/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./external/";
|
|
2
2
|
export * from "./internal/apiService";
|
|
3
3
|
export * from "./internal/assetsService";
|
|
4
|
+
export * from "./internal/bitcoinService";
|
|
4
5
|
export * from "./internal/configService";
|
|
5
6
|
export * from "./internal/cosmosService";
|
|
6
7
|
export * from "./internal/errorService";
|
|
@@ -14,6 +15,7 @@ export * from "./internal/routeService";
|
|
|
14
15
|
export * from "./internal/searchService";
|
|
15
16
|
export * from "./internal/solanaService";
|
|
16
17
|
export * from "./internal/stellarService";
|
|
18
|
+
export * from "./internal/suiService";
|
|
17
19
|
export * from "./internal/transactionService";
|
|
18
20
|
export * from "./internal/transactionStatusService";
|
|
19
21
|
export * from "./internal/urlParamsService";
|
|
@@ -108,16 +108,7 @@ export type AssetsColors = {
|
|
|
108
108
|
}>;
|
|
109
109
|
};
|
|
110
110
|
export declare function fetchAssetsColors(): Promise<AssetsColors>;
|
|
111
|
-
export declare function
|
|
112
|
-
/**
|
|
113
|
-
* Normalizes SDK data after each init/refetch before the rest of hooks consumes it.
|
|
114
|
-
*
|
|
115
|
-
* - Removes chains whose chainType is not supported by the local package.
|
|
116
|
-
* - Drops tokens for those removed chains.
|
|
117
|
-
* - Converts Evmos chains/tokens to EVM.
|
|
118
|
-
* - Applies optional asset colors.
|
|
119
|
-
*/
|
|
120
|
-
export declare function initializeSquidData(squid: Squid, assetsColors?: AssetsColors): void;
|
|
111
|
+
export declare function initializeSquidWithAssetsColors(squid: Squid, assetsColors: AssetsColors): void;
|
|
121
112
|
export declare function isEmptyObject(obj: Record<string, unknown> | undefined): boolean;
|
|
122
113
|
export declare const normalizeTokenSymbol: (symbol: string) => string;
|
|
123
114
|
export declare const areTokenSymbolsCompatible: (symbol1: string, symbol2: string) => boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function encodeUtf8(value: string): Uint8Array;
|
|
2
|
+
export declare function bytesToBase64(bytes: ArrayLike<number>): string;
|
|
3
|
+
export declare function isBase64(value: string): boolean;
|
|
4
|
+
export declare function base64StringOrBytes(value: string | ArrayLike<number>): string;
|
|
5
|
+
export declare function normalizeBase64Ed25519Signature(signature: string): string;
|
|
6
|
+
export declare function stringToUtf8Hex(value: string, { uppercase }?: {
|
|
7
|
+
uppercase?: boolean;
|
|
8
|
+
}): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -150,9 +150,9 @@ export declare class WidgetEvents extends EventTarget {
|
|
|
150
150
|
*/
|
|
151
151
|
dispatchQrCodeGenerationFailedForSign(data: WidgetEventMap["qrCodeGenerationFailedForSign"]): void;
|
|
152
152
|
/**
|
|
153
|
-
* Dispatches event after
|
|
154
|
-
*
|
|
153
|
+
* Dispatches event after a QR code is scanned and we're waiting for the user
|
|
154
|
+
* to approve or reject it.
|
|
155
155
|
*/
|
|
156
|
-
|
|
156
|
+
dispatchQrScannedAwaitingApproval(data: WidgetEventMap["qrScannedAwaitingUserApproval"]): void;
|
|
157
157
|
}
|
|
158
158
|
export {};
|
|
@@ -9,6 +9,7 @@ export declare function addEthereumChain({ chain, provider, }: {
|
|
|
9
9
|
provider: any;
|
|
10
10
|
}): Promise<any>;
|
|
11
11
|
export declare const parseEvmAddress: (address: string | undefined) => EvmAddress | undefined;
|
|
12
|
+
export declare function isEvmAddressValid(address: string): boolean;
|
|
12
13
|
/**
|
|
13
14
|
* Formats a Wagmi connector into a Squid Wallet
|
|
14
15
|
*/
|
|
@@ -39,7 +39,7 @@ export declare function isCoralBridgeAction(action: SimplifiedRouteAction): bool
|
|
|
39
39
|
*/
|
|
40
40
|
export declare function isActionCompletedOnSourceTx(action: Pick<RouteActionResponse, "type" | "fromChain" | "toChain">, fromChainId: string): boolean;
|
|
41
41
|
export declare function sleep(ms: number): Promise<unknown>;
|
|
42
|
-
export declare const
|
|
42
|
+
export declare const isDepositRoute: (route?: RouteResponse["route"]) => boolean;
|
|
43
43
|
/**
|
|
44
44
|
* Checks if the route contains a Chainflip bridge action
|
|
45
45
|
*/
|
|
@@ -50,9 +50,5 @@ export declare function isChainflipBridgeTransaction(actions?: SimplifiedRouteAc
|
|
|
50
50
|
* On-chain routes require calling a smart contract to execute
|
|
51
51
|
*/
|
|
52
52
|
export declare function isOnChainTxData(squidData: SquidData): squidData is OnChainExecutionData;
|
|
53
|
-
/**
|
|
54
|
-
* Checks if a route is of type DepositAddressDirectTransfer
|
|
55
|
-
*/
|
|
56
|
-
export declare function isDepositAddressDirectTransferRoute(squidData: SquidData): squidData is OnChainExecutionData;
|
|
57
53
|
export declare function getHistoryTransactionId(tx: HistoryTransaction): string;
|
|
58
54
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChainType } from '@0xsquid/squid-types';
|
|
2
2
|
import { HANA_ID, LOBSTR_ID, FREIGHTER_ID, XBULL_ID, RABET_ID, HOTWALLET_ID, ALBEDO_ID } from '@creit.tech/stellar-wallets-kit';
|
|
3
3
|
import { LEDGER_ID } from '@creit.tech/stellar-wallets-kit/modules/ledger.module.mjs';
|
|
4
|
-
import { a as WindowWalletFlag, w as walletIconBaseUrl, d as definedInWindow } from './index-
|
|
4
|
+
import { a as WindowWalletFlag, w as walletIconBaseUrl, d as definedInWindow } from './index-CtXS5uny.js';
|
|
5
5
|
import 'viem';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '@tanstack/react-query';
|
|
@@ -96,4 +96,4 @@ function formatStellarWallet(connector, isAvailable) {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
export { formatStellarWallet };
|
|
99
|
-
//# sourceMappingURL=stellarService.client-
|
|
99
|
+
//# sourceMappingURL=stellarService.client-D20h9JPG.js.map
|
package/dist/{stellarService.client-C-pOt34O.js.map → stellarService.client-D20h9JPG.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stellarService.client-
|
|
1
|
+
{"version":3,"file":"stellarService.client-D20h9JPG.js","sources":["../src/services/internal/stellarService.client.ts"],"sourcesContent":["import { ChainType } from \"@0xsquid/squid-types\";\nimport {\n ALBEDO_ID,\n FREIGHTER_ID,\n HANA_ID,\n HOTWALLET_ID,\n LOBSTR_ID,\n RABET_ID,\n XBULL_ID,\n} from \"@creit.tech/stellar-wallets-kit\";\nimport { LEDGER_ID } from \"@creit.tech/stellar-wallets-kit/modules/ledger.module\";\nimport { StellarConnector } from \"../../core/types/stellar\";\nimport {\n ConnectorID,\n StellarWallet,\n WindowWalletFlag,\n} from \"../../core/types/wallet\";\nimport { walletIconBaseUrl } from \"../../core/wallets\";\nimport { definedInWindow } from \"./walletService\";\n\ntype WalletOverride = Partial<\n Pick<\n StellarWallet,\n \"icon\" | \"windowFlag\" | \"skipInstallCheck\" | \"isInstalled\" | \"connectorId\"\n >\n>;\n\nconst walletOverrides: Partial<Record<string, WalletOverride>> = {\n [ALBEDO_ID]: {\n icon: `${walletIconBaseUrl}/albedo.webp`,\n isInstalled: () => false,\n skipInstallCheck: true,\n connectorId: \"albedo\",\n },\n [HOTWALLET_ID]: {\n icon: `${walletIconBaseUrl}/hot.webp`,\n windowFlag: WindowWalletFlag.HotWallet,\n skipInstallCheck: true,\n connectorId: \"hotWallet\",\n },\n [RABET_ID]: {\n icon: `${walletIconBaseUrl}/rabet.webp`,\n },\n [LEDGER_ID]: {\n icon: `${walletIconBaseUrl}/ledger_stellar_snap.webp`,\n },\n [XBULL_ID]: {\n icon: `${walletIconBaseUrl}/xbull.webp`,\n windowFlag: WindowWalletFlag.XBull,\n skipInstallCheck: true,\n connectorId: \"xBull\",\n },\n [FREIGHTER_ID]: {\n connectorId: \"freighter\",\n },\n [LOBSTR_ID]: {\n connectorId: \"lobstr\",\n },\n [HANA_ID]: {\n connectorId: \"hanaWallet\",\n },\n};\n\nexport function formatStellarWallet(\n connector: StellarConnector,\n isAvailable: boolean\n): StellarWallet {\n const { productName, productId, productIcon, productUrl } = connector;\n\n const overrides = walletOverrides[productId];\n const icon = overrides?.icon || productIcon;\n const connectorId = overrides?.connectorId || (productId as ConnectorID);\n\n return {\n connectorId,\n name: productName,\n connectorName: productName,\n type: ChainType.STELLAR,\n icon,\n windowFlag: productName as WindowWalletFlag,\n isMobile: false,\n isInstalled: overrides?.windowFlag\n ? () => definedInWindow(overrides.windowFlag, window)\n : overrides?.isInstalled || (() => isAvailable),\n skipInstallCheck: overrides?.skipInstallCheck,\n connector,\n url: productUrl,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,eAAe,GAA4C;IAC/D,CAAC,SAAS,GAAG;QACX,IAAI,EAAE,CAAG,EAAA,iBAAiB,CAAc,YAAA,CAAA;AACxC,QAAA,WAAW,EAAE,MAAM,KAAK;AACxB,QAAA,gBAAgB,EAAE,IAAI;AACtB,QAAA,WAAW,EAAE,QAAQ;AACtB,KAAA;IACD,CAAC,YAAY,GAAG;QACd,IAAI,EAAE,CAAG,EAAA,iBAAiB,C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S,EAAE;cACpB,MAAM,eAAe,CAAC,SAAS,CAAC,UAAU,EAAE,MAAM;cAClD,SAAS,EAAE,WAAW,KAAK,MAAM,WAAW,CAAC;QACjD,gBAAgB,EAAE,SAAS,EAAE,gBAAgB;QAC7C,SAAS;AACT,QAAA,GAAG,EAAE,UAAU;KAChB;AACH;;;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var squidTypes = require('@0xsquid/squid-types');
|
|
4
4
|
var stellarWalletsKit = require('@creit.tech/stellar-wallets-kit');
|
|
5
5
|
var ledger_module = require('@creit.tech/stellar-wallets-kit/modules/ledger.module.mjs');
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-z1nGQX9p.js');
|
|
7
7
|
require('viem');
|
|
8
8
|
require('react');
|
|
9
9
|
require('@tanstack/react-query');
|
|
@@ -98,4 +98,4 @@ function formatStellarWallet(connector, isAvailable) {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
exports.formatStellarWallet = formatStellarWallet;
|
|
101
|
-
//# sourceMappingURL=stellarService.client-
|
|
101
|
+
//# sourceMappingURL=stellarService.client-yWCDuq6S.js.map
|
package/dist/{stellarService.client-DBROJ4yf.js.map → stellarService.client-yWCDuq6S.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stellarService.client-
|
|
1
|
+
{"version":3,"file":"stellarService.client-yWCDuq6S.js","sources":["../src/services/internal/stellarService.client.ts"],"sourcesContent":["import { ChainType } from \"@0xsquid/squid-types\";\nimport {\n ALBEDO_ID,\n FREIGHTER_ID,\n HANA_ID,\n HOTWALLET_ID,\n LOBSTR_ID,\n RABET_ID,\n XBULL_ID,\n} from \"@creit.tech/stellar-wallets-kit\";\nimport { LEDGER_ID } from \"@creit.tech/stellar-wallets-kit/modules/ledger.module\";\nimport { StellarConnector } from \"../../core/types/stellar\";\nimport {\n ConnectorID,\n StellarWallet,\n WindowWalletFlag,\n} from \"../../core/types/wallet\";\nimport { walletIconBaseUrl } from \"../../core/wallets\";\nimport { definedInWindow } from \"./walletService\";\n\ntype WalletOverride = Partial<\n Pick<\n StellarWallet,\n \"icon\" | \"windowFlag\" | \"skipInstallCheck\" | \"isInstalled\" | \"connectorId\"\n >\n>;\n\nconst walletOverrides: Partial<Record<string, WalletOverride>> = {\n [ALBEDO_ID]: {\n icon: `${walletIconBaseUrl}/albedo.webp`,\n isInstalled: () => false,\n skipInstallCheck: true,\n connectorId: \"albedo\",\n },\n [HOTWALLET_ID]: {\n icon: `${walletIconBaseUrl}/hot.webp`,\n windowFlag: WindowWalletFlag.HotWallet,\n skipInstallCheck: true,\n connectorId: \"hotWallet\",\n },\n [RABET_ID]: {\n icon: `${walletIconBaseUrl}/rabet.webp`,\n },\n [LEDGER_ID]: {\n icon: `${walletIconBaseUrl}/ledger_stellar_snap.webp`,\n },\n [XBULL_ID]: {\n icon: `${walletIconBaseUrl}/xbull.webp`,\n windowFlag: WindowWalletFlag.XBull,\n skipInstallCheck: true,\n connectorId: \"xBull\",\n },\n [FREIGHTER_ID]: {\n connectorId: \"freighter\",\n },\n [LOBSTR_ID]: {\n connectorId: \"lobstr\",\n },\n [HANA_ID]: {\n connectorId: \"hanaWallet\",\n },\n};\n\nexport function formatStellarWallet(\n connector: StellarConnector,\n isAvailable: boolean\n): StellarWallet {\n const { productName, productId, productIcon, productUrl } = connector;\n\n const overrides = walletOverrides[productId];\n const icon = overrides?.icon || productIcon;\n const connectorId = overrides?.connectorId || (productId as ConnectorID);\n\n return {\n connectorId,\n name: productName,\n connectorName: productName,\n type: ChainType.STELLAR,\n icon,\n windowFlag: productName as WindowWalletFlag,\n isMobile: false,\n isInstalled: overrides?.windowFlag\n ? () => definedInWindow(overrides.windowFlag, window)\n : overrides?.isInstalled || (() => isAvailable),\n skipInstallCheck: overrides?.skipInstallCheck,\n connector,\n url: productUrl,\n };\n}\n"],"names":["ALBEDO_ID","walletIconBaseUrl","HOTWALLET_ID","WindowWalletFlag","RABET_ID","LEDGER_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,UAAU,EAAE,GAAG,SAAS;AAErE,IAAA,MAAM,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC;AAC5C,IAAA,MAAM,IAAI,GAAG,SAAS,EAAE,IAAI,IAAI,WAAW;AAC3C,IAAA,MAAM,WAAW,GAAG,SAAS,EAAE,WAAW,IAAK,SAAyB;IAExE,OAAO;QACL,WAAW;AACX,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,aAAa,EAAE,WAAW;QAC1B,IAAI,EAAEC,oBAAS,CAAC,OAAO;QACvB,IAAI;AACJ,QAAA,UAAU,EAAE,WAA+B;AAC3C,QAAA,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,SAAS,EAAE;cACpB,MAAMC,qBAAe,CAAC,SAAS,CAAC,UAAU,EAAE,MAAM;cAClD,SAAS,EAAE,WAAW,KAAK,MAAM,WAAW,CAAC;QACjD,gBAAgB,EAAE,SAAS,EAAE,gBAAgB;QAC7C,SAAS;AACT,QAAA,GAAG,EAAE,UAAU;KAChB;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsquid/react-hooks",
|
|
3
|
-
"version": "8.8.1-beta-
|
|
3
|
+
"version": "8.8.1-beta-wallet-verification.0",
|
|
4
4
|
"description": "Squid hooks monorepo",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@0xsquid/sdk": "2.13.0",
|
|
50
|
-
"@0xsquid/squid-types": "0.1.
|
|
50
|
+
"@0xsquid/squid-types": "0.1.216",
|
|
51
51
|
"@bitcoinerlab/secp256k1": "1.1.1",
|
|
52
52
|
"@cosmjs/cosmwasm-stargate": "0.32.4",
|
|
53
53
|
"@cosmjs/encoding": "0.32.4",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { RouteResponse } from "@0xsquid/squid-types";
|
|
2
|
-
import { SwapTransactionForStatus } from "../../core/types/transaction";
|
|
3
|
-
interface UseDepositTransactionStatusParams {
|
|
4
|
-
transaction?: SwapTransactionForStatus;
|
|
5
|
-
route?: RouteResponse["route"];
|
|
6
|
-
retry?: number;
|
|
7
|
-
refetchOnWindowFocus?: "always" | boolean;
|
|
8
|
-
enabled?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Called once the source deposit has been received, after the transaction has
|
|
11
|
-
* been registered in the stores. The view uses it to navigate.
|
|
12
|
-
*/
|
|
13
|
-
onReceived?: () => void;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Tracks a generated deposit address before it becomes a persisted swap history item.
|
|
17
|
-
*
|
|
18
|
-
* Mirrors the hooks-first pattern of `useExecuteTransaction`: once the source deposit
|
|
19
|
-
* is received, it registers the transaction in the transaction + history stores, then
|
|
20
|
-
* signals the view (via `onReceived`) to navigate. The view never writes to the stores.
|
|
21
|
-
*/
|
|
22
|
-
export declare const useDepositTransactionStatus: ({ transaction, route, retry, refetchOnWindowFocus, enabled, onReceived, }: UseDepositTransactionStatusParams) => {
|
|
23
|
-
transactionStatusQuery: import("@tanstack/react-query").UseQueryResult<import("@0xsquid/squid-types").StatusResponse, Error>;
|
|
24
|
-
};
|
|
25
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { StatusResponse } from "@0xsquid/squid-types";
|
|
2
|
-
import { SwapTransactionForStatus, TransactionStatus } from "../../core/types/transaction";
|
|
3
|
-
interface UseSwapStatusQueryParams {
|
|
4
|
-
transaction?: SwapTransactionForStatus;
|
|
5
|
-
retry?: number;
|
|
6
|
-
refetchOnWindowFocus?: "always" | boolean;
|
|
7
|
-
enabled?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Fires on every successful status response, with the raw status string.
|
|
10
|
-
* Use for non-terminal transitions (e.g. a deposit being received).
|
|
11
|
-
*/
|
|
12
|
-
onStatus?: (params: {
|
|
13
|
-
status: string;
|
|
14
|
-
statusResponse: StatusResponse;
|
|
15
|
-
}) => void;
|
|
16
|
-
onEndStatus?: (params: {
|
|
17
|
-
status: TransactionStatus;
|
|
18
|
-
statusResponse: StatusResponse;
|
|
19
|
-
}) => void;
|
|
20
|
-
onNotFound?: () => void;
|
|
21
|
-
onError?: () => void;
|
|
22
|
-
}
|
|
23
|
-
export declare const useSwapStatusQuery: ({ transaction, retry, refetchOnWindowFocus, enabled, onStatus, onEndStatus, onNotFound, onError, }: UseSwapStatusQueryParams) => {
|
|
24
|
-
transactionStatusQuery: import("@tanstack/react-query").UseQueryResult<StatusResponse, Error>;
|
|
25
|
-
};
|
|
26
|
-
export {};
|