@0xsquid/react-hooks 8.8.1-beta-canton.4 → 8.9.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/constants.d.ts +0 -2
- package/dist/core/types/wallet.d.ts +6 -9
- package/dist/hooks/chains/useSquidChains.d.ts +0 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/store/useDepositAddressStore.d.ts +5 -23
- 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 +15 -41
- package/dist/hooks/wallet/useWallet.d.ts +15 -45
- package/dist/{index-D5QOR7JT.js → index-BL_AUWQg.js} +217 -394
- package/dist/index-BL_AUWQg.js.map +1 -0
- package/dist/{index-mgE1SeE-.js → index-DcBFug8t.js} +216 -396
- package/dist/index-DcBFug8t.js.map +1 -0
- package/dist/{index.es-3JPbTFKq.js → index.es-1XEAWjab.js} +2 -2
- package/dist/{index.es-3JPbTFKq.js.map → index.es-1XEAWjab.js.map} +1 -1
- package/dist/{index.es-Cq4mUT_n.js → index.es-DSQHpime.js} +2 -2
- package/dist/{index.es-Cq4mUT_n.js.map → index.es-DSQHpime.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +3 -6
- package/dist/index.js.map +1 -1
- package/dist/{secretService-DWq78rM5.js → secretService-B1SDXLS1.js} +2 -2
- package/dist/{secretService-DWq78rM5.js.map → secretService-B1SDXLS1.js.map} +1 -1
- package/dist/{secretService-DOOg6zVn.js → secretService-DxQ78j5I.js} +2 -2
- package/dist/{secretService-DOOg6zVn.js.map → secretService-DxQ78j5I.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/internal/assetsService.d.ts +1 -10
- package/dist/services/internal/solanaTokenProgramService.d.ts +9 -0
- package/dist/services/internal/transactionService.d.ts +1 -5
- package/dist/{stellarService.client-DBROJ4yf.js → stellarService.client-C4TLBEpm.js} +2 -2
- package/dist/{stellarService.client-DBROJ4yf.js.map → stellarService.client-C4TLBEpm.js.map} +1 -1
- package/dist/{stellarService.client-C-pOt34O.js → stellarService.client-CkP5ng2n.js} +2 -2
- package/dist/{stellarService.client-C-pOt34O.js.map → stellarService.client-CkP5ng2n.js.map} +1 -1
- package/dist/tests/rpcServiceSolana.test.d.ts +1 -0
- package/dist/tests/solanaTokenProgramService.test.d.ts +1 -0
- 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.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 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 ...trans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,GAAG,SAAS,CAAC,OAAO;AAClC,IAAA,CAAC,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM;AACpC,IAAA,CAAC,SAAS,CAAC,GAAG,GAAG,SAAS,CAAC,GAAG;AAC9B,IAAA,CAAC,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI;AAChC,IAAA,CAAC,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO;;AAG3B,MAAA,gCAAgC,GAA8B;AACzE,IAAA,CAAC,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;;AAahD,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 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,GAA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AA,GAAA,YAAyB;AAC3B,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,GAGhC,EAAA,CAAA,CAAA;;;;;;;;;;;;;"}
|
|
@@ -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,9 @@
|
|
|
1
|
+
import type { Token } from "@0xsquid/squid-types";
|
|
2
|
+
import { Connection, PublicKey } from "@solana/web3.js";
|
|
3
|
+
export declare const solanaTokenProgramIds: readonly [PublicKey, PublicKey];
|
|
4
|
+
export declare const isSupportedSolanaTokenProgramId: (programId: PublicKey) => boolean;
|
|
5
|
+
export declare const getSupportedSolanaTokenProgramId: (tokenProgramId?: string) => PublicKey | undefined;
|
|
6
|
+
export declare const resolveSolanaTokenProgramId: ({ connection, token, }: {
|
|
7
|
+
connection: Connection;
|
|
8
|
+
token: Token;
|
|
9
|
+
}) => Promise<PublicKey>;
|
|
@@ -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 {};
|
|
@@ -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-DcBFug8t.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-C4TLBEpm.js.map
|
package/dist/{stellarService.client-DBROJ4yf.js.map → stellarService.client-C4TLBEpm.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stellarService.client-
|
|
1
|
+
{"version":3,"file":"stellarService.client-C4TLBEpm.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_ID","XBULL_ID","FREIGHTER_ID","LOBSTR_ID","HANA_ID","ChainType","definedInWindow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,eAAe,GAA4C;IAC/D,CAACA,2BAAS,GAAG;QACX,IAAI,EAAE,CAAG,EAAAC,uBAAiB,CAAc,YAAA,CAAA;AACxC,QAAA,WAAW,EAAE,MAAM,KAAK;AACxB,QAAA,gBAAgB,EAAE,IAAI;AACtB,QAAA,WAAW,EAAE,QAAQ;AACtB,KAAA;IACD,CAACC,8BAAY,GAAG;QACd,IAAI,EAAE,CAAG,EAAAD,uBAAiB,CAAW,SAAA,CAAA;QACrC,UAAU,EAAEE,sBAAgB,CAAC,SAAS;AACtC,QAAA,gBAAgB,EAAE,IAAI;AACtB,QAAA,WAAW,EAAE,WAAW;AACzB,KAAA;IACD,CAACC,0BAAQ,GAAG;QACV,IAAI,EAAE,CAAG,EAAAH,uBAAiB,CAAa,WAAA,CAAA;AACxC,KAAA;IACD,CAACI,uBAAS,GAAG;QACX,IAAI,EAAE,CAAG,EAAAJ,uBAAiB,CAA2B,yBAAA,CAAA;AACtD,KAAA;IACD,CAACK,0BAAQ,GAAG;QACV,IAAI,EAAE,CAAG,EAAAL,uBAAiB,CAAa,WAAA,CAAA;QACvC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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-BL_AUWQg.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-CkP5ng2n.js.map
|
package/dist/{stellarService.client-C-pOt34O.js.map → stellarService.client-CkP5ng2n.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stellarService.client-
|
|
1
|
+
{"version":3,"file":"stellarService.client-CkP5ng2n.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,CAA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f,WAAW,EAAE,SAAS,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;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsquid/react-hooks",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.9.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 {};
|