@avalabs/bridge-unified 2.1.2 → 3.1.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 +81 -13
- package/dist/index.cjs +36 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +254 -55
- package/dist/index.d.ts +254 -55
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/package.json +8 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Address } from 'viem';
|
|
2
|
+
import { z } from 'zod';
|
|
2
3
|
|
|
3
4
|
type Chain = {
|
|
4
5
|
chainName: string;
|
|
@@ -7,28 +8,135 @@ type Chain = {
|
|
|
7
8
|
utilityAddresses?: {
|
|
8
9
|
multicall: Address;
|
|
9
10
|
};
|
|
10
|
-
networkToken:
|
|
11
|
+
networkToken: NativeAsset;
|
|
11
12
|
};
|
|
13
|
+
declare enum AvalancheChainIds {
|
|
14
|
+
FUJI = "eip155:43113",
|
|
15
|
+
MAINNET = "eip155:43114"
|
|
16
|
+
}
|
|
17
|
+
declare enum EthereumChainIds {
|
|
18
|
+
MAINNET = "eip155:1",
|
|
19
|
+
SEPOLIA = "eip155:11155111"
|
|
20
|
+
}
|
|
21
|
+
declare enum BitcoinChainIds {
|
|
22
|
+
MAINNET = "bip122:000000000019d6689c085ae165831e93",
|
|
23
|
+
TESTNET = "bip122:000000000933ea01ad0ee984209779ba"
|
|
24
|
+
}
|
|
25
|
+
declare const AVALANCHE_FUJI_CHAIN: Chain;
|
|
26
|
+
declare const AVALANCHE_MAINNET_CHAIN: Chain;
|
|
27
|
+
declare const ETHEREUM_SEPOLIA_CHAIN: Chain;
|
|
28
|
+
declare const ETHEREUM_MAINNET_CHAIN: Chain;
|
|
29
|
+
declare const BITCOIN_TESTNET_CHAIN: Chain;
|
|
30
|
+
declare const BITCOIN_MAINNET_CHAIN: Chain;
|
|
12
31
|
|
|
13
32
|
declare enum Environment {
|
|
33
|
+
DEV = "dev",
|
|
14
34
|
PROD = "production",
|
|
35
|
+
STAGING = "staging",
|
|
15
36
|
TEST = "test"
|
|
16
37
|
}
|
|
17
38
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Custom Bitcoin UTXO interface.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
declare const BitcoinInputUTXO: z.ZodObject<{
|
|
44
|
+
txHash: z.ZodString;
|
|
45
|
+
txHex: z.ZodOptional<z.ZodString>;
|
|
46
|
+
index: z.ZodNumber;
|
|
47
|
+
value: z.ZodNumber;
|
|
48
|
+
script: z.ZodString;
|
|
49
|
+
blockHeight: z.ZodNumber;
|
|
50
|
+
confirmations: z.ZodNumber;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
txHash: string;
|
|
53
|
+
value: number;
|
|
54
|
+
index: number;
|
|
55
|
+
script: string;
|
|
56
|
+
blockHeight: number;
|
|
57
|
+
confirmations: number;
|
|
58
|
+
txHex?: string | undefined;
|
|
59
|
+
}, {
|
|
60
|
+
txHash: string;
|
|
61
|
+
value: number;
|
|
62
|
+
index: number;
|
|
63
|
+
script: string;
|
|
64
|
+
blockHeight: number;
|
|
65
|
+
confirmations: number;
|
|
66
|
+
txHex?: string | undefined;
|
|
67
|
+
}>;
|
|
68
|
+
type BitcoinInputUTXO = typeof BitcoinInputUTXO._output;
|
|
69
|
+
declare const BitcoinInputUTXOWithOptionalScript: z.ZodObject<z.objectUtil.extendShape<{
|
|
70
|
+
txHash: z.ZodString;
|
|
71
|
+
txHex: z.ZodOptional<z.ZodString>;
|
|
72
|
+
index: z.ZodNumber;
|
|
73
|
+
value: z.ZodNumber;
|
|
74
|
+
script: z.ZodString;
|
|
75
|
+
blockHeight: z.ZodNumber;
|
|
76
|
+
confirmations: z.ZodNumber;
|
|
77
|
+
}, {
|
|
78
|
+
script: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}>, "strip", z.ZodTypeAny, {
|
|
80
|
+
txHash: string;
|
|
81
|
+
value: number;
|
|
82
|
+
index: number;
|
|
83
|
+
blockHeight: number;
|
|
84
|
+
confirmations: number;
|
|
85
|
+
txHex?: string | undefined;
|
|
86
|
+
script?: string | undefined;
|
|
87
|
+
}, {
|
|
88
|
+
txHash: string;
|
|
89
|
+
value: number;
|
|
90
|
+
index: number;
|
|
91
|
+
blockHeight: number;
|
|
92
|
+
confirmations: number;
|
|
93
|
+
txHex?: string | undefined;
|
|
94
|
+
script?: string | undefined;
|
|
95
|
+
}>;
|
|
96
|
+
type BitcoinInputUTXOWithOptionalScript = typeof BitcoinInputUTXOWithOptionalScript._output;
|
|
97
|
+
/**
|
|
98
|
+
* Used for defining outputs when creating a transaction.
|
|
99
|
+
*/
|
|
100
|
+
declare const BitcoinOutputUTXO: z.ZodObject<{
|
|
101
|
+
address: z.ZodString;
|
|
102
|
+
value: z.ZodNumber;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
value: number;
|
|
105
|
+
address: string;
|
|
106
|
+
}, {
|
|
107
|
+
value: number;
|
|
108
|
+
address: string;
|
|
109
|
+
}>;
|
|
110
|
+
type BitcoinOutputUTXO = typeof BitcoinOutputUTXO._output;
|
|
111
|
+
interface BitcoinTx {
|
|
112
|
+
hash: string;
|
|
113
|
+
fees: number;
|
|
114
|
+
block: number;
|
|
115
|
+
amount: number;
|
|
116
|
+
confirmations: number;
|
|
117
|
+
blockTime: number;
|
|
118
|
+
addresses: string[];
|
|
119
|
+
inputs: {
|
|
120
|
+
txid: string;
|
|
121
|
+
vout: number;
|
|
122
|
+
sequence: number;
|
|
123
|
+
n: number;
|
|
124
|
+
addresses: string[];
|
|
125
|
+
isAddress: boolean;
|
|
126
|
+
value: number;
|
|
127
|
+
}[];
|
|
128
|
+
outputs: {
|
|
129
|
+
addresses: string[];
|
|
130
|
+
value: number;
|
|
131
|
+
n: number;
|
|
132
|
+
spent: boolean;
|
|
133
|
+
hex: string;
|
|
134
|
+
isAddress: boolean;
|
|
135
|
+
}[];
|
|
136
|
+
}
|
|
29
137
|
|
|
30
138
|
type Hex = `0x${string}`;
|
|
31
|
-
type
|
|
139
|
+
type EvmTransactionRequest = {
|
|
32
140
|
type?: number | null;
|
|
33
141
|
data?: Hex | null;
|
|
34
142
|
from: Hex;
|
|
@@ -41,8 +149,20 @@ type TransactionRequest = {
|
|
|
41
149
|
maxPriorityFeePerGas?: bigint | null;
|
|
42
150
|
maxFeePerGas?: bigint | null;
|
|
43
151
|
};
|
|
44
|
-
type
|
|
45
|
-
type
|
|
152
|
+
type EvmDispatch = (signedTxHash: Hex) => Promise<Hex>;
|
|
153
|
+
type EvmSign = (data: EvmTransactionRequest, dispatch: EvmDispatch, step: BridgeStepDetails) => Promise<Hex>;
|
|
154
|
+
type EvmSigner = {
|
|
155
|
+
sign: EvmSign;
|
|
156
|
+
};
|
|
157
|
+
type BtcTransactionRequest = {
|
|
158
|
+
inputs: BitcoinInputUTXO[];
|
|
159
|
+
outputs: BitcoinOutputUTXO[];
|
|
160
|
+
};
|
|
161
|
+
type BtcDispatch = (signedTxHash: string) => Promise<string>;
|
|
162
|
+
type BtcSign = (data: BtcTransactionRequest, dispatch: BtcDispatch, step: BridgeStepDetails) => Promise<string>;
|
|
163
|
+
type BtcSigner = {
|
|
164
|
+
sign: BtcSign;
|
|
165
|
+
};
|
|
46
166
|
|
|
47
167
|
declare enum ErrorCode {
|
|
48
168
|
BRIDGE_NOT_AVAILABLE = 5001,
|
|
@@ -52,15 +172,24 @@ declare enum ErrorCode {
|
|
|
52
172
|
TRANSACTION_REVERTED = 5005
|
|
53
173
|
}
|
|
54
174
|
declare enum ErrorReason {
|
|
55
|
-
|
|
175
|
+
ASSET_NOT_SUPPORTED = "ASSET_NOT_SUPPORTED",
|
|
176
|
+
CHAIN_NOT_SUPPORTED = "CHAIN_NOT_SUPPORTED",
|
|
56
177
|
CONFIG_NOT_AVAILABLE = "CONFIG_NOT_AVAILABLE",
|
|
57
|
-
|
|
178
|
+
CONFIRMATION_COUNT_UNKNOWN = "CONFIRMATION_COUNT_UNKNOWN",
|
|
179
|
+
ENVIRONMENT_NOT_SUPPORTED = "ENVIRONMENT_NOT_SUPPORTED",
|
|
58
180
|
IDENTICAL_CHAINS_PROVIDED = "IDENTICAL_CHAINS_PROVIDED",
|
|
59
|
-
INCORRECT_AMOUNT_PROVIDED = "INCORRECT_AMOUNT_PROVIDED",
|
|
60
181
|
INCORRECT_ADDRESS_PROVIDED = "INCORRECT_ADDRESS_PROVIDED",
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
182
|
+
INCORRECT_AMOUNT_PROVIDED = "INCORRECT_AMOUNT_PROVIDED",
|
|
183
|
+
INCORRECT_HASH_PROVIDED = "INCORRECT_HASH_PROVIDED",
|
|
184
|
+
INCORRECT_PROVIDER_PROVIDED = "INCORRECT_PROVIDER_PROVIDED",
|
|
185
|
+
INCORRECT_SIGNER_PROVIDED = "INCORRECT_SIGNER_PROVIDED",
|
|
186
|
+
INCORRECT_TXHASH_PROVIDED = "INCORRECT_TXHASH_PROVIDED",
|
|
187
|
+
INVALID_PARAMS = "INVALID_PARAMS",
|
|
188
|
+
UNKNOWN = "UNKNOWN",
|
|
189
|
+
VULNERABLE_TOKEN_APPROVAL_ADDRESS = "VULNERABLE_TOKEN_APPROVAL_ADDRESS",
|
|
190
|
+
WARDEN_CONFIG_MISMATCH = "WARDEN_CONFIG_MISMATCH",
|
|
191
|
+
WARDEN_CONFIG_MISSING_NETWORK = "WARDEN_CONFIG_MISSING_NETWORK",
|
|
192
|
+
ADDRESS_IS_BLOCKED = "ADDRESS_IS_BLOCKED"
|
|
64
193
|
}
|
|
65
194
|
|
|
66
195
|
type BridgeTransfer = {
|
|
@@ -69,8 +198,7 @@ type BridgeTransfer = {
|
|
|
69
198
|
fromAddress: string;
|
|
70
199
|
toAddress: string;
|
|
71
200
|
amount: bigint;
|
|
72
|
-
|
|
73
|
-
symbol: string;
|
|
201
|
+
asset: BridgeAsset;
|
|
74
202
|
completedAt?: number;
|
|
75
203
|
errorCode?: ErrorCode;
|
|
76
204
|
bridgeFee: bigint;
|
|
@@ -79,64 +207,134 @@ type BridgeTransfer = {
|
|
|
79
207
|
sourceTxHash: string;
|
|
80
208
|
sourceNetworkFee?: bigint;
|
|
81
209
|
sourceConfirmationCount: number;
|
|
82
|
-
|
|
210
|
+
sourceRequiredConfirmationCount: number;
|
|
83
211
|
targetChain: Chain;
|
|
84
212
|
targetStartedAt?: number;
|
|
85
213
|
targetTxHash?: string;
|
|
86
214
|
targetNetworkFee?: bigint;
|
|
87
215
|
targetConfirmationCount: number;
|
|
88
|
-
|
|
89
|
-
|
|
216
|
+
targetRequiredConfirmationCount: number;
|
|
217
|
+
targetStartBlockNumber?: bigint;
|
|
90
218
|
metadata?: Record<string, unknown>;
|
|
91
219
|
};
|
|
92
220
|
|
|
221
|
+
interface BitcoinFunctions {
|
|
222
|
+
getChainHeight: () => Promise<number>;
|
|
223
|
+
getUTXOs: (address: string, withScripts?: boolean) => Promise<{
|
|
224
|
+
confirmed: BitcoinInputUTXOWithOptionalScript[];
|
|
225
|
+
unconfirmed: BitcoinInputUTXOWithOptionalScript[];
|
|
226
|
+
}>;
|
|
227
|
+
getTransaction: (hash: string) => Promise<BitcoinTx>;
|
|
228
|
+
getFeeRates: () => Promise<{
|
|
229
|
+
low: number;
|
|
230
|
+
medium: number;
|
|
231
|
+
high: number;
|
|
232
|
+
}>;
|
|
233
|
+
getUtxoBalance: (address: string, withScripts?: boolean) => Promise<{
|
|
234
|
+
utxos: BitcoinInputUTXOWithOptionalScript[];
|
|
235
|
+
utxosUnconfirmed: BitcoinInputUTXOWithOptionalScript[];
|
|
236
|
+
}>;
|
|
237
|
+
getScriptsForUtxos: (utxos: BitcoinInputUTXOWithOptionalScript[]) => Promise<BitcoinInputUTXO[]>;
|
|
238
|
+
issueRawTx: (tx: string) => Promise<string>;
|
|
239
|
+
}
|
|
240
|
+
|
|
93
241
|
declare enum BridgeType {
|
|
94
|
-
|
|
242
|
+
AVALANCHE_EVM = "avalanche-evm",
|
|
243
|
+
AVALANCHE_BTC_AVA = "avalanche-btc-ava",
|
|
244
|
+
AVALANCHE_AVA_BTC = "avalanche-ava-btc",
|
|
245
|
+
CCTP = "cctp",
|
|
246
|
+
ICTT_ERC20_ERC20 = "ictt-erc20-erc20"
|
|
95
247
|
}
|
|
248
|
+
declare const BTC_BRIDGE_TYPES: readonly [BridgeType.AVALANCHE_AVA_BTC, BridgeType.AVALANCHE_BTC_AVA];
|
|
249
|
+
declare const EVM_BRIDGE_TYPES: readonly [BridgeType.AVALANCHE_EVM, BridgeType.CCTP, BridgeType.ICTT_ERC20_ERC20];
|
|
250
|
+
type ArrayElement<A> = A extends readonly (infer T)[] ? T : never;
|
|
251
|
+
type EvmBridgeInitializer = {
|
|
252
|
+
type: ArrayElement<typeof EVM_BRIDGE_TYPES>;
|
|
253
|
+
signer: EvmSigner;
|
|
254
|
+
};
|
|
255
|
+
type AvaToBtcBridgeInitializer = {
|
|
256
|
+
type: BridgeType.AVALANCHE_AVA_BTC;
|
|
257
|
+
signer: EvmSigner;
|
|
258
|
+
bitcoinFunctions: BitcoinFunctions;
|
|
259
|
+
};
|
|
260
|
+
type BtcToAvaBridgeInitializer = {
|
|
261
|
+
type: BridgeType.AVALANCHE_BTC_AVA;
|
|
262
|
+
signer: BtcSigner;
|
|
263
|
+
bitcoinFunctions: BitcoinFunctions;
|
|
264
|
+
};
|
|
265
|
+
type BridgeInitializer = EvmBridgeInitializer | AvaToBtcBridgeInitializer | BtcToAvaBridgeInitializer;
|
|
266
|
+
declare const isEvmBridgeInitializer: (initializer: BridgeInitializer) => initializer is EvmBridgeInitializer;
|
|
267
|
+
declare const isAvaToBtcBridgeInitializer: (initializer: BridgeInitializer) => initializer is AvaToBtcBridgeInitializer;
|
|
268
|
+
declare const isBtcToAvaBridgeInitializer: (initializer: BridgeInitializer) => initializer is BtcToAvaBridgeInitializer;
|
|
96
269
|
type FeeParams = {
|
|
97
270
|
asset: BridgeAsset;
|
|
98
271
|
amount: bigint;
|
|
99
272
|
sourceChain: Chain;
|
|
100
273
|
targetChain: Chain;
|
|
101
|
-
provider?: Provider;
|
|
102
274
|
};
|
|
103
275
|
declare enum BridgeSignatureReason {
|
|
104
276
|
AllowanceApproval = "allowance-approval",
|
|
105
|
-
TokensTransfer = "tokens-transfer"
|
|
277
|
+
TokensTransfer = "tokens-transfer",
|
|
278
|
+
WrapToken = "wrap-token"
|
|
106
279
|
}
|
|
107
280
|
type BridgeStepDetails = {
|
|
108
281
|
currentSignature: number;
|
|
109
282
|
requiredSignatures: number;
|
|
110
283
|
currentSignatureReason: BridgeSignatureReason;
|
|
111
284
|
};
|
|
285
|
+
type GasSettings = {
|
|
286
|
+
price: bigint;
|
|
287
|
+
tip?: bigint;
|
|
288
|
+
};
|
|
112
289
|
type TransferParams = {
|
|
113
290
|
asset: BridgeAsset;
|
|
114
291
|
amount: bigint;
|
|
115
292
|
fromAddress: string;
|
|
116
|
-
toAddress
|
|
293
|
+
toAddress: string;
|
|
117
294
|
sourceChain: Chain;
|
|
118
295
|
targetChain: Chain;
|
|
119
|
-
|
|
120
|
-
targetProvider?: Provider;
|
|
296
|
+
gasSettings?: GasSettings;
|
|
121
297
|
onStepChange?: (stepDetails: BridgeStepDetails) => void;
|
|
122
|
-
sign?: Signer;
|
|
123
298
|
};
|
|
299
|
+
type GasEstimationParams = Omit<TransferParams, 'onStepChange' | 'toAddress'>;
|
|
124
300
|
type TrackingParams = {
|
|
125
301
|
bridgeTransfer: BridgeTransfer;
|
|
126
|
-
sourceProvider?: Provider;
|
|
127
|
-
targetProvider?: Provider;
|
|
128
302
|
updateListener: (transfer: BridgeTransfer) => void;
|
|
129
303
|
};
|
|
304
|
+
type AnalyzeTxParams = {
|
|
305
|
+
chainId: string;
|
|
306
|
+
from: string;
|
|
307
|
+
to: string;
|
|
308
|
+
tokenTransfers: {
|
|
309
|
+
from?: string;
|
|
310
|
+
to?: string;
|
|
311
|
+
symbol: string;
|
|
312
|
+
}[];
|
|
313
|
+
};
|
|
314
|
+
type AnalyzeTxResult = {
|
|
315
|
+
isBridgeTx: true;
|
|
316
|
+
bridgeType: BridgeType;
|
|
317
|
+
sourceChainId?: string;
|
|
318
|
+
targetChainId?: string;
|
|
319
|
+
} | {
|
|
320
|
+
isBridgeTx: false;
|
|
321
|
+
};
|
|
130
322
|
type BridgeService = {
|
|
131
323
|
type: BridgeType;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
324
|
+
analyzeTx: (params: AnalyzeTxParams) => AnalyzeTxResult;
|
|
325
|
+
estimateGas: (params: GasEstimationParams) => Promise<bigint>;
|
|
326
|
+
estimateReceiveAmount: (params: GasEstimationParams) => Promise<{
|
|
327
|
+
asset: Asset;
|
|
328
|
+
amount: bigint;
|
|
329
|
+
}>;
|
|
135
330
|
transferAsset: (params: TransferParams) => Promise<BridgeTransfer>;
|
|
136
331
|
trackTransfer: (transfer: TrackingParams) => {
|
|
137
332
|
cancel: () => void;
|
|
138
333
|
result: Promise<BridgeTransfer>;
|
|
139
334
|
};
|
|
335
|
+
getAssets: () => ChainAssetMap;
|
|
336
|
+
getFees: (params: FeeParams) => Promise<AssetFeeMap>;
|
|
337
|
+
getMinimumTransferAmount: (params: FeeParams) => Promise<bigint>;
|
|
140
338
|
};
|
|
141
339
|
type BridgeServiceFactory = (environment: Environment) => Promise<BridgeService>;
|
|
142
340
|
|
|
@@ -144,39 +342,40 @@ declare enum TokenType {
|
|
|
144
342
|
NATIVE = "native",
|
|
145
343
|
ERC20 = "erc20"
|
|
146
344
|
}
|
|
147
|
-
type
|
|
148
|
-
type: TokenType;
|
|
149
|
-
address?: Address;
|
|
345
|
+
type BaseAsset = {
|
|
150
346
|
name: string;
|
|
151
347
|
symbol: string;
|
|
152
348
|
decimals: number;
|
|
153
349
|
};
|
|
350
|
+
type Erc20Asset = BaseAsset & {
|
|
351
|
+
type: TokenType.ERC20;
|
|
352
|
+
address: Address;
|
|
353
|
+
};
|
|
354
|
+
type NativeAsset = BaseAsset & {
|
|
355
|
+
type: TokenType.NATIVE;
|
|
356
|
+
};
|
|
357
|
+
declare const isErc20Asset: (asset: Asset) => asset is Erc20Asset;
|
|
358
|
+
declare const isNativeAsset: (asset: Asset) => asset is NativeAsset;
|
|
359
|
+
type Asset = Erc20Asset | NativeAsset;
|
|
154
360
|
type DestinationInfo = Record<string, BridgeType[]>;
|
|
155
361
|
type BridgeAsset = Asset & {
|
|
156
362
|
destinations: DestinationInfo;
|
|
157
363
|
};
|
|
158
364
|
type ChainAssetMap = Record<string, BridgeAsset[]>;
|
|
159
|
-
type AssetFeeMap = Record<Address, bigint
|
|
365
|
+
type AssetFeeMap = Partial<Record<Address | 'NATIVE', bigint>>;
|
|
160
366
|
|
|
161
367
|
type BridgeServicesMap = Map<BridgeType, BridgeService>;
|
|
162
368
|
type BridgeServiceConfig = {
|
|
163
369
|
environment: Environment;
|
|
164
370
|
enabledBridgeServices: BridgeServicesMap;
|
|
165
371
|
};
|
|
166
|
-
|
|
167
|
-
declare const createUnifiedBridgeService: ({ environment, enabledBridgeServices }: BridgeServiceConfig) => {
|
|
168
|
-
environment: Environment;
|
|
169
|
-
getAssets: () => Promise<ChainAssetMap>;
|
|
170
|
-
getFees: (params: FeeParams) => Promise<AssetFeeMap>;
|
|
171
|
-
estimateGas: (params: TransferParams) => Promise<bigint>;
|
|
372
|
+
type UnifiedBridgeService = Omit<BridgeService, 'type'> & {
|
|
172
373
|
canTransferAsset: (asset: BridgeAsset, targetChainId: string) => boolean;
|
|
173
|
-
|
|
174
|
-
trackTransfer: (params: TrackingParams) => {
|
|
175
|
-
cancel: () => void;
|
|
176
|
-
result: Promise<BridgeTransfer>;
|
|
177
|
-
};
|
|
374
|
+
environment: Environment;
|
|
178
375
|
};
|
|
179
376
|
|
|
377
|
+
declare const createUnifiedBridgeService: ({ environment, enabledBridgeServices }: BridgeServiceConfig) => UnifiedBridgeService;
|
|
378
|
+
|
|
180
379
|
type Caip2ChainId = {
|
|
181
380
|
namespace: string;
|
|
182
381
|
reference: string;
|
|
@@ -186,6 +385,6 @@ declare const _default: {
|
|
|
186
385
|
toString: ({ namespace, reference }: Caip2ChainId) => string;
|
|
187
386
|
};
|
|
188
387
|
|
|
189
|
-
declare const getEnabledBridgeServices: (environment: Environment,
|
|
388
|
+
declare const getEnabledBridgeServices: (environment: Environment, enabledBridgeInitializers: BridgeInitializer[]) => Promise<BridgeServicesMap>;
|
|
190
389
|
|
|
191
|
-
export { Asset, AssetFeeMap, BridgeAsset, BridgeService, BridgeServiceConfig, BridgeServiceFactory, BridgeServicesMap, BridgeSignatureReason, BridgeStepDetails, BridgeTransfer, BridgeType, Chain, ChainAssetMap, DestinationInfo,
|
|
390
|
+
export { AVALANCHE_FUJI_CHAIN, AVALANCHE_MAINNET_CHAIN, AnalyzeTxParams, AnalyzeTxResult, ArrayElement, Asset, AssetFeeMap, AvaToBtcBridgeInitializer, AvalancheChainIds, BITCOIN_MAINNET_CHAIN, BITCOIN_TESTNET_CHAIN, BTC_BRIDGE_TYPES, BitcoinChainIds, BitcoinFunctions, BitcoinInputUTXO, BitcoinInputUTXOWithOptionalScript, BitcoinTx, BridgeAsset, BridgeInitializer, BridgeService, BridgeServiceConfig, BridgeServiceFactory, BridgeServicesMap, BridgeSignatureReason, BridgeStepDetails, BridgeTransfer, BridgeType, BtcDispatch, BtcSign, BtcSigner, BtcToAvaBridgeInitializer, BtcTransactionRequest, Chain, ChainAssetMap, DestinationInfo, ETHEREUM_MAINNET_CHAIN, ETHEREUM_SEPOLIA_CHAIN, EVM_BRIDGE_TYPES, Environment, Erc20Asset, ErrorCode, ErrorReason, EthereumChainIds, EvmBridgeInitializer, EvmDispatch, EvmSign, EvmSigner, EvmTransactionRequest, FeeParams, GasEstimationParams, GasSettings, Hex, NativeAsset, TokenType, TrackingParams, TransferParams, UnifiedBridgeService, _default as caip2, createUnifiedBridgeService, getEnabledBridgeServices, isAvaToBtcBridgeInitializer, isBtcToAvaBridgeInitializer, isErc20Asset, isEvmBridgeInitializer, isNativeAsset };
|