@wormhole-foundation/sdk-connect
Advanced tools
Comparing version 0.7.1 to 0.7.2
import type { Chain, Network } from "@wormhole-foundation/sdk-base"; | ||
import { amount } from "@wormhole-foundation/sdk-base"; | ||
import type { ChainContext, Signer, TokenId } from "@wormhole-foundation/sdk-definitions"; | ||
import { ChainAddress } from "@wormhole-foundation/sdk-definitions"; | ||
import { TokenTransfer } from "../../protocols/tokenBridge/tokenTransfer.js"; | ||
@@ -9,3 +10,2 @@ import type { AttestationReceipt } from "../../types.js"; | ||
import type { Quote, QuoteResult, Receipt, TransferParams, ValidatedTransferParams, ValidationResult } from "../types.js"; | ||
import { ChainAddress } from "@wormhole-foundation/sdk-definitions"; | ||
export declare namespace AutomaticTokenBridgeRoute { | ||
@@ -12,0 +12,0 @@ type Options = { |
@@ -8,4 +8,4 @@ "use strict"; | ||
const types_js_1 = require("../../types.js"); | ||
const wormhole_js_1 = require("../../wormhole.js"); | ||
const route_js_1 = require("../route.js"); | ||
const wormhole_js_1 = require("../../wormhole.js"); | ||
class AutomaticTokenBridgeRoute extends route_js_1.AutomaticRoute { | ||
@@ -40,3 +40,9 @@ NATIVE_GAS_DROPOFF_SUPPORTED = true; | ||
try { | ||
return [await tokenTransfer_js_1.TokenTransfer.lookupDestinationToken(fromChain, toChain, sourceToken)]; | ||
const expectedDestinationToken = await tokenTransfer_js_1.TokenTransfer.lookupDestinationToken(fromChain, toChain, sourceToken); | ||
const atb = await toChain.getAutomaticTokenBridge(); | ||
const acceptable = await atb.isRegisteredToken(expectedDestinationToken.address); | ||
if (!acceptable) { | ||
throw new Error("Destination token is not accepted by the AutomaticTokenBridge"); | ||
} | ||
return [expectedDestinationToken]; | ||
} | ||
@@ -43,0 +49,0 @@ catch (e) { |
import type { Chain, Network } from "@wormhole-foundation/sdk-base"; | ||
import { amount } from "@wormhole-foundation/sdk-base"; | ||
import type { ChainContext, Signer, TokenId } from "@wormhole-foundation/sdk-definitions"; | ||
import { ChainAddress } from "@wormhole-foundation/sdk-definitions"; | ||
import { TokenTransfer } from "../../protocols/tokenBridge/tokenTransfer.js"; | ||
@@ -9,3 +10,2 @@ import type { AttestationReceipt } from "../../types.js"; | ||
import type { Quote, QuoteResult, Receipt, TransferParams, ValidatedTransferParams, ValidationResult } from "../types.js"; | ||
import { ChainAddress } from "@wormhole-foundation/sdk-definitions"; | ||
export declare namespace AutomaticTokenBridgeRoute { | ||
@@ -12,0 +12,0 @@ type Options = { |
import { amount, contracts } from "@wormhole-foundation/sdk-base"; | ||
import { isNative, isTokenId, nativeTokenId } from "@wormhole-foundation/sdk-definitions"; | ||
import { isNative, isTokenId, nativeTokenId, } from "@wormhole-foundation/sdk-definitions"; | ||
import { TokenTransfer } from "../../protocols/tokenBridge/tokenTransfer.js"; | ||
import { TransferState } from "../../types.js"; | ||
import { Wormhole } from "../../wormhole.js"; | ||
import { AutomaticRoute } from "../route.js"; | ||
import { Wormhole } from "../../wormhole.js"; | ||
export class AutomaticTokenBridgeRoute extends AutomaticRoute { | ||
@@ -36,3 +36,9 @@ NATIVE_GAS_DROPOFF_SUPPORTED = true; | ||
try { | ||
return [await TokenTransfer.lookupDestinationToken(fromChain, toChain, sourceToken)]; | ||
const expectedDestinationToken = await TokenTransfer.lookupDestinationToken(fromChain, toChain, sourceToken); | ||
const atb = await toChain.getAutomaticTokenBridge(); | ||
const acceptable = await atb.isRegisteredToken(expectedDestinationToken.address); | ||
if (!acceptable) { | ||
throw new Error("Destination token is not accepted by the AutomaticTokenBridge"); | ||
} | ||
return [expectedDestinationToken]; | ||
} | ||
@@ -39,0 +45,0 @@ catch (e) { |
{ | ||
"name": "@wormhole-foundation/sdk-connect", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"repository": { | ||
@@ -101,6 +101,6 @@ "type": "git", | ||
"axios": "^1.4.0", | ||
"@wormhole-foundation/sdk-base": "0.7.1", | ||
"@wormhole-foundation/sdk-definitions": "0.7.1" | ||
"@wormhole-foundation/sdk-base": "0.7.2", | ||
"@wormhole-foundation/sdk-definitions": "0.7.2" | ||
}, | ||
"type": "module" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
796776
8839
+ Added@wormhole-foundation/sdk-base@0.7.2(transitive)
+ Added@wormhole-foundation/sdk-definitions@0.7.2(transitive)
- Removed@wormhole-foundation/sdk-base@0.7.1(transitive)
- Removed@wormhole-foundation/sdk-definitions@0.7.1(transitive)