@0xsquid/react-hooks 9.0.0-beta-bump-wagmi-viem.1 → 9.0.0-beta-nodev24.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/canton/cantonConnector.d.ts +32 -0
- package/dist/core/canton/cip103Client.d.ts +20 -0
- package/dist/core/canton/errors.d.ts +4 -0
- package/dist/core/canton/injectedCantonProvider.d.ts +31 -0
- package/dist/core/canton/loopCantonConnector.d.ts +38 -0
- package/dist/core/client/index.d.ts +1 -0
- package/dist/core/connectors/bitcoin/wallets/keplr.d.ts +3 -0
- package/dist/core/connectors/bitcoin/wallets/phantom.d.ts +3 -1
- package/dist/core/connectors/bitcoin/wallets/unisat.d.ts +15 -0
- package/dist/core/constants.d.ts +9 -4
- package/dist/core/externalLinks.d.ts +1 -1
- package/dist/core/fallbackWallets.d.ts +16 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/providers/CantonProvider.d.ts +19 -0
- package/dist/core/queries/queries-keys.d.ts +9 -4
- package/dist/core/queries/queryClient.d.ts +2 -0
- package/dist/core/types/bitcoin.d.ts +3 -0
- package/dist/core/types/canton.d.ts +92 -0
- package/dist/core/types/config.d.ts +9 -3
- package/dist/core/types/cosmos.d.ts +5 -0
- package/dist/core/types/error.d.ts +0 -6
- package/dist/core/types/event.d.ts +4 -0
- package/dist/core/types/history.d.ts +14 -6
- package/dist/core/types/index.d.ts +4 -3
- package/dist/core/types/solana.d.ts +8 -0
- package/dist/core/types/status.d.ts +116 -0
- package/dist/core/types/stellar.d.ts +52 -0
- package/dist/core/types/tokens.d.ts +4 -0
- package/dist/core/types/transaction.d.ts +5 -31
- package/dist/core/types/wallet.d.ts +16 -8
- package/dist/core/wallets.d.ts +5 -0
- package/dist/hooks/canton/useCanton.d.ts +2 -0
- package/dist/hooks/canton/useCantonWallets.d.ts +10 -0
- package/dist/hooks/chains/useSquidChains.d.ts +1 -0
- package/dist/hooks/index.d.ts +5 -2
- package/dist/hooks/stellar/useStellarTrustLine.d.ts +13 -0
- package/dist/hooks/store/historyStoreMigration.d.ts +9 -0
- package/dist/hooks/store/useDepositAddressStore.d.ts +18 -5
- package/dist/hooks/store/useHistoryStore.d.ts +2 -4
- package/dist/hooks/swap/useDepositAddress.d.ts +6 -7
- package/dist/hooks/swap/useUrlSwapParams.d.ts +10 -0
- package/dist/hooks/tokens/useBalance.d.ts +1 -0
- package/dist/hooks/tokens/useNativeBalance.d.ts +1 -0
- package/dist/hooks/tokens/useSourceChainGasToken.d.ts +13 -0
- package/dist/hooks/tokens/useSquidTokens.d.ts +1 -0
- package/dist/hooks/transaction/liveSwapStatus.d.ts +12 -0
- package/dist/hooks/transaction/send/useEstimateSendTransactionGas.d.ts +11 -2
- package/dist/hooks/transaction/swapStatusEffects.d.ts +9 -0
- package/dist/hooks/transaction/useAllTransactionsStatus.d.ts +1 -28
- package/dist/hooks/transaction/useArcFeeCheck.d.ts +5 -0
- package/dist/hooks/transaction/useDepositTransactionStatus.d.ts +18 -0
- package/dist/hooks/transaction/useEstimate.d.ts +7 -12
- package/dist/hooks/transaction/useSwapStatusQuery.d.ts +42 -0
- package/dist/hooks/transaction/useSwapTransactionStatus.d.ts +11 -7
- package/dist/hooks/transaction/useTempoFeeCheck.d.ts +11 -0
- package/dist/hooks/user/useHistory.d.ts +2 -2
- package/dist/hooks/wallet/useMultiChainWallet.d.ts +55 -29
- package/dist/hooks/wallet/useSigner.d.ts +1 -0
- package/dist/hooks/wallet/useWallet.d.ts +59 -29
- package/dist/hooks/xrpl/useXrplWallets.d.ts +2 -2
- package/dist/{index-C6kS-jmR.js → index-BlAWmCDu.js} +6331 -2423
- package/dist/index-BlAWmCDu.js.map +1 -0
- package/dist/{index-qdyx4kRv.js → index-lvZT1hVo.js} +6336 -2420
- package/dist/index-lvZT1hVo.js.map +1 -0
- package/dist/{index.es-BFUlxkuY.js → index.es-C2hTEGoR.js} +5 -4
- package/dist/index.es-C2hTEGoR.js.map +1 -0
- package/dist/{index.es-DYkdUayP.js → index.es-hfCMk9rm.js} +5 -4
- package/dist/index.es-hfCMk9rm.js.map +1 -0
- package/dist/index.esm.js +4 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +34 -33
- package/dist/index.js.map +1 -1
- package/dist/provider/index.d.ts +0 -1
- package/dist/{secretService-B0dq0pBR.js → secretService-C3-RQz_Q.js} +5 -4
- package/dist/{secretService-B0dq0pBR.js.map → secretService-C3-RQz_Q.js.map} +1 -1
- package/dist/{secretService-CVRY2vnf.js → secretService-CqZdXZDv.js} +5 -4
- package/dist/{secretService-CVRY2vnf.js.map → secretService-CqZdXZDv.js.map} +1 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.esm.js +120 -0
- package/dist/server.esm.js.map +1 -0
- package/dist/server.js +132 -0
- package/dist/server.js.map +1 -0
- package/dist/services/external/onrampAdapter.d.ts +3 -4
- package/dist/services/external/rpcService.d.ts +16 -1
- package/dist/services/external/stellarApiClient.d.ts +4 -0
- package/dist/services/external/stellarRpcClient.d.ts +2 -2
- package/dist/services/external/xrplRpcClient.d.ts +2 -1
- package/dist/services/index.d.ts +5 -0
- package/dist/services/internal/apiService.d.ts +0 -2
- package/dist/services/internal/arcService.d.ts +9 -0
- package/dist/services/internal/assetsService.d.ts +12 -3
- package/dist/services/internal/cantonDamlValue.d.ts +71 -0
- package/dist/services/internal/cantonService.d.ts +82 -0
- package/dist/services/internal/cantonTransferService.d.ts +93 -0
- package/dist/services/internal/configService.d.ts +2 -1
- package/dist/services/internal/errorService.d.ts +6 -4
- package/dist/services/internal/estimateService.d.ts +30 -33
- package/dist/services/internal/eventService.d.ts +4 -0
- package/dist/services/internal/evmService.d.ts +4 -2
- package/dist/services/internal/solanaTokenProgramService.d.ts +9 -0
- package/dist/services/internal/status/statusApi.d.ts +41 -0
- package/dist/services/internal/status/statusExplorerLinks.d.ts +52 -0
- package/dist/services/internal/status/statusFollow.d.ts +29 -0
- package/dist/services/internal/status/statusGuards.d.ts +19 -0
- package/dist/services/internal/status/statusHistory.d.ts +35 -0
- package/dist/services/internal/status/statusKeys.d.ts +8 -0
- package/dist/services/internal/status/statusMapping.d.ts +73 -0
- package/dist/services/internal/status/statusPolicy.d.ts +45 -0
- package/dist/services/internal/status/statusSteps.d.ts +40 -0
- package/dist/services/internal/status/statusWsClient.d.ts +157 -0
- package/dist/services/internal/stellarService.d.ts +9 -0
- package/dist/services/internal/tempoService.d.ts +42 -0
- package/dist/services/internal/transactionService.d.ts +11 -24
- package/dist/services/internal/transactionStatusService.d.ts +1 -54
- package/dist/services/internal/typeGuards.d.ts +10 -0
- package/dist/services/internal/urlParamsService.d.ts +19 -0
- package/dist/services/internal/walletService.d.ts +3 -6
- package/dist/services/internal/xrplService.d.ts +2 -0
- package/dist/{stellarService.client-BL7JVIrT.js → stellarService.client-C-9OeI3W.js} +7 -6
- package/dist/{stellarService.client-BL7JVIrT.js.map → stellarService.client-C-9OeI3W.js.map} +1 -1
- package/dist/{stellarService.client-DdI-363G.js → stellarService.client-Dwpk6ir6.js} +7 -6
- package/dist/{stellarService.client-DdI-363G.js.map → stellarService.client-Dwpk6ir6.js.map} +1 -1
- package/package.json +36 -35
- package/dist/hooks/user/useUserParams.d.ts +0 -4
- package/dist/index-C6kS-jmR.js.map +0 -1
- package/dist/index-qdyx4kRv.js.map +0 -1
- package/dist/index.es-BFUlxkuY.js.map +0 -1
- package/dist/index.es-DYkdUayP.js.map +0 -1
- package/dist/services/internal/fiatToCryptoService.test.d.ts +0 -1
- package/dist/tests/apiService.test.d.ts +0 -1
- package/dist/tests/assetsService.test.d.ts +0 -1
- package/dist/tests/configService.test.d.ts +0 -1
- package/dist/tests/estimateService.test.d.ts +0 -1
- package/dist/tests/fetchSquidData.d.ts +0 -8
- package/dist/tests/numberService.test.d.ts +0 -1
- package/dist/tests/priceService.test.d.ts +0 -1
- package/dist/tests/searchService.test.d.ts +0 -1
- package/dist/tests/swapConfig.test.d.ts +0 -1
- package/dist/tests/transactionService.test.d.ts +0 -1
- package/dist/tests/transactionStatusService.test.d.ts +0 -1
- package/dist/tests/walletService.test.d.ts +0 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type CantonClient } from "@sigilry/dapp";
|
|
2
|
+
import type { CantonAccount, CantonConnectResult, CantonCip103Connector, CantonConnectorEvent, CantonConnectorEventHandler, CantonLedgerApiParams, CantonPrepareExecuteAndWaitResult, CantonPrepareExecuteParams, CantonTransferParams, CantonTransferResult } from "../types/canton";
|
|
3
|
+
import { AnnouncedCantonProvider } from "./cip103Client";
|
|
4
|
+
/**
|
|
5
|
+
* Browser-extension Canton connector: wraps one discovered CIP-103 provider
|
|
6
|
+
* (bound to its announce `target`) and exposes the lifecycle methods.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CantonBrowserConnector implements CantonCip103Connector {
|
|
9
|
+
readonly kind = "cip103";
|
|
10
|
+
readonly providerId: string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly target: string | undefined;
|
|
13
|
+
private readonly client;
|
|
14
|
+
private readonly listeners;
|
|
15
|
+
private _accounts;
|
|
16
|
+
constructor(provider: AnnouncedCantonProvider, win?: Window, client?: CantonClient);
|
|
17
|
+
get accounts(): CantonAccount[];
|
|
18
|
+
get address(): string | undefined;
|
|
19
|
+
connect(): Promise<CantonConnectResult>;
|
|
20
|
+
/** Silent connect: read accounts without prompting; throws if not connected. */
|
|
21
|
+
autoConnect(): Promise<CantonConnectResult>;
|
|
22
|
+
disconnect(): Promise<void>;
|
|
23
|
+
ledgerApi<T = unknown>(params: CantonLedgerApiParams): Promise<T>;
|
|
24
|
+
prepareExecuteAndWait(params: CantonPrepareExecuteParams): Promise<CantonPrepareExecuteAndWaitResult>;
|
|
25
|
+
getAccounts(): Promise<CantonAccount[]>;
|
|
26
|
+
getBalances(partyId: string): Promise<Record<string, string>>;
|
|
27
|
+
transfer(params: CantonTransferParams): Promise<CantonTransferResult>;
|
|
28
|
+
on<E extends CantonConnectorEvent>(event: E, handler: CantonConnectorEventHandler<E>): void;
|
|
29
|
+
off<E extends CantonConnectorEvent>(event: E, handler: CantonConnectorEventHandler<E>): void;
|
|
30
|
+
private emit;
|
|
31
|
+
private refreshAccounts;
|
|
32
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const CANTON_REQUEST_PROVIDER_EVENT = "canton:requestProvider";
|
|
2
|
+
export declare const CANTON_ANNOUNCE_PROVIDER_EVENT = "canton:announceProvider";
|
|
3
|
+
export interface AnnouncedCantonProvider {
|
|
4
|
+
/** Stable identifier for the wallet/extension. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Display name for pickers. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Optional icon (data URL or https URL). */
|
|
9
|
+
icon?: string;
|
|
10
|
+
/** Routing key for the postMessage transport (defaults to `id`). */
|
|
11
|
+
target?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* CIP-103 browser-wallet discovery (EIP-6963-style).
|
|
15
|
+
* The wallet dispatches `canton:announceProvider` and dApps
|
|
16
|
+
* dispatch `canton:requestProvider` to ask installed wallets to re-announce.
|
|
17
|
+
* Each announcement carries a `target` we route through Sigilry's `WindowTransport`,
|
|
18
|
+
* so multiple extensions coexist without contending on the `window.canton` global.
|
|
19
|
+
*/
|
|
20
|
+
export declare function discoverCantonProviders(timeoutMs?: number, win?: Window): Promise<AnnouncedCantonProvider[]>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CantonClient, SpliceProvider } from "@sigilry/dapp";
|
|
2
|
+
import type { ConnectorID } from "../types/wallet";
|
|
3
|
+
export interface InjectedCantonWalletConfig {
|
|
4
|
+
connectorId: ConnectorID;
|
|
5
|
+
name: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
/** Dot-path to the injected CIP-103 provider on `window` (e.g. `nightly.canton`). */
|
|
8
|
+
windowPath: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* CIP-103 wallets that expose their provider as an injected `window` global
|
|
12
|
+
* instead of participating in the `canton:announceProvider` discovery protocol.
|
|
13
|
+
* Add an entry to support a new one.
|
|
14
|
+
*/
|
|
15
|
+
export declare const INJECTED_CANTON_WALLETS: InjectedCantonWalletConfig[];
|
|
16
|
+
export interface DiscoveredInjectedCantonWallet {
|
|
17
|
+
config: InjectedCantonWalletConfig;
|
|
18
|
+
provider: SpliceProvider;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Adapts an injected CIP-103 `SpliceProvider` (the normative `request` API) to
|
|
22
|
+
* the {@link CantonClient} surface consumed by `CantonBrowserConnector`, so
|
|
23
|
+
* injected wallets reuse the same connector as announce-discovered ones.
|
|
24
|
+
*/
|
|
25
|
+
export declare function cantonClientFromSpliceProvider(provider: SpliceProvider): CantonClient;
|
|
26
|
+
/**
|
|
27
|
+
* Detect installed injected Canton wallets by walking each registered
|
|
28
|
+
* `windowPath`, mirroring the `definedInWindow` install check used for other
|
|
29
|
+
* non-autodiscovered wallets.
|
|
30
|
+
*/
|
|
31
|
+
export declare function discoverInjectedCantonWallets(win?: Window): DiscoveredInjectedCantonWallet[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CantonAccount, CantonConnectResult, CantonConnectorEvent, CantonConnectorEventHandler, CantonLoopConnector, CantonTransferParams, CantonTransferResult, CantonTransferUpdate } from "../types/canton";
|
|
2
|
+
type LoopModule = typeof import("@fivenorth/loop-sdk");
|
|
3
|
+
export declare function parseLoopTransferUpdate(value: unknown, commandId: string): CantonTransferUpdate | undefined;
|
|
4
|
+
export declare class LoopCantonConnector implements CantonLoopConnector {
|
|
5
|
+
private loadSdk;
|
|
6
|
+
readonly kind = "loop";
|
|
7
|
+
readonly providerId = "canton-loop";
|
|
8
|
+
readonly name = "Loop";
|
|
9
|
+
readonly target: undefined;
|
|
10
|
+
private module?;
|
|
11
|
+
private initialization?;
|
|
12
|
+
private provider?;
|
|
13
|
+
private pendingConnection?;
|
|
14
|
+
private connectionStart;
|
|
15
|
+
private transfers;
|
|
16
|
+
private listeners;
|
|
17
|
+
constructor(loadSdk?: () => Promise<LoopModule>);
|
|
18
|
+
get accounts(): CantonAccount[];
|
|
19
|
+
get address(): string | undefined;
|
|
20
|
+
connect(): Promise<CantonConnectResult>;
|
|
21
|
+
autoConnect(): Promise<CantonConnectResult>;
|
|
22
|
+
cancelConnect(): void;
|
|
23
|
+
disconnect(): Promise<void>;
|
|
24
|
+
getAccounts(): Promise<CantonAccount[]>;
|
|
25
|
+
getBalances(partyId: string): Promise<Record<string, string>>;
|
|
26
|
+
transfer(params: CantonTransferParams): Promise<CantonTransferResult>;
|
|
27
|
+
on<E extends CantonConnectorEvent>(event: E, handler: CantonConnectorEventHandler<E>): void;
|
|
28
|
+
off<E extends CantonConnectorEvent>(event: E, handler: CantonConnectorEventHandler<E>): void;
|
|
29
|
+
private emit;
|
|
30
|
+
private initialize;
|
|
31
|
+
private startConnection;
|
|
32
|
+
private acceptConnection;
|
|
33
|
+
private rejectConnection;
|
|
34
|
+
private requireProvider;
|
|
35
|
+
private submitTransfer;
|
|
36
|
+
}
|
|
37
|
+
export declare const loopCantonConnector: LoopCantonConnector;
|
|
38
|
+
export {};
|
|
@@ -13,6 +13,7 @@ type ChainTypeToClient = {
|
|
|
13
13
|
[ChainType.SUI]: SuiClient;
|
|
14
14
|
[ChainType.XRPL]: XrplRpcClient;
|
|
15
15
|
[ChainType.STELLAR]: StellarRpcClient;
|
|
16
|
+
[ChainType.CANTON]: null;
|
|
16
17
|
};
|
|
17
18
|
export declare function getClient<T extends ChainType>(chain: ChainData): Promise<ChainTypeToClient[T]>;
|
|
18
19
|
export {};
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { BitcoinConnector } from "../../../../core/types/bitcoin";
|
|
2
|
+
interface UnisatSignPsbtOptions {
|
|
3
|
+
autoFinalized?: boolean;
|
|
4
|
+
toSignInputs?: Array<{
|
|
5
|
+
index: number;
|
|
6
|
+
address?: string;
|
|
7
|
+
publicKey?: string;
|
|
8
|
+
sighashTypes?: number[];
|
|
9
|
+
disableTweakSigner?: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
2
12
|
interface UnisatProvider {
|
|
3
13
|
sendBitcoin: (to: string, amount: number) => Promise<string>;
|
|
4
14
|
requestAccounts: () => Promise<string[]>;
|
|
15
|
+
signPsbt: (psbtHex: string, options?: UnisatSignPsbtOptions) => Promise<string>;
|
|
16
|
+
pushPsbt: (psbtHex: string) => Promise<string>;
|
|
5
17
|
}
|
|
6
18
|
export declare class UnisatConnector implements BitcoinConnector {
|
|
7
19
|
get getProvider(): UnisatProvider;
|
|
@@ -11,5 +23,8 @@ export declare class UnisatConnector implements BitcoinConnector {
|
|
|
11
23
|
requestAccount(): Promise<{
|
|
12
24
|
address: string;
|
|
13
25
|
}>;
|
|
26
|
+
signPsbt(psbtHex: string): Promise<{
|
|
27
|
+
txHash: string;
|
|
28
|
+
}>;
|
|
14
29
|
}
|
|
15
30
|
export {};
|
package/dist/core/constants.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare const nativeBitcoinTokenAddress = "satoshi";
|
|
|
21
21
|
export declare const nativeSuiTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
22
22
|
export declare const nativeXrplTokenAddress = "xrp";
|
|
23
23
|
export declare const nativeStellarTokenAddress = "CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA";
|
|
24
|
+
export declare const nativeCantonTokenAddress = "DSO::1220b1431ef217342db44d516bb9befde802be7d8899637d290895fa58880f19accc";
|
|
24
25
|
export declare const defaultSlippage: SlippageOption;
|
|
25
26
|
export declare const destinationAddressResetValue = "null";
|
|
26
27
|
export declare const fallbackAddressResetValue = "null";
|
|
@@ -28,6 +29,7 @@ export declare const gasRefundMultiplier = 25;
|
|
|
28
29
|
export declare const internalSquidApiBaseUrl = "https://app.squidrouter.com/api";
|
|
29
30
|
export declare const XAMAN_API_URL: string;
|
|
30
31
|
export declare const TOKEN_PRICE_API_URL: string;
|
|
32
|
+
export declare const CANTON_AMULET_REGISTRY_URL: string;
|
|
31
33
|
export declare const DEFAULT_ROUTE_REFETCH_INTERVAL = 30000;
|
|
32
34
|
export declare const SOLANA_RPC_URL = "https://meredith-ute2ko-fast-mainnet.helius-rpc.com";
|
|
33
35
|
export declare const INTEGRATOR_ID = "squid-widget-playground-local-cd33cba6-7e12-4fcc-8d5d-35e286f655ea";
|
|
@@ -69,6 +71,11 @@ export declare const CHAIN_IDS: {
|
|
|
69
71
|
readonly SONEIUM: "1868";
|
|
70
72
|
readonly PEAQ: "3338";
|
|
71
73
|
readonly HEDERA: "295";
|
|
74
|
+
readonly MANTRA: "5888";
|
|
75
|
+
readonly CITREA: "4114";
|
|
76
|
+
readonly TEMPO: "4217";
|
|
77
|
+
readonly ARC: "5042";
|
|
78
|
+
readonly KUB: "96";
|
|
72
79
|
readonly BITCOIN: "bitcoin";
|
|
73
80
|
readonly SOLANA: "solana-mainnet-beta";
|
|
74
81
|
readonly SUI: "sui-mainnet";
|
|
@@ -77,7 +84,9 @@ export declare const CHAIN_IDS: {
|
|
|
77
84
|
readonly XRPL_TESTNET: "xrpl-testnet";
|
|
78
85
|
readonly STELLAR: "stellar-mainnet";
|
|
79
86
|
readonly STELLAR_TESTNET: "stellar-testnet";
|
|
87
|
+
readonly CANTON: "canton";
|
|
80
88
|
};
|
|
89
|
+
export declare const zeroAllowanceResetTokens: Set<string>;
|
|
81
90
|
export declare const chainTypeToDefaultChainIdMap: Record<ChainType, string>;
|
|
82
91
|
export declare const chainTypeToNativeTokenAddressMap: Record<ChainType, string>;
|
|
83
92
|
export declare const defaultConfigValues: AppConfig;
|
|
@@ -85,7 +94,3 @@ export declare enum EvmPriorityConnectors {
|
|
|
85
94
|
Safe = "safe",
|
|
86
95
|
LedgerLive = "ledgerLive"
|
|
87
96
|
}
|
|
88
|
-
export declare const transactionRefundedStatuses: string[];
|
|
89
|
-
export declare const transactionErrorStatuses: string[];
|
|
90
|
-
export declare const transactionSuccessStatuses: string[];
|
|
91
|
-
export declare const transactionEndStatuses: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const squidApiBaseUrl = "https://api.
|
|
1
|
+
export declare const squidApiBaseUrl = "https://v2.api.squidrouter.com";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ChainType } from "@0xsquid/squid-types";
|
|
2
|
+
import type { WalletLinks } from "./types/wallet";
|
|
3
|
+
export type FallbackWalletConfig = {
|
|
4
|
+
chainType: ChainType;
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
connectorName: string;
|
|
8
|
+
icon: string;
|
|
9
|
+
links: WalletLinks;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Wallets to show regardless of whether they're detected.
|
|
13
|
+
* Useful when we want to link to the browser extension store
|
|
14
|
+
* for wallets that are automatically discovered (i.e. EVM, SOLANA, CANTON...)
|
|
15
|
+
*/
|
|
16
|
+
export declare const fallbackWallets: FallbackWalletConfig[];
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CHAIN_IDS,
|
|
1
|
+
export { CHAIN_IDS, DEFAULT_LOCALE, DEFAULT_ROUTE_REFETCH_INTERVAL, chainTypeToNativeTokenAddressMap, chainTypeToZeroAddressMap, destinationAddressResetValue, fallbackAddressResetValue, nativeBitcoinTokenAddress, nativeCantonTokenAddress, nativeCosmosTokenAddress, nativeEvmTokenAddress, nativeSolanaTokenAddress, nativeStellarTokenAddress, nativeSuiTokenAddress, nativeXrplTokenAddress, } from "./constants";
|
|
2
2
|
export { CosmosProvider, useCosmosContext } from "./providers/CosmosProvider";
|
|
3
3
|
export { QueryKeys } from "./queries/queries-keys";
|
|
4
4
|
export * from "./types";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ChainType } from "@0xsquid/squid-types";
|
|
2
|
+
import { UseMutationResult } from "@tanstack/react-query";
|
|
3
|
+
import React, { ReactNode } from "react";
|
|
4
|
+
import { CantonConnector } from "../types/canton";
|
|
5
|
+
import { CantonWallet, ConnectWalletResult } from "../types/wallet";
|
|
6
|
+
export interface ICantonContextData {
|
|
7
|
+
connectCanton: UseMutationResult<ConnectWalletResult<ChainType.CANTON>, unknown, {
|
|
8
|
+
wallet: CantonWallet;
|
|
9
|
+
}, unknown>;
|
|
10
|
+
disconnectCanton: () => Promise<void>;
|
|
11
|
+
autoConnectCanton: () => Promise<void>;
|
|
12
|
+
signer: CantonConnector | undefined;
|
|
13
|
+
wallets: CantonWallet[];
|
|
14
|
+
}
|
|
15
|
+
export declare const CantonContext: React.Context<ICantonContextData | undefined>;
|
|
16
|
+
export declare const CantonProvider: React.FC<{
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const useCantonContext: () => ICantonContextData;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ChainType, RouteResponse } from "@0xsquid/squid-types";
|
|
2
2
|
import { HistoryTransaction } from "../../core/types/history";
|
|
3
3
|
import { AppConfig, SlippageOption } from "../types/config";
|
|
4
|
+
import type { StatusKeys } from "../types/status";
|
|
4
5
|
import { SwapDirection } from "../types/swap";
|
|
5
6
|
import { Timeframe, TokenWithBalance } from "../types/tokens";
|
|
6
7
|
export declare enum QueryKeys {
|
|
@@ -13,7 +14,7 @@ export declare enum QueryKeys {
|
|
|
13
14
|
AllTokensBalance = "allTokensBalance",
|
|
14
15
|
Transactions = "transactions",
|
|
15
16
|
Transaction = "transaction",
|
|
16
|
-
|
|
17
|
+
SwapStatus = "swapStatus",
|
|
17
18
|
SendTransactionStatus = "sendTransactionStatus",
|
|
18
19
|
RouteApproved = "routeApproved",
|
|
19
20
|
SendTransactionGas = "sendTransactionGas",
|
|
@@ -34,6 +35,8 @@ export declare enum QueryKeys {
|
|
|
34
35
|
XrplAccountActivatedInfo = "xrplAccountActivatedInfo",
|
|
35
36
|
FiatToCryptoPaymentMethods = "fiatToCryptoPaymentMethods",
|
|
36
37
|
Stellar = "stellar",
|
|
38
|
+
StellarTrustLine = "stellarTrustLine",
|
|
39
|
+
IsStellarTrustLineApproved = "isStellarTrustLineApproved",
|
|
37
40
|
StellarAccountActivatedInfo = "stellarAccountActivatedInfo",
|
|
38
41
|
Hedera = "hedera",
|
|
39
42
|
IsHederaTokenAssociated = "isHederaTokenAssociated"
|
|
@@ -54,12 +57,12 @@ export declare const keys: () => {
|
|
|
54
57
|
tokenData: (token?: TokenWithBalance) => (string | undefined)[];
|
|
55
58
|
balance: (chainId?: number | string, tokenAddress?: string, userAddress?: string) => (string | number | undefined)[];
|
|
56
59
|
allTokensBalance: (address: string | undefined, chainType: ChainType | undefined, direction?: SwapDirection) => (string | undefined)[];
|
|
57
|
-
transaction: (fromChainId: string | undefined, toChainId: string | undefined, toTokenAddress: string | undefined, fromTokenAddress: string | undefined, price: string | undefined, slippage: SlippageOption | undefined,
|
|
58
|
-
|
|
60
|
+
transaction: (fromChainId: string | undefined, toChainId: string | undefined, toTokenAddress: string | undefined, fromTokenAddress: string | undefined, price: string | undefined, slippage: SlippageOption | 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, overrideGasRefundAddress: AppConfig["overrideGasRefundAddress"] | undefined) => (string | number | boolean | Omit<import("@0xsquid/squid-types").Hook, "fundAmount" | "fundToken"> | undefined)[];
|
|
61
|
+
swapStatus: (statusKeys: StatusKeys | undefined) => (string | null)[];
|
|
59
62
|
fiatToCryptoStatus: (transactionId?: string) => (string | undefined)[];
|
|
60
63
|
sendTransactionStatus: (txHash: string | undefined, chainId: string | undefined) => (string | undefined)[];
|
|
61
64
|
allTransactionsStatus: (transactions: HistoryTransaction[] | undefined) => string[];
|
|
62
|
-
routeApproved: (routeData: RouteResponse["route"] | undefined, allowanceInWei: bigint | undefined) => (string | undefined)[];
|
|
65
|
+
routeApproved: (routeData: RouteResponse["route"] | undefined, allowanceInWei: bigint | undefined, isAllowanceQueryEnabled: boolean | undefined, hasAllowance: boolean | undefined) => (string | boolean | undefined)[];
|
|
63
66
|
sendTransactionGas: (chainId: string | undefined, tokenAddress: string | undefined, from: string | undefined) => (string | undefined)[];
|
|
64
67
|
ensData: (address?: string) => (string | undefined)[];
|
|
65
68
|
ensSearch: (query?: string) => (string | undefined)[];
|
|
@@ -71,6 +74,8 @@ export declare const keys: () => {
|
|
|
71
74
|
xrplTrustLine: (tokenAddress: string | undefined, chainId: string | undefined, address: string | undefined) => (string | undefined)[];
|
|
72
75
|
isXrplTrustLineApproved: (address: string | undefined, chainId: string | undefined, chainType: ChainType | undefined, tokenAddress: string | undefined, trustLineLimit: string | undefined, amountToApprove: bigint | undefined) => (string | undefined)[];
|
|
73
76
|
xrplAccountActivatedInfo: (destinationAddress: string | undefined, toChainId: string | undefined, toChainType: ChainType | undefined) => (string | undefined)[];
|
|
77
|
+
stellarTrustLine: (tokenAddress: string | undefined, chainId: string | undefined, address: string | undefined) => (string | undefined)[];
|
|
78
|
+
isStellarTrustLineApproved: (address: string | undefined, chainId: string | undefined, chainType: ChainType | undefined, tokenAddress: string | undefined, trustLineLimit: string | undefined, amountToApprove: bigint | undefined) => (string | undefined)[];
|
|
74
79
|
stellarAccountActivatedInfo: (address: string | undefined, chainId: string | undefined, chainType: ChainType | undefined) => (string | undefined)[];
|
|
75
80
|
isHederaTokenAssociated: (address: string | undefined, chainId: string | undefined, chainType: ChainType | undefined, tokenAddress: string | undefined) => (string | undefined)[];
|
|
76
81
|
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { CantonClient } from "@sigilry/dapp";
|
|
2
|
+
import type { Token } from "./tokens";
|
|
3
|
+
export interface CantonLedgerApiParams {
|
|
4
|
+
requestMethod: "get" | "post" | "patch" | "put" | "delete";
|
|
5
|
+
resource: string;
|
|
6
|
+
body?: Record<string, unknown>;
|
|
7
|
+
query?: Record<string, unknown>;
|
|
8
|
+
path?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export interface CantonAccount {
|
|
11
|
+
partyId: string;
|
|
12
|
+
primary?: boolean;
|
|
13
|
+
hint?: string;
|
|
14
|
+
namespace?: string;
|
|
15
|
+
networkId?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CantonInstrument {
|
|
18
|
+
admin: string;
|
|
19
|
+
id: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CantonHolding {
|
|
22
|
+
contractId: string;
|
|
23
|
+
instrument: CantonInstrument;
|
|
24
|
+
amount: string;
|
|
25
|
+
locked: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface CantonDisclosedContract {
|
|
28
|
+
templateId?: string;
|
|
29
|
+
contractId?: string;
|
|
30
|
+
createdEventBlob: string;
|
|
31
|
+
synchronizerId?: string;
|
|
32
|
+
}
|
|
33
|
+
export type CantonPrepareExecuteParams = Parameters<CantonClient["prepareExecuteAndWait"]>[0];
|
|
34
|
+
export type CantonPrepareExecuteAndWaitResult = Awaited<ReturnType<CantonClient["prepareExecuteAndWait"]>>;
|
|
35
|
+
export interface CantonConnectorEventMap {
|
|
36
|
+
connect: [address: string];
|
|
37
|
+
disconnect: [];
|
|
38
|
+
}
|
|
39
|
+
export interface CantonTransferParams {
|
|
40
|
+
sender: string;
|
|
41
|
+
receiver: string;
|
|
42
|
+
amount: string;
|
|
43
|
+
token: Token;
|
|
44
|
+
memo: string;
|
|
45
|
+
nowMs: number;
|
|
46
|
+
}
|
|
47
|
+
export type CantonTransferResult = {
|
|
48
|
+
status: "completed";
|
|
49
|
+
commandId: string;
|
|
50
|
+
updateId: string;
|
|
51
|
+
};
|
|
52
|
+
export type CantonTransferUpdate = Extract<CantonTransferResult, {
|
|
53
|
+
status: "completed";
|
|
54
|
+
}> | {
|
|
55
|
+
status: "failed";
|
|
56
|
+
commandId: string;
|
|
57
|
+
message: string;
|
|
58
|
+
};
|
|
59
|
+
export interface CantonLedgerReader {
|
|
60
|
+
ledgerApi<T = unknown>(params: CantonLedgerApiParams): Promise<T>;
|
|
61
|
+
}
|
|
62
|
+
export type CantonConnectorEvent = keyof CantonConnectorEventMap;
|
|
63
|
+
export type CantonConnectorEventHandler<E extends CantonConnectorEvent> = (...args: CantonConnectorEventMap[E]) => void;
|
|
64
|
+
export interface CantonConnectResult {
|
|
65
|
+
address: string;
|
|
66
|
+
accounts: CantonAccount[];
|
|
67
|
+
}
|
|
68
|
+
interface CantonConnectorBase {
|
|
69
|
+
readonly providerId: string;
|
|
70
|
+
readonly name: string;
|
|
71
|
+
readonly target: string | undefined;
|
|
72
|
+
connect(): Promise<CantonConnectResult>;
|
|
73
|
+
autoConnect(): Promise<CantonConnectResult>;
|
|
74
|
+
disconnect(): Promise<void>;
|
|
75
|
+
cancelConnect?(): void;
|
|
76
|
+
getBalances(partyId: string): Promise<Record<string, string>>;
|
|
77
|
+
transfer(params: CantonTransferParams): Promise<CantonTransferResult>;
|
|
78
|
+
getAccounts(): Promise<CantonAccount[]>;
|
|
79
|
+
on<E extends CantonConnectorEvent>(event: E, handler: CantonConnectorEventHandler<E>): void;
|
|
80
|
+
off<E extends CantonConnectorEvent>(event: E, handler: CantonConnectorEventHandler<E>): void;
|
|
81
|
+
readonly accounts: CantonAccount[];
|
|
82
|
+
readonly address: string | undefined;
|
|
83
|
+
}
|
|
84
|
+
export interface CantonCip103Connector extends CantonConnectorBase, CantonLedgerReader {
|
|
85
|
+
readonly kind: "cip103";
|
|
86
|
+
prepareExecuteAndWait(params: CantonPrepareExecuteParams): Promise<CantonPrepareExecuteAndWaitResult>;
|
|
87
|
+
}
|
|
88
|
+
export interface CantonLoopConnector extends CantonConnectorBase {
|
|
89
|
+
readonly kind: "loop";
|
|
90
|
+
}
|
|
91
|
+
export type CantonConnector = CantonCip103Connector | CantonLoopConnector;
|
|
92
|
+
export {};
|
|
@@ -4,10 +4,16 @@ export type TokenConfig = {
|
|
|
4
4
|
address: string;
|
|
5
5
|
chainId: string;
|
|
6
6
|
};
|
|
7
|
+
export type NamedTokenConfig = {
|
|
8
|
+
networkName: string;
|
|
9
|
+
/**
|
|
10
|
+
* When omitted, a default token will be selected automatically
|
|
11
|
+
*/
|
|
12
|
+
symbol?: string;
|
|
13
|
+
};
|
|
7
14
|
export interface AppConfig {
|
|
8
15
|
integratorId: string;
|
|
9
16
|
slippage?: SlippageOption;
|
|
10
|
-
enableGetGasOnDestination?: boolean;
|
|
11
17
|
/**
|
|
12
18
|
* If set to true, will load initial tokens and chains from local storage
|
|
13
19
|
*/
|
|
@@ -23,8 +29,8 @@ export interface AppConfig {
|
|
|
23
29
|
* If {@link loadPreviousStateFromLocalStorage} is set to true, this will be ignored
|
|
24
30
|
*/
|
|
25
31
|
initialAssets?: {
|
|
26
|
-
from?: TokenConfig;
|
|
27
|
-
to?: TokenConfig;
|
|
32
|
+
from?: TokenConfig | NamedTokenConfig;
|
|
33
|
+
to?: TokenConfig | NamedTokenConfig;
|
|
28
34
|
};
|
|
29
35
|
/**
|
|
30
36
|
* When chains are changed, this allows to choose the first token that will be selected
|
|
@@ -13,13 +13,7 @@ export interface SquidRouteError {
|
|
|
13
13
|
statusCode: number;
|
|
14
14
|
type: string;
|
|
15
15
|
}
|
|
16
|
-
export interface SquidStatusError {
|
|
17
|
-
errorType?: string;
|
|
18
|
-
}
|
|
19
16
|
export type SquidRouteErrorType = "Unknown" | "UnknownError" | "SquidServiceError" | "BAD_REQUEST";
|
|
20
|
-
export declare enum SquidStatusErrorType {
|
|
21
|
-
NotFoundError = "NotFoundError"
|
|
22
|
-
}
|
|
23
17
|
export declare class QrCodeGenerationError extends Error {
|
|
24
18
|
constructor(message: string);
|
|
25
19
|
}
|
|
@@ -36,6 +36,10 @@ export interface WidgetEventMap {
|
|
|
36
36
|
toChainId?: string;
|
|
37
37
|
fromTokenAddress?: string;
|
|
38
38
|
toTokenAddress?: string;
|
|
39
|
+
fromNetworkName?: string;
|
|
40
|
+
toNetworkName?: string;
|
|
41
|
+
fromTokenSymbol?: string;
|
|
42
|
+
toTokenSymbol?: string;
|
|
39
43
|
};
|
|
40
44
|
swapTxSignatureRequested: {
|
|
41
45
|
route: RouteResponse["route"];
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { ChainType
|
|
1
|
+
import { ChainType } from "@0xsquid/squid-types";
|
|
2
2
|
import { OnRampTransactionStatusType } from "./onramps";
|
|
3
|
+
import type { SwapStatusSummary } from "./status";
|
|
3
4
|
import { SendTransactionStatus, SimplifiedRouteAction, TransactionStatus } from "./transaction";
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Explorer URLs of history items that were stored before the v3 status API.
|
|
7
|
+
* The v3 status document has no URLs.
|
|
8
|
+
*/
|
|
9
|
+
export type LegacyExplorerLinks = {
|
|
10
|
+
squidscan?: string;
|
|
11
|
+
axelarscan?: string;
|
|
12
|
+
chainflip?: string;
|
|
13
|
+
destination?: string;
|
|
6
14
|
};
|
|
7
15
|
export type SwapTransactionHistory = {
|
|
8
16
|
fromChain: string;
|
|
@@ -20,10 +28,11 @@ export type SwapTransactionHistory = {
|
|
|
20
28
|
timestamp: number;
|
|
21
29
|
nonce?: number;
|
|
22
30
|
routeType: string | undefined;
|
|
23
|
-
|
|
31
|
+
statusSummary?: SwapStatusSummary;
|
|
32
|
+
legacyExplorerLinks?: LegacyExplorerLinks;
|
|
24
33
|
sourceTxExplorerUrl?: string;
|
|
25
|
-
bridgeType?: string;
|
|
26
34
|
actions?: SimplifiedRouteAction[];
|
|
35
|
+
depositTxVerificationSignature?: string;
|
|
27
36
|
};
|
|
28
37
|
export type SendTransactionHistory = {
|
|
29
38
|
toAddress: string;
|
|
@@ -81,4 +90,3 @@ export type TxTypeToTransactionMap = {
|
|
|
81
90
|
};
|
|
82
91
|
};
|
|
83
92
|
export type HistoryTransaction = TxTypeToTransactionMap[HistoryTxType];
|
|
84
|
-
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export type { AppConfig } from "./config";
|
|
2
|
-
export {
|
|
2
|
+
export { TransactionErrorType, type SquidRouteError, type SquidRouteErrorType, } from "./error";
|
|
3
3
|
export type { QrCodeData } from "./event";
|
|
4
4
|
export * from "./history";
|
|
5
5
|
export type * from "./onramps/";
|
|
6
|
+
export type { KnownSwapStatusActionStatus, SwapStatus, SwapStatusAction, SwapStatusActionRole, SwapStatusActionStatus, SwapStatusActionType, SwapStatusBridgeType, SwapStatusChain, SwapStatusDocument, SwapStatusSummary, } from "./status";
|
|
6
7
|
export type { SwapParams } from "./swap";
|
|
7
|
-
export type { Chain, Token } from "./tokens";
|
|
8
|
-
export {
|
|
8
|
+
export type { Chain, Token, TrustLineAsset } from "./tokens";
|
|
9
|
+
export { SendTransactionStatus, TransactionStatus, type PatchedRouteActionResponse, type TransactionParams, } from "./transaction";
|
|
9
10
|
export type { AddressWithEns, BitcoinWallet, ConnectorID, CosmosWallet, EnsData, EnsSearchResult, FullAddressData, NetworkConfig, SolanaWallet, SupportedChain, Wallet, } from "./wallet";
|
|
10
11
|
export { XamanXrplNetwork } from "./xrpl";
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import type { StandardWalletAdapter } from "@solana/wallet-standard-wallet-adapter-base";
|
|
2
2
|
export type SolanaConnector = StandardWalletAdapter;
|
|
3
|
+
export declare const SOLANA_ON_CHAIN_ERROR_CODE = "SOLANA_ON_CHAIN_ERROR";
|
|
4
|
+
export declare const SOLANA_BLOCKHASH_EXPIRED_CODE = "SOLANA_BLOCKHASH_EXPIRED";
|
|
5
|
+
export type SolanaTransactionErrorCode = typeof SOLANA_ON_CHAIN_ERROR_CODE | typeof SOLANA_BLOCKHASH_EXPIRED_CODE;
|
|
6
|
+
export declare class SolanaTransactionError extends Error {
|
|
7
|
+
readonly code: SolanaTransactionErrorCode;
|
|
8
|
+
readonly signature?: string;
|
|
9
|
+
constructor(code: SolanaTransactionErrorCode, message: string, signature?: string);
|
|
10
|
+
}
|