@gibs/bridge-sdk 1.6.36 → 1.7.2

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.
@@ -1,4 +1,4 @@
1
- /** the abi for the bridge */
1
+ /** the abi for the input bridge */
2
2
  export declare const inputBridge: readonly [{
3
3
  readonly name: "minPerTx";
4
4
  readonly type: "function";
@@ -96,6 +96,7 @@ export declare const inputBridge: readonly [{
96
96
  }];
97
97
  readonly outputs: readonly [];
98
98
  }];
99
+ /** the abi for the input bridge with extra input for the sender origin (tokensex) */
99
100
  export declare const inputBridgeExtraInput: readonly [{
100
101
  readonly name: "relayTokensAndCall";
101
102
  readonly type: "function";
@@ -136,6 +137,7 @@ export declare const inputBridgeExtraInput: readonly [{
136
137
  }];
137
138
  readonly outputs: readonly [];
138
139
  }];
140
+ /** the abi for erc677 tokens */
139
141
  export declare const erc677: readonly [{
140
142
  readonly name: "transferAndCall";
141
143
  readonly type: "function";
@@ -149,6 +151,7 @@ export declare const erc677: readonly [{
149
151
  }];
150
152
  readonly outputs: readonly [];
151
153
  }];
154
+ /** the abi for erc677 tokens bridge with extra input for the sender origin (tokensex) */
152
155
  export declare const erc677ExtraInput: readonly [{
153
156
  readonly name: "transferAndCall";
154
157
  readonly type: "function";
@@ -165,6 +168,7 @@ export declare const erc677ExtraInput: readonly [{
165
168
  }];
166
169
  readonly outputs: readonly [];
167
170
  }];
171
+ /** the abi to read data from the output router */
168
172
  export declare const outputRouter: readonly [{
169
173
  readonly name: "onTokenBridged";
170
174
  readonly type: "function";
@@ -197,6 +201,7 @@ export declare const outputRouter: readonly [{
197
201
  readonly type: "address";
198
202
  }];
199
203
  }];
204
+ /** the abi for the output bridge */
200
205
  export declare const outputBridge: readonly [{
201
206
  readonly name: "bridgeContract";
202
207
  readonly type: "function";
@@ -206,6 +211,7 @@ export declare const outputBridge: readonly [{
206
211
  readonly type: "address";
207
212
  }];
208
213
  }];
214
+ /** the abi for the fee manager */
209
215
  export declare const feeManager: readonly [{
210
216
  readonly name: "HOME_TO_FOREIGN_FEE";
211
217
  readonly type: "function";
@@ -235,6 +241,7 @@ export declare const feeManager: readonly [{
235
241
  readonly type: "uint256";
236
242
  }];
237
243
  }];
244
+ /** the abi for the native router */
238
245
  export declare const nativeRouter: readonly [{
239
246
  readonly name: "wrapAndRelayTokens";
240
247
  readonly type: "function";
@@ -257,6 +264,7 @@ export declare const nativeRouter: readonly [{
257
264
  }];
258
265
  readonly outputs: readonly [];
259
266
  }];
267
+ /** the abi for the native router with extra input for the sender origin (tokensex) */
260
268
  export declare const nativeRouterExtraInput: readonly [{
261
269
  readonly name: "wrapAndRelayTokens";
262
270
  readonly type: "function";
@@ -285,6 +293,7 @@ export declare const nativeRouterExtraInput: readonly [{
285
293
  }];
286
294
  readonly outputs: readonly [];
287
295
  }];
296
+ /** the abi for the univ2 router */
288
297
  export declare const univ2Router: readonly [{
289
298
  readonly name: "getAmountsOut";
290
299
  readonly type: "function";
@@ -300,6 +309,7 @@ export declare const univ2Router: readonly [{
300
309
  readonly type: "uint256[]";
301
310
  }];
302
311
  }];
312
+ /** the abi for the fee delivery struct */
303
313
  export declare const feeDeliveryStruct: readonly [{
304
314
  readonly type: "tuple";
305
315
  readonly components: readonly [{
@@ -312,6 +322,7 @@ export declare const feeDeliveryStruct: readonly [{
312
322
  readonly type: "uint256";
313
323
  }];
314
324
  }];
325
+ /** the abi for the relay tokens direct */
315
326
  export declare const relayTokensDirect: readonly [{
316
327
  readonly name: "safeExecuteSignaturesWithAutoGasLimit";
317
328
  readonly type: "function";
@@ -325,6 +336,7 @@ export declare const relayTokensDirect: readonly [{
325
336
  }];
326
337
  readonly outputs: readonly [];
327
338
  }];
339
+ /** the abi for the home amb */
328
340
  export declare const homeAmb: readonly [{
329
341
  readonly name: "submitSignature";
330
342
  readonly type: "function";
@@ -338,6 +350,7 @@ export declare const homeAmb: readonly [{
338
350
  }];
339
351
  readonly outputs: readonly [];
340
352
  }];
353
+ /** the abi for the univ2 pair */
341
354
  export declare const pair: readonly [{
342
355
  readonly name: "getReserves";
343
356
  readonly type: "function";
package/dist/src/abis.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { parseAbi, parseAbiParameters } from 'viem';
2
- /** the abi for the bridge */
2
+ /** the abi for the input bridge */
3
3
  export const inputBridge = parseAbi([
4
4
  'function minPerTx(address token) external view returns(uint256)',
5
5
  'function foreignTokenAddress(address token) external view returns(address)',
@@ -10,45 +10,58 @@ export const inputBridge = parseAbi([
10
10
  'function relayTokensAndCall(address token, address _receiver, uint256 _value, bytes memory _data) external',
11
11
  'function relayTokens(address token, address _receiver, uint256 _value) external',
12
12
  ]);
13
+ /** the abi for the input bridge with extra input for the sender origin (tokensex) */
13
14
  export const inputBridgeExtraInput = parseAbi([
14
15
  'function relayTokensAndCall(address token, address _receiver, uint256 _value, bytes memory _data, address _senderOrigin) external',
15
16
  'function relayTokens(address token, address _receiver, uint256 _value, address _senderOrigin) external',
16
17
  ]);
18
+ /** the abi for erc677 tokens */
17
19
  export const erc677 = parseAbi([
18
20
  'function transferAndCall(address, uint256, bytes calldata) external',
19
21
  ]);
22
+ /** the abi for erc677 tokens bridge with extra input for the sender origin (tokensex) */
20
23
  export const erc677ExtraInput = parseAbi([
21
24
  'function transferAndCall(address, uint256, bytes calldata, address sender) external',
22
25
  ]);
26
+ /** the abi to read data from the output router */
23
27
  export const outputRouter = parseAbi([
24
28
  'function onTokenBridged(address _token, uint256 _value, bytes memory _data) external payable',
25
29
  'function WETH() external view returns(address)',
26
30
  'function bridge() external view returns(address)',
27
31
  ]);
32
+ /** the abi for the output bridge */
28
33
  export const outputBridge = parseAbi(['function bridgeContract() external view returns(address)']);
34
+ /** the abi for the fee manager */
29
35
  export const feeManager = parseAbi([
30
36
  'function HOME_TO_FOREIGN_FEE() public view returns(bytes32)',
31
37
  'function FOREIGN_TO_HOME_FEE() public view returns(bytes32)',
32
38
  'function getFee(bytes32, address) public view returns(uint256)',
33
39
  ]);
40
+ /** the abi for the native router */
34
41
  export const nativeRouter = parseAbi([
35
42
  'function wrapAndRelayTokens(address receiver) external payable',
36
43
  'function relayTokensAndCall(address receiver, bytes calldata data) external payable',
37
44
  ]);
45
+ /** the abi for the native router with extra input for the sender origin (tokensex) */
38
46
  export const nativeRouterExtraInput = parseAbi([
39
47
  'function wrapAndRelayTokens(address receiver, address sender) external payable',
40
48
  'function relayTokensAndCall(address receiver, bytes calldata data, address sender) external payable',
41
49
  ]);
50
+ /** the abi for the univ2 router */
42
51
  export const univ2Router = parseAbi([
43
52
  'function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns(uint256[] memory)',
44
53
  ]);
54
+ /** the abi for the fee delivery struct */
45
55
  export const feeDeliveryStruct = parseAbiParameters('(address, uint256, uint256, uint256)');
56
+ /** the abi for the relay tokens direct */
46
57
  export const relayTokensDirect = parseAbi([
47
58
  'function safeExecuteSignaturesWithAutoGasLimit(bytes calldata data, bytes calldata signatures) external',
48
59
  ]);
60
+ /** the abi for the home amb */
49
61
  export const homeAmb = parseAbi([
50
62
  'function submitSignature(bytes message, bytes signature) external',
51
63
  ]);
64
+ /** the abi for the univ2 pair */
52
65
  export const pair = parseAbi([
53
66
  'function getReserves() view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast)',
54
67
  ]);
@@ -15,12 +15,29 @@ export type TokenBridgeInfo = {
15
15
  foreign: Hex;
16
16
  };
17
17
  };
18
+ /**
19
+ * Returns the bridged token address and native token address
20
+ * @param chainId - the chain id being targeted
21
+ * @param target - the target
22
+ * @param address - the address
23
+ * @param client - the client
24
+ * @returns the bridged token address and native token address
25
+ */
18
26
  export declare const links: (({ chainId, target, address, client }: {
19
27
  chainId: number;
20
28
  target: Hex;
21
29
  address: Hex;
22
30
  client: PublicClient;
23
31
  }) => Promise<`0x${string}`[]>) & _.MemoizedFunction;
32
+ /**
33
+ * Returns the token bridge info for the given bridge key, asset in, is prod, from chain client, and to chain client
34
+ * @param bridgeKey - the bridge key
35
+ * @param assetIn - the asset in
36
+ * @param isProd - whether to use the production pathway
37
+ * @param fromChainClient - the from chain client
38
+ * @param toChainClient - the to chain client
39
+ * @returns the token bridge info
40
+ */
24
41
  export declare const tokenBridgeInfo: ({ bridgeKey, assetIn, isProd, fromChainClient, toChainClient, }: {
25
42
  bridgeKey: BridgeKey;
26
43
  assetIn: Token | null;
@@ -28,7 +45,20 @@ export declare const tokenBridgeInfo: ({ bridgeKey, assetIn, isProd, fromChainCl
28
45
  fromChainClient: PublicClient;
29
46
  toChainClient: PublicClient;
30
47
  }) => Promise<null | TokenBridgeInfo>;
48
+ /** The result of reading the amount out from a router */
31
49
  export type FetchResult = bigint[] | Hex;
50
+ /**
51
+ * Fetch the price corrective for the given bridge key, asset out, measurement token, from chain client, to chain client, asset link, amount in, and is prod
52
+ * @param bridgeKeyPartner - the bridge key partner
53
+ * @param assetOut - the asset out
54
+ * @param measurementToken - the measurement token
55
+ * @param fromChainClient - the from chain client
56
+ * @param toChainClient - the to chain client
57
+ * @param assetLink - the asset link
58
+ * @param amountIn - the amount in
59
+ * @param isProd - whether to use the production pathway
60
+ * @returns the price corrective
61
+ */
32
62
  export declare const fetchPriceCorrective: ({ bridgeKeyPartner, assetOut, measurementToken, fromChainClient, toChainClient, assetLink, amountIn, isProd, }: {
33
63
  bridgeKey: BridgeKey;
34
64
  bridgeKeyPartner: BridgeKey;
@@ -52,6 +82,14 @@ export declare const fetchPriceCorrective: ({ bridgeKeyPartner, assetOut, measur
52
82
  oneToken: bigint;
53
83
  }) => bigint;
54
84
  };
85
+ /**
86
+ * Fetch the minimum bridge amount in for the given asset in, pathway, from public client, and to public client
87
+ * @param assetIn - the asset in
88
+ * @param pathway - the pathway
89
+ * @param fromPublicClient - the from public client
90
+ * @param toPublicClient - the to public client
91
+ * @returns the minimum bridge amount in
92
+ */
55
93
  export declare const minBridgeAmountIn: ({ assetIn, pathway, fromPublicClient, toPublicClient, }: {
56
94
  assetIn: Token;
57
95
  pathway: Pathway;
@@ -60,19 +98,33 @@ export declare const minBridgeAmountIn: ({ assetIn, pathway, fromPublicClient, t
60
98
  }) => Promise<bigint>;
61
99
  /** get the symbol of the native asset, unwrap it if it needs to be */
62
100
  export declare const nativeSymbol: (asset: {
63
- address: Hex;
101
+ address: string;
64
102
  symbol: string;
65
103
  chainId: number;
66
104
  } | null, unwrap?: boolean) => string;
105
+ /** The input for loading the bridge fees */
67
106
  export type InputLoadFeeFor = {
68
107
  pathway: Pathway;
69
108
  fromChainClient: PublicClient;
70
109
  toChainClient: PublicClient;
71
110
  };
111
+ /** The fee configuration for a given pathway */
72
112
  export type PathwayExtendableConfig = {
73
113
  feeManager: Hex;
74
114
  feeH2F: bigint;
75
115
  feeF2H: bigint;
76
116
  };
117
+ /**
118
+ * Returns the chain multicall for the given client
119
+ * @param client - the client
120
+ * @returns the chain multicall
121
+ */
77
122
  export declare const chainMulticall: (client: PublicClient) => any;
123
+ /**
124
+ * Load the bridge fees for the given pathway, from chain client, and to chain client
125
+ * @param pathway - the pathway
126
+ * @param fromChainClient - the from chain client
127
+ * @param toChainClient - the to chain client
128
+ * @returns the bridge fees
129
+ */
78
130
  export declare const loadBridgeFees: ({ pathway, fromChainClient, toChainClient }: InputLoadFeeFor) => Promise<PathwayExtendableConfig>;
@@ -4,6 +4,14 @@ import _ from "lodash";
4
4
  import { chainsMetadata } from "./chains.js";
5
5
  import * as abis from "./abis.js";
6
6
  import { multicallRead } from "@gibs/common/multicall";
7
+ /**
8
+ * Returns the bridged token address and native token address
9
+ * @param chainId - the chain id being targeted
10
+ * @param target - the target
11
+ * @param address - the address
12
+ * @param client - the client
13
+ * @returns the bridged token address and native token address
14
+ */
7
15
  export const links = _.memoize(async ({ chainId, target, address, client }) => {
8
16
  return multicallRead({
9
17
  client,
@@ -16,8 +24,17 @@ export const links = _.memoize(async ({ chainId, target, address, client }) => {
16
24
  ],
17
25
  });
18
26
  }, ({ chainId, target, address }) => `${chainId}-${target}-${address}`.toLowerCase());
27
+ /**
28
+ * Returns the token bridge info for the given bridge key, asset in, is prod, from chain client, and to chain client
29
+ * @param bridgeKey - the bridge key
30
+ * @param assetIn - the asset in
31
+ * @param isProd - whether to use the production pathway
32
+ * @param fromChainClient - the from chain client
33
+ * @param toChainClient - the to chain client
34
+ * @returns the token bridge info
35
+ */
19
36
  export const tokenBridgeInfo = async ({ bridgeKey, assetIn, isProd, fromChainClient, toChainClient, }) => {
20
- const bridgePathway = pathway(bridgeKey, isProd);
37
+ const bridgePathway = pathway(bridgeKey, isProd, assetIn?.address);
21
38
  if (!assetIn || !bridgePathway) {
22
39
  console.log('missing asset in or bridge pathway');
23
40
  return null;
@@ -39,28 +56,23 @@ export const tokenBridgeInfo = async ({ bridgeKey, assetIn, isProd, fromChainCli
39
56
  }),
40
57
  ]);
41
58
  const [toBridged, toNative] = toMappings;
42
- // const notGas = !Object.values(nativeAssetOut).find(
43
- // (v) => v.toLowerCase() === assetInAddress.toLowerCase(),
44
- // )
45
59
  if (toBridged !== zeroAddress) {
46
- // if (notGas) console.log('toBridged')
47
60
  return {
48
61
  originationChainId: fromChain,
49
62
  assetInAddress: assetInAddress,
50
63
  assetOutAddress: toBridged,
51
- toForeign: {
52
- foreign: toBridged,
53
- home: assetInAddress,
64
+ toHome: {
65
+ home: toBridged,
66
+ foreign: assetInAddress,
54
67
  },
55
68
  };
56
69
  }
57
70
  if (toNative !== zeroAddress) {
58
- // if (notGas) console.log('toNative')
59
71
  return {
60
72
  originationChainId: toChain,
61
73
  assetInAddress: assetInAddress,
62
74
  assetOutAddress: toNative,
63
- toHome: {
75
+ toForeign: {
64
76
  home: toNative,
65
77
  foreign: assetInAddress,
66
78
  },
@@ -68,7 +80,6 @@ export const tokenBridgeInfo = async ({ bridgeKey, assetIn, isProd, fromChainCli
68
80
  }
69
81
  const [fromBridged, fromNative] = fromMappings;
70
82
  if (fromNative !== zeroAddress) {
71
- // if (notGas) console.log('fromNative')
72
83
  return {
73
84
  originationChainId: toChain,
74
85
  assetInAddress: assetInAddress,
@@ -80,7 +91,6 @@ export const tokenBridgeInfo = async ({ bridgeKey, assetIn, isProd, fromChainCli
80
91
  };
81
92
  }
82
93
  if (fromBridged !== zeroAddress) {
83
- // if (notGas) console.log('fromBridged')
84
94
  return {
85
95
  originationChainId: fromChain,
86
96
  assetInAddress: assetInAddress,
@@ -112,7 +122,7 @@ export const tokenBridgeInfo = async ({ bridgeKey, assetIn, isProd, fromChainCli
112
122
  };
113
123
  };
114
124
  /**
115
- * check the prices that each router offers for the given paths
125
+ * Check the prices that each router offers for the given paths
116
126
  * @param assetInAddress the address of the asset going into the bridge
117
127
  * @param oneTokenInt the number of tokens to push into the bridge (before fees)
118
128
  * @param chain the chain of the asset going into the bridge
@@ -135,11 +145,19 @@ const readAmountOut = ({ amountIn, chain, paths, client, uniV2Router, }) => {
135
145
  }))),
136
146
  });
137
147
  };
138
- export const fetchPriceCorrective = ({
139
- // bridgeKey,
140
- // assetIn,
141
- // isProd,
142
- bridgeKeyPartner, assetOut, measurementToken, fromChainClient, toChainClient, assetLink, amountIn, isProd, }) => {
148
+ /**
149
+ * Fetch the price corrective for the given bridge key, asset out, measurement token, from chain client, to chain client, asset link, amount in, and is prod
150
+ * @param bridgeKeyPartner - the bridge key partner
151
+ * @param assetOut - the asset out
152
+ * @param measurementToken - the measurement token
153
+ * @param fromChainClient - the from chain client
154
+ * @param toChainClient - the to chain client
155
+ * @param assetLink - the asset link
156
+ * @param amountIn - the amount in
157
+ * @param isProd - whether to use the production pathway
158
+ * @returns the price corrective
159
+ */
160
+ export const fetchPriceCorrective = ({ bridgeKeyPartner, assetOut, measurementToken, fromChainClient, toChainClient, assetLink, amountIn, isProd, }) => {
143
161
  return {
144
162
  getPaymentToken: async () => {
145
163
  // fetch the token bridge info for the token that is about to be spent by the delivery service
@@ -213,6 +231,14 @@ bridgeKeyPartner, assetOut, measurementToken, fromChainClient, toChainClient, as
213
231
  }
214
232
  };
215
233
  };
234
+ /**
235
+ * Fetch the minimum bridge amount in for the given asset in, pathway, from public client, and to public client
236
+ * @param assetIn - the asset in
237
+ * @param pathway - the pathway
238
+ * @param fromPublicClient - the from public client
239
+ * @param toPublicClient - the to public client
240
+ * @returns the minimum bridge amount in
241
+ */
216
242
  export const minBridgeAmountIn = async ({ assetIn, pathway, fromPublicClient, toPublicClient, }) => {
217
243
  const publicClient = pathway?.feeManager === 'from' ? fromPublicClient : toPublicClient;
218
244
  return publicClient.readContract({
@@ -226,6 +252,11 @@ export const minBridgeAmountIn = async ({ assetIn, pathway, fromPublicClient, to
226
252
  export const nativeSymbol = (asset, unwrap = false) => {
227
253
  return asset ? (unwrap && asset.address === nativeAssetOut[toChain(asset.chainId)] ? asset.symbol.slice(1) : asset.symbol) : '';
228
254
  };
255
+ /**
256
+ * Returns the chain multicall for the given client
257
+ * @param client - the client
258
+ * @returns the chain multicall
259
+ */
229
260
  export const chainMulticall = (client) => {
230
261
  const chainId = client.chain.id;
231
262
  const metadata = chainsMetadata[toChain(chainId)];
@@ -235,6 +266,13 @@ export const chainMulticall = (client) => {
235
266
  address: metadata.contracts.multicall3.address,
236
267
  });
237
268
  };
269
+ /**
270
+ * Load the bridge fees for the given pathway, from chain client, and to chain client
271
+ * @param pathway - the pathway
272
+ * @param fromChainClient - the from chain client
273
+ * @param toChainClient - the to chain client
274
+ * @returns the bridge fees
275
+ */
238
276
  export const loadBridgeFees = async ({ pathway, fromChainClient, toChainClient }) => {
239
277
  const multicall = pathway.feeManager === 'from'
240
278
  ? chainMulticall(fromChainClient)
@@ -10,42 +10,104 @@ export declare enum Chains {
10
10
  SEP = "0xaa36a7",
11
11
  V4PLS = "0x3af"
12
12
  }
13
+ /** The key of a chain - human readable for query params */
13
14
  export type ChainKey = keyof typeof Chains;
15
+ /** A map of chain ids to chain keys */
14
16
  export declare const chainIdToKey: Map<Chains, "ETH" | "PLS" | "BNB" | "SEP" | "V4PLS">;
17
+ /**
18
+ * Converts a chain id to a chain key
19
+ * @param chainId - the chain id
20
+ * @returns the chain key
21
+ */
15
22
  export declare const toChain: (chainId: number | string) => Chains;
23
+ /**
24
+ * Converts a chain id to a chain key
25
+ * @param chainId - the chain id
26
+ * @returns the chain key
27
+ */
16
28
  export declare const toChainKey: (chainId: number | string) => "ETH" | "PLS" | "BNB" | "SEP" | "V4PLS" | undefined;
29
+ /** The provider of an omnibridge */
17
30
  export declare enum Provider {
18
31
  PULSECHAIN = "pulsechain",
19
32
  TOKENSEX = "tokensex"
20
33
  }
34
+ /** A map of chains to native asset out addresses */
21
35
  export declare const nativeAssetOut: Record<Chains, Hex>;
36
+ /** A map of chains to deprecated native asset out addresses */
37
+ export declare const deprecatedNativeAssetOut: Partial<Record<Chains, Set<Hex>>>;
38
+ /** A map of chains to uni v2 router addresses */
22
39
  export declare const uniV2Routers: Record<Chains, Hex[]>;
40
+ /** A map of chains to native token symbols */
23
41
  export declare const nativeTokenSymbol: Record<Chains, string>;
42
+ /** A map of chains to native token names */
24
43
  export declare const nativeTokenName: Record<Chains, string>;
44
+ /** The pathway of a bridge */
25
45
  export type Pathway = {
26
46
  from: Hex;
27
47
  to: Hex;
28
48
  destinationRouter: Hex | null;
29
49
  nativeRouter: Hex;
30
50
  validator: Hex;
31
- defaultAssetIn: Token;
32
51
  usesExtraParam: boolean;
33
52
  feeManager: 'from' | 'to';
34
53
  toHome: boolean;
35
54
  requiresDelivery: boolean;
55
+ bridgedNativeAssetOut: Hex;
56
+ settingOverrides?: Record<Hex, Partial<Pathway>>;
36
57
  };
58
+ /** A map of providers to pathways */
37
59
  export type DeepPathwayConfig = Record<Provider, Partial<Record<Chains, Partial<Record<Chains, Pathway>>>>>;
38
60
  export declare const pathways: DeepPathwayConfig;
39
61
  export declare const testnetPathways: DeepPathwayConfig;
62
+ /** Returns the valid bridge keys for the given is prod */
40
63
  export declare const validBridgeKeys: (isProd: boolean) => BridgeKey[];
64
+ /**
65
+ * Infers the bridge key from the current key, provider, from chain, and to chain
66
+ * @param currentKey - the current bridge key
67
+ * @param provider - the provider
68
+ * @param fromChain - the from chain
69
+ * @param toChain - the to chain
70
+ * @returns the inferred bridge key
71
+ */
41
72
  export declare const inferBridgeKey: ({ currentKey, provider, fromChain, toChain, }: {
42
73
  currentKey: BridgeKey;
43
74
  provider: Provider;
44
75
  fromChain?: Chains;
45
76
  toChain?: Chains;
46
77
  }) => BridgeKey;
47
- export declare const pathway: (bridgeKey: BridgeKey | null, isProd: boolean) => Pathway | undefined;
48
- export declare const defaultAssetIn: ($bridgeKey: BridgeKey | null, isProd: boolean) => Token | undefined;
78
+ /**
79
+ * Returns the pathway for the given bridge key, is prod, and asset in address
80
+ * @param bridgeKey - the bridge key
81
+ * @param isProd - whether to use the production pathway
82
+ * @param assetInAddress - the asset in address
83
+ * @returns the pathway
84
+ */
85
+ export declare const pathway: (bridgeKey: BridgeKey | null, isProd: boolean, assetInAddress?: string | Hex | null | undefined) => Pathway | undefined;
86
+ /**
87
+ * Returns the default asset in for the given bridge key and is prod
88
+ * @param bridgeKey - the bridge key
89
+ * @param isProd - whether to use the production pathway
90
+ * @returns the default asset in
91
+ */
92
+ export declare const defaultAssetIn: ($bridgeKey: BridgeKey | null, isProd: boolean) => `0x${string}` | null | undefined;
93
+ /**
94
+ * Returns whether the given asset is the native asset for the given bridge key
95
+ * @param asset - the asset
96
+ * @param bridgeKey - the bridge key
97
+ * @returns whether the given asset is the native asset for the given bridge key
98
+ */
49
99
  export declare const isNative: (asset: Token | TokenOut | null, bridgeKey: BridgeKey | null) => boolean;
50
- export declare const isUnwrappable: (asset: Pick<Token, "extensions"> | null, bridgeKey: BridgeKey | null) => boolean;
100
+ /**
101
+ * Returns whether the given asset is unwrappable for the given bridge key
102
+ * @param bridgeKey - the bridge key
103
+ * @param assetIn - the asset in
104
+ * @returns whether the given asset is unwrappable for the given bridge key
105
+ */
106
+ export declare const isUnwrappable: (bridgeKey: BridgeKey | null, assetIn: Pick<Token, "address"> | null) => boolean;
107
+ /**
108
+ * Returns whether the given asset can be unwrapped for the given bridge key
109
+ * @param bridgeKey - the bridge key
110
+ * @param assetIn - the asset in
111
+ * @returns boolean
112
+ */
51
113
  export declare const canChangeUnwrap: (bridgeKey: BridgeKey, assetIn: Token | null) => boolean;