@defuse-protocol/intents-sdk 0.14.0 → 0.15.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/README.md +452 -345
- package/dist/index.cjs +381 -65
- package/dist/index.d.cts +16 -10
- package/dist/index.d.ts +16 -10
- package/dist/index.js +385 -54
- package/package.json +6 -2
package/dist/index.d.cts
CHANGED
|
@@ -8,11 +8,12 @@ import { Account } from 'viem';
|
|
|
8
8
|
|
|
9
9
|
type HotBridgeChain = (typeof HotBridgeChains)[number];
|
|
10
10
|
type HotBridgeEVMChain = Extract<HotBridgeChain, `eip155:${string}`>;
|
|
11
|
-
declare const HotBridgeChains: ("eip155:
|
|
11
|
+
declare const HotBridgeChains: ("eip155:10" | "eip155:56" | "eip155:137" | "eip155:43114" | "tvm:-239" | "stellar:pubnet")[];
|
|
12
12
|
|
|
13
13
|
declare const BridgeNameEnum: {
|
|
14
14
|
readonly Hot: "hot";
|
|
15
15
|
readonly Poa: "poa";
|
|
16
|
+
readonly Omni: "omni";
|
|
16
17
|
readonly None: null;
|
|
17
18
|
};
|
|
18
19
|
type BridgeNameEnum = typeof BridgeNameEnum;
|
|
@@ -21,6 +22,7 @@ type BridgeNameEnumValues = (typeof BridgeNameEnum)[keyof typeof BridgeNameEnum]
|
|
|
21
22
|
declare const RouteEnum: {
|
|
22
23
|
readonly HotBridge: "hot_bridge";
|
|
23
24
|
readonly PoaBridge: "poa_bridge";
|
|
25
|
+
readonly OmniBridge: "omni_bridge";
|
|
24
26
|
readonly NearWithdrawal: "near_withdrawal";
|
|
25
27
|
readonly VirtualChain: "virtual_chain";
|
|
26
28
|
readonly InternalTransfer: "internal_transfer";
|
|
@@ -68,22 +70,22 @@ type OnBeforePublishIntentHook<RelayParams = Omit<RelayParamsDefault, "multiPayl
|
|
|
68
70
|
*/
|
|
69
71
|
declare const Chains: {
|
|
70
72
|
readonly Bitcoin: "bip122:000000000019d6689c085ae165831e93";
|
|
73
|
+
readonly Zcash: "bip122:00040fe8ec8471911baa1db1266ea15d";
|
|
74
|
+
readonly Dogecoin: "bip122:1a91e3dace36e2be3bf030a65679fe82";
|
|
71
75
|
readonly Ethereum: "eip155:1";
|
|
72
|
-
readonly
|
|
73
|
-
readonly Arbitrum: "eip155:42161";
|
|
76
|
+
readonly Optimism: "eip155:10";
|
|
74
77
|
readonly BNB: "eip155:56";
|
|
78
|
+
readonly Gnosis: "eip155:100";
|
|
75
79
|
readonly Polygon: "eip155:137";
|
|
80
|
+
readonly Base: "eip155:8453";
|
|
81
|
+
readonly Arbitrum: "eip155:42161";
|
|
82
|
+
readonly Avalanche: "eip155:43114";
|
|
83
|
+
readonly Berachain: "eip155:80085";
|
|
76
84
|
readonly Near: "near:mainnet";
|
|
77
85
|
readonly Solana: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
78
86
|
readonly Tron: "tron:27Lqcw";
|
|
79
|
-
readonly Gnosis: "eip155:100";
|
|
80
87
|
readonly XRPL: "xrpl:0";
|
|
81
|
-
readonly Dogecoin: "bip122:1a91e3dace36e2be3bf030a65679fe82";
|
|
82
|
-
readonly Zcash: "zcash:0";
|
|
83
|
-
readonly Berachain: "eip155:80085";
|
|
84
88
|
readonly TON: "tvm:-239";
|
|
85
|
-
readonly Optimism: "eip155:10";
|
|
86
|
-
readonly Avalanche: "eip155:43114";
|
|
87
89
|
readonly Sui: "sui:mainnet";
|
|
88
90
|
readonly Aptos: "aptos:mainnet";
|
|
89
91
|
readonly Stellar: "stellar:pubnet";
|
|
@@ -225,7 +227,10 @@ type HotBridgeRouteConfig = {
|
|
|
225
227
|
route: RouteEnum["HotBridge"];
|
|
226
228
|
chain: Chain;
|
|
227
229
|
};
|
|
228
|
-
type
|
|
230
|
+
type OmniBridgeRouteConfig = {
|
|
231
|
+
route: RouteEnum["OmniBridge"];
|
|
232
|
+
};
|
|
233
|
+
type RouteConfig = NearWithdrawalRouteConfig | InternalTransferRouteConfig | VirtualChainRouteConfig | PoaBridgeRouteConfig | HotBridgeRouteConfig | OmniBridgeRouteConfig;
|
|
229
234
|
interface FeeEstimation {
|
|
230
235
|
amount: bigint;
|
|
231
236
|
quote: null | solverRelay.Quote;
|
|
@@ -246,6 +251,7 @@ interface Bridge {
|
|
|
246
251
|
assetId: string;
|
|
247
252
|
amount: bigint;
|
|
248
253
|
destinationAddress: string;
|
|
254
|
+
feeEstimation: FeeEstimation;
|
|
249
255
|
logger?: ILogger;
|
|
250
256
|
}): Promise<void>;
|
|
251
257
|
estimateWithdrawalFee<T extends Pick<WithdrawalParams, "assetId" | "destinationAddress" | "routeConfig">>(args: {
|
package/dist/index.d.ts
CHANGED
|
@@ -8,11 +8,12 @@ import { Account } from 'viem';
|
|
|
8
8
|
|
|
9
9
|
type HotBridgeChain = (typeof HotBridgeChains)[number];
|
|
10
10
|
type HotBridgeEVMChain = Extract<HotBridgeChain, `eip155:${string}`>;
|
|
11
|
-
declare const HotBridgeChains: ("eip155:
|
|
11
|
+
declare const HotBridgeChains: ("eip155:10" | "eip155:56" | "eip155:137" | "eip155:43114" | "tvm:-239" | "stellar:pubnet")[];
|
|
12
12
|
|
|
13
13
|
declare const BridgeNameEnum: {
|
|
14
14
|
readonly Hot: "hot";
|
|
15
15
|
readonly Poa: "poa";
|
|
16
|
+
readonly Omni: "omni";
|
|
16
17
|
readonly None: null;
|
|
17
18
|
};
|
|
18
19
|
type BridgeNameEnum = typeof BridgeNameEnum;
|
|
@@ -21,6 +22,7 @@ type BridgeNameEnumValues = (typeof BridgeNameEnum)[keyof typeof BridgeNameEnum]
|
|
|
21
22
|
declare const RouteEnum: {
|
|
22
23
|
readonly HotBridge: "hot_bridge";
|
|
23
24
|
readonly PoaBridge: "poa_bridge";
|
|
25
|
+
readonly OmniBridge: "omni_bridge";
|
|
24
26
|
readonly NearWithdrawal: "near_withdrawal";
|
|
25
27
|
readonly VirtualChain: "virtual_chain";
|
|
26
28
|
readonly InternalTransfer: "internal_transfer";
|
|
@@ -68,22 +70,22 @@ type OnBeforePublishIntentHook<RelayParams = Omit<RelayParamsDefault, "multiPayl
|
|
|
68
70
|
*/
|
|
69
71
|
declare const Chains: {
|
|
70
72
|
readonly Bitcoin: "bip122:000000000019d6689c085ae165831e93";
|
|
73
|
+
readonly Zcash: "bip122:00040fe8ec8471911baa1db1266ea15d";
|
|
74
|
+
readonly Dogecoin: "bip122:1a91e3dace36e2be3bf030a65679fe82";
|
|
71
75
|
readonly Ethereum: "eip155:1";
|
|
72
|
-
readonly
|
|
73
|
-
readonly Arbitrum: "eip155:42161";
|
|
76
|
+
readonly Optimism: "eip155:10";
|
|
74
77
|
readonly BNB: "eip155:56";
|
|
78
|
+
readonly Gnosis: "eip155:100";
|
|
75
79
|
readonly Polygon: "eip155:137";
|
|
80
|
+
readonly Base: "eip155:8453";
|
|
81
|
+
readonly Arbitrum: "eip155:42161";
|
|
82
|
+
readonly Avalanche: "eip155:43114";
|
|
83
|
+
readonly Berachain: "eip155:80085";
|
|
76
84
|
readonly Near: "near:mainnet";
|
|
77
85
|
readonly Solana: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
78
86
|
readonly Tron: "tron:27Lqcw";
|
|
79
|
-
readonly Gnosis: "eip155:100";
|
|
80
87
|
readonly XRPL: "xrpl:0";
|
|
81
|
-
readonly Dogecoin: "bip122:1a91e3dace36e2be3bf030a65679fe82";
|
|
82
|
-
readonly Zcash: "zcash:0";
|
|
83
|
-
readonly Berachain: "eip155:80085";
|
|
84
88
|
readonly TON: "tvm:-239";
|
|
85
|
-
readonly Optimism: "eip155:10";
|
|
86
|
-
readonly Avalanche: "eip155:43114";
|
|
87
89
|
readonly Sui: "sui:mainnet";
|
|
88
90
|
readonly Aptos: "aptos:mainnet";
|
|
89
91
|
readonly Stellar: "stellar:pubnet";
|
|
@@ -225,7 +227,10 @@ type HotBridgeRouteConfig = {
|
|
|
225
227
|
route: RouteEnum["HotBridge"];
|
|
226
228
|
chain: Chain;
|
|
227
229
|
};
|
|
228
|
-
type
|
|
230
|
+
type OmniBridgeRouteConfig = {
|
|
231
|
+
route: RouteEnum["OmniBridge"];
|
|
232
|
+
};
|
|
233
|
+
type RouteConfig = NearWithdrawalRouteConfig | InternalTransferRouteConfig | VirtualChainRouteConfig | PoaBridgeRouteConfig | HotBridgeRouteConfig | OmniBridgeRouteConfig;
|
|
229
234
|
interface FeeEstimation {
|
|
230
235
|
amount: bigint;
|
|
231
236
|
quote: null | solverRelay.Quote;
|
|
@@ -246,6 +251,7 @@ interface Bridge {
|
|
|
246
251
|
assetId: string;
|
|
247
252
|
amount: bigint;
|
|
248
253
|
destinationAddress: string;
|
|
254
|
+
feeEstimation: FeeEstimation;
|
|
249
255
|
logger?: ILogger;
|
|
250
256
|
}): Promise<void>;
|
|
251
257
|
estimateWithdrawalFee<T extends Pick<WithdrawalParams, "assetId" | "destinationAddress" | "routeConfig">>(args: {
|