@avalabs/bridge-unified 3.0.0 → 3.1.1
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/index.cjs +25 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -148,9 +148,10 @@ type EvmTransactionRequest = {
|
|
|
148
148
|
gasLimit?: bigint | null;
|
|
149
149
|
maxPriorityFeePerGas?: bigint | null;
|
|
150
150
|
maxFeePerGas?: bigint | null;
|
|
151
|
+
chainId?: string;
|
|
151
152
|
};
|
|
152
153
|
type EvmDispatch = (signedTxHash: Hex) => Promise<Hex>;
|
|
153
|
-
type EvmSign = (data: EvmTransactionRequest, dispatch: EvmDispatch) => Promise<Hex>;
|
|
154
|
+
type EvmSign = (data: EvmTransactionRequest, dispatch: EvmDispatch, step: BridgeStepDetails) => Promise<Hex>;
|
|
154
155
|
type EvmSigner = {
|
|
155
156
|
sign: EvmSign;
|
|
156
157
|
};
|
|
@@ -159,7 +160,7 @@ type BtcTransactionRequest = {
|
|
|
159
160
|
outputs: BitcoinOutputUTXO[];
|
|
160
161
|
};
|
|
161
162
|
type BtcDispatch = (signedTxHash: string) => Promise<string>;
|
|
162
|
-
type BtcSign = (data: BtcTransactionRequest, dispatch: BtcDispatch) => Promise<string>;
|
|
163
|
+
type BtcSign = (data: BtcTransactionRequest, dispatch: BtcDispatch, step: BridgeStepDetails) => Promise<string>;
|
|
163
164
|
type BtcSigner = {
|
|
164
165
|
sign: BtcSign;
|
|
165
166
|
};
|
|
@@ -188,7 +189,8 @@ declare enum ErrorReason {
|
|
|
188
189
|
UNKNOWN = "UNKNOWN",
|
|
189
190
|
VULNERABLE_TOKEN_APPROVAL_ADDRESS = "VULNERABLE_TOKEN_APPROVAL_ADDRESS",
|
|
190
191
|
WARDEN_CONFIG_MISMATCH = "WARDEN_CONFIG_MISMATCH",
|
|
191
|
-
WARDEN_CONFIG_MISSING_NETWORK = "WARDEN_CONFIG_MISSING_NETWORK"
|
|
192
|
+
WARDEN_CONFIG_MISSING_NETWORK = "WARDEN_CONFIG_MISSING_NETWORK",
|
|
193
|
+
ADDRESS_IS_BLOCKED = "ADDRESS_IS_BLOCKED"
|
|
192
194
|
}
|
|
193
195
|
|
|
194
196
|
type BridgeTransfer = {
|
|
@@ -281,6 +283,10 @@ type BridgeStepDetails = {
|
|
|
281
283
|
requiredSignatures: number;
|
|
282
284
|
currentSignatureReason: BridgeSignatureReason;
|
|
283
285
|
};
|
|
286
|
+
type GasSettings = {
|
|
287
|
+
price: bigint;
|
|
288
|
+
tip?: bigint;
|
|
289
|
+
};
|
|
284
290
|
type TransferParams = {
|
|
285
291
|
asset: BridgeAsset;
|
|
286
292
|
amount: bigint;
|
|
@@ -288,6 +294,7 @@ type TransferParams = {
|
|
|
288
294
|
toAddress: string;
|
|
289
295
|
sourceChain: Chain;
|
|
290
296
|
targetChain: Chain;
|
|
297
|
+
gasSettings?: GasSettings;
|
|
291
298
|
onStepChange?: (stepDetails: BridgeStepDetails) => void;
|
|
292
299
|
};
|
|
293
300
|
type GasEstimationParams = Omit<TransferParams, 'onStepChange' | 'toAddress'>;
|
|
@@ -377,8 +384,9 @@ type Caip2ChainId = {
|
|
|
377
384
|
declare const _default: {
|
|
378
385
|
toJSON: (identifier: string) => Caip2ChainId;
|
|
379
386
|
toString: ({ namespace, reference }: Caip2ChainId) => string;
|
|
387
|
+
toEip155HexChainId: ({ namespace, reference }: Caip2ChainId) => string;
|
|
380
388
|
};
|
|
381
389
|
|
|
382
390
|
declare const getEnabledBridgeServices: (environment: Environment, enabledBridgeInitializers: BridgeInitializer[]) => Promise<BridgeServicesMap>;
|
|
383
391
|
|
|
384
|
-
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, Hex, NativeAsset, TokenType, TrackingParams, TransferParams, UnifiedBridgeService, _default as caip2, createUnifiedBridgeService, getEnabledBridgeServices, isAvaToBtcBridgeInitializer, isBtcToAvaBridgeInitializer, isErc20Asset, isEvmBridgeInitializer, isNativeAsset };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -148,9 +148,10 @@ type EvmTransactionRequest = {
|
|
|
148
148
|
gasLimit?: bigint | null;
|
|
149
149
|
maxPriorityFeePerGas?: bigint | null;
|
|
150
150
|
maxFeePerGas?: bigint | null;
|
|
151
|
+
chainId?: string;
|
|
151
152
|
};
|
|
152
153
|
type EvmDispatch = (signedTxHash: Hex) => Promise<Hex>;
|
|
153
|
-
type EvmSign = (data: EvmTransactionRequest, dispatch: EvmDispatch) => Promise<Hex>;
|
|
154
|
+
type EvmSign = (data: EvmTransactionRequest, dispatch: EvmDispatch, step: BridgeStepDetails) => Promise<Hex>;
|
|
154
155
|
type EvmSigner = {
|
|
155
156
|
sign: EvmSign;
|
|
156
157
|
};
|
|
@@ -159,7 +160,7 @@ type BtcTransactionRequest = {
|
|
|
159
160
|
outputs: BitcoinOutputUTXO[];
|
|
160
161
|
};
|
|
161
162
|
type BtcDispatch = (signedTxHash: string) => Promise<string>;
|
|
162
|
-
type BtcSign = (data: BtcTransactionRequest, dispatch: BtcDispatch) => Promise<string>;
|
|
163
|
+
type BtcSign = (data: BtcTransactionRequest, dispatch: BtcDispatch, step: BridgeStepDetails) => Promise<string>;
|
|
163
164
|
type BtcSigner = {
|
|
164
165
|
sign: BtcSign;
|
|
165
166
|
};
|
|
@@ -188,7 +189,8 @@ declare enum ErrorReason {
|
|
|
188
189
|
UNKNOWN = "UNKNOWN",
|
|
189
190
|
VULNERABLE_TOKEN_APPROVAL_ADDRESS = "VULNERABLE_TOKEN_APPROVAL_ADDRESS",
|
|
190
191
|
WARDEN_CONFIG_MISMATCH = "WARDEN_CONFIG_MISMATCH",
|
|
191
|
-
WARDEN_CONFIG_MISSING_NETWORK = "WARDEN_CONFIG_MISSING_NETWORK"
|
|
192
|
+
WARDEN_CONFIG_MISSING_NETWORK = "WARDEN_CONFIG_MISSING_NETWORK",
|
|
193
|
+
ADDRESS_IS_BLOCKED = "ADDRESS_IS_BLOCKED"
|
|
192
194
|
}
|
|
193
195
|
|
|
194
196
|
type BridgeTransfer = {
|
|
@@ -281,6 +283,10 @@ type BridgeStepDetails = {
|
|
|
281
283
|
requiredSignatures: number;
|
|
282
284
|
currentSignatureReason: BridgeSignatureReason;
|
|
283
285
|
};
|
|
286
|
+
type GasSettings = {
|
|
287
|
+
price: bigint;
|
|
288
|
+
tip?: bigint;
|
|
289
|
+
};
|
|
284
290
|
type TransferParams = {
|
|
285
291
|
asset: BridgeAsset;
|
|
286
292
|
amount: bigint;
|
|
@@ -288,6 +294,7 @@ type TransferParams = {
|
|
|
288
294
|
toAddress: string;
|
|
289
295
|
sourceChain: Chain;
|
|
290
296
|
targetChain: Chain;
|
|
297
|
+
gasSettings?: GasSettings;
|
|
291
298
|
onStepChange?: (stepDetails: BridgeStepDetails) => void;
|
|
292
299
|
};
|
|
293
300
|
type GasEstimationParams = Omit<TransferParams, 'onStepChange' | 'toAddress'>;
|
|
@@ -377,8 +384,9 @@ type Caip2ChainId = {
|
|
|
377
384
|
declare const _default: {
|
|
378
385
|
toJSON: (identifier: string) => Caip2ChainId;
|
|
379
386
|
toString: ({ namespace, reference }: Caip2ChainId) => string;
|
|
387
|
+
toEip155HexChainId: ({ namespace, reference }: Caip2ChainId) => string;
|
|
380
388
|
};
|
|
381
389
|
|
|
382
390
|
declare const getEnabledBridgeServices: (environment: Environment, enabledBridgeInitializers: BridgeInitializer[]) => Promise<BridgeServicesMap>;
|
|
383
391
|
|
|
384
|
-
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, Hex, NativeAsset, TokenType, TrackingParams, TransferParams, UnifiedBridgeService, _default as caip2, createUnifiedBridgeService, getEnabledBridgeServices, isAvaToBtcBridgeInitializer, isBtcToAvaBridgeInitializer, isErc20Asset, isEvmBridgeInitializer, isNativeAsset };
|
|
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 };
|