@wormhole-foundation/sdk-connect
Advanced tools
Comparing version 0.5.3-beta.3 to 0.5.3-beta.4
@@ -207,3 +207,3 @@ "use strict"; | ||
*/ | ||
if (this._state < types_js_1.TransferState.SourceInitiated || this._state > types_js_1.TransferState.Attested) | ||
if (this._state < types_js_1.TransferState.SourceInitiated) | ||
throw new Error("Invalid state transition in `fetchAttestation`"); | ||
@@ -217,2 +217,12 @@ const ids = this.transfer.automatic | ||
this._state = types_js_1.TransferState.Attested; | ||
if (this.attestations && this.attestations.length > 0) { | ||
for (const _attestation of this.attestations) { | ||
const { attestation } = _attestation; | ||
if (!sdk_definitions_1.CircleBridge.isCircleAttestation(attestation)) | ||
continue; | ||
const completed = await CircleTransfer.isTransferComplete(this.toChain, attestation); | ||
if (completed) | ||
this._state = types_js_1.TransferState.DestinationFinalized; | ||
} | ||
} | ||
return ids; | ||
@@ -219,0 +229,0 @@ } |
@@ -129,2 +129,9 @@ "use strict"; | ||
this._state = types_js_1.TransferState.Attested; | ||
if (this.attestations.length > 0) { | ||
// Check if the transfer has been completed | ||
const { attestation } = this.attestations[0]; | ||
const completed = await TokenTransfer.isTransferComplete(this.toChain, attestation); | ||
if (completed) | ||
this._state = types_js_1.TransferState.DestinationFinalized; | ||
} | ||
return this.attestations.map((vaa) => vaa.id); | ||
@@ -131,0 +138,0 @@ } |
@@ -204,3 +204,3 @@ import { circle, encoding, toChain } from "@wormhole-foundation/sdk-base"; | ||
*/ | ||
if (this._state < TransferState.SourceInitiated || this._state > TransferState.Attested) | ||
if (this._state < TransferState.SourceInitiated) | ||
throw new Error("Invalid state transition in `fetchAttestation`"); | ||
@@ -214,2 +214,12 @@ const ids = this.transfer.automatic | ||
this._state = TransferState.Attested; | ||
if (this.attestations && this.attestations.length > 0) { | ||
for (const _attestation of this.attestations) { | ||
const { attestation } = _attestation; | ||
if (!CircleBridge.isCircleAttestation(attestation)) | ||
continue; | ||
const completed = await CircleTransfer.isTransferComplete(this.toChain, attestation); | ||
if (completed) | ||
this._state = TransferState.DestinationFinalized; | ||
} | ||
} | ||
return ids; | ||
@@ -216,0 +226,0 @@ } |
@@ -126,2 +126,9 @@ import { amount, encoding, toChain as toChainName } from "@wormhole-foundation/sdk-base"; | ||
this._state = TransferState.Attested; | ||
if (this.attestations.length > 0) { | ||
// Check if the transfer has been completed | ||
const { attestation } = this.attestations[0]; | ||
const completed = await TokenTransfer.isTransferComplete(this.toChain, attestation); | ||
if (completed) | ||
this._state = TransferState.DestinationFinalized; | ||
} | ||
return this.attestations.map((vaa) => vaa.id); | ||
@@ -128,0 +135,0 @@ } |
{ | ||
"name": "@wormhole-foundation/sdk-connect", | ||
"version": "0.5.3-beta.3", | ||
"version": "0.5.3-beta.4", | ||
"repository": { | ||
@@ -78,6 +78,6 @@ "type": "git", | ||
"axios": "^1.4.0", | ||
"@wormhole-foundation/sdk-base": "0.5.3-beta.3", | ||
"@wormhole-foundation/sdk-definitions": "0.5.3-beta.3" | ||
"@wormhole-foundation/sdk-base": "0.5.3-beta.4", | ||
"@wormhole-foundation/sdk-definitions": "0.5.3-beta.4" | ||
}, | ||
"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
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
757688
8528
+ Added@wormhole-foundation/sdk-base@0.5.3-beta.4(transitive)
+ Added@wormhole-foundation/sdk-definitions@0.5.3-beta.4(transitive)
- Removed@wormhole-foundation/sdk-base@0.5.3-beta.3(transitive)
- Removed@wormhole-foundation/sdk-definitions@0.5.3-beta.3(transitive)