@0xsquid/react-hooks 6.4.1-onramp-beta.6 → 6.4.1-onramp-beta.7
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 +2 -1
- package/dist/core/client/index.js +2 -0
- package/dist/core/client/index.js.map +1 -1
- package/dist/core/connectors/bitcoin/errors/index.d.ts +2 -1
- package/dist/core/connectors/bitcoin/errors/index.js +1 -1
- package/dist/core/connectors/bitcoin/errors/index.js.map +1 -1
- package/dist/core/connectors/bitcoin/wallets/index.d.ts +1 -0
- package/dist/core/connectors/bitcoin/wallets/index.js +1 -0
- package/dist/core/connectors/bitcoin/wallets/index.js.map +1 -1
- package/dist/core/connectors/bitcoin/wallets/keplr.d.ts +11 -0
- package/dist/core/connectors/bitcoin/wallets/keplr.js +28 -0
- package/dist/core/connectors/bitcoin/wallets/keplr.js.map +1 -0
- package/dist/core/constants.d.ts +7 -4
- package/dist/core/constants.js +17 -5
- package/dist/core/constants.js.map +1 -1
- package/dist/core/externalLinks.d.ts +1 -1
- package/dist/core/externalLinks.js +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/providers/CosmosProvider.d.ts +1 -1
- package/dist/core/providers/CosmosProvider.js.map +1 -1
- package/dist/core/providers/SuiProvider.d.ts +19 -0
- package/dist/core/providers/SuiProvider.js +15 -0
- package/dist/core/providers/SuiProvider.js.map +1 -0
- package/dist/core/queries/queries-keys.d.ts +3 -3
- package/dist/core/queries/queries-keys.js +3 -1
- package/dist/core/queries/queries-keys.js.map +1 -1
- package/dist/core/types/config.d.ts +2 -0
- package/dist/core/types/event.d.ts +5 -0
- package/dist/core/types/history.d.ts +1 -0
- package/dist/core/types/history.js.map +1 -1
- package/dist/core/types/rpc.d.ts +10 -0
- package/dist/core/types/rpc.js +2 -0
- package/dist/core/types/rpc.js.map +1 -0
- package/dist/core/types/sui.d.ts +14 -0
- package/dist/core/types/sui.js +2 -0
- package/dist/core/types/sui.js.map +1 -0
- package/dist/core/types/transaction.d.ts +3 -2
- package/dist/core/types/wallet.d.ts +19 -2
- package/dist/core/types/wallet.js.map +1 -1
- package/dist/core/wallets.d.ts +2 -1
- package/dist/core/wallets.js +32 -21
- package/dist/core/wallets.js.map +1 -1
- package/dist/hooks/analytics/useTrackSearchEmpty.d.ts +12 -0
- package/dist/hooks/analytics/useTrackSearchEmpty.js +22 -0
- package/dist/hooks/analytics/useTrackSearchEmpty.js.map +1 -0
- package/dist/hooks/chains/useSquidChains.d.ts +1 -0
- package/dist/hooks/chains/useSquidChains.js +23 -4
- package/dist/hooks/chains/useSquidChains.js.map +1 -1
- package/dist/hooks/cosmos/useCosmos.js +28 -27
- package/dist/hooks/cosmos/useCosmos.js.map +1 -1
- package/dist/hooks/cosmos/useCosmosForChain.js +14 -3
- package/dist/hooks/cosmos/useCosmosForChain.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/solana/useSolana.js +8 -2
- package/dist/hooks/solana/useSolana.js.map +1 -1
- package/dist/hooks/store/useSquidStore.d.ts +0 -1
- package/dist/hooks/store/useSquidStore.js +0 -1
- package/dist/hooks/store/useSquidStore.js.map +1 -1
- package/dist/hooks/store/useWalletStore.d.ts +5 -5
- package/dist/hooks/store/useWalletStore.js +13 -20
- package/dist/hooks/store/useWalletStore.js.map +1 -1
- package/dist/hooks/sui/useSui.d.ts +2 -0
- package/dist/hooks/sui/useSui.js +28 -0
- package/dist/hooks/sui/useSui.js.map +1 -0
- package/dist/hooks/sui/useSuiClient.d.ts +9 -0
- package/dist/hooks/sui/useSuiClient.js +16 -0
- package/dist/hooks/sui/useSuiClient.js.map +1 -0
- package/dist/hooks/sui/useSuiWallets.d.ts +7 -0
- package/dist/hooks/sui/useSuiWallets.js +42 -0
- package/dist/hooks/sui/useSuiWallets.js.map +1 -0
- package/dist/hooks/swap/useSwap.js +3 -3
- package/dist/hooks/swap/useSwap.js.map +1 -1
- package/dist/hooks/tokens/useAllConnectedWalletBalances.js +12 -1
- package/dist/hooks/tokens/useAllConnectedWalletBalances.js.map +1 -1
- package/dist/hooks/tokens/useAllTokensWithBalanceForChainType.d.ts +4 -5
- package/dist/hooks/tokens/useAllTokensWithBalanceForChainType.js +30 -17
- package/dist/hooks/tokens/useAllTokensWithBalanceForChainType.js.map +1 -1
- package/dist/hooks/tokens/useBalance.d.ts +18 -246
- package/dist/hooks/tokens/useBalance.js +66 -25
- package/dist/hooks/tokens/useBalance.js.map +1 -1
- package/dist/hooks/tokens/useMultiChainBalance.d.ts +2 -2
- package/dist/hooks/tokens/useMultiChainBalance.js +38 -35
- package/dist/hooks/tokens/useMultiChainBalance.js.map +1 -1
- package/dist/hooks/tokens/useNativeBalance.d.ts +16 -18
- package/dist/hooks/tokens/useNativeBalance.js +121 -56
- package/dist/hooks/tokens/useNativeBalance.js.map +1 -1
- package/dist/hooks/tokens/useNativeTokenForChain.js +6 -4
- package/dist/hooks/tokens/useNativeTokenForChain.js.map +1 -1
- package/dist/hooks/tokens/useSquidTokens.d.ts +2 -11
- package/dist/hooks/tokens/useSquidTokens.js +8 -16
- package/dist/hooks/tokens/useSquidTokens.js.map +1 -1
- package/dist/hooks/transaction/send/useSendTransaction.js +2 -0
- package/dist/hooks/transaction/send/useSendTransaction.js.map +1 -1
- package/dist/hooks/transaction/useAllTransactionsStatus.js +1 -3
- package/dist/hooks/transaction/useAllTransactionsStatus.js.map +1 -1
- package/dist/hooks/transaction/useApproval.js +1 -1
- package/dist/hooks/transaction/useApproval.js.map +1 -1
- package/dist/hooks/transaction/useEstimate.js +1 -1
- package/dist/hooks/transaction/useEstimate.js.map +1 -1
- package/dist/hooks/transaction/useExecuteTransaction.d.ts +0 -2
- package/dist/hooks/transaction/useExecuteTransaction.js +95 -26
- package/dist/hooks/transaction/useExecuteTransaction.js.map +1 -1
- package/dist/hooks/transaction/useGetRoute.d.ts +4 -2
- package/dist/hooks/transaction/useGetRoute.js +12 -9
- package/dist/hooks/transaction/useGetRoute.js.map +1 -1
- package/dist/hooks/transaction/useSwapTransactionStatus.js +1 -2
- package/dist/hooks/transaction/useSwapTransactionStatus.js.map +1 -1
- package/dist/hooks/user/useHistory.js +1 -0
- package/dist/hooks/user/useHistory.js.map +1 -1
- package/dist/hooks/user/useUserParams.js +1 -1
- package/dist/hooks/user/useUserParams.js.map +1 -1
- package/dist/hooks/wallet/useIntegratorContext.js +1 -1
- package/dist/hooks/wallet/useIntegratorContext.js.map +1 -1
- package/dist/hooks/wallet/useMultiChainWallet.d.ts +1 -1
- package/dist/hooks/wallet/useMultiChainWallet.js +32 -24
- package/dist/hooks/wallet/useMultiChainWallet.js.map +1 -1
- package/dist/hooks/wallet/useSigner.d.ts +1 -0
- package/dist/hooks/wallet/useSigner.js +11 -1
- package/dist/hooks/wallet/useSigner.js.map +1 -1
- package/dist/hooks/wallet/useWallet.d.ts +24 -6
- package/dist/hooks/wallet/useWallet.js +25 -11
- package/dist/hooks/wallet/useWallet.js.map +1 -1
- package/dist/hooks/wallet/useWallets.js +26 -1
- package/dist/hooks/wallet/useWallets.js.map +1 -1
- package/dist/provider/index.d.ts +1 -1
- package/dist/provider/index.js +10 -8
- package/dist/provider/index.js.map +1 -1
- package/dist/services/external/rpcService.d.ts +9 -5
- package/dist/services/external/rpcService.js +42 -15
- package/dist/services/external/rpcService.js.map +1 -1
- package/dist/services/external/suiRpcClient.d.ts +32 -0
- package/dist/services/external/suiRpcClient.js +80 -0
- package/dist/services/external/suiRpcClient.js.map +1 -0
- package/dist/services/internal/assetsService.d.ts +2 -2
- package/dist/services/internal/assetsService.js +10 -5
- package/dist/services/internal/assetsService.js.map +1 -1
- package/dist/services/internal/bitcoinService.d.ts +3 -5
- package/dist/services/internal/bitcoinService.js +9 -1
- package/dist/services/internal/bitcoinService.js.map +1 -1
- package/dist/services/internal/configService.js +10 -2
- package/dist/services/internal/configService.js.map +1 -1
- package/dist/services/internal/cosmosService.d.ts +16 -14
- package/dist/services/internal/cosmosService.js +18 -1
- package/dist/services/internal/cosmosService.js.map +1 -1
- package/dist/services/internal/errorService.d.ts +15 -0
- package/dist/services/internal/errorService.js +34 -4
- package/dist/services/internal/errorService.js.map +1 -1
- package/dist/services/internal/eventService.d.ts +5 -0
- package/dist/services/internal/eventService.js +7 -0
- package/dist/services/internal/eventService.js.map +1 -1
- package/dist/services/internal/evmService.d.ts +3 -6
- package/dist/services/internal/evmService.js.map +1 -1
- package/dist/services/internal/searchService.js +18 -4
- package/dist/services/internal/searchService.js.map +1 -1
- package/dist/services/internal/sendTransactionStatus.js +8 -0
- package/dist/services/internal/sendTransactionStatus.js.map +1 -1
- package/dist/services/internal/solanaService.d.ts +3 -6
- package/dist/services/internal/solanaService.js.map +1 -1
- package/dist/services/internal/suiService.d.ts +20 -0
- package/dist/services/internal/suiService.js +119 -0
- package/dist/services/internal/suiService.js.map +1 -0
- package/dist/services/internal/transactionService.d.ts +1 -2
- package/dist/services/internal/transactionService.js +3 -2
- package/dist/services/internal/transactionService.js.map +1 -1
- package/dist/services/internal/transactionStatusService.js +1 -0
- package/dist/services/internal/transactionStatusService.js.map +1 -1
- package/dist/services/internal/walletService.d.ts +21 -15
- package/dist/services/internal/walletService.js +38 -28
- package/dist/services/internal/walletService.js.map +1 -1
- package/dist/tests/swapConfig.test.js +72 -7
- package/dist/tests/swapConfig.test.js.map +1 -1
- package/package.json +14 -10
- package/dist/core/types/route.d.ts +0 -9
- package/dist/core/types/route.js +0 -4
- package/dist/core/types/route.js.map +0 -1
|
@@ -2,11 +2,12 @@ import { ChainData, ChainType } from "@0xsquid/squid-types";
|
|
|
2
2
|
import { StargateClient } from "@cosmjs/stargate";
|
|
3
3
|
import { Connection as SolanaConnection } from "@solana/web3.js";
|
|
4
4
|
import { JsonRpcProvider } from "ethers";
|
|
5
|
-
export declare function getClient<T extends ChainType>(chain: ChainData): Promise<ChainTypeToClient[T]>;
|
|
6
5
|
type ChainTypeToClient = {
|
|
7
6
|
[ChainType.EVM]: JsonRpcProvider;
|
|
8
7
|
[ChainType.COSMOS]: StargateClient;
|
|
9
8
|
[ChainType.SOLANA]: SolanaConnection;
|
|
10
9
|
[ChainType.BTC]: null;
|
|
10
|
+
[ChainType.SUI]: null;
|
|
11
11
|
};
|
|
12
|
+
export declare function getClient<T extends ChainType>(chain: ChainData): Promise<ChainTypeToClient[T]>;
|
|
12
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAY9C,MAAM,WAAW,GAAG,IAAI,GAAG,EAAgD,CAAC;AAE5E,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,KAAgB;IAEhB,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,OAAO,EAAW,CAAC;IAE3D,IAAI,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACxB,OAAO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAyB,CAAC;KACrD;IAED,MAAM,MAAM,GAAG,MAAM,YAAY,CAAI,KAAK,CAAC,CAAC;IAE5C,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAE7B,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,YAAY,CACzB,KAAgB;IAEhB,QAAQ,KAAK,CAAC,SAAS,EAAE;QACvB,KAAK,SAAS,CAAC,GAAG;YAChB,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,GAAG,CAAyB,CAAC;QAEhE,KAAK,SAAS,CAAC,MAAM;YACnB,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC,KAAK,CAAC,CAAC;YACnD,OAAO,CAAC,MAAM,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAyB,CAAC;QAExE,KAAK,SAAS,CAAC,MAAM;YACnB,OAAO,IAAI,gBAAgB,CAAC,cAAc,CAAyB,CAAC;QAEtE,KAAK,SAAS,CAAC,GAAG;YAChB,OAAO,IAA4B,CAAC;QAEtC,KAAK,SAAS,CAAC,GAAG;YAChB,OAAO,IAA4B,CAAC;KACvC;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
declare class BitcoinConnectorError extends Error {
|
|
2
2
|
constructor(message: string);
|
|
3
3
|
}
|
|
4
4
|
export declare class BitcoinConnectorProviderNotFoundError extends BitcoinConnectorError {
|
|
@@ -10,3 +10,4 @@ export declare class BitcoinConnectorTransactionFailedError extends BitcoinConne
|
|
|
10
10
|
export declare class BitcoinConnectorInvalidAccountError extends BitcoinConnectorError {
|
|
11
11
|
constructor();
|
|
12
12
|
}
|
|
13
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/connectors/bitcoin/errors/index.ts"],"names":[],"mappings":"AAAA,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/connectors/bitcoin/errors/index.ts"],"names":[],"mappings":"AAAA,MAAM,qBAAsB,SAAQ,KAAK;IACvC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AAED,MAAM,OAAO,qCAAsC,SAAQ,qBAAqB;IAC9E,YAAY,YAAoB;QAC9B,KAAK,CAAC,oBAAoB,YAAY,YAAY,CAAC,CAAC;IACtD,CAAC;CACF;AAED,MAAM,OAAO,sCAAuC,SAAQ,qBAAqB;IAC/E;QACE,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACtC,CAAC;CACF;AAED,MAAM,OAAO,mCAAoC,SAAQ,qBAAqB;IAC5E;QACE,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/connectors/bitcoin/wallets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/connectors/bitcoin/wallets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IBitcoinProvider as KeplrBitcoinProvider } from "@keplr-wallet/types";
|
|
2
|
+
import { BitcoinConnector } from "..";
|
|
3
|
+
export declare class KeplrConnector implements BitcoinConnector {
|
|
4
|
+
get getProvider(): KeplrBitcoinProvider;
|
|
5
|
+
sendBTC(to: string, amount: number): Promise<{
|
|
6
|
+
txHash: string;
|
|
7
|
+
}>;
|
|
8
|
+
requestAccount(): Promise<{
|
|
9
|
+
address: string;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BitcoinConnectorInvalidAccountError, BitcoinConnectorProviderNotFoundError, BitcoinConnectorTransactionFailedError, } from "../errors";
|
|
2
|
+
export class KeplrConnector {
|
|
3
|
+
get getProvider() {
|
|
4
|
+
const provider = window?.bitcoin_keplr;
|
|
5
|
+
if (!provider) {
|
|
6
|
+
throw new BitcoinConnectorProviderNotFoundError("Keplr");
|
|
7
|
+
}
|
|
8
|
+
return provider;
|
|
9
|
+
}
|
|
10
|
+
async sendBTC(to, amount) {
|
|
11
|
+
const txHash = await this.getProvider.sendBitcoin(to, amount);
|
|
12
|
+
if (!txHash) {
|
|
13
|
+
throw new BitcoinConnectorTransactionFailedError();
|
|
14
|
+
}
|
|
15
|
+
return { txHash };
|
|
16
|
+
}
|
|
17
|
+
async requestAccount() {
|
|
18
|
+
const accounts = await this.getProvider.requestAccounts();
|
|
19
|
+
const account = accounts[0];
|
|
20
|
+
if (typeof account !== "string") {
|
|
21
|
+
throw new BitcoinConnectorInvalidAccountError();
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
address: account,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=keplr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keplr.js","sourceRoot":"","sources":["../../../../../src/core/connectors/bitcoin/wallets/keplr.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mCAAmC,EACnC,qCAAqC,EACrC,sCAAsC,GACvC,MAAM,WAAW,CAAC;AAEnB,MAAM,OAAO,cAAc;IACzB,IAAW,WAAW;QACpB,MAAM,QAAQ,GAAI,MAAc,EAAE,aAAa,CAAC;QAEhD,IAAI,CAAC,QAAQ,EAAE;YACb,MAAM,IAAI,qCAAqC,CAAC,OAAO,CAAC,CAAC;SAC1D;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU,EAAE,MAAc;QACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAE9D,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,sCAAsC,EAAE,CAAC;SACpD;QAED,OAAO,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,MAAM,QAAQ,GAAa,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,CAAC;QAEpE,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QAE5B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,MAAM,IAAI,mCAAmC,EAAE,CAAC;SACjD;QAED,OAAO;YACL,OAAO,EAAE,OAAO;SACjB,CAAC;IACJ,CAAC;CACF"}
|
package/dist/core/constants.d.ts
CHANGED
|
@@ -6,22 +6,20 @@ export declare const nativeEvmTokenAddress = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
|
|
|
6
6
|
export declare const nativeCosmosTokenAddress = "uosmo";
|
|
7
7
|
export declare const nativeSolanaTokenAddress = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
8
8
|
export declare const nativeBitcoinTokenAddress = "satoshi";
|
|
9
|
+
export declare const nativeSuiTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
9
10
|
export declare const maxPriceImpact = 30;
|
|
10
11
|
export declare const limitTradeSizeUsd = 10000000;
|
|
11
12
|
export declare const defaultSlippage: SlippageOption;
|
|
12
13
|
export declare const destinationAddressResetValue = "null";
|
|
13
14
|
export declare const fallbackAddressResetValue = "null";
|
|
14
|
-
export declare const widgetHeight = 684;
|
|
15
|
-
export declare const widgetWidth = 440;
|
|
16
15
|
export declare const gasRefundMultiplier = 25;
|
|
17
16
|
export declare const transparentClass = "tw-bg-opacity-80";
|
|
18
17
|
export declare const subTransparentClass = "tw-bg-opacity-50";
|
|
19
|
-
export declare const backendVersion = "v2";
|
|
20
18
|
export declare const internalSquidApiBaseUrl = "https://app.squidrouter.com/api";
|
|
21
19
|
export declare const TOKEN_PRICE_API_URL = "https://beta.app.squidrouter.com/api/coingecko";
|
|
22
20
|
export declare const BETA_INTERNAL_API_BASE_URL = "https://squid-app-v2-git-feat-api-fiat-onramp-0xsquid.vercel.app/api";
|
|
23
21
|
export declare const SOLANA_RPC_URL = "https://meredith-ute2ko-fast-mainnet.helius-rpc.com";
|
|
24
|
-
export declare const INTEGRATOR_ID = "
|
|
22
|
+
export declare const INTEGRATOR_ID = "squid-widget-playground-local-cd33cba6-7e12-4fcc-8d5d-35e286f655ea";
|
|
25
23
|
export declare const DEFAULT_COUNTRY_CODE = "GB";
|
|
26
24
|
export declare const CHAIN_IDS: {
|
|
27
25
|
readonly OSMOSIS: "osmosis-1";
|
|
@@ -38,7 +36,9 @@ export declare const CHAIN_IDS: {
|
|
|
38
36
|
readonly MIGALOO: "migaloo-1";
|
|
39
37
|
readonly UMEE: "umee-1";
|
|
40
38
|
readonly PERSISTENCE: "core-1";
|
|
39
|
+
readonly NOBLE: "noble-1";
|
|
41
40
|
readonly ETHEREUM: "1";
|
|
41
|
+
readonly ETHEREUM_SEPOLIA: "11155111";
|
|
42
42
|
readonly ARBITRUM: "42161";
|
|
43
43
|
readonly BSC: "56";
|
|
44
44
|
readonly BASE: "8453";
|
|
@@ -58,7 +58,10 @@ export declare const CHAIN_IDS: {
|
|
|
58
58
|
readonly BERACHAIN: "80094";
|
|
59
59
|
readonly BITCOIN: "bitcoin";
|
|
60
60
|
readonly SOLANA: "solana-mainnet-beta";
|
|
61
|
+
readonly SUI: "sui-mainnet";
|
|
62
|
+
readonly SUI_TESTNET: "sui-testnet";
|
|
61
63
|
};
|
|
64
|
+
export declare const chainTypeToDefaultChainIdMap: Record<ChainType, string>;
|
|
62
65
|
export declare const chainTypeToNativeTokenAddressMap: Record<ChainType, string>;
|
|
63
66
|
export declare const widgetHeaderSize: {
|
|
64
67
|
height: number;
|
package/dist/core/constants.js
CHANGED
|
@@ -6,33 +6,33 @@ export const DEFAULT_LOCALE = "en-US";
|
|
|
6
6
|
const btcZeroAddress = "bc1qcdyjau30xhw26h2egcfklwyyyskafhp9x8qtg2";
|
|
7
7
|
const cosmosZeroAddress = "osmo1awrua7e2kj69d7vn5qt5tccrhavmj9xa6y8hhu";
|
|
8
8
|
const solanaZeroAddress = "AuF3k2X5CsXJiXo7YKL5jxDG3gmf9MjaVK8hqt7Kfes1";
|
|
9
|
+
const suiZeroAddress = "0x0000000000000000000000000000000000000000";
|
|
9
10
|
export const chainTypeToZeroAddressMap = {
|
|
10
11
|
[ChainType.EVM]: evmZeroAddress,
|
|
11
12
|
[ChainType.COSMOS]: cosmosZeroAddress,
|
|
12
13
|
[ChainType.BTC]: btcZeroAddress,
|
|
13
14
|
[ChainType.SOLANA]: solanaZeroAddress,
|
|
15
|
+
[ChainType.SUI]: suiZeroAddress,
|
|
14
16
|
};
|
|
15
17
|
export const nativeEvmTokenAddress = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
16
18
|
export const nativeCosmosTokenAddress = "uosmo";
|
|
17
19
|
export const nativeSolanaTokenAddress = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
18
20
|
export const nativeBitcoinTokenAddress = "satoshi";
|
|
21
|
+
export const nativeSuiTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
19
22
|
export const maxPriceImpact = 30;
|
|
20
23
|
export const limitTradeSizeUsd = 10000000;
|
|
21
24
|
// by setting slippage to undefined, it's set to "auto"
|
|
22
25
|
export const defaultSlippage = undefined;
|
|
23
26
|
export const destinationAddressResetValue = "null";
|
|
24
27
|
export const fallbackAddressResetValue = "null";
|
|
25
|
-
export const widgetHeight = 684;
|
|
26
|
-
export const widgetWidth = 440;
|
|
27
28
|
export const gasRefundMultiplier = 25;
|
|
28
29
|
export const transparentClass = "tw-bg-opacity-80";
|
|
29
30
|
export const subTransparentClass = "tw-bg-opacity-50";
|
|
30
|
-
export const backendVersion = "v2";
|
|
31
31
|
export const internalSquidApiBaseUrl = "https://app.squidrouter.com/api";
|
|
32
32
|
export const TOKEN_PRICE_API_URL = `https://beta.app.squidrouter.com/api/coingecko`;
|
|
33
33
|
export const BETA_INTERNAL_API_BASE_URL = "https://squid-app-v2-git-feat-api-fiat-onramp-0xsquid.vercel.app/api";
|
|
34
34
|
export const SOLANA_RPC_URL = "https://meredith-ute2ko-fast-mainnet.helius-rpc.com";
|
|
35
|
-
export const INTEGRATOR_ID = "
|
|
35
|
+
export const INTEGRATOR_ID = "squid-widget-playground-local-cd33cba6-7e12-4fcc-8d5d-35e286f655ea";
|
|
36
36
|
export const DEFAULT_COUNTRY_CODE = "GB";
|
|
37
37
|
export const CHAIN_IDS = {
|
|
38
38
|
// Cosmos
|
|
@@ -50,8 +50,10 @@ export const CHAIN_IDS = {
|
|
|
50
50
|
MIGALOO: "migaloo-1",
|
|
51
51
|
UMEE: "umee-1",
|
|
52
52
|
PERSISTENCE: "core-1",
|
|
53
|
+
NOBLE: "noble-1",
|
|
53
54
|
// EVM
|
|
54
55
|
ETHEREUM: "1",
|
|
56
|
+
ETHEREUM_SEPOLIA: "11155111",
|
|
55
57
|
ARBITRUM: "42161",
|
|
56
58
|
BSC: "56",
|
|
57
59
|
BASE: "8453",
|
|
@@ -72,12 +74,22 @@ export const CHAIN_IDS = {
|
|
|
72
74
|
// others
|
|
73
75
|
BITCOIN: "bitcoin",
|
|
74
76
|
SOLANA: "solana-mainnet-beta",
|
|
77
|
+
SUI: "sui-mainnet",
|
|
78
|
+
SUI_TESTNET: "sui-testnet",
|
|
79
|
+
};
|
|
80
|
+
export const chainTypeToDefaultChainIdMap = {
|
|
81
|
+
[ChainType.EVM]: CHAIN_IDS.ETHEREUM,
|
|
82
|
+
[ChainType.COSMOS]: CHAIN_IDS.OSMOSIS,
|
|
83
|
+
[ChainType.BTC]: CHAIN_IDS.BITCOIN,
|
|
84
|
+
[ChainType.SOLANA]: CHAIN_IDS.SOLANA,
|
|
85
|
+
[ChainType.SUI]: CHAIN_IDS.SUI,
|
|
75
86
|
};
|
|
76
87
|
export const chainTypeToNativeTokenAddressMap = {
|
|
77
88
|
[ChainType.EVM]: nativeEvmTokenAddress,
|
|
78
89
|
[ChainType.COSMOS]: nativeCosmosTokenAddress,
|
|
79
90
|
[ChainType.BTC]: nativeBitcoinTokenAddress,
|
|
80
91
|
[ChainType.SOLANA]: nativeSolanaTokenAddress,
|
|
92
|
+
[ChainType.SUI]: nativeSuiTokenAddress,
|
|
81
93
|
};
|
|
82
94
|
export const widgetHeaderSize = {
|
|
83
95
|
height: 60,
|
|
@@ -100,7 +112,7 @@ export var PriorityConnectors;
|
|
|
100
112
|
// Success
|
|
101
113
|
const cctpSuccessStatuses = ["complete"];
|
|
102
114
|
const chainflipSuccessStatuses = ["COMPLETE"];
|
|
103
|
-
const solanaSameChainSuccessStatuses = ["
|
|
115
|
+
const solanaSameChainSuccessStatuses = ["finalized"];
|
|
104
116
|
const axelarSuccessStatuses = [
|
|
105
117
|
"destination_executed",
|
|
106
118
|
"executed",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,WAAW,IAAI,cAAc,EAAE,MA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1,6 +1,6 @@
|
|
|
1
1
|
export declare const squidMainLink = "https://www.squidrouter.com/";
|
|
2
2
|
export declare const squidDocLink = "https://docs.widget.squidrouter.com/";
|
|
3
|
-
export declare const squidApiBaseUrl = "https://
|
|
3
|
+
export declare const squidApiBaseUrl = "https://api.uatsquidrouter.com";
|
|
4
4
|
export declare const squidDiscordLink = "https://discord.gg/squidrouter";
|
|
5
5
|
export declare const squidSupportLink = "https://support.squidrouter.com";
|
|
6
6
|
export declare const squidHelpLink: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Squid Links
|
|
2
2
|
export const squidMainLink = "https://www.squidrouter.com/";
|
|
3
3
|
export const squidDocLink = "https://docs.widget.squidrouter.com/";
|
|
4
|
-
export const squidApiBaseUrl = "https://
|
|
4
|
+
export const squidApiBaseUrl = "https://api.uatsquidrouter.com";
|
|
5
5
|
export const squidDiscordLink = "https://discord.gg/squidrouter";
|
|
6
6
|
export const squidSupportLink = "https://support.squidrouter.com";
|
|
7
7
|
export const squidHelpLink = `${squidDocLink}troubleshooting#additional-support`;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { CHAIN_IDS, chainTypeToNativeTokenAddressMap, chainTypeToZeroAddressMap, DEFAULT_LOCALE, destinationAddressResetValue, fallbackAddressResetValue, nativeBitcoinTokenAddress, nativeCosmosTokenAddress, nativeEvmTokenAddress, nativeSolanaTokenAddress, } from "./constants";
|
|
1
|
+
export { CHAIN_IDS, chainTypeToNativeTokenAddressMap, chainTypeToZeroAddressMap, DEFAULT_LOCALE, destinationAddressResetValue, fallbackAddressResetValue, nativeBitcoinTokenAddress, nativeCosmosTokenAddress, nativeEvmTokenAddress, nativeSolanaTokenAddress, nativeSuiTokenAddress, } from "./constants";
|
|
2
2
|
export { CosmosProvider, useCosmosContext } from "./providers/CosmosProvider";
|
|
3
3
|
export * from "./types";
|
package/dist/core/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CHAIN_IDS, chainTypeToNativeTokenAddressMap, chainTypeToZeroAddressMap, DEFAULT_LOCALE, destinationAddressResetValue, fallbackAddressResetValue, nativeBitcoinTokenAddress, nativeCosmosTokenAddress, nativeEvmTokenAddress, nativeSolanaTokenAddress, } from "./constants";
|
|
1
|
+
export { CHAIN_IDS, chainTypeToNativeTokenAddressMap, chainTypeToZeroAddressMap, DEFAULT_LOCALE, destinationAddressResetValue, fallbackAddressResetValue, nativeBitcoinTokenAddress, nativeCosmosTokenAddress, nativeEvmTokenAddress, nativeSolanaTokenAddress, nativeSuiTokenAddress, } from "./constants";
|
|
2
2
|
export { CosmosProvider, useCosmosContext } from "./providers/CosmosProvider";
|
|
3
3
|
export * from "./types";
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,gCAAgC,EAChC,yBAAyB,EACzB,cAAc,EACd,4BAA4B,EAC5B,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,gCAAgC,EAChC,yBAAyB,EACzB,cAAc,EACd,4BAA4B,EAC5B,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9E,cAAc,SAAS,CAAC"}
|
|
@@ -4,7 +4,7 @@ import type { Keplr } from "@keplr-wallet/types";
|
|
|
4
4
|
import type { UseMutationResult } from "@tanstack/react-query";
|
|
5
5
|
import type { ReactNode } from "react";
|
|
6
6
|
import React from "react";
|
|
7
|
-
import type { CosmosWallet, Wallet } from "
|
|
7
|
+
import type { CosmosWallet, Wallet } from "../types/wallet";
|
|
8
8
|
export interface ICosmosContextData {
|
|
9
9
|
connectCosmos?: UseMutationResult<string | undefined, unknown, {
|
|
10
10
|
chain: ChainData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CosmosProvider.js","sourceRoot":"","sources":["../../../src/core/providers/CosmosProvider.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CosmosProvider.js","sourceRoot":"","sources":["../../../src/core/providers/CosmosProvider.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAqBzD,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAqB;IACnE,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE;CACzC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAEtB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpB,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC;IAElC,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,IACzC,QAAQ,CACc,CAC1B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,gBAAgB;IAC9B,OAAO,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ChainType } from "@0xsquid/squid-types";
|
|
2
|
+
import { UseMutationResult } from "@tanstack/react-query";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { SuiConnector } from "../types/sui";
|
|
5
|
+
import { ConnectWalletResult, SuiWallet } from "../types/wallet";
|
|
6
|
+
export interface ISuiContextData {
|
|
7
|
+
connectSui: UseMutationResult<ConnectWalletResult<ChainType.SUI>, unknown, {
|
|
8
|
+
wallet: SuiWallet;
|
|
9
|
+
}, unknown>;
|
|
10
|
+
disconnectSui: () => Promise<void>;
|
|
11
|
+
isConnected: boolean;
|
|
12
|
+
signer: SuiConnector | undefined;
|
|
13
|
+
wallets: SuiWallet[];
|
|
14
|
+
}
|
|
15
|
+
export declare const SuiContext: React.Context<ISuiContextData | undefined>;
|
|
16
|
+
export declare const SuiProvider: React.FC<{
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const useSuiContext: () => ISuiContextData;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { createContext, useContext } from "react";
|
|
2
|
+
import { useSui } from "../../hooks/sui/useSui";
|
|
3
|
+
export const SuiContext = createContext(undefined);
|
|
4
|
+
export const SuiProvider = ({ children, }) => {
|
|
5
|
+
const suiContext = useSui();
|
|
6
|
+
return (React.createElement(SuiContext.Provider, { value: suiContext }, children));
|
|
7
|
+
};
|
|
8
|
+
export const useSuiContext = () => {
|
|
9
|
+
const context = useContext(SuiContext);
|
|
10
|
+
if (!context) {
|
|
11
|
+
throw new Error("useSuiContext must be used within a SuiProvider");
|
|
12
|
+
}
|
|
13
|
+
return context;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=SuiProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuiProvider.js","sourceRoot":"","sources":["../../../src/core/providers/SuiProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAmBhD,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAA8B,SAAS,CAAC,CAAC;AAEhF,MAAM,CAAC,MAAM,WAAW,GAA4C,CAAC,EACnE,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC;IAE5B,OAAO,CACL,oBAAC,UAAU,CAAC,QAAQ,IAAC,KAAK,EAAE,UAAU,IAAG,QAAQ,CAAuB,CACzE,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAoB,EAAE;IACjD,MAAM,OAAO,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IACvC,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;KACpE;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChainType, RouteResponse } from "@0xsquid/squid-types";
|
|
2
|
-
import { SlippageOption } from "../../core/types/config";
|
|
3
2
|
import { HistoryTransaction } from "../../core/types/history";
|
|
4
|
-
import {
|
|
3
|
+
import { AppConfig, SlippageOption } from "../types/config";
|
|
4
|
+
import { Timeframe, TokenWithBalance } from "../types/tokens";
|
|
5
5
|
export declare enum QueryKeys {
|
|
6
6
|
All = "all",
|
|
7
7
|
SquidInfo = "squidInfo",
|
|
@@ -41,7 +41,7 @@ export declare const keys: () => {
|
|
|
41
41
|
tokenData: (token?: TokenWithBalance) => (string | undefined)[];
|
|
42
42
|
balance: (chainId?: number | string, tokenAddress?: string, userAddress?: string) => (string | number | undefined)[];
|
|
43
43
|
allTokensBalance: (address: string | undefined, chainType: ChainType | undefined) => (string | undefined)[];
|
|
44
|
-
transaction: (fromChainId: string | undefined, toChainId: string | undefined, toTokenAddress: string | undefined, fromTokenAddress: string | undefined, price: string | undefined, slippage: SlippageOption | undefined, getGasOnDestination: boolean | undefined, sourceUserAddress: string | undefined, degenMode: boolean | undefined, destinationAddress: string | undefined, fallbackAddress: string | undefined, quoteOnly: boolean | undefined, fromChainType: ChainType | undefined) => (string | number | boolean | undefined)[];
|
|
44
|
+
transaction: (fromChainId: string | undefined, toChainId: string | undefined, toTokenAddress: string | undefined, fromTokenAddress: string | undefined, price: string | undefined, slippage: SlippageOption | undefined, getGasOnDestination: boolean | undefined, sourceUserAddress: string | undefined, degenMode: boolean | undefined, destinationAddress: string | undefined, fallbackAddress: string | undefined, quoteOnly: boolean | undefined, fromChainType: ChainType | undefined, preHook: AppConfig["preHook"] | undefined, postHook: AppConfig["postHook"] | undefined) => (string | number | boolean | Omit<import("@0xsquid/squid-types").Hook, "fundAmount" | "fundToken"> | undefined)[];
|
|
45
45
|
swapTransactionStatus: (transactionId: string | undefined) => (string | undefined)[];
|
|
46
46
|
fiatToCryptoStatus: (transactionId?: string) => (string | undefined)[];
|
|
47
47
|
sendTransactionStatus: (txHash: string | undefined, chainId: string | undefined) => (string | undefined)[];
|
|
@@ -77,7 +77,7 @@ export const keys = () => ({
|
|
|
77
77
|
// ============
|
|
78
78
|
// Transactions
|
|
79
79
|
// ============
|
|
80
|
-
transaction: (fromChainId, toChainId, toTokenAddress, fromTokenAddress, price, slippage, getGasOnDestination, sourceUserAddress, degenMode, destinationAddress, fallbackAddress, quoteOnly, fromChainType) => [
|
|
80
|
+
transaction: (fromChainId, toChainId, toTokenAddress, fromTokenAddress, price, slippage, getGasOnDestination, sourceUserAddress, degenMode, destinationAddress, fallbackAddress, quoteOnly, fromChainType, preHook, postHook) => [
|
|
81
81
|
...keys().transactions(),
|
|
82
82
|
QueryKeys.Transaction,
|
|
83
83
|
fromChainId,
|
|
@@ -93,6 +93,8 @@ export const keys = () => ({
|
|
|
93
93
|
fallbackAddress,
|
|
94
94
|
quoteOnly,
|
|
95
95
|
fromChainType,
|
|
96
|
+
preHook,
|
|
97
|
+
postHook,
|
|
96
98
|
],
|
|
97
99
|
swapTransactionStatus: (transactionId) => [
|
|
98
100
|
...keys().transactions(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries-keys.js","sourceRoot":"","sources":["../../../src/core/queries/queries-keys.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"queries-keys.js","sourceR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AAO,CAAC,GAAG,CAAC,CAAC;QAEf,KAAK,SAAS,CAAC,OAAO,CAAC;QACvB,KAAK,SAAS,CAAC,gBAAgB;YAC7B,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,CAAC;QAErC,KAAK,SAAS,CAAC,WAAW,CAAC;QAC3B,KAAK,SAAS,CAAC,qBAAqB,CAAC;QACrC,KAAK,SAAS,CAAC,kBAAkB,CAAC;QAClC,KAAK,SAAS,CAAC,qBAAqB,CAAC;QACrC,KAAK,SAAS,CAAC,YAAY,CAAC;QAC5B,KAAK,SAAS,CAAC,aAAa;YAC1B,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,YAAY,EAAE,EAAE,GAAG,CAAC,CAAC;QAEzC;YACE,OAAO,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;KAC/B;AACH,CAAC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import type { RouteRequest, RouteResponse } from "@0xsquid/squid-types";
|
|
|
2
2
|
import { TransactionErrorWithMessage } from "./error";
|
|
3
3
|
import { ExecuteQuoteClient } from "./onramps";
|
|
4
4
|
type BaseSwapEventParams = Pick<RouteRequest, "fromAddress" | "toAddress" | "fromChain" | "toChain" | "fromToken" | "toToken" | "fromAmount">;
|
|
5
|
+
export type SearchContext = "token" | "chain";
|
|
5
6
|
export interface WidgetEventMap {
|
|
6
7
|
swapStatus: {
|
|
7
8
|
status: string;
|
|
@@ -50,6 +51,10 @@ export interface WidgetEventMap {
|
|
|
50
51
|
region?: string;
|
|
51
52
|
};
|
|
52
53
|
onrampQuoteExecute: ExecuteQuoteClient;
|
|
54
|
+
searchEmpty: {
|
|
55
|
+
searchQuery: string;
|
|
56
|
+
context: SearchContext;
|
|
57
|
+
};
|
|
53
58
|
}
|
|
54
59
|
export type EventListenerFunction<T extends keyof WidgetEventMap> = (event: CustomEvent<WidgetEventMap[T]>) => void;
|
|
55
60
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/core/types/history.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/core/types/history.ts"],"names":[],"mappings":"AAoEA,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,iDAAI,CAAA;IACJ,+CAAG,CAAA;IACH,iDAAI,CAAA;AACN,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.js","sourceRoot":"","sources":["../../../src/core/types/rpc.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SuiSignTransactionMethod, WalletAccount as SuiWalletAccount } from "@mysten/wallet-standard";
|
|
2
|
+
export interface SuiAccount {
|
|
3
|
+
account: SuiWalletAccount;
|
|
4
|
+
}
|
|
5
|
+
export type SuiConnector = {
|
|
6
|
+
connect: () => Promise<SuiAccount>;
|
|
7
|
+
disconnect: () => Promise<void>;
|
|
8
|
+
signTransaction: SuiSignTransactionMethod;
|
|
9
|
+
};
|
|
10
|
+
export interface SuiCoinBalance {
|
|
11
|
+
coinType: string;
|
|
12
|
+
coinObjectCount: number;
|
|
13
|
+
totalBalance: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sui.js","sourceRoot":"","sources":["../../../src/core/types/sui.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ChainData, RouteActionResponse, RouteResponse } from "@0xsquid/squid-types";
|
|
2
|
-
import { UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { UseQueryResult } from "@tanstack/react-query";
|
|
3
3
|
import type { TransactionErrorWithMessage } from "./error";
|
|
4
4
|
import { SwapTransactionHistory } from "./history";
|
|
5
5
|
export declare enum TransactionType {
|
|
@@ -48,6 +48,7 @@ export interface TransactionParams {
|
|
|
48
48
|
nonce?: number;
|
|
49
49
|
transactionIdForStatus?: string;
|
|
50
50
|
transactionId: string | undefined;
|
|
51
|
+
requestId?: string;
|
|
51
52
|
timestamp?: number;
|
|
52
53
|
sourceStatus?: TransactionStatus;
|
|
53
54
|
status: TransactionStatus;
|
|
@@ -67,7 +68,7 @@ export interface StepStatusGetterProps {
|
|
|
67
68
|
export interface PatchedRouteActionResponse extends Omit<RouteActionResponse, "data"> {
|
|
68
69
|
data?: RouteActionResponse["data"];
|
|
69
70
|
}
|
|
70
|
-
export type SwapTransactionForStatus = Pick<SwapTransactionHistory, "fromChain" | "transactionId" | "toChain" | "status" | "fromAddress" | "bridgeType" | "transactionIdForStatus" | "actions">;
|
|
71
|
+
export type SwapTransactionForStatus = Pick<SwapTransactionHistory, "fromChain" | "transactionId" | "toChain" | "status" | "fromAddress" | "bridgeType" | "transactionIdForStatus" | "actions" | "requestId">;
|
|
71
72
|
export type SimplifiedRouteAction = Pick<PatchedRouteActionResponse, "type" | "provider"> & {
|
|
72
73
|
data?: any;
|
|
73
74
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ChainType } from "@0xsquid/squid-types";
|
|
2
2
|
import type { Chain } from "viem";
|
|
3
3
|
import { CreateConnectorFn } from "wagmi";
|
|
4
|
+
import { SuiAccount, SuiConnector } from "./sui";
|
|
4
5
|
export type TypedWindow = Window & typeof globalThis & {
|
|
5
6
|
[key in WindowWalletFlag]?: any;
|
|
6
7
|
};
|
|
@@ -47,6 +48,10 @@ export type SolanaWallet = Wallet & {
|
|
|
47
48
|
export type BitcoinWallet = Wallet & {
|
|
48
49
|
type: ChainType.BTC;
|
|
49
50
|
};
|
|
51
|
+
export type SuiWallet = Wallet & {
|
|
52
|
+
type: ChainType.SUI;
|
|
53
|
+
connector: () => SuiConnector;
|
|
54
|
+
};
|
|
50
55
|
export type SupportedChain = {
|
|
51
56
|
chainType: ChainType;
|
|
52
57
|
chains?: string[];
|
|
@@ -61,8 +66,7 @@ export type Wallet = {
|
|
|
61
66
|
connectorName: string;
|
|
62
67
|
icon: string | undefined;
|
|
63
68
|
windowFlag: WindowWalletFlag;
|
|
64
|
-
canSwitchWallets
|
|
65
|
-
direction?: "from" | "to";
|
|
69
|
+
canSwitchWallets?: boolean;
|
|
66
70
|
isMobile?: boolean;
|
|
67
71
|
isInstalled?: () => boolean;
|
|
68
72
|
skipInstallCheck?: boolean;
|
|
@@ -103,3 +107,16 @@ export type AddressWithEns = {
|
|
|
103
107
|
export type FullAddressData = Partial<AddressWithEns> & {
|
|
104
108
|
formatted?: string;
|
|
105
109
|
};
|
|
110
|
+
export type ConnectWalletResult<T extends ChainType> = ChainTypeToWalletState[T];
|
|
111
|
+
type BaseWalletState<WalletType extends Wallet> = {
|
|
112
|
+
wallet: WalletType;
|
|
113
|
+
address: string;
|
|
114
|
+
};
|
|
115
|
+
export interface ChainTypeToWalletState {
|
|
116
|
+
[ChainType.EVM]: BaseWalletState<EvmWallet>;
|
|
117
|
+
[ChainType.COSMOS]: BaseWalletState<CosmosWallet>;
|
|
118
|
+
[ChainType.SOLANA]: BaseWalletState<SolanaWallet>;
|
|
119
|
+
[ChainType.BTC]: BaseWalletState<BitcoinWallet>;
|
|
120
|
+
[ChainType.SUI]: BaseWalletState<SuiWallet> & SuiAccount;
|
|
121
|
+
}
|
|
122
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../../src/core/types/wallet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../../src/core/types/wallet.ts"],"names":[],"mappings":"AAWA,MAAM,CAAN,IAAY,gBAuBX;AAvBD,WAAY,gBAAgB;IAC1B,yCAAqB,CAAA;IACrB,wDAAoC,CAAA;IACpC,oDAAgC,CAAA;IAChC,mDAA+B,CAAA;IAC/B,yDAAqC,CAAA;IACrC,iDAA6B,CAAA;IAC7B,mCAAe,CAAA;IACf,iCAAa,CAAA;IACb,gCAAY,CAAA;IACZ,sCAAkB,CAAA;IAClB,+CAA2B,CAAA;IAC3B,qCAAiB,CAAA;IACjB,mCAAe,CAAA;IACf,qCAAiB,CAAA;IACjB,yCAAqB,CAAA;IACrB,uDAAmC,CAAA;IACnC,2CAAuB,CAAA;IACvB,qCAAiB,CAAA;IACjB,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;IACnB,qCAAiB,CAAA;IACjB,yCAAqB,CAAA;AACvB,CAAC,EAvBW,gBAAgB,KAAhB,gBAAgB,QAuB3B"}
|
package/dist/core/wallets.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ConnectorID } from "./types";
|
|
2
2
|
import { CosmosWallet, EvmWallet, Wallet } from "./types/wallet";
|
|
3
|
+
export declare const walletIconBaseUrl = "https://raw.githubusercontent.com/0xsquid/assets/main/images/webp128/wallets";
|
|
3
4
|
export declare const evmWallets: EvmWallet[];
|
|
4
5
|
export declare const cosmosWallets: CosmosWallet[];
|
|
5
6
|
export declare const multiChainWallets: Wallet[];
|
|
6
|
-
export declare const
|
|
7
|
+
export declare const singleChainWallets: Wallet[];
|
|
7
8
|
export declare const walletStoreLinks: {
|
|
8
9
|
[key in ConnectorID]: {
|
|
9
10
|
chrome: string;
|