@0xsquid/react-hooks 8.9.1-beta.0 → 8.10.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 +28 -0
- package/dist/core/canton/cip103Client.d.ts +20 -0
- package/dist/core/client/index.d.ts +1 -0
- package/dist/core/connectors/bitcoin/errors/index.d.ts +0 -3
- package/dist/core/connectors/bitcoin/wallets/index.d.ts +0 -1
- package/dist/core/connectors/bitcoin/wallets/phantom.d.ts +26 -10
- package/dist/core/constants.d.ts +3 -0
- package/dist/core/fallbackWallets.d.ts +16 -0
- package/dist/core/providers/CantonProvider.d.ts +19 -0
- package/dist/core/types/canton.d.ts +58 -0
- package/dist/core/types/cosmos.d.ts +5 -0
- package/dist/core/types/wallet.d.ts +15 -7
- package/dist/core/wallets.d.ts +5 -0
- package/dist/hooks/canton/useCanton.d.ts +2 -0
- package/dist/hooks/canton/useCantonWallets.d.ts +8 -0
- package/dist/hooks/chains/useSquidChains.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/store/useDepositAddressStore.d.ts +18 -5
- package/dist/hooks/swap/useDepositAddress.d.ts +6 -7
- package/dist/hooks/tokens/useBalance.d.ts +1 -0
- package/dist/hooks/tokens/useNativeBalance.d.ts +1 -0
- package/dist/hooks/tokens/useSquidTokens.d.ts +1 -0
- package/dist/hooks/transaction/useDepositTransactionStatus.d.ts +20 -0
- package/dist/hooks/transaction/useSwapStatusQuery.d.ts +29 -0
- 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-Ypw6i6uY.js → index-BlB3yIoX.js} +1398 -294
- package/dist/index-BlB3yIoX.js.map +1 -0
- package/dist/{index-sCLxPcqi.js → index-Dzir2lUQ.js} +1383 -276
- package/dist/index-Dzir2lUQ.js.map +1 -0
- package/dist/{index.es-B2QD8f3q.js → index.es-BPXYaraD.js} +5 -4
- package/dist/index.es-BPXYaraD.js.map +1 -0
- package/dist/{index.es-Bot12hgd.js → index.es-DwtZr7bN.js} +5 -4
- package/dist/index.es-DwtZr7bN.js.map +1 -0
- package/dist/index.esm.js +4 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/{secretService-C3jMjsK0.js → secretService-ICina23f.js} +5 -4
- package/dist/{secretService-C3jMjsK0.js.map → secretService-ICina23f.js.map} +1 -1
- package/dist/{secretService-BAK4sBb7.js → secretService-eiBnD7dI.js} +5 -4
- package/dist/{secretService-BAK4sBb7.js.map → secretService-eiBnD7dI.js.map} +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.esm.js +7 -1
- package/dist/server.esm.js.map +1 -1
- package/dist/server.js +7 -0
- package/dist/server.js.map +1 -1
- package/dist/services/external/onrampAdapter.d.ts +3 -4
- package/dist/services/external/rpcService.d.ts +17 -0
- package/dist/services/internal/assetsService.d.ts +10 -1
- package/dist/services/internal/cantonDamlValue.d.ts +75 -0
- package/dist/services/internal/cantonService.d.ts +64 -0
- package/dist/services/internal/cantonTransferService.d.ts +93 -0
- package/dist/services/internal/transactionService.d.ts +5 -1
- package/dist/services/internal/walletService.d.ts +3 -6
- package/dist/{stellarService.client-SrhXgRGB.js → stellarService.client-Bjc92sC_.js} +6 -5
- package/dist/{stellarService.client-SrhXgRGB.js.map → stellarService.client-Bjc92sC_.js.map} +1 -1
- package/dist/{stellarService.client-DkJ6WAdl.js → stellarService.client-VOmCOPzL.js} +6 -5
- package/dist/{stellarService.client-DkJ6WAdl.js.map → stellarService.client-VOmCOPzL.js.map} +1 -1
- package/dist/tests/cantonService.test.d.ts +1 -0
- package/dist/tests/cantonTransferService.test.d.ts +1 -0
- package/dist/tests/cip103Client.test.d.ts +1 -0
- package/dist/tests/fallbackWallets.test.d.ts +1 -0
- package/dist/tests/wallets.test.d.ts +1 -0
- package/package.json +3 -2
- package/dist/core/connectors/bitcoin/bitcoinFeatures.d.ts +0 -53
- package/dist/core/connectors/bitcoin/wallets/standard.d.ts +0 -30
- package/dist/index-Ypw6i6uY.js.map +0 -1
- package/dist/index-sCLxPcqi.js.map +0 -1
- package/dist/index.es-B2QD8f3q.js.map +0 -1
- package/dist/index.es-Bot12hgd.js.map +0 -1
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { ChainType } from '@0xsquid/squid-types';
|
|
2
2
|
import { HANA_ID, LOBSTR_ID, FREIGHTER_ID, XBULL_ID, RABET_ID, HOTWALLET_ID, ALBEDO_ID } from '@creit.tech/stellar-wallets-kit';
|
|
3
3
|
import { LEDGER_ID } from '@creit.tech/stellar-wallets-kit/modules/ledger.module.mjs';
|
|
4
|
-
import { a as WindowWalletFlag, w as walletIconBaseUrl, d as definedInWindow } from './index-
|
|
4
|
+
import { a as WindowWalletFlag, w as walletIconBaseUrl, d as definedInWindow } from './index-BlB3yIoX.js';
|
|
5
5
|
import 'viem';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '@tanstack/react-query';
|
|
8
8
|
import '@cosmjs/encoding';
|
|
9
|
-
import '@wallet-standard/core';
|
|
10
9
|
import 'bitcoinjs-lib';
|
|
11
10
|
import '@bitcoinerlab/secp256k1';
|
|
12
11
|
import 'axios';
|
|
13
12
|
import '@walletconnect/modal';
|
|
14
13
|
import '@walletconnect/universal-provider';
|
|
15
14
|
import 'ripple-address-codec';
|
|
15
|
+
import 'bignumber.js';
|
|
16
16
|
import '@solana/spl-token';
|
|
17
17
|
import '@solana/wallet-standard-wallet-adapter-base';
|
|
18
18
|
import '@solana/web3.js';
|
|
19
19
|
import '@stellar/stellar-sdk';
|
|
20
20
|
import '@mysten/wallet-standard';
|
|
21
21
|
import 'ethers';
|
|
22
|
-
import 'bignumber.js';
|
|
23
22
|
import 'countries-list';
|
|
24
23
|
import 'currency-symbol-map';
|
|
25
24
|
import 'fuse.js';
|
|
@@ -27,6 +26,8 @@ import 'zustand';
|
|
|
27
26
|
import 'zustand/middleware';
|
|
28
27
|
import 'wagmi';
|
|
29
28
|
import '@safe-global/safe-apps-sdk';
|
|
29
|
+
import '@sigilry/dapp';
|
|
30
|
+
import '@wallet-standard/core';
|
|
30
31
|
import '@mysten/slush-wallet';
|
|
31
32
|
import '@cosmjs/stargate';
|
|
32
33
|
import '@mysten/sui/client';
|
|
@@ -91,9 +92,9 @@ function formatStellarWallet(connector, isAvailable) {
|
|
|
91
92
|
: overrides?.isInstalled || (() => isAvailable),
|
|
92
93
|
skipInstallCheck: overrides?.skipInstallCheck,
|
|
93
94
|
connector,
|
|
94
|
-
|
|
95
|
+
links: { website: productUrl },
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
export { formatStellarWallet };
|
|
99
|
-
//# sourceMappingURL=stellarService.client-
|
|
100
|
+
//# sourceMappingURL=stellarService.client-VOmCOPzL.js.map
|
package/dist/{stellarService.client-DkJ6WAdl.js.map → stellarService.client-VOmCOPzL.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stellarService.client-
|
|
1
|
+
{"version":3,"file":"stellarService.client-VOmCOPzL.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 links: { website: productUrl },\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,eAAe,GAA4C;IAC/D,CAAC,SAAS,GAAG;QACX,IAAI,EAAE,CAAG,EAAA,iBAAiB,CAAc,YAAA,CAAA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AAE,WAAW;AACjB,QAAA,aAAa,EAAE,WAAW;QAC1B,IAAI,EAAE,SAAS,CAAC,OAAO;QACvB,IAAI;AACJ,QAAA,UAAU,EAAE,WAA+B;AAC3C,QAAA,QAAQ,EAAE,KAAK;QACf,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,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;KAC/B;AACH;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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.10.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.227",
|
|
51
51
|
"@bitcoinerlab/secp256k1": "1.1.1",
|
|
52
52
|
"@cosmjs/cosmwasm-stargate": "0.32.4",
|
|
53
53
|
"@cosmjs/encoding": "0.32.4",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"@mysten/sui": "1.21.2",
|
|
61
61
|
"@mysten/wallet-standard": "0.14.0",
|
|
62
62
|
"@safe-global/safe-apps-sdk": "9.1.0",
|
|
63
|
+
"@sigilry/dapp": "2.0.0",
|
|
63
64
|
"@solana/spl-token": "0.4.9",
|
|
64
65
|
"@solana/wallet-standard-wallet-adapter-base": "1.1.4",
|
|
65
66
|
"@solana/web3.js": "1.95.3",
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { IdentifierString, WalletAccount, WalletWithFeatures } from "@wallet-standard/core";
|
|
2
|
-
/**
|
|
3
|
-
* Local mirror of the Bitcoin extension to the Wallet Standard.
|
|
4
|
-
*
|
|
5
|
-
* These identifiers and shapes are defined by the cross-wallet Bitcoin Wallet
|
|
6
|
-
* Standard (github.com/ExodusMovement/bitcoin-wallet-standard, the spec Phantom
|
|
7
|
-
* points integrators at). They're kept here instead of pulling the `0.0.x`
|
|
8
|
-
* `@exodus/bitcoin-wallet-standard-*` packages so the SDK depends only on the
|
|
9
|
-
* already-present `@wallet-standard/core`.
|
|
10
|
-
*/
|
|
11
|
-
export type BitcoinAddressPurpose = "ordinals" | "payment";
|
|
12
|
-
export declare const BitcoinConnect = "bitcoin:connect";
|
|
13
|
-
export interface BitcoinConnectInput {
|
|
14
|
-
purposes: BitcoinAddressPurpose[];
|
|
15
|
-
}
|
|
16
|
-
export interface BitcoinConnectOutput {
|
|
17
|
-
accounts: readonly WalletAccount[];
|
|
18
|
-
}
|
|
19
|
-
export type BitcoinConnectFeature = {
|
|
20
|
-
readonly [BitcoinConnect]: {
|
|
21
|
-
readonly version: "1.0.0";
|
|
22
|
-
readonly connect: (input: BitcoinConnectInput) => Promise<BitcoinConnectOutput>;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export declare const BitcoinSignTransaction = "bitcoin:signTransaction";
|
|
26
|
-
export interface BitcoinInputToSign {
|
|
27
|
-
account: WalletAccount;
|
|
28
|
-
signingIndexes: number[];
|
|
29
|
-
}
|
|
30
|
-
export interface BitcoinSignTransactionInput {
|
|
31
|
-
/** PSBT as raw bytes. */
|
|
32
|
-
psbt: Uint8Array;
|
|
33
|
-
inputsToSign: BitcoinInputToSign[];
|
|
34
|
-
chain?: IdentifierString;
|
|
35
|
-
}
|
|
36
|
-
export interface BitcoinSignTransactionOutput {
|
|
37
|
-
/** Signed PSBT as raw bytes. */
|
|
38
|
-
signedPsbt: Uint8Array;
|
|
39
|
-
}
|
|
40
|
-
export type BitcoinSignTransactionFeature = {
|
|
41
|
-
readonly [BitcoinSignTransaction]: {
|
|
42
|
-
readonly version: "1.0.0";
|
|
43
|
-
readonly signTransaction: (...inputs: readonly BitcoinSignTransactionInput[]) => Promise<readonly BitcoinSignTransactionOutput[]>;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
export type BitcoinStandardFeatures = BitcoinConnectFeature & BitcoinSignTransactionFeature;
|
|
47
|
-
export type WalletWithBitcoinFeatures = WalletWithFeatures<Partial<BitcoinStandardFeatures>>;
|
|
48
|
-
export declare const REQUIRED_BITCOIN_FEATURES: readonly ["bitcoin:connect", "bitcoin:signTransaction"];
|
|
49
|
-
/**
|
|
50
|
-
* Type guard: the wallet exposes the Bitcoin features this SDK needs (connect +
|
|
51
|
-
* signTransaction). Wallets advertising only a subset are treated as unsupported.
|
|
52
|
-
*/
|
|
53
|
-
export declare function hasBitcoinFeatures(wallet: WalletWithBitcoinFeatures): wallet is WalletWithFeatures<BitcoinStandardFeatures>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { BitcoinConnector } from "../../../../core/types/bitcoin";
|
|
2
|
-
export interface BitcoinStandardConnectorParams {
|
|
3
|
-
/**
|
|
4
|
-
* Name the wallet registers under the Wallet Standard (`wallet.name`),
|
|
5
|
-
* e.g. "Phantom". Matched case-insensitively against the registry.
|
|
6
|
-
*/
|
|
7
|
-
walletName: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Bitcoin connector backed by the Bitcoin Wallet Standard.
|
|
11
|
-
*
|
|
12
|
-
* Discovers the wallet from the Wallet Standard registry at call time (mirroring
|
|
13
|
-
* how Solana/Sui wallets are resolved) and connects/signs through the
|
|
14
|
-
* `bitcoin:connect` and `bitcoin:signTransaction` features instead of a
|
|
15
|
-
* wallet-specific injected provider. Configure it with a `walletName` to support
|
|
16
|
-
* any wallet exposing the Bitcoin Wallet Standard — Phantom is the first consumer.
|
|
17
|
-
*/
|
|
18
|
-
export declare class BitcoinStandardConnector implements BitcoinConnector {
|
|
19
|
-
private readonly walletName;
|
|
20
|
-
constructor({ walletName }: BitcoinStandardConnectorParams);
|
|
21
|
-
private getWallet;
|
|
22
|
-
private connectAccount;
|
|
23
|
-
requestAccount(): Promise<{
|
|
24
|
-
address: string;
|
|
25
|
-
}>;
|
|
26
|
-
sendBTC(to: string, amount: number): Promise<{
|
|
27
|
-
txHash: string;
|
|
28
|
-
}>;
|
|
29
|
-
private signAndBroadcast;
|
|
30
|
-
}
|