@avalabs/bridge-unified 0.0.0-hello-world-20230824162438 → 0.0.0-project-fusion-pr-20260112192135
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/LICENSE +9 -0
- package/README.md +207 -4
- package/dist/index.cjs +38 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +388 -32
- package/dist/index.d.ts +388 -32
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/package.json +26 -10
- package/.turbo/turbo-build.log +0 -22
- package/.turbo/turbo-lint.log +0 -4
- package/CHANGELOG.md +0 -13
- package/src/errors/index.ts +0 -20
- package/src/handlers/check-for-pending-bridge-journey.ts +0 -20
- package/src/handlers/execute-bridge-journey-step.ts +0 -20
- package/src/handlers/plan-bridge-journey.ts +0 -25
- package/src/index.ts +0 -2
- package/src/unified-bridge-service.ts +0 -19
- package/tsconfig.json +0 -8
- package/tsup.config.ts +0 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,36 +1,392 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
4
|
+
type Chain = {
|
|
5
|
+
chainName: string;
|
|
6
|
+
chainId: string;
|
|
7
|
+
rpcUrl: string;
|
|
8
|
+
utilityAddresses?: {
|
|
9
|
+
multicall: Address;
|
|
10
|
+
};
|
|
11
|
+
networkToken: NativeAsset;
|
|
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;
|
|
31
|
+
|
|
32
|
+
declare enum Environment {
|
|
33
|
+
DEV = "dev",
|
|
34
|
+
PROD = "production",
|
|
35
|
+
STAGING = "staging",
|
|
36
|
+
TEST = "test"
|
|
37
|
+
}
|
|
38
|
+
|
|
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;
|
|
25
135
|
}[];
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
type Hex = `0x${string}`;
|
|
139
|
+
type EvmTransactionRequest = {
|
|
140
|
+
type?: number | null;
|
|
141
|
+
data?: Hex | null;
|
|
142
|
+
from: Hex;
|
|
143
|
+
gas?: bigint;
|
|
144
|
+
nonce?: number;
|
|
145
|
+
to?: Hex | null;
|
|
146
|
+
value?: bigint;
|
|
147
|
+
gasPrice?: bigint | null;
|
|
148
|
+
gasLimit?: bigint | null;
|
|
149
|
+
maxPriorityFeePerGas?: bigint | null;
|
|
150
|
+
maxFeePerGas?: bigint | null;
|
|
151
|
+
chainId?: string;
|
|
152
|
+
};
|
|
153
|
+
type EvmDispatch = (signedTxHash: Hex) => Promise<Hex>;
|
|
154
|
+
type EvmSign = (data: EvmTransactionRequest, dispatch: EvmDispatch, step: BridgeStepDetails) => Promise<Hex>;
|
|
155
|
+
type EvmSigner = {
|
|
156
|
+
sign: EvmSign;
|
|
157
|
+
};
|
|
158
|
+
type BtcTransactionRequest = {
|
|
159
|
+
inputs: BitcoinInputUTXO[];
|
|
160
|
+
outputs: BitcoinOutputUTXO[];
|
|
161
|
+
};
|
|
162
|
+
type BtcDispatch = (signedTxHash: string) => Promise<string>;
|
|
163
|
+
type BtcSign = (data: BtcTransactionRequest, dispatch: BtcDispatch, step: BridgeStepDetails) => Promise<string>;
|
|
164
|
+
type BtcSigner = {
|
|
165
|
+
sign: BtcSign;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
declare enum ErrorCode {
|
|
169
|
+
BRIDGE_NOT_AVAILABLE = 5001,
|
|
170
|
+
INITIALIZATION_FAILED = 5002,
|
|
171
|
+
INVALID_PARAMS = 5003,
|
|
172
|
+
TIMEOUT = 5004,
|
|
173
|
+
TRANSACTION_REVERTED = 5005
|
|
174
|
+
}
|
|
175
|
+
declare enum ErrorReason {
|
|
176
|
+
ASSET_NOT_SUPPORTED = "ASSET_NOT_SUPPORTED",// the provided asset is not supported by the bridge
|
|
177
|
+
CHAIN_NOT_SUPPORTED = "CHAIN_NOT_SUPPORTED",// the provided source or target chain is not supported by the bridge
|
|
178
|
+
CONFIG_NOT_AVAILABLE = "CONFIG_NOT_AVAILABLE",// error while fetching or parsing the config
|
|
179
|
+
CONFIRMATION_COUNT_UNKNOWN = "CONFIRMATION_COUNT_UNKNOWN",// required confirmation count of the source or target chain is unknown
|
|
180
|
+
ENVIRONMENT_NOT_SUPPORTED = "ENVIRONMENT_NOT_SUPPORTED",// bridge does not support specified environment
|
|
181
|
+
IDENTICAL_CHAINS_PROVIDED = "IDENTICAL_CHAINS_PROVIDED",// provided source and target chains are the same
|
|
182
|
+
INCORRECT_ADDRESS_PROVIDED = "INCORRECT_ADDRESS_PROVIDED",// the sender or recipient address is incorrect
|
|
183
|
+
INCORRECT_AMOUNT_PROVIDED = "INCORRECT_AMOUNT_PROVIDED",// the transfer amount is incorrect (e.g.: lesser than or equal to zero)
|
|
184
|
+
INCORRECT_HASH_PROVIDED = "INCORRECT_HASH_PROVIDED",// the transaction is not hex
|
|
185
|
+
INCORRECT_PROVIDER_PROVIDED = "INCORRECT_PROVIDER_PROVIDED",// The provided provider is incorrect type (Provider VS BitcoinProvider)
|
|
186
|
+
INCORRECT_SIGNER_PROVIDED = "INCORRECT_SIGNER_PROVIDED",// The provided signer is incorrect type
|
|
187
|
+
INCORRECT_TXHASH_PROVIDED = "INCORRECT_TXHASH_PROVIDED",// the sourceTxHash or targetTxHash is incorrect
|
|
188
|
+
INVALID_PARAMS = "INVALID_PARAMS",// generic error with the params
|
|
189
|
+
UNKNOWN = "UNKNOWN",// generic, not specified error
|
|
190
|
+
VULNERABLE_TOKEN_APPROVAL_ADDRESS = "VULNERABLE_TOKEN_APPROVAL_ADDRESS",// error when the address has token approvals for addresses involved in the multichain incident
|
|
191
|
+
WARDEN_CONFIG_MISMATCH = "WARDEN_CONFIG_MISMATCH",// error when warden config was not found or it is over the mismatch threshold
|
|
192
|
+
WARDEN_CONFIG_MISSING_NETWORK = "WARDEN_CONFIG_MISSING_NETWORK",// fetched warden config does not contain network IDs
|
|
193
|
+
ADDRESS_IS_BLOCKED = "ADDRESS_IS_BLOCKED"
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
type BridgeTransfer = {
|
|
197
|
+
type: BridgeType;
|
|
198
|
+
environment: Environment;
|
|
199
|
+
fromAddress: string;
|
|
200
|
+
toAddress: string;
|
|
201
|
+
amount: bigint;
|
|
202
|
+
asset: BridgeAsset;
|
|
203
|
+
completedAt?: number;
|
|
204
|
+
errorCode?: ErrorCode;
|
|
205
|
+
bridgeFee: bigint;
|
|
206
|
+
sourceChain: Chain;
|
|
207
|
+
sourceStartedAt: number;
|
|
208
|
+
sourceTxHash: string;
|
|
209
|
+
sourceNetworkFee?: bigint;
|
|
210
|
+
sourceConfirmationCount: number;
|
|
211
|
+
sourceRequiredConfirmationCount: number;
|
|
212
|
+
targetChain: Chain;
|
|
213
|
+
targetStartedAt?: number;
|
|
214
|
+
targetTxHash?: string;
|
|
215
|
+
targetNetworkFee?: bigint;
|
|
216
|
+
targetConfirmationCount: number;
|
|
217
|
+
targetRequiredConfirmationCount: number;
|
|
218
|
+
targetStartBlockNumber?: bigint;
|
|
219
|
+
metadata?: Record<string, unknown>;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
interface BitcoinFunctions {
|
|
223
|
+
getChainHeight: () => Promise<number>;
|
|
224
|
+
getUTXOs: (address: string, withScripts?: boolean) => Promise<{
|
|
225
|
+
confirmed: BitcoinInputUTXOWithOptionalScript[];
|
|
226
|
+
unconfirmed: BitcoinInputUTXOWithOptionalScript[];
|
|
227
|
+
}>;
|
|
228
|
+
getTransaction: (hash: string) => Promise<BitcoinTx>;
|
|
229
|
+
getFeeRates: () => Promise<{
|
|
230
|
+
low: number;
|
|
231
|
+
medium: number;
|
|
232
|
+
high: number;
|
|
233
|
+
}>;
|
|
234
|
+
getUtxoBalance: (address: string, withScripts?: boolean) => Promise<{
|
|
235
|
+
utxos: BitcoinInputUTXOWithOptionalScript[];
|
|
236
|
+
utxosUnconfirmed: BitcoinInputUTXOWithOptionalScript[];
|
|
237
|
+
}>;
|
|
238
|
+
getScriptsForUtxos: (utxos: BitcoinInputUTXOWithOptionalScript[]) => Promise<BitcoinInputUTXO[]>;
|
|
239
|
+
issueRawTx: (tx: string) => Promise<string>;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
declare enum BridgeType {
|
|
243
|
+
AVALANCHE_EVM = "avalanche-evm",
|
|
244
|
+
AVALANCHE_BTC_AVA = "avalanche-btc-ava",
|
|
245
|
+
AVALANCHE_AVA_BTC = "avalanche-ava-btc",
|
|
246
|
+
CCTP = "cctp",
|
|
247
|
+
ICTT_ERC20_ERC20 = "ictt-erc20-erc20"
|
|
248
|
+
}
|
|
249
|
+
declare const BTC_BRIDGE_TYPES: readonly [BridgeType.AVALANCHE_AVA_BTC, BridgeType.AVALANCHE_BTC_AVA];
|
|
250
|
+
declare const EVM_BRIDGE_TYPES: readonly [BridgeType.AVALANCHE_EVM, BridgeType.CCTP, BridgeType.ICTT_ERC20_ERC20];
|
|
251
|
+
type ArrayElement<A> = A extends readonly (infer T)[] ? T : never;
|
|
252
|
+
type EvmBridgeInitializer = {
|
|
253
|
+
type: ArrayElement<typeof EVM_BRIDGE_TYPES>;
|
|
254
|
+
signer: EvmSigner;
|
|
255
|
+
};
|
|
256
|
+
type AvaToBtcBridgeInitializer = {
|
|
257
|
+
type: BridgeType.AVALANCHE_AVA_BTC;
|
|
258
|
+
signer: EvmSigner;
|
|
259
|
+
bitcoinFunctions: BitcoinFunctions;
|
|
260
|
+
};
|
|
261
|
+
type BtcToAvaBridgeInitializer = {
|
|
262
|
+
type: BridgeType.AVALANCHE_BTC_AVA;
|
|
263
|
+
signer: BtcSigner;
|
|
264
|
+
bitcoinFunctions: BitcoinFunctions;
|
|
265
|
+
};
|
|
266
|
+
type BridgeInitializer = EvmBridgeInitializer | AvaToBtcBridgeInitializer | BtcToAvaBridgeInitializer;
|
|
267
|
+
declare const isEvmBridgeInitializer: (initializer: BridgeInitializer) => initializer is EvmBridgeInitializer;
|
|
268
|
+
declare const isAvaToBtcBridgeInitializer: (initializer: BridgeInitializer) => initializer is AvaToBtcBridgeInitializer;
|
|
269
|
+
declare const isBtcToAvaBridgeInitializer: (initializer: BridgeInitializer) => initializer is BtcToAvaBridgeInitializer;
|
|
270
|
+
type FeeParams = {
|
|
271
|
+
asset: BridgeAsset;
|
|
272
|
+
amount: bigint;
|
|
273
|
+
sourceChain: Chain;
|
|
274
|
+
targetChain: Chain;
|
|
275
|
+
};
|
|
276
|
+
declare enum BridgeSignatureReason {
|
|
277
|
+
AllowanceApproval = "allowance-approval",
|
|
278
|
+
TokensTransfer = "tokens-transfer",
|
|
279
|
+
WrapToken = "wrap-token"
|
|
280
|
+
}
|
|
281
|
+
type BridgeStepDetails = {
|
|
282
|
+
currentSignature: number;
|
|
283
|
+
requiredSignatures: number;
|
|
284
|
+
currentSignatureReason: BridgeSignatureReason;
|
|
285
|
+
};
|
|
286
|
+
type GasSettings = {
|
|
287
|
+
price: bigint;
|
|
288
|
+
tip?: bigint;
|
|
34
289
|
};
|
|
290
|
+
type TransferParams = {
|
|
291
|
+
asset: BridgeAsset;
|
|
292
|
+
amount: bigint;
|
|
293
|
+
fromAddress: string;
|
|
294
|
+
toAddress: string;
|
|
295
|
+
sourceChain: Chain;
|
|
296
|
+
targetChain: Chain;
|
|
297
|
+
gasSettings?: GasSettings;
|
|
298
|
+
onStepChange?: (stepDetails: BridgeStepDetails) => void;
|
|
299
|
+
};
|
|
300
|
+
type GasEstimationParams = Omit<TransferParams, 'onStepChange' | 'toAddress'>;
|
|
301
|
+
type TrackingParams = {
|
|
302
|
+
bridgeTransfer: BridgeTransfer;
|
|
303
|
+
updateListener: (transfer: BridgeTransfer) => void;
|
|
304
|
+
};
|
|
305
|
+
type AnalyzeTxParams = {
|
|
306
|
+
chainId: string;
|
|
307
|
+
from: string;
|
|
308
|
+
to: string;
|
|
309
|
+
tokenTransfers: {
|
|
310
|
+
from?: string;
|
|
311
|
+
to?: string;
|
|
312
|
+
symbol: string;
|
|
313
|
+
}[];
|
|
314
|
+
};
|
|
315
|
+
type AnalyzeTxResult = {
|
|
316
|
+
isBridgeTx: true;
|
|
317
|
+
bridgeType: BridgeType;
|
|
318
|
+
sourceChainId?: string;
|
|
319
|
+
targetChainId?: string;
|
|
320
|
+
} | {
|
|
321
|
+
isBridgeTx: false;
|
|
322
|
+
};
|
|
323
|
+
type BridgeService = {
|
|
324
|
+
type: BridgeType;
|
|
325
|
+
analyzeTx: (params: AnalyzeTxParams) => AnalyzeTxResult;
|
|
326
|
+
estimateGas: (params: GasEstimationParams) => Promise<bigint>;
|
|
327
|
+
estimateReceiveAmount: (params: GasEstimationParams) => Promise<{
|
|
328
|
+
asset: Asset;
|
|
329
|
+
amount: bigint;
|
|
330
|
+
}>;
|
|
331
|
+
transferAsset: (params: TransferParams) => Promise<BridgeTransfer>;
|
|
332
|
+
trackTransfer: (transfer: TrackingParams) => {
|
|
333
|
+
cancel: () => void;
|
|
334
|
+
result: Promise<BridgeTransfer>;
|
|
335
|
+
};
|
|
336
|
+
getAssets: () => ChainAssetMap;
|
|
337
|
+
getFees: (params: FeeParams) => Promise<AssetFeeMap>;
|
|
338
|
+
getMinimumTransferAmount: (params: FeeParams) => Promise<bigint>;
|
|
339
|
+
};
|
|
340
|
+
type BridgeServiceFactory = (environment: Environment) => Promise<BridgeService>;
|
|
341
|
+
|
|
342
|
+
declare enum TokenType {
|
|
343
|
+
NATIVE = "native",
|
|
344
|
+
ERC20 = "erc20"
|
|
345
|
+
}
|
|
346
|
+
type BaseAsset = {
|
|
347
|
+
name: string;
|
|
348
|
+
symbol: string;
|
|
349
|
+
decimals: number;
|
|
350
|
+
};
|
|
351
|
+
type Erc20Asset = BaseAsset & {
|
|
352
|
+
type: TokenType.ERC20;
|
|
353
|
+
address: Address;
|
|
354
|
+
};
|
|
355
|
+
type NativeAsset = BaseAsset & {
|
|
356
|
+
type: TokenType.NATIVE;
|
|
357
|
+
};
|
|
358
|
+
declare const isErc20Asset: (asset: Asset) => asset is Erc20Asset;
|
|
359
|
+
declare const isNativeAsset: (asset: Asset) => asset is NativeAsset;
|
|
360
|
+
type Asset = Erc20Asset | NativeAsset;
|
|
361
|
+
type DestinationInfo = Record<string, BridgeType[]>;
|
|
362
|
+
type BridgeAsset = Asset & {
|
|
363
|
+
destinations: DestinationInfo;
|
|
364
|
+
};
|
|
365
|
+
type ChainAssetMap = Record<string, BridgeAsset[]>;
|
|
366
|
+
type AssetFeeMap = Record<string, Partial<Record<Address | 'NATIVE', bigint>>>;
|
|
367
|
+
|
|
368
|
+
type BridgeServicesMap = Map<BridgeType, BridgeService>;
|
|
369
|
+
type BridgeServiceConfig = {
|
|
370
|
+
environment: Environment;
|
|
371
|
+
enabledBridgeServices: BridgeServicesMap;
|
|
372
|
+
};
|
|
373
|
+
type UnifiedBridgeService = Omit<BridgeService, 'type'> & {
|
|
374
|
+
canTransferAsset: (asset: BridgeAsset, targetChainId: string) => boolean;
|
|
375
|
+
environment: Environment;
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
declare const createUnifiedBridgeService: ({ environment, enabledBridgeServices }: BridgeServiceConfig) => UnifiedBridgeService;
|
|
379
|
+
|
|
380
|
+
type Caip2ChainId = {
|
|
381
|
+
namespace: string;
|
|
382
|
+
reference: string;
|
|
383
|
+
};
|
|
384
|
+
declare const _default: {
|
|
385
|
+
toJSON: (identifier: string) => Caip2ChainId;
|
|
386
|
+
toString: ({ namespace, reference }: Caip2ChainId) => string;
|
|
387
|
+
toEip155HexChainId: ({ namespace, reference }: Caip2ChainId) => string;
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
declare const getEnabledBridgeServices: (environment: Environment, enabledBridgeInitializers: BridgeInitializer[]) => Promise<BridgeServicesMap>;
|
|
35
391
|
|
|
36
|
-
export { BridgeServiceConfig, createUnifiedBridgeService };
|
|
392
|
+
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 };
|