From 1845b03795113c532961c876bdf9825455d8f689 Mon Sep 17 00:00:00 2001 From: scnale Date: Tue, 30 Jul 2024 13:21:01 -0300 Subject: [PATCH 01/69] fix: throws an `Error` object instead of plain string in `getTokenMap` (#647) --- core/base/src/constants/tokens/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/base/src/constants/tokens/index.ts b/core/base/src/constants/tokens/index.ts index 81da75fed..b07d0dea9 100644 --- a/core/base/src/constants/tokens/index.ts +++ b/core/base/src/constants/tokens/index.ts @@ -24,7 +24,7 @@ export function getTokenMap( return Object.fromEntries(chainTokens!.map(([key, token]) => [key, { ...token, chain, key }])); } - throw "Unsupported network: " + network; + throw new Error("Unsupported network: " + network); } // The token that represents the native gas token on a given chain From 3b27d05530f52c72ced6667551d865620057d7c7 Mon Sep 17 00:00:00 2001 From: Kevin Peters Date: Mon, 29 Jul 2024 16:33:01 -0500 Subject: [PATCH 02/69] connect: Added InReview transfer state, governor warnings and fixes The InReview transfer state is currently set when a token bridge transfer is enqueued in the Governor. Added Governor warnings to token bridge quotes. Fixed an issue where the token price wasn't being looked up by its origin chain. --- connect/src/index.ts | 1 + .../protocols/tokenBridge/tokenTransfer.ts | 119 ++++++++++++------ connect/src/routes/request.ts | 4 + connect/src/routes/types.ts | 3 +- connect/src/types.ts | 23 ++-- connect/src/warnings.ts | 11 ++ connect/src/whscan-api.ts | 13 +- connect/src/wormhole.ts | 16 ++- 8 files changed, 131 insertions(+), 59 deletions(-) create mode 100644 connect/src/warnings.ts diff --git a/connect/src/index.ts b/connect/src/index.ts index e05769480..05bdf32c6 100644 --- a/connect/src/index.ts +++ b/connect/src/index.ts @@ -2,6 +2,7 @@ export * from "./wormhole.js"; export * from "./config.js"; export * from "./common.js"; export * from "./types.js"; +export * from "./warnings.js"; export * from "./protocols/index.js"; diff --git a/connect/src/protocols/tokenBridge/tokenTransfer.ts b/connect/src/protocols/tokenBridge/tokenTransfer.ts index ff095b116..cc342b554 100644 --- a/connect/src/protocols/tokenBridge/tokenTransfer.ts +++ b/connect/src/protocols/tokenBridge/tokenTransfer.ts @@ -23,7 +23,6 @@ import { serialize, toNative, toUniversal, - universalAddress, } from "@wormhole-foundation/sdk-definitions"; import { signSendWait } from "../../common.js"; import { DEFAULT_TASK_TIMEOUT } from "../../config.js"; @@ -36,10 +35,12 @@ import type { SourceInitiatedTransferReceipt, TransferQuote, TransferReceipt as _TransferReceipt, + InReviewTransferReceipt, } from "../../types.js"; import { TransferState, isAttested, + isInReview, isRedeemed, isSourceFinalized, isSourceInitiated, @@ -47,6 +48,7 @@ import { import { getGovernedTokens, getGovernorLimits } from "../../whscan-api.js"; import { Wormhole } from "../../wormhole.js"; import type { WormholeTransfer } from "../wormholeTransfer.js"; +import type { QuoteWarning } from "../../warnings.js"; export class TokenTransfer implements WormholeTransfer @@ -155,6 +157,7 @@ export class TokenTransfer timeout?: number, ): Promise> { const vaa = await TokenTransfer.getTransferVaa(wh, id, timeout); + if (!vaa) throw new Error("VAA not found"); const automatic = vaa.protocolName === "AutomaticTokenBridge"; // TODO: the `from.address` here is a lie, but we don't @@ -236,11 +239,9 @@ export class TokenTransfer // Check if we already have the VAA if (this.attestations[idx]!.attestation) continue; - this.attestations[idx]!.attestation = await TokenTransfer.getTransferVaa( - this.wh, - this.attestations[idx]!.id, - timeout, - ); + const vaa = await TokenTransfer.getTransferVaa(this.wh, this.attestations[idx]!.id, timeout); + if (!vaa) throw new Error("VAA not found"); + this.attestations[idx]!.attestation = vaa; } this._state = TransferState.Attested; @@ -362,25 +363,38 @@ export namespace TokenTransfer { yield receipt; } - // If the source is finalized, we need to fetch the signed attestation - // so that we may deliver it to the destination chain + // If the source is finalized or in review (governor held), we need to fetch the signed attestation + // (once it's available) so that we may deliver it to the destination chain // or at least track the transfer through its progress - if (isSourceFinalized(receipt)) { + if (isSourceFinalized(receipt) || isInReview(receipt)) { if (!receipt.attestation.id) throw "Attestation id required to fetch attestation"; const { id } = receipt.attestation; const attestation = await TokenTransfer.getTransferVaa(wh, id, leftover(start, timeout)); - receipt = { - ...receipt, - attestation: { id, attestation }, - state: TransferState.Attested, - } satisfies AttestedTransferReceipt; - yield receipt; + if (attestation) { + receipt = { + ...receipt, + attestation: { id, attestation }, + state: TransferState.Attested, + } satisfies AttestedTransferReceipt; + yield receipt; + } else { + // If the attestation is not found, check if the transfer is held by the governor + const isEnqueued = await TokenTransfer.isTransferEnqueued(wh, id); + if (isEnqueued) { + receipt = { + ...receipt, + state: TransferState.InReview, + } satisfies InReviewTransferReceipt; + yield receipt; + } + } + throw new Error("Attestation not found"); } // First try to grab the tx status from the API // Note: this requires a subsequent async step on the backend // to have the dest txid populated, so it may be delayed by some time - if (isAttested(receipt) || isSourceFinalized(receipt)) { + if (isAttested(receipt) || isSourceFinalized(receipt) || isInReview(receipt)) { if (!receipt.attestation.id) throw "Attestation id required to fetch redeem tx"; const { id } = receipt.attestation; const txStatus = await wh.getTransactionStatus(id, leftover(start, timeout)); @@ -544,9 +558,9 @@ export namespace TokenTransfer { wh: Wormhole, key: WormholeMessageId | TxHash, timeout?: number, - ): Promise { + ): Promise { const vaa = await wh.getVaa(key, TokenBridge.getTransferDiscriminator(), timeout); - if (!vaa) throw new Error(`No VAA available after retries exhausted`); + if (!vaa) return null; // Check if its automatic and re-de-serialize if (vaa.payloadName === "TransferWithPayload") { @@ -562,6 +576,13 @@ export namespace TokenTransfer { return vaa; } + export async function isTransferEnqueued( + wh: Wormhole, + key: WormholeMessageId, + ): Promise { + return await wh.getIsVaaEnqueued(key); + } + export function validateTransferDetails( wh: Wormhole, transfer: TokenTransferDetails, @@ -613,7 +634,6 @@ export namespace TokenTransfer { const srcToken = isNative(transfer.token.address) ? await srcChain.getNativeWrappedTokenId() : transfer.token; - const srcTokenUniversalAddress = universalAddress(srcToken); // Ensure the transfer would not violate governor transfer limits const [tokens, limits] = await Promise.all([ @@ -621,26 +641,47 @@ export namespace TokenTransfer { getGovernorLimits(wh.config.api), ]); - if ( - limits !== null && - srcChain.chain in limits && - tokens !== null && - srcChain.chain in tokens && - srcTokenUniversalAddress in tokens[srcChain.chain]! - ) { - const limit = limits[srcChain.chain]!; - const tokenPrice = tokens[srcChain.chain]![srcTokenUniversalAddress]!; - const notionalTransferAmt = tokenPrice * amount.whole(srcAmountTruncated); - - if (limit.maxSize && notionalTransferAmt > limit.maxSize) - throw new Error( - `Transfer amount exceeds maximum size: ${notionalTransferAmt} > ${limit.maxSize}`, - ); + const warnings: QuoteWarning[] = []; + if (limits !== null && srcChain.chain in limits && tokens !== null) { + const srcTb = await srcChain.getTokenBridge(); + + let origAsset: TokenId; + if (isNative(transfer.token.address)) { + origAsset = { + chain: srcChain.chain, + address: await srcTb.getTokenUniversalAddress(srcToken.address), + }; + } else { + try { + origAsset = await srcTb.getOriginalAsset(transfer.token.address); + } catch (e: any) { + if (!e.message.includes("not a wrapped asset")) throw e; + origAsset = { + chain: srcChain.chain, + address: await srcTb.getTokenUniversalAddress(srcToken.address), + }; + } + } - if (notionalTransferAmt > limit.available) - throw new Error( - `Transfer amount exceeds available governed amount: ${notionalTransferAmt} > ${limit.available}`, - ); + if (origAsset.chain in tokens && origAsset.address.toString() in tokens[origAsset.chain]!) { + const limit = limits[srcChain.chain]!; + const tokenPrice = tokens[origAsset.chain]![origAsset.address.toString()]!; + const notionalTransferAmt = tokenPrice * amount.whole(srcAmountTruncated); + + if (limit.maxSize && notionalTransferAmt > limit.maxSize) { + warnings.push({ + type: "GovernorLimitWarning", + reason: "ExceedsLargeTransferLimit", + }); + } + + if (notionalTransferAmt > limit.available) { + warnings.push({ + type: "GovernorLimitWarning", + reason: "ExceedsRemainingNotional", + }); + } + } } const dstToken = await TokenTransfer.lookupDestinationToken(srcChain, dstChain, transfer.token); @@ -664,6 +705,7 @@ export namespace TokenTransfer { return { sourceToken: { token: srcToken, amount: amount.units(srcAmountTruncated) }, destinationToken: { token: dstToken, amount: amount.units(dstAmountReceivable) }, + warnings: warnings.length > 0 ? warnings : undefined, }; } @@ -753,6 +795,7 @@ export namespace TokenTransfer { destinationToken: { token: dstToken, amount: destAmountLessFee }, relayFee: { token: srcToken, amount: fee }, destinationNativeGas, + warnings: warnings.length > 0 ? warnings : undefined, }; } diff --git a/connect/src/routes/request.ts b/connect/src/routes/request.ts index 7216fc836..3322858fd 100644 --- a/connect/src/routes/request.ts +++ b/connect/src/routes/request.ts @@ -64,6 +64,10 @@ export class RouteTransferRequest { dq.destinationNativeGas = amount.fromBaseUnits(quote.destinationNativeGas, dstDecimals); } + if (quote.warnings && quote.warnings.length > 0) { + dq.warnings = [...quote.warnings]; + } + if (details) { dq.details = details; } diff --git a/connect/src/routes/types.ts b/connect/src/routes/types.ts index 8fa70200d..334acf0e9 100644 --- a/connect/src/routes/types.ts +++ b/connect/src/routes/types.ts @@ -1,6 +1,7 @@ import type { TokenId } from "@wormhole-foundation/sdk-definitions"; -import type { AttestationReceipt, QuoteWarning, TransferReceipt } from "../types.js"; +import type { AttestationReceipt, TransferReceipt } from "../types.js"; import type { amount } from "@wormhole-foundation/sdk-base"; +import type { QuoteWarning } from "../warnings.js"; // Extend Options to provide custom options // to use for the transfer diff --git a/connect/src/types.ts b/connect/src/types.ts index f84016f8b..6fcca60b3 100644 --- a/connect/src/types.ts +++ b/connect/src/types.ts @@ -6,6 +6,7 @@ import type { TokenId, TransactionId, } from "@wormhole-foundation/sdk-definitions"; +import type { QuoteWarning } from "./warnings.js"; // Transfer state machine states export enum TransferState { @@ -13,6 +14,7 @@ export enum TransferState { Created = 0, // The TokenTransfer object is created SourceInitiated, // Source chain transactions are submitted SourceFinalized, // Source chain transactions are finalized or whenever we have a message id + InReview, // Transfer is in review (e.g. held by governor) Attested, // VAA or Circle Attestation is available DestinationInitiated, // Attestation is submitted to destination chain DestinationQueued, // Transfer is queued on destination chain @@ -54,6 +56,13 @@ export interface SourceFinalizedTransferReceipt< attestation: AT; } +export interface InReviewTransferReceipt + extends BaseTransferReceipt { + state: TransferState.InReview; + originTxs: TransactionId[]; + attestation: AT; +} + export interface AttestedTransferReceipt extends BaseTransferReceipt { state: TransferState.Attested; @@ -110,6 +119,12 @@ export function isSourceFinalized( return receipt.state === TransferState.SourceFinalized; } +export function isInReview( + receipt: TransferReceipt, +): receipt is InReviewTransferReceipt { + return receipt.state === TransferState.InReview; +} + export function isAttested( receipt: TransferReceipt, ): receipt is AttestedTransferReceipt { @@ -143,6 +158,7 @@ export type TransferReceipt | SourceInitiatedTransferReceipt | SourceFinalizedTransferReceipt + | InReviewTransferReceipt | AttestedTransferReceipt | RedeemedTransferReceipt | DestinationQueuedTransferReceipt @@ -178,10 +194,3 @@ export interface TransferQuote { // such as high slippage or a delay, they will be included here warnings?: QuoteWarning[]; } - -export type QuoteWarning = DestinationCapacityWarning; - -export type DestinationCapacityWarning = { - type: "DestinationCapacityWarning"; - delayDurationSec?: number; -}; diff --git a/connect/src/warnings.ts b/connect/src/warnings.ts new file mode 100644 index 000000000..c4c06efb5 --- /dev/null +++ b/connect/src/warnings.ts @@ -0,0 +1,11 @@ +export type DestinationCapacityWarning = { + type: "DestinationCapacityWarning"; + delayDurationSec?: number; +}; + +export type GovernorLimitWarning = { + type: "GovernorLimitWarning"; + reason: "ExceedsRemainingNotional" | "ExceedsLargeTransferLimit"; +}; + +export type QuoteWarning = DestinationCapacityWarning | GovernorLimitWarning; diff --git a/connect/src/whscan-api.ts b/connect/src/whscan-api.ts index 3239aca9e..3cb13030e 100644 --- a/connect/src/whscan-api.ts +++ b/connect/src/whscan-api.ts @@ -422,18 +422,11 @@ export async function getGovernorLimits(rpcUrl: string): Promise { +export async function getIsVaaEnqueued(rpcUrl: string, whm: WormholeMessageId): Promise { const { chain, emitter, sequence } = whm; const chainId = toChainId(chain); const emitterAddress = emitter.toUniversalAddress().toString(); const url = `${rpcUrl}/v1/governor/is_vaa_enqueued/${chainId}/${emitterAddress}/${sequence}`; - try { - const response = await axios.get<{ isEnqueued: boolean }>(url); - return response.data.isEnqueued; - } catch {} - return null; + const response = await axios.get<{ isEnqueued: boolean }>(url); + return response.data.isEnqueued; } diff --git a/connect/src/wormhole.ts b/connect/src/wormhole.ts index 31d4d9003..b66f15792 100644 --- a/connect/src/wormhole.ts +++ b/connect/src/wormhole.ts @@ -32,6 +32,7 @@ import { RouteResolver } from "./routes/resolver.js"; import { retry } from "./tasks.js"; import type { TransactionStatus } from "./whscan-api.js"; import { + getIsVaaEnqueued, getTransactionStatusWithRetry, getTxsByAddress, getVaaByTxHashWithRetry, @@ -193,7 +194,7 @@ export class Wormhole { /** * Gets the TokenId for a token representation on any chain * These are the Wormhole wrapped token addresses, not necessarily - * the cannonical version of that token + * the canonical version of that token * * @param chain The chain name to get the wrapped token address * @param tokenId The Token ID (chain/address) of the original token @@ -209,7 +210,7 @@ export class Wormhole { /** * Taking the original TokenId for some wrapped token chain * These are the Wormhole wrapped token addresses, not necessarily - * the cannonical version of that token + * the canonical version of that token * * @param tokenId The Token ID of the token we're looking up the original asset for * @returns The Original TokenId corresponding to the token id passed, @@ -299,6 +300,15 @@ export class Wormhole { return await getVaaWithRetry(this.config.api, id, decodeAs, timeout); } + /** + * Gets if the token bridge transfer VAA has been enqueued by the Governor. + * @param id The WormholeMessageId corresponding to the token bridge transfer VAA to check + * @returns True if the transfer has been enqueued, false otherwise + */ + async getIsVaaEnqueued(id: WormholeMessageId): Promise { + return await getIsVaaEnqueued(this.config.api, id); + } + /** * Gets the CircleAttestation corresponding to the message hash logged in the transfer transaction. * @param msgHash The keccak256 hash of the message emitted by the circle contract @@ -351,7 +361,7 @@ export class Wormhole { } /** - * Parse an address from its canonincal string format to a NativeAddress + * Parse an address from its canonical string format to a NativeAddress * * @param chain The chain the address is for * @param address The address in canonical string format From 1b8c5ba3fe34812ae0f8f1b5b6cfc836f362bc26 Mon Sep 17 00:00:00 2001 From: Kevin Peters Date: Tue, 30 Jul 2024 10:46:59 -0500 Subject: [PATCH 03/69] connect: Added eta to quote interface The eta tells us the estimated transfer time in milliseconds (essentially finality time). --- connect/src/protocols/cctp/cctpTransfer.ts | 10 ++++++++-- .../src/protocols/tokenBridge/tokenTransfer.ts | 5 ++++- connect/src/routes/portico/automatic.ts | 2 ++ connect/src/routes/request.ts | 2 ++ connect/src/routes/types.ts | 3 +++ connect/src/types.ts | 2 ++ core/base/src/constants/finality.ts | 15 +++++++++++++++ 7 files changed, 36 insertions(+), 3 deletions(-) diff --git a/connect/src/protocols/cctp/cctpTransfer.ts b/connect/src/protocols/cctp/cctpTransfer.ts index 0a3437529..7ab779703 100644 --- a/connect/src/protocols/cctp/cctpTransfer.ts +++ b/connect/src/protocols/cctp/cctpTransfer.ts @@ -37,6 +37,7 @@ import type { import { TransferState, isAttested, isSourceFinalized, isSourceInitiated } from "../../types.js"; import { Wormhole } from "../../wormhole.js"; import type { WormholeTransfer } from "../wormholeTransfer.js"; +import { finality } from "@wormhole-foundation/sdk-base"; export class CircleTransfer implements WormholeTransfer @@ -225,10 +226,10 @@ export class CircleTransfer try { msgIds = await fromChain.parseTransaction(txid); } catch (e: any) { - if (e.message.includes('no bridge messages found')) { + if (e.message.includes("no bridge messages found")) { // This means it's a Circle attestation; swallow } else { - throw e + throw e; } } @@ -584,10 +585,14 @@ export namespace CircleTransfer { const dstToken = Wormhole.chainAddress(dstChain.chain, dstUsdcAddress); const srcToken = Wormhole.chainAddress(srcChain.chain, srcUsdcAddress); + // https://developers.circle.com/stablecoins/docs/required-block-confirmations + const eta = + srcChain.chain === "Polygon" ? 2_000 * 200 : finality.estimateFinalityTime(srcChain.chain); if (!transfer.automatic) { return { sourceToken: { token: srcToken, amount: transfer.amount }, destinationToken: { token: dstToken, amount: transfer.amount }, + eta, }; } @@ -619,6 +624,7 @@ export namespace CircleTransfer { destinationToken: { token: dstToken, amount: dstAmount }, relayFee: { token: srcToken, amount: fee }, destinationNativeGas, + eta, }; } diff --git a/connect/src/protocols/tokenBridge/tokenTransfer.ts b/connect/src/protocols/tokenBridge/tokenTransfer.ts index cc342b554..abdb611a7 100644 --- a/connect/src/protocols/tokenBridge/tokenTransfer.ts +++ b/connect/src/protocols/tokenBridge/tokenTransfer.ts @@ -1,5 +1,5 @@ import type { Chain, Network } from "@wormhole-foundation/sdk-base"; -import { amount, encoding, toChain as toChainName } from "@wormhole-foundation/sdk-base"; +import { amount, encoding, finality, toChain as toChainName } from "@wormhole-foundation/sdk-base"; import type { AttestationId, AutomaticTokenBridge, @@ -701,11 +701,13 @@ export namespace TokenTransfer { const dstDecimals = await dstChain.getDecimals(dstToken.address); const dstAmountReceivable = amount.scale(srcAmountTruncated, dstDecimals); + const eta = finality.estimateFinalityTime(srcChain.chain); if (!transfer.automatic) { return { sourceToken: { token: srcToken, amount: amount.units(srcAmountTruncated) }, destinationToken: { token: dstToken, amount: amount.units(dstAmountReceivable) }, warnings: warnings.length > 0 ? warnings : undefined, + eta, }; } @@ -796,6 +798,7 @@ export namespace TokenTransfer { relayFee: { token: srcToken, amount: fee }, destinationNativeGas, warnings: warnings.length > 0 ? warnings : undefined, + eta, }; } diff --git a/connect/src/routes/portico/automatic.ts b/connect/src/routes/portico/automatic.ts index 498aa5d8f..b03af7a70 100644 --- a/connect/src/routes/portico/automatic.ts +++ b/connect/src/routes/portico/automatic.ts @@ -36,6 +36,7 @@ import { } from "./../../index.js"; import type { ChainAddress } from "@wormhole-foundation/sdk-definitions"; import type { RouteTransferRequest } from "../request.js"; +import { finality } from "@wormhole-foundation/sdk-base"; export const SLIPPAGE_BPS = 15n; // 0.15% export const BPS_PER_HUNDRED_PERCENT = 10000n; @@ -255,6 +256,7 @@ export class AutomaticPorticoRoute token: params.normalizedParams.destinationToken, amount: fee, }, + eta: finality.estimateFinalityTime(request.fromChain.chain), }, params, details, diff --git a/connect/src/routes/request.ts b/connect/src/routes/request.ts index 3322858fd..9662691b6 100644 --- a/connect/src/routes/request.ts +++ b/connect/src/routes/request.ts @@ -68,6 +68,8 @@ export class RouteTransferRequest { dq.warnings = [...quote.warnings]; } + dq.eta = quote.eta; + if (details) { dq.details = details; } diff --git a/connect/src/routes/types.ts b/connect/src/routes/types.ts index 334acf0e9..e68e36888 100644 --- a/connect/src/routes/types.ts +++ b/connect/src/routes/types.ts @@ -75,6 +75,9 @@ export type Quote< // If the transfer being quoted has any warnings // such as high slippage or a delay, they will be included here warnings?: QuoteWarning[]; + + // Estimated time to completion in milliseconds + eta?: number; }; export type QuoteError = { diff --git a/connect/src/types.ts b/connect/src/types.ts index 6fcca60b3..a555bc830 100644 --- a/connect/src/types.ts +++ b/connect/src/types.ts @@ -193,4 +193,6 @@ export interface TransferQuote { // If the transfer being quoted has any warnings // such as high slippage or a delay, they will be included here warnings?: QuoteWarning[]; + // Estimated time to completion in milliseconds + eta?: number; } diff --git a/core/base/src/constants/finality.ts b/core/base/src/constants/finality.ts index 45f612236..8ff6477cf 100644 --- a/core/base/src/constants/finality.ts +++ b/core/base/src/constants/finality.ts @@ -176,3 +176,18 @@ export function consistencyLevelToBlock( throw new Error("Only Ethereum safe is supported for now"); } } + +/** + * Estimates the time required for a transaction to be considered "final" + * @param chain The chain to estimate finality time for + * @returns The estimated time in milliseconds + */ +export function estimateFinalityTime(chain: Chain): number { + const finality = finalityThreshold.get(chain); + if (finality === undefined) throw new Error("Cannot find finality for " + chain); + + const time = blockTime.get(chain); + if (time === undefined) throw new Error("Cannot find block time for " + chain); + + return finality * time; +} From 01a4269a0257edb44caba530a91adc67c2c47128 Mon Sep 17 00:00:00 2001 From: Kevin Peters Date: Thu, 1 Aug 2024 09:12:50 -0500 Subject: [PATCH 04/69] connect: added resume method to FinalizableRoute --- connect/src/routes/route.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/connect/src/routes/route.ts b/connect/src/routes/route.ts index e1320d367..1bf697f0d 100644 --- a/connect/src/routes/route.ts +++ b/connect/src/routes/route.ts @@ -1,5 +1,10 @@ import type { Chain, Network } from "@wormhole-foundation/sdk-base"; -import type { ChainContext, Signer, TokenId, TransactionId } from "@wormhole-foundation/sdk-definitions"; +import type { + ChainContext, + Signer, + TokenId, + TransactionId, +} from "@wormhole-foundation/sdk-definitions"; import type { Wormhole } from "../wormhole.js"; import type { RouteTransferRequest } from "./request.js"; import type { @@ -148,6 +153,7 @@ export abstract class FinalizableRoute< R extends Receipt = Receipt, > extends Route { public abstract finalize(sender: Signer, receipt: R): Promise; + public abstract resume(tx: TransactionId): Promise; } export function isFinalizable(route: Route): route is FinalizableRoute { From d2b5e5d3288744930acb3fd9e50fb4cf24a651e9 Mon Sep 17 00:00:00 2001 From: evgeniko <97796468+evgeniko@users.noreply.github.com> Date: Sat, 3 Aug 2024 20:29:32 +0200 Subject: [PATCH 05/69] update berachain chain id for they testnet v2 (#653) --- core/base/src/constants/nativeChainIds.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/base/src/constants/nativeChainIds.ts b/core/base/src/constants/nativeChainIds.ts index c9f636a91..e3791fdaa 100644 --- a/core/base/src/constants/nativeChainIds.ts +++ b/core/base/src/constants/nativeChainIds.ts @@ -103,7 +103,7 @@ const chainNetworkNativeChainIdEntries = [ ["Blast", 168587773n], // Sepolia testnet ["Mantle", 5003n], // Sepolia testnet ["Scroll", 534351n], - ["Berachain", 80085n], + ["Berachain", 80084n], // Testnet v2 ["Snaxchain", 2192n], ["Xlayer", 195n], ["Linea", 59141n], // Sepolia From 8d980c771d2893bc64075d78325ce536971c7e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Claro?= Date: Mon, 5 Aug 2024 18:49:55 +0100 Subject: [PATCH 06/69] contracts: update acala and karura testnet contracts (#654) * contracts: update acala and karura testnet core contracts * contracts: update acala and karura testnet token bridge contracts * contracts: remove acala and karura testnet nft bridge contracts --- core/base/src/constants/contracts/core.ts | 4 ++-- core/base/src/constants/contracts/nftBridge.ts | 2 -- core/base/src/constants/contracts/tokenBridge.ts | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/core/base/src/constants/contracts/core.ts b/core/base/src/constants/contracts/core.ts index 960979706..5a004b7eb 100644 --- a/core/base/src/constants/contracts/core.ts +++ b/core/base/src/constants/contracts/core.ts @@ -51,8 +51,8 @@ export const coreBridgeContracts = [[ ["Algorand", "86525623"], ["Aurora", "0xBd07292de7b505a4E803CEe286184f7Acf908F5e"], ["Fantom", "0x1BB3B4119b7BA9dfad76B0545fb3F531383c3bB7"], - ["Karura", "0xE4eacc10990ba3308DdCC72d985f2a27D20c7d03"], - ["Acala", "0x4377B49d559c0a9466477195C6AdC3D433e265c0"], + ["Karura", "0x64fb09E405D2043ed7785a29E296C766D56F2056"], + ["Acala", "0x64fb09E405D2043ed7785a29E296C766D56F2056"], ["Klaytn", "0x1830CC6eE66c84D2F177B94D544967c774E624cA"], ["Celo", "0x88505117CA88e7dd2eC6EA1E13f0948db2D50D56"], ["Near", "wormhole.wormhole.testnet"], diff --git a/core/base/src/constants/contracts/nftBridge.ts b/core/base/src/constants/contracts/nftBridge.ts index 82079da9c..090866798 100644 --- a/core/base/src/constants/contracts/nftBridge.ts +++ b/core/base/src/constants/contracts/nftBridge.ts @@ -32,8 +32,6 @@ export const nftBridgeContracts = [[ ["Oasis", "0xC5c25B41AB0b797571620F5204Afa116A44c0ebA"], ["Aurora", "0x8F399607E9BA2405D87F5f3e1B78D950b44b2e24"], ["Fantom", "0x63eD9318628D26BdCB15df58B53BB27231D1B227"], - ["Karura", "0x0A693c2D594292B6Eb89Cb50EFe4B0b63Dd2760D"], - ["Acala", "0x96f1335e0AcAB3cfd9899B30b2374e25a2148a6E"], ["Klaytn", "0x94c994fC51c13101062958b567e743f1a04432dE"], ["Celo", "0xaCD8190F647a31E56A656748bC30F69259f245Db"], ["Moonbeam", "0x98A0F4B96972b32Fcb3BD03cAeB66A44a6aB9Edb"], diff --git a/core/base/src/constants/contracts/tokenBridge.ts b/core/base/src/constants/contracts/tokenBridge.ts index 92920e7cb..9a599f16c 100644 --- a/core/base/src/constants/contracts/tokenBridge.ts +++ b/core/base/src/constants/contracts/tokenBridge.ts @@ -47,8 +47,8 @@ export const tokenBridgeContracts = [[ ["Algorand", "86525641"], ["Aurora", "0xD05eD3ad637b890D68a854d607eEAF11aF456fba"], ["Fantom", "0x599CEa2204B4FaECd584Ab1F2b6aCA137a0afbE8"], - ["Karura", "0xd11De1f930eA1F7Dd0290Fe3a2e35b9C91AEFb37"], - ["Acala", "0xebA00cbe08992EdD08ed7793E07ad6063c807004"], + ["Karura", "0xe157115ef34c93145Fec2FE53706846853B07F42"], + ["Acala", "0xe157115ef34c93145Fec2FE53706846853B07F42"], ["Klaytn", "0xC7A13BE098720840dEa132D860fDfa030884b09A"], ["Celo", "0x05ca6037eC51F8b712eD2E6Fa72219FEaE74E153"], ["Near", "token.wormhole.testnet"], From 5f01bf93e9808ced2c7b55c7e05c64f1865235b2 Mon Sep 17 00:00:00 2001 From: Evan Gray Date: Mon, 5 Aug 2024 14:40:06 -0400 Subject: [PATCH 07/69] contracts: add Mantle and X Layer relayer addresses --- core/base/src/constants/contracts/relayer.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/base/src/constants/contracts/relayer.ts b/core/base/src/constants/contracts/relayer.ts index d1b5cc050..4b96f9338 100644 --- a/core/base/src/constants/contracts/relayer.ts +++ b/core/base/src/constants/contracts/relayer.ts @@ -20,6 +20,8 @@ export const relayerContracts = [[ ["Optimism", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], ["Blast", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], ["Scroll", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], + ["Mantle", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], + ["Xlayer", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], ]], [ "Testnet", [ ["Ethereum", "0x28D8F1Be96f97C1387e94A53e00eCcFb4E75175a"], From 74eeb75b1219a331a14c1b3ec5bf062172b57f20 Mon Sep 17 00:00:00 2001 From: Kevin Peters Date: Thu, 1 Aug 2024 08:48:29 -0500 Subject: [PATCH 08/69] examples: fix type imports --- examples/src/cctp.ts | 16 ++++------------ examples/src/cosmos.ts | 17 +++++------------ examples/src/createWrapped.ts | 2 +- examples/src/helpers/helpers.ts | 8 +++++--- examples/src/parseVaa.ts | 3 +-- examples/src/quorum.ts | 3 ++- examples/src/repairVaa.ts | 11 ++--------- examples/src/tokenBridge.ts | 15 ++++----------- 8 files changed, 24 insertions(+), 51 deletions(-) diff --git a/examples/src/cctp.ts b/examples/src/cctp.ts index aa48fdee6..54e91682e 100644 --- a/examples/src/cctp.ts +++ b/examples/src/cctp.ts @@ -1,17 +1,9 @@ -import { - Chain, - CircleTransfer, - Network, - Signer, - TransactionId, - TransferState, - Wormhole, - amount, - wormhole, -} from "@wormhole-foundation/sdk"; +import type { Network, Signer, TransactionId, Wormhole } from "@wormhole-foundation/sdk"; +import { CircleTransfer, amount, wormhole } from "@wormhole-foundation/sdk"; import evm from "@wormhole-foundation/sdk/evm"; import solana from "@wormhole-foundation/sdk/solana"; -import { SignerStuff, getSigner, waitForRelay } from "./helpers/index.js"; +import type { SignerStuff } from "./helpers/index.js"; +import { getSigner, waitForRelay } from "./helpers/index.js"; /* Notes: diff --git a/examples/src/cosmos.ts b/examples/src/cosmos.ts index 1f7bf8aa3..c84962446 100644 --- a/examples/src/cosmos.ts +++ b/examples/src/cosmos.ts @@ -1,20 +1,13 @@ -import { - Chain, - GatewayTransfer, - GatewayTransferDetails, - Network, - TokenId, - Wormhole, - amount, - wormhole, -} from "@wormhole-foundation/sdk"; +import type { Chain, GatewayTransferDetails, Network, TokenId } from "@wormhole-foundation/sdk"; +import { GatewayTransfer, Wormhole, amount, wormhole } from "@wormhole-foundation/sdk"; // Import the platform specific packages import cosmwasm from "@wormhole-foundation/sdk/cosmwasm"; import evm from "@wormhole-foundation/sdk/evm"; import solana from "@wormhole-foundation/sdk/solana"; -import { SignerStuff, getSigner } from "./helpers/index.js"; +import type { SignerStuff } from "./helpers/index.js"; +import { getSigner } from "./helpers/index.js"; // We're going to transfer into, around, and out of the Cosmos ecosystem // First on Avalanche, transparently through gateway and over IBC to Cosmoshub @@ -66,7 +59,7 @@ import { SignerStuff, getSigner } from "./helpers/index.js"; : await transferIntoCosmos(wh, token, amt, leg1, leg2); console.log("Route 1 (External => Cosmos)", route1); - // Lookup the Gateway representation of the wrappd token + // Lookup the Gateway representation of the wrapped token const { denom } = route1.ibcTransfers![0]!.data; const cosmosTokenAddress = Wormhole.parseAddress("Wormchain", denom); diff --git a/examples/src/createWrapped.ts b/examples/src/createWrapped.ts index d4917e2ef..25d2eab80 100644 --- a/examples/src/createWrapped.ts +++ b/examples/src/createWrapped.ts @@ -1,4 +1,4 @@ -import { TokenId, Wormhole, signSendWait, wormhole } from "@wormhole-foundation/sdk"; +import { Wormhole, signSendWait, wormhole } from "@wormhole-foundation/sdk"; import evm from "@wormhole-foundation/sdk/evm"; import solana from "@wormhole-foundation/sdk/solana"; diff --git a/examples/src/helpers/helpers.ts b/examples/src/helpers/helpers.ts index 2c474f300..536442544 100644 --- a/examples/src/helpers/helpers.ts +++ b/examples/src/helpers/helpers.ts @@ -1,13 +1,15 @@ -import { +import type { Chain, ChainAddress, ChainContext, - DEFAULT_TASK_TIMEOUT, Network, Signer, + TxHash, +} from "@wormhole-foundation/sdk"; +import { + DEFAULT_TASK_TIMEOUT, TokenTransfer, TransferState, - TxHash, Wormhole, amount, api, diff --git a/examples/src/parseVaa.ts b/examples/src/parseVaa.ts index b0a0de7b6..843fc7725 100644 --- a/examples/src/parseVaa.ts +++ b/examples/src/parseVaa.ts @@ -1,13 +1,12 @@ +import type { Layout } from "@wormhole-foundation/sdk"; import { UniversalAddress, createVAA, deserialize, serialize, encoding, - Layout, serializeLayout, deserializeLayout, - serializePayload, } from "@wormhole-foundation/sdk"; (async function () { diff --git a/examples/src/quorum.ts b/examples/src/quorum.ts index d4dc7e3c8..00c2d63d5 100644 --- a/examples/src/quorum.ts +++ b/examples/src/quorum.ts @@ -1,4 +1,5 @@ -import { Chain, api, toChain, wormhole } from "@wormhole-foundation/sdk"; +import type { Chain } from "@wormhole-foundation/sdk"; +import { api, toChain, wormhole } from "@wormhole-foundation/sdk"; import algorand from "@wormhole-foundation/sdk/algorand"; import cosmwasm from "@wormhole-foundation/sdk/cosmwasm"; import evm from "@wormhole-foundation/sdk/evm"; diff --git a/examples/src/repairVaa.ts b/examples/src/repairVaa.ts index cfe443f35..61a30bf0a 100644 --- a/examples/src/repairVaa.ts +++ b/examples/src/repairVaa.ts @@ -1,12 +1,5 @@ -import { - SignatureUtils, - VAA, - WormholeCore, - encoding, - keccak256, - serialize, - wormhole, -} from "@wormhole-foundation/sdk"; +import type { VAA, WormholeCore } from "@wormhole-foundation/sdk"; +import { SignatureUtils, encoding, keccak256, serialize, wormhole } from "@wormhole-foundation/sdk"; import evm from "@wormhole-foundation/sdk/evm"; // If a VAA contains signatures from an older guardian set, it can be repaired by removing the invalid signatures and setting the new guardian set index. diff --git a/examples/src/tokenBridge.ts b/examples/src/tokenBridge.ts index c2c095be5..5c2de84e2 100644 --- a/examples/src/tokenBridge.ts +++ b/examples/src/tokenBridge.ts @@ -1,19 +1,12 @@ -import { - Chain, - Network, - TokenId, - TokenTransfer, - Wormhole, - amount, - isTokenId, - wormhole, -} from "@wormhole-foundation/sdk"; +import type { Chain, Network, TokenId } from "@wormhole-foundation/sdk"; +import { TokenTransfer, Wormhole, amount, isTokenId, wormhole } from "@wormhole-foundation/sdk"; // Import the platform-specific packages import evm from "@wormhole-foundation/sdk/evm"; import solana from "@wormhole-foundation/sdk/solana"; -import { SignerStuff, getSigner, waitLog } from "./helpers/index.js"; +import type { SignerStuff } from "./helpers/index.js"; +import { getSigner, waitLog } from "./helpers/index.js"; (async function () { // Init Wormhole object, passing config for which network From f9ff531a141fa9e9dad36e4094166420d2fa3efd Mon Sep 17 00:00:00 2001 From: Kevin Peters Date: Fri, 2 Aug 2024 14:50:35 -0500 Subject: [PATCH 09/69] cctp: gas drop-off fix - use wormhole circle relayer instead of token bridge relayer to compute max swap and gas drop-off amounts - the connect interface specifies a percentage that is applied to the the max swap amount to get the gas drop-off amount --- connect/src/protocols/cctp/cctpTransfer.ts | 18 ++++++++++++------ connect/src/routes/cctp/automatic.ts | 18 +++++++++++++++--- .../src/protocols/circleBridge/circleBridge.ts | 4 ++++ .../cctp/src/automaticCircleBridge.ts | 11 +++++++++++ 4 files changed, 42 insertions(+), 9 deletions(-) diff --git a/connect/src/protocols/cctp/cctpTransfer.ts b/connect/src/protocols/cctp/cctpTransfer.ts index 7ab779703..9fd358510 100644 --- a/connect/src/protocols/cctp/cctpTransfer.ts +++ b/connect/src/protocols/cctp/cctpTransfer.ts @@ -34,7 +34,13 @@ import type { TransferQuote, TransferReceipt as _TransferReceipt, } from "../../types.js"; -import { TransferState, isAttested, isSourceFinalized, isSourceInitiated } from "../../types.js"; +import { + TransferState, + isAttested, + isRedeemed, + isSourceFinalized, + isSourceInitiated, +} from "../../types.js"; import { Wormhole } from "../../wormhole.js"; import type { WormholeTransfer } from "../wormholeTransfer.js"; import { finality } from "@wormhole-foundation/sdk-base"; @@ -537,7 +543,7 @@ export namespace CircleTransfer { // Fall back to asking the destination chain if this VAA has been redeemed // assuming we have the full attestation - if (isAttested(receipt)) { + if (isAttested(receipt) || isRedeemed(receipt)) { const isComplete = await CircleTransfer.isTransferComplete( _toChain, receipt.attestation.attestation, @@ -605,15 +611,15 @@ export namespace CircleTransfer { // The fee is also removed from the amount transferred // quoted on the source chain - const stb = await srcChain.getAutomaticCircleBridge(); - const fee = await stb.getRelayerFee(dstChain.chain); + const scb = await srcChain.getAutomaticCircleBridge(); + const fee = await scb.getRelayerFee(dstChain.chain); dstAmount -= fee; // The expected destination gas can be pulled from the destination token bridge let destinationNativeGas = 0n; if (transfer.nativeGas) { - const dtb = await dstChain.getAutomaticTokenBridge(); - destinationNativeGas = await dtb.nativeTokenAmount(dstToken.address, _nativeGas); + const dcb = await dstChain.getAutomaticCircleBridge(); + destinationNativeGas = await dcb.nativeTokenAmount(_nativeGas); } return { diff --git a/connect/src/routes/cctp/automatic.ts b/connect/src/routes/cctp/automatic.ts index 6a851f2cd..8f44a9c81 100644 --- a/connect/src/routes/cctp/automatic.ts +++ b/connect/src/routes/cctp/automatic.ts @@ -168,7 +168,7 @@ export class AutomaticCCTPRoute ); } - const transferableAmount = amount.units(amt) - fee; + const redeemableAmount = amount.units(amt) - fee; const options = params.options ?? this.getDefaultOptions(); @@ -179,9 +179,21 @@ export class AutomaticCCTPRoute let nativeGasAmount = 0n; if (nativeGasPerc > 0.0) { + const dcb = await request.toChain.getAutomaticCircleBridge(); + let maxSwapAmount = await dcb.maxSwapAmount(); + if (redeemableAmount < maxSwapAmount) { + // can't swap more than the receivable amount + maxSwapAmount = redeemableAmount; + } + const scale = 10000; - const scaledGas = BigInt(nativeGasPerc * scale); - nativeGasAmount = (transferableAmount * scaledGas) / BigInt(scale); + const scaledGas = BigInt(Math.floor(nativeGasPerc * scale)); + // the native gas percentage is applied to the max swap amount + nativeGasAmount = (maxSwapAmount * scaledGas) / BigInt(scale); + if (nativeGasAmount === redeemableAmount && nativeGasAmount > 0n) { + // edge case: transfer will revert if the native gas amount is equal to the redeemable amount + nativeGasAmount -= 1n; + } } return { diff --git a/core/definitions/src/protocols/circleBridge/circleBridge.ts b/core/definitions/src/protocols/circleBridge/circleBridge.ts index 725a1364d..fd8461e54 100644 --- a/core/definitions/src/protocols/circleBridge/circleBridge.ts +++ b/core/definitions/src/protocols/circleBridge/circleBridge.ts @@ -187,4 +187,8 @@ export interface AutomaticCircleBridge>; + /** Amount of native tokens a user would receive by swapping x amount of sending tokens */ + nativeTokenAmount(amount: bigint): Promise; + /** Maximum amount of sending tokens that can be swapped for native tokens */ + maxSwapAmount(): Promise; } diff --git a/platforms/evm/protocols/cctp/src/automaticCircleBridge.ts b/platforms/evm/protocols/cctp/src/automaticCircleBridge.ts index b890b4b4a..d30cb8a06 100644 --- a/platforms/evm/protocols/cctp/src/automaticCircleBridge.ts +++ b/platforms/evm/protocols/cctp/src/automaticCircleBridge.ts @@ -163,4 +163,15 @@ export class EvmAutomaticCircleBridge parallelizable, ); } + + async nativeTokenAmount(amount: bigint): Promise { + return await this.circleRelayer.calculateNativeSwapAmountOut( + this.tokenAddr, + amount, + ); + } + + async maxSwapAmount(): Promise { + return await this.circleRelayer.calculateMaxSwapAmountIn(this.tokenAddr); + } } From 97d82a4f08028ecd9d85cd91a6f9e2196bfca5b4 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:15:27 -0500 Subject: [PATCH 10/69] tokenBridge protocol: add token address conversion methods (#649) * tokenBridge protocol: add token address conversion methods - Added getTokenUniversalAddress and getTokenNativeAddress methods to each platform's token bridge protocol implementation. - Some chains like Aptos and Sui require fetching on-chain data for token address conversions (universal to native and vice versa). - Fixed issue where lookupDestinationToken would return a universal address, causing issues in functions expecting a native address. - lookupDestinationToken now consistently returns a native address. - Resolved issues with transferring native Sui and Aptos tokens back to their origin chains. * check not a wrapped asset error --- .../protocols/tokenBridge/tokenTransfer.ts | 83 ++++++++++++------- connect/src/wormhole.ts | 33 ++++++++ .../src/protocols/tokenBridge/tokenBridge.ts | 19 +++-- .../src/testing/mocks/tokenBridge.ts | 7 +- .../protocols/tokenBridge/src/tokenBridge.ts | 10 ++- platforms/algorand/src/address.ts | 2 +- .../protocols/tokenBridge/src/tokenBridge.ts | 18 +++- .../protocols/tokenBridge/src/tokenBridge.ts | 10 ++- platforms/cosmwasm/src/gateway.ts | 2 + .../protocols/tokenBridge/src/tokenBridge.ts | 9 +- .../protocols/tokenBridge/src/tokenBridge.ts | 13 ++- .../protocols/tokenBridge/src/tokenBridge.ts | 22 +++-- 12 files changed, 175 insertions(+), 53 deletions(-) diff --git a/connect/src/protocols/tokenBridge/tokenTransfer.ts b/connect/src/protocols/tokenBridge/tokenTransfer.ts index abdb611a7..d9a6f1769 100644 --- a/connect/src/protocols/tokenBridge/tokenTransfer.ts +++ b/connect/src/protocols/tokenBridge/tokenTransfer.ts @@ -5,6 +5,7 @@ import type { AutomaticTokenBridge, ChainContext, Signer, + NativeAddress, TokenId, TokenTransferDetails, TransactionId, @@ -14,6 +15,7 @@ import type { } from "@wormhole-foundation/sdk-definitions"; import { TokenBridge, + UniversalAddress, deserialize, isNative, isTokenId, @@ -501,7 +503,6 @@ export namespace TokenTransfer { dstChain: ChainContext, token: TokenId, ): Promise> { - // that will be minted when the transfer is redeemed let lookup: TokenId; const tb = await srcChain.getTokenBridge(); if (isNative(token.address)) { @@ -514,20 +515,37 @@ export namespace TokenTransfer { } else { try { // otherwise, check to see if it is a wrapped token locally - lookup = await tb.getOriginalAsset(token.address); - } catch (e) { + let address: NativeAddress; + if (UniversalAddress.instanceof(token.address)) { + address = (await tb.getWrappedAsset(token)) as NativeAddress; + } else { + address = token.address; + } + lookup = await tb.getOriginalAsset(address); + } catch (e: any) { + if (!e.message.includes("not a wrapped asset")) throw e; // not a from-chain native wormhole-wrapped one - lookup = { chain: token.chain, address: await tb.getTokenUniversalAddress(token.address) }; + let address: NativeAddress; + if (UniversalAddress.instanceof(token.address)) { + address = await tb.getTokenNativeAddress(srcChain.chain, token.address); + } else { + address = token.address; + } + lookup = { chain: token.chain, address: await tb.getTokenUniversalAddress(address) }; } } // if the token id is actually native to the destination, return it + const dstTb = await dstChain.getTokenBridge(); if (lookup.chain === dstChain.chain) { - return lookup as TokenId; + const nativeAddress = await dstTb.getTokenNativeAddress( + lookup.chain, + lookup.address as UniversalAddress, + ); + return { chain: dstChain.chain, address: nativeAddress }; } // otherwise, figure out what the token address representing the wormhole-wrapped token we're transferring - const dstTb = await dstChain.getTokenBridge(); const dstAddress = await dstTb.getWrappedAsset(lookup); return { chain: dstChain.chain, address: dstAddress }; } @@ -627,14 +645,27 @@ export namespace TokenTransfer { dstChain: ChainContext, transfer: Omit, ): Promise { - const srcDecimals = await srcChain.getDecimals(transfer.token.address); + const srcTb = await srcChain.getTokenBridge(); + let srcToken: NativeAddress; + if (isNative(transfer.token.address)) { + srcToken = await srcTb.getWrappedNative(); + } else if (UniversalAddress.instanceof(transfer.token.address)) { + try { + srcToken = (await srcTb.getWrappedAsset(transfer.token)) as NativeAddress; + } catch (e: any) { + if (!e.message.includes("not a wrapped asset")) throw e; + srcToken = await srcTb.getTokenNativeAddress(srcChain.chain, transfer.token.address); + } + } else { + srcToken = transfer.token.address; + } + // @ts-ignore: TS2339 + const srcTokenId = Wormhole.tokenId(srcChain.chain, srcToken.toString()); + + const srcDecimals = await srcChain.getDecimals(srcToken); const srcAmount = amount.fromBaseUnits(transfer.amount, srcDecimals); const srcAmountTruncated = amount.truncate(srcAmount, TokenTransfer.MAX_DECIMALS); - const srcToken = isNative(transfer.token.address) - ? await srcChain.getNativeWrappedTokenId() - : transfer.token; - // Ensure the transfer would not violate governor transfer limits const [tokens, limits] = await Promise.all([ getGovernedTokens(wh.config.api), @@ -643,13 +674,11 @@ export namespace TokenTransfer { const warnings: QuoteWarning[] = []; if (limits !== null && srcChain.chain in limits && tokens !== null) { - const srcTb = await srcChain.getTokenBridge(); - let origAsset: TokenId; if (isNative(transfer.token.address)) { origAsset = { chain: srcChain.chain, - address: await srcTb.getTokenUniversalAddress(srcToken.address), + address: await srcTb.getTokenUniversalAddress(srcToken), }; } else { try { @@ -658,7 +687,7 @@ export namespace TokenTransfer { if (!e.message.includes("not a wrapped asset")) throw e; origAsset = { chain: srcChain.chain, - address: await srcTb.getTokenUniversalAddress(srcToken.address), + address: await srcTb.getTokenUniversalAddress(srcToken), }; } } @@ -685,26 +714,16 @@ export namespace TokenTransfer { } const dstToken = await TokenTransfer.lookupDestinationToken(srcChain, dstChain, transfer.token); - // TODO: this is a hack to get the aptos native gas token decimals - // which requires us to pass in a token address in canonical form - // but the `dstToken.address` here is in universal form - if (dstChain.chain === "Aptos" && dstToken.chain === "Aptos") { - const dstTb = await dstChain.getTokenBridge(); - const wrappedNative = await dstTb.getWrappedNative(); - if ( - dstToken.address.toString() === - (await dstTb.getTokenUniversalAddress(wrappedNative)).toString() - ) { - dstToken.address = wrappedNative; - } - } const dstDecimals = await dstChain.getDecimals(dstToken.address); const dstAmountReceivable = amount.scale(srcAmountTruncated, dstDecimals); const eta = finality.estimateFinalityTime(srcChain.chain); if (!transfer.automatic) { return { - sourceToken: { token: srcToken, amount: amount.units(srcAmountTruncated) }, + sourceToken: { + token: srcTokenId, + amount: amount.units(srcAmountTruncated), + }, destinationToken: { token: dstToken, amount: amount.units(dstAmountReceivable) }, warnings: warnings.length > 0 ? warnings : undefined, eta, @@ -716,7 +735,7 @@ export namespace TokenTransfer { // The fee is removed from the amount transferred // quoted on the source chain const stb = await srcChain.getAutomaticTokenBridge(); - const fee = await stb.getRelayerFee(dstChain.chain, srcToken.address); + const fee = await stb.getRelayerFee(dstChain.chain, srcToken); const feeAmountDest = amount.scale( amount.truncate(amount.fromBaseUnits(fee, srcDecimals), TokenTransfer.MAX_DECIMALS), dstDecimals, @@ -791,11 +810,11 @@ export namespace TokenTransfer { return { sourceToken: { - token: srcToken, + token: srcTokenId, amount: amount.units(srcAmountTruncated), }, destinationToken: { token: dstToken, amount: destAmountLessFee }, - relayFee: { token: srcToken, amount: fee }, + relayFee: { token: srcTokenId, amount: fee }, destinationNativeGas, warnings: warnings.length > 0 ? warnings : undefined, eta, diff --git a/connect/src/wormhole.ts b/connect/src/wormhole.ts index b66f15792..5352da378 100644 --- a/connect/src/wormhole.ts +++ b/connect/src/wormhole.ts @@ -39,6 +39,7 @@ import { getVaaBytesWithRetry, getVaaWithRetry, } from "./whscan-api.js"; +import { UniversalAddress } from "@wormhole-foundation/sdk-definitions"; type PlatformMap = Map>; type ChainMap = Map>; @@ -222,6 +223,38 @@ export class Wormhole { return await tb.getOriginalAsset(token.address); } + /** + * Returns the UniversalAddress of the token. This may require fetching on-chain data. + * @param chain The chain to get the UniversalAddress for + * @param token The address to get the UniversalAddress for + * @returns The UniversalAddress of the token + */ + async getTokenUniversalAddress( + chain: C, + token: NativeAddress, + ): Promise { + const ctx = this.getChain(chain); + const tb = await ctx.getTokenBridge(); + return await tb.getTokenUniversalAddress(token); + } + + /** + * Returns the native address of the token. This may require fetching on-chain data. + * @param chain The chain to get the native address for + * @param originChain The chain the token is from / native to + * @param token The address to get the native address for + * @returns The native address of the token + */ + async getTokenNativeAddress( + chain: C, + originChain: Chain, + token: UniversalAddress, + ): Promise> { + const ctx = this.getChain(chain); + const tb = await ctx.getTokenBridge(); + return await tb.getTokenNativeAddress(originChain, token); + } + /** * Gets the number of decimals for a token on a given chain * diff --git a/core/definitions/src/protocols/tokenBridge/tokenBridge.ts b/core/definitions/src/protocols/tokenBridge/tokenBridge.ts index 3982b0730..56b263936 100644 --- a/core/definitions/src/protocols/tokenBridge/tokenBridge.ts +++ b/core/definitions/src/protocols/tokenBridge/tokenBridge.ts @@ -1,7 +1,7 @@ import type { Chain, Network } from "@wormhole-foundation/sdk-base"; import { lazyInstantiate } from "@wormhole-foundation/sdk-base"; -import type { AccountAddress, ChainAddress } from "../../address.js"; -import { UniversalAddress } from "../../universalAddress.js"; +import type { AccountAddress, ChainAddress, NativeAddress } from "../../address.js"; +import type { UniversalAddress } from "../../universalAddress.js"; import type { TokenAddress, TokenId } from "../../types.js"; import type { UnsignedTransaction } from "../../unsignedTransaction.js"; import type { ProtocolPayload, ProtocolVAA } from "./../../vaa/index.js"; @@ -135,19 +135,26 @@ export interface TokenBridge): Promise>; /** - * Returns the UniversalAddress of the token. This may require retrieving data on-chain. + * Returns the UniversalAddress of the token. This may require fetching on-chain data. * - * @param nativeAddress The address to get the UniversalAddress for + * @param token The address to get the UniversalAddress for * @returns The UniversalAddress of the token */ - getTokenUniversalAddress(nativeAddress: TokenAddress): Promise; + getTokenUniversalAddress(token: NativeAddress): Promise; + /** + * Returns the native address of the token. This may require fetching on-chain data. + * @param originChain The chain the token is from / native to + * @param token The address to get the native address for + * @returns The native address of the token + */ + getTokenNativeAddress(originChain: Chain, token: UniversalAddress): Promise>; /** * returns the wrapped version of the native asset * * @returns The address of the native gas token that has been wrapped * for use where the gas token is not possible to use (e.g. bridging) */ - getWrappedNative(): Promise>; + getWrappedNative(): Promise>; /** * Check to see if a foreign token has a wrapped version * diff --git a/core/definitions/src/testing/mocks/tokenBridge.ts b/core/definitions/src/testing/mocks/tokenBridge.ts index f56c00004..283a97345 100644 --- a/core/definitions/src/testing/mocks/tokenBridge.ts +++ b/core/definitions/src/testing/mocks/tokenBridge.ts @@ -1,4 +1,4 @@ -import type { Network, Platform, PlatformToChains } from "@wormhole-foundation/sdk-base"; +import type { Chain, Network, Platform, PlatformToChains } from "@wormhole-foundation/sdk-base"; import type { ChainAddress, NativeAddress, @@ -20,7 +20,10 @@ export class MockTokenBridge): Promise { throw new Error("Method not implemented."); } - getTokenUniversalAddress(nativeAddress: TokenAddress): Promise { + getTokenUniversalAddress(token: NativeAddress): Promise { + throw new Error("Method not implemented."); + } + getTokenNativeAddress(originChain: Chain, token: UniversalAddress): Promise> { throw new Error("Method not implemented."); } hasWrappedAsset(original: ChainAddress): Promise { diff --git a/platforms/algorand/protocols/tokenBridge/src/tokenBridge.ts b/platforms/algorand/protocols/tokenBridge/src/tokenBridge.ts index 189006fb7..538ff546f 100644 --- a/platforms/algorand/protocols/tokenBridge/src/tokenBridge.ts +++ b/platforms/algorand/protocols/tokenBridge/src/tokenBridge.ts @@ -146,12 +146,20 @@ export class AlgorandTokenBridge return { chain, address }; } - async getTokenUniversalAddress(token: TokenAddress): Promise { + async getTokenUniversalAddress(token: NativeAddress): Promise { return new AlgorandAddress(token).toUniversalAddress(); } + async getTokenNativeAddress( + originChain: Chain, + token: UniversalAddress, + ): Promise> { + return new AlgorandAddress(token).toNative() as NativeAddress; + } + // Returns the address of the native version of this asset async getWrappedAsset(token: TokenId): Promise> { + if (isNative(token.address)) throw new Error("native asset cannot be a wrapped asset"); const storageAccount = StorageLogicSig.forWrappedAsset(this.tokenBridgeAppId, token); const data = await StorageLogicSig.decodeLocalState( this.connection, diff --git a/platforms/algorand/src/address.ts b/platforms/algorand/src/address.ts index 472d6aecf..7c7a75162 100644 --- a/platforms/algorand/src/address.ts +++ b/platforms/algorand/src/address.ts @@ -8,7 +8,7 @@ import { _platform, safeBigIntToNumber } from "./types.js"; export const AlgorandZeroAddress = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ"; // Note: for ASA/App IDs we encode them as 8 bytes at the start of -// the 32 byte adddress bytes. +// the 32 byte address bytes. export class AlgorandAddress implements Address { static readonly byteSize = 32; diff --git a/platforms/aptos/protocols/tokenBridge/src/tokenBridge.ts b/platforms/aptos/protocols/tokenBridge/src/tokenBridge.ts index 4c1acdc36..3f503dce1 100644 --- a/platforms/aptos/protocols/tokenBridge/src/tokenBridge.ts +++ b/platforms/aptos/protocols/tokenBridge/src/tokenBridge.ts @@ -1,8 +1,10 @@ import type { + Chain, ChainAddress, ChainId, ChainsConfig, Contracts, + NativeAddress, Network, TokenBridge, TokenId, @@ -98,10 +100,23 @@ export class AptosTokenBridge return { chain, address }; } - async getTokenUniversalAddress(token: AnyAptosAddress): Promise { + async getTokenUniversalAddress(token: NativeAddress): Promise { return new UniversalAddress(encoding.hex.encode(sha3_256(token.toString()), true)); } + async getTokenNativeAddress( + originChain: Chain, + token: UniversalAddress, + ): Promise> { + const assetType = + originChain === this.chain + ? await this.getTypeFromExternalAddress(token.toString()) + : await this.getAssetFullyQualifiedType({ chain: originChain, address: token }); + + if (!assetType) throw new Error("Invalid asset address."); + return new AptosAddress(assetType) as NativeAddress; + } + async hasWrappedAsset(token: TokenId): Promise { try { await this.getWrappedAsset(token); @@ -111,6 +126,7 @@ export class AptosTokenBridge } async getWrappedAsset(token: TokenId) { + if (isNative(token.address)) throw new Error("native asset cannot be a wrapped asset"); const assetFullyQualifiedType = await this.getAssetFullyQualifiedType(token); if (!assetFullyQualifiedType) throw new Error("Invalid asset address."); diff --git a/platforms/cosmwasm/protocols/tokenBridge/src/tokenBridge.ts b/platforms/cosmwasm/protocols/tokenBridge/src/tokenBridge.ts index e0b05bda6..06b4db4ee 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/src/tokenBridge.ts +++ b/platforms/cosmwasm/protocols/tokenBridge/src/tokenBridge.ts @@ -1,5 +1,6 @@ import type { CosmWasmClient } from "@cosmjs/cosmwasm-stargate"; import type { + Chain, ChainAddress, ChainsConfig, Contracts, @@ -125,10 +126,17 @@ export class CosmwasmTokenBridge }; } - async getTokenUniversalAddress(token: AnyCosmwasmAddress): Promise { + async getTokenUniversalAddress(token: NativeAddress): Promise { return new CosmwasmAddress(token).toUniversalAddress(); } + async getTokenNativeAddress( + originChain: Chain, + token: UniversalAddress, + ): Promise> { + return new CosmwasmAddress(token).toNative() as NativeAddress; + } + async isTransferCompleted(vaa: TokenBridge.TransferVAA): Promise { const data = encoding.b64.encode(serialize(vaa)); const result = await this.rpc.queryContractSmart(this.tokenBridge, { diff --git a/platforms/cosmwasm/src/gateway.ts b/platforms/cosmwasm/src/gateway.ts index c74e593eb..c37591b36 100644 --- a/platforms/cosmwasm/src/gateway.ts +++ b/platforms/cosmwasm/src/gateway.ts @@ -12,6 +12,7 @@ import { CosmwasmChain } from "./chain.js"; import { IBC_TRANSFER_PORT } from "./constants.js"; import { CosmwasmPlatform } from "./platform.js"; import type { CosmwasmChains } from "./types.js"; +import { isNative } from "@wormhole-foundation/sdk-connect"; export class Gateway extends CosmwasmChain { static chain: "Wormchain" = "Wormchain"; @@ -25,6 +26,7 @@ export class Gateway extends CosmwasmChain { // Get the wrapped version of an asset created on wormchain async getWrappedAsset(token: TokenId): Promise { + if (isNative(token.address)) throw new Error("native asset cannot be a wrapped asset"); const tb = await this.getTokenBridge(); const wrappedAsset = new CosmwasmAddress(await tb.getWrappedAsset(token)); diff --git a/platforms/evm/protocols/tokenBridge/src/tokenBridge.ts b/platforms/evm/protocols/tokenBridge/src/tokenBridge.ts index 84fc413b5..9ed731131 100644 --- a/platforms/evm/protocols/tokenBridge/src/tokenBridge.ts +++ b/platforms/evm/protocols/tokenBridge/src/tokenBridge.ts @@ -106,11 +106,18 @@ export class EvmTokenBridge } async getTokenUniversalAddress( - token: TokenAddress, + token: NativeAddress, ): Promise { return new EvmAddress(token).toUniversalAddress(); } + async getTokenNativeAddress( + originChain: Chain, + token: UniversalAddress, + ): Promise> { + return new EvmAddress(token).toNative() as NativeAddress; + } + async hasWrappedAsset(token: TokenId): Promise { try { await this.getWrappedAsset(token); diff --git a/platforms/solana/protocols/tokenBridge/src/tokenBridge.ts b/platforms/solana/protocols/tokenBridge/src/tokenBridge.ts index f01c3e909..a2f284ab8 100644 --- a/platforms/solana/protocols/tokenBridge/src/tokenBridge.ts +++ b/platforms/solana/protocols/tokenBridge/src/tokenBridge.ts @@ -1,8 +1,10 @@ import type { + Chain, ChainAddress, ChainId, ChainsConfig, Contracts, + NativeAddress, Network, Platform, TokenBridge, @@ -157,7 +159,7 @@ export class SolanaTokenBridge return { chain: toChain(meta.chain as ChainId), - address: new UniversalAddress(meta.tokenAddress), + address: new UniversalAddress(new Uint8Array(meta.tokenAddress)), }; } catch (_) { throw ErrNotWrapped(token.toString()); @@ -165,11 +167,18 @@ export class SolanaTokenBridge } async getTokenUniversalAddress( - token: AnySolanaAddress, + token: NativeAddress, ): Promise { return new SolanaAddress(token).toUniversalAddress(); } + async getTokenNativeAddress( + originChain: Chain, + token: UniversalAddress, + ): Promise> { + return new SolanaAddress(token).toNative() as NativeAddress; + } + async hasWrappedAsset(token: TokenId): Promise { try { await this.getWrappedAsset(token); diff --git a/platforms/sui/protocols/tokenBridge/src/tokenBridge.ts b/platforms/sui/protocols/tokenBridge/src/tokenBridge.ts index 929b0b48e..14dff4dd2 100644 --- a/platforms/sui/protocols/tokenBridge/src/tokenBridge.ts +++ b/platforms/sui/protocols/tokenBridge/src/tokenBridge.ts @@ -29,7 +29,8 @@ import { toNative, } from "@wormhole-foundation/sdk-connect"; -import type { SuiAddress, SuiBuildOutput, SuiChains } from "@wormhole-foundation/sdk-sui"; +import type { SuiBuildOutput, SuiChains } from "@wormhole-foundation/sdk-sui"; +import { SuiAddress } from "@wormhole-foundation/sdk-sui"; import { SuiPlatform, SuiUnsignedTransaction, @@ -148,7 +149,7 @@ export class SuiTokenBridge implements T throw ErrNotWrapped(coinType); } - async getTokenUniversalAddress(token: TokenAddress): Promise { + async getTokenUniversalAddress(token: NativeAddress): Promise { let coinType = (token as SuiAddress).getCoinType(); if (!isValidSuiType(coinType)) throw new Error(`Invalid Sui type: ${coinType}`); @@ -190,11 +191,20 @@ export class SuiTokenBridge implements T } throw new Error(`Token of type ${coinType} is not a native asset`); + } - //// TODO: implement - //return new UniversalAddress( - // Buffer.from("9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3", "hex"), - //); + async getTokenNativeAddress( + originChain: Chain, + token: UniversalAddress, + ): Promise> { + const address = await getTokenCoinType( + this.provider, + this.tokenBridgeObjectId, + token.toUint8Array(), + toChainId(originChain), + ); + if (!address) throw new Error(`Token ${token.toString()} not found in token registry`); + return new SuiAddress(address) as NativeAddress; } async hasWrappedAsset(token: TokenId): Promise { From 6ac2e72eb39b46f5d92cef725b9eeb2372d78c01 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:26:19 -0500 Subject: [PATCH 11/69] version 0.9.0 (#657) --- connect/package.json | 6 +-- core/base/package.json | 2 +- core/definitions/package.json | 4 +- core/icons/package.json | 4 +- examples/package.json | 4 +- package.json | 2 +- platforms/algorand/package.json | 4 +- .../algorand/protocols/core/package.json | 6 +-- .../protocols/tokenBridge/package.json | 8 +-- platforms/aptos/package.json | 4 +- platforms/aptos/protocols/core/package.json | 6 +-- .../aptos/protocols/tokenBridge/package.json | 6 +-- platforms/cosmwasm/package.json | 4 +- .../cosmwasm/protocols/core/package.json | 6 +-- platforms/cosmwasm/protocols/ibc/package.json | 8 +-- .../protocols/tokenBridge/package.json | 6 +-- platforms/evm/package.json | 4 +- platforms/evm/protocols/cctp/package.json | 6 +-- platforms/evm/protocols/core/package.json | 6 +-- platforms/evm/protocols/portico/package.json | 10 ++-- .../evm/protocols/tokenBridge/package.json | 8 +-- platforms/solana/package.json | 4 +- platforms/solana/protocols/cctp/package.json | 6 +-- platforms/solana/protocols/core/package.json | 6 +-- .../solana/protocols/tokenBridge/package.json | 8 +-- platforms/sui/package.json | 4 +- platforms/sui/protocols/core/package.json | 6 +-- .../sui/protocols/tokenBridge/package.json | 8 +-- sdk/package.json | 52 +++++++++---------- 29 files changed, 104 insertions(+), 104 deletions(-) diff --git a/connect/package.json b/connect/package.json index 5d130e207..1965a706c 100644 --- a/connect/package.json +++ b/connect/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-connect", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -98,8 +98,8 @@ }, "dependencies": { "axios": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.8.2-beta.0", - "@wormhole-foundation/sdk-definitions": "0.8.2-beta.0" + "@wormhole-foundation/sdk-base": "0.9.0", + "@wormhole-foundation/sdk-definitions": "0.9.0" }, "type": "module" } \ No newline at end of file diff --git a/core/base/package.json b/core/base/package.json index 4407b5290..e24bfd7f2 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-base", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" diff --git a/core/definitions/package.json b/core/definitions/package.json index c51b02a63..e1066b0f5 100644 --- a/core/definitions/package.json +++ b/core/definitions/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -86,7 +86,7 @@ "dependencies": { "@noble/hashes": "^1.3.1", "@noble/curves": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.8.2-beta.0" + "@wormhole-foundation/sdk-base": "0.9.0" }, "type": "module" } \ No newline at end of file diff --git a/core/icons/package.json b/core/icons/package.json index 3e1e89631..6915ba416 100644 --- a/core/icons/package.json +++ b/core/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-icons", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -50,7 +50,7 @@ "dist/cjs" ], "dependencies": { - "@wormhole-foundation/sdk-base": "0.8.2-beta.0" + "@wormhole-foundation/sdk-base": "0.9.0" }, "sideEffects": false, "scripts": { diff --git a/examples/package.json b/examples/package.json index c651f0058..222e5b297 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -51,6 +51,6 @@ "tsx": "^4.7.0" }, "dependencies": { - "@wormhole-foundation/sdk": "0.8.2-beta.0" + "@wormhole-foundation/sdk": "0.9.0" } } \ No newline at end of file diff --git a/package.json b/package.json index 81d132271..542137a5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sdk", - "version": "0.8.2-beta.0", + "version": "0.9.0", "license": "Apache-2.0", "directories": { "test": "__tests__" diff --git a/platforms/algorand/package.json b/platforms/algorand/package.json index 84e9cd050..cd74a48aa 100644 --- a/platforms/algorand/package.json +++ b/platforms/algorand/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -96,7 +96,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", + "@wormhole-foundation/sdk-connect": "0.9.0", "algosdk": "2.7.0" }, "type": "module" diff --git a/platforms/algorand/protocols/core/package.json b/platforms/algorand/protocols/core/package.json index 1908c66f0..f6f7d6a74 100644 --- a/platforms/algorand/protocols/core/package.json +++ b/platforms/algorand/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-algorand": "0.8.2-beta.0" + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-algorand": "0.9.0" }, "type": "module", "exports": { diff --git a/platforms/algorand/protocols/tokenBridge/package.json b/platforms/algorand/protocols/tokenBridge/package.json index 55965c518..227502315 100644 --- a/platforms/algorand/protocols/tokenBridge/package.json +++ b/platforms/algorand/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-algorand": "0.8.2-beta.0", - "@wormhole-foundation/sdk-algorand-core": "0.8.2-beta.0" + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-algorand": "0.9.0", + "@wormhole-foundation/sdk-algorand-core": "0.9.0" }, "type": "module", "exports": { diff --git a/platforms/aptos/package.json b/platforms/aptos/package.json index 9dd8ba5c4..22b91d78e 100644 --- a/platforms/aptos/package.json +++ b/platforms/aptos/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", + "@wormhole-foundation/sdk-connect": "0.9.0", "aptos": "1.21.0" }, "type": "module", diff --git a/platforms/aptos/protocols/core/package.json b/platforms/aptos/protocols/core/package.json index ea40777ff..d06ed9cb5 100644 --- a/platforms/aptos/protocols/core/package.json +++ b/platforms/aptos/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-aptos": "0.8.2-beta.0" + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-aptos": "0.9.0" }, "type": "module", "exports": { diff --git a/platforms/aptos/protocols/tokenBridge/package.json b/platforms/aptos/protocols/tokenBridge/package.json index 1261652b2..44060bc74 100644 --- a/platforms/aptos/protocols/tokenBridge/package.json +++ b/platforms/aptos/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-aptos": "0.8.2-beta.0" + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-aptos": "0.9.0" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/package.json b/platforms/cosmwasm/package.json index 5e7e4afa8..69f918435 100644 --- a/platforms/cosmwasm/package.json +++ b/platforms/cosmwasm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", + "@wormhole-foundation/sdk-connect": "0.9.0", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", diff --git a/platforms/cosmwasm/protocols/core/package.json b/platforms/cosmwasm/protocols/core/package.json index 7d906db7b..e4cd566df 100644 --- a/platforms/cosmwasm/protocols/core/package.json +++ b/platforms/cosmwasm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-cosmwasm": "0.8.2-beta.0", + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-cosmwasm": "0.9.0", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2" diff --git a/platforms/cosmwasm/protocols/ibc/package.json b/platforms/cosmwasm/protocols/ibc/package.json index cf709f540..8cf12f873 100644 --- a/platforms/cosmwasm/protocols/ibc/package.json +++ b/platforms/cosmwasm/protocols/ibc/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,9 +57,9 @@ "@cosmjs/stargate": "^0.32.0", "cosmjs-types": "^0.9.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-cosmwasm": "0.8.2-beta.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.8.2-beta.0" + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-cosmwasm": "0.9.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.9.0" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/protocols/tokenBridge/package.json b/platforms/cosmwasm/protocols/tokenBridge/package.json index 41b515fc2..1c7b22894 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/package.json +++ b/platforms/cosmwasm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -54,8 +54,8 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.14.13-beta.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-cosmwasm": "0.8.2-beta.0" + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-cosmwasm": "0.9.0" }, "type": "module", "exports": { diff --git a/platforms/evm/package.json b/platforms/evm/package.json index ad9a81b28..34bf2c9f7 100644 --- a/platforms/evm/package.json +++ b/platforms/evm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,7 +57,7 @@ "nock": "13.3.8" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", + "@wormhole-foundation/sdk-connect": "0.9.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index 3a7d73b5b..deebc8ba3 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,8 +53,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-evm": "0.8.2-beta.0", + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-evm": "0.9.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/core/package.json b/platforms/evm/protocols/core/package.json index 496398916..84ca47d8d 100644 --- a/platforms/evm/protocols/core/package.json +++ b/platforms/evm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-evm": "0.8.2-beta.0", + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-evm": "0.9.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/package.json b/platforms/evm/protocols/portico/package.json index 1f016dfc0..2904ea359 100644 --- a/platforms/evm/protocols/portico/package.json +++ b/platforms/evm/protocols/portico/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,10 +52,10 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-evm": "0.8.2-beta.0", - "@wormhole-foundation/sdk-evm-core": "0.8.2-beta.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.8.2-beta.0", + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-evm": "0.9.0", + "@wormhole-foundation/sdk-evm-core": "0.9.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.9.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/tokenBridge/package.json b/platforms/evm/protocols/tokenBridge/package.json index 63a54611a..5a592331c 100644 --- a/platforms/evm/protocols/tokenBridge/package.json +++ b/platforms/evm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,9 +52,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-evm": "0.8.2-beta.0", - "@wormhole-foundation/sdk-evm-core": "0.8.2-beta.0", + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-evm": "0.9.0", + "@wormhole-foundation/sdk-evm-core": "0.9.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/solana/package.json b/platforms/solana/package.json index 85031acaf..c1c18b267 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -49,7 +49,7 @@ "nock": "^13.3.3" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", + "@wormhole-foundation/sdk-connect": "0.9.0", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index 031041c4d..3a40bf171 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -48,8 +48,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-solana": "0.8.2-beta.0", + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-solana": "0.9.0", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7" diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index b33ecb786..2ecb1287c 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-solana": "0.8.2-beta.0", + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-solana": "0.9.0", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/web3.js": "1.91.7" diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index 66ccd93c7..09fbaad62 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-solana": "0.8.2-beta.0", - "@wormhole-foundation/sdk-solana-core": "0.8.2-beta.0", + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-solana": "0.9.0", + "@wormhole-foundation/sdk-solana-core": "0.9.0", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7" diff --git a/platforms/sui/package.json b/platforms/sui/package.json index cb7541a31..b0c7faa6b 100644 --- a/platforms/sui/package.json +++ b/platforms/sui/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", + "@wormhole-foundation/sdk-connect": "0.9.0", "@mysten/sui.js": "^0.50.1" }, "type": "module", diff --git a/platforms/sui/protocols/core/package.json b/platforms/sui/protocols/core/package.json index b94e9beb4..ea2206650 100644 --- a/platforms/sui/protocols/core/package.json +++ b/platforms/sui/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-sui": "0.8.2-beta.0" + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-sui": "0.9.0" }, "type": "module", "exports": { diff --git a/platforms/sui/protocols/tokenBridge/package.json b/platforms/sui/protocols/tokenBridge/package.json index 3f8c241e1..8b2d55278 100644 --- a/platforms/sui/protocols/tokenBridge/package.json +++ b/platforms/sui/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,9 +46,9 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-sui": "0.8.2-beta.0", - "@wormhole-foundation/sdk-sui-core": "0.8.2-beta.0" + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-sui": "0.9.0", + "@wormhole-foundation/sdk-sui-core": "0.9.0" }, "type": "module", "exports": { diff --git a/sdk/package.json b/sdk/package.json index 33b6ce69b..3c157b59e 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk", - "version": "0.8.2-beta.0", + "version": "0.9.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -384,31 +384,31 @@ } }, "dependencies": { - "@wormhole-foundation/sdk-base": "0.8.2-beta.0", - "@wormhole-foundation/sdk-definitions": "0.8.2-beta.0", - "@wormhole-foundation/sdk-connect": "0.8.2-beta.0", - "@wormhole-foundation/sdk-evm": "0.8.2-beta.0", - "@wormhole-foundation/sdk-evm-core": "0.8.2-beta.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.8.2-beta.0", - "@wormhole-foundation/sdk-evm-portico": "0.8.2-beta.0", - "@wormhole-foundation/sdk-evm-cctp": "0.8.2-beta.0", - "@wormhole-foundation/sdk-solana": "0.8.2-beta.0", - "@wormhole-foundation/sdk-solana-core": "0.8.2-beta.0", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.8.2-beta.0", - "@wormhole-foundation/sdk-solana-cctp": "0.8.2-beta.0", - "@wormhole-foundation/sdk-cosmwasm": "0.8.2-beta.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.8.2-beta.0", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.8.2-beta.0", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.8.2-beta.0", - "@wormhole-foundation/sdk-sui": "0.8.2-beta.0", - "@wormhole-foundation/sdk-sui-core": "0.8.2-beta.0", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.8.2-beta.0", - "@wormhole-foundation/sdk-aptos": "0.8.2-beta.0", - "@wormhole-foundation/sdk-aptos-core": "0.8.2-beta.0", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.8.2-beta.0", - "@wormhole-foundation/sdk-algorand": "0.8.2-beta.0", - "@wormhole-foundation/sdk-algorand-core": "0.8.2-beta.0", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.8.2-beta.0" + "@wormhole-foundation/sdk-base": "0.9.0", + "@wormhole-foundation/sdk-definitions": "0.9.0", + "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-evm": "0.9.0", + "@wormhole-foundation/sdk-evm-core": "0.9.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.9.0", + "@wormhole-foundation/sdk-evm-portico": "0.9.0", + "@wormhole-foundation/sdk-evm-cctp": "0.9.0", + "@wormhole-foundation/sdk-solana": "0.9.0", + "@wormhole-foundation/sdk-solana-core": "0.9.0", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.9.0", + "@wormhole-foundation/sdk-solana-cctp": "0.9.0", + "@wormhole-foundation/sdk-cosmwasm": "0.9.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.9.0", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.9.0", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.9.0", + "@wormhole-foundation/sdk-sui": "0.9.0", + "@wormhole-foundation/sdk-sui-core": "0.9.0", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.9.0", + "@wormhole-foundation/sdk-aptos": "0.9.0", + "@wormhole-foundation/sdk-aptos-core": "0.9.0", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.9.0", + "@wormhole-foundation/sdk-algorand": "0.9.0", + "@wormhole-foundation/sdk-algorand-core": "0.9.0", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.9.0" }, "type": "module" } \ No newline at end of file From e91bcced4e55ab022bf623c1e034b5842a260599 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Wed, 7 Aug 2024 08:07:32 -0500 Subject: [PATCH 12/69] Sui vite fix (#658) * sui: explicitly set SuiAddress platform There is an issue with vite/rollup where the platform is being set to undefined when running an app built with the SDK on the local dev server. A similar issue was fixed here: https://github.com/wormhole-foundation/wormhole-sdk-ts/pull/615 It's not clear what the root cause is and if it's an actual bug in vite/rollup or in the SDK. * 0.9.1 version bump --- connect/package.json | 6 +-- core/base/package.json | 2 +- core/definitions/package.json | 4 +- core/icons/package.json | 4 +- examples/package.json | 4 +- package.json | 2 +- platforms/algorand/package.json | 4 +- .../algorand/protocols/core/package.json | 6 +-- .../protocols/tokenBridge/package.json | 8 +-- platforms/aptos/package.json | 4 +- platforms/aptos/protocols/core/package.json | 6 +-- .../aptos/protocols/tokenBridge/package.json | 6 +-- platforms/cosmwasm/package.json | 4 +- .../cosmwasm/protocols/core/package.json | 6 +-- platforms/cosmwasm/protocols/ibc/package.json | 8 +-- .../protocols/tokenBridge/package.json | 6 +-- platforms/evm/package.json | 4 +- platforms/evm/protocols/cctp/package.json | 6 +-- platforms/evm/protocols/core/package.json | 6 +-- platforms/evm/protocols/portico/package.json | 10 ++-- .../evm/protocols/tokenBridge/package.json | 8 +-- platforms/solana/package.json | 4 +- platforms/solana/protocols/cctp/package.json | 6 +-- platforms/solana/protocols/core/package.json | 6 +-- .../solana/protocols/tokenBridge/package.json | 8 +-- platforms/sui/package.json | 4 +- platforms/sui/protocols/core/package.json | 6 +-- .../sui/protocols/tokenBridge/package.json | 8 +-- platforms/sui/src/address.ts | 2 +- sdk/package.json | 52 +++++++++---------- 30 files changed, 105 insertions(+), 105 deletions(-) diff --git a/connect/package.json b/connect/package.json index 1965a706c..56595f173 100644 --- a/connect/package.json +++ b/connect/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-connect", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -98,8 +98,8 @@ }, "dependencies": { "axios": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.9.0", - "@wormhole-foundation/sdk-definitions": "0.9.0" + "@wormhole-foundation/sdk-base": "0.9.1", + "@wormhole-foundation/sdk-definitions": "0.9.1" }, "type": "module" } \ No newline at end of file diff --git a/core/base/package.json b/core/base/package.json index e24bfd7f2..b0057389b 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-base", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" diff --git a/core/definitions/package.json b/core/definitions/package.json index e1066b0f5..c47f5b241 100644 --- a/core/definitions/package.json +++ b/core/definitions/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -86,7 +86,7 @@ "dependencies": { "@noble/hashes": "^1.3.1", "@noble/curves": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.9.0" + "@wormhole-foundation/sdk-base": "0.9.1" }, "type": "module" } \ No newline at end of file diff --git a/core/icons/package.json b/core/icons/package.json index 6915ba416..5515de7c0 100644 --- a/core/icons/package.json +++ b/core/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-icons", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -50,7 +50,7 @@ "dist/cjs" ], "dependencies": { - "@wormhole-foundation/sdk-base": "0.9.0" + "@wormhole-foundation/sdk-base": "0.9.1" }, "sideEffects": false, "scripts": { diff --git a/examples/package.json b/examples/package.json index 222e5b297..e69b1decc 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -51,6 +51,6 @@ "tsx": "^4.7.0" }, "dependencies": { - "@wormhole-foundation/sdk": "0.9.0" + "@wormhole-foundation/sdk": "0.9.1" } } \ No newline at end of file diff --git a/package.json b/package.json index 542137a5f..edbffae6e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sdk", - "version": "0.9.0", + "version": "0.9.1", "license": "Apache-2.0", "directories": { "test": "__tests__" diff --git a/platforms/algorand/package.json b/platforms/algorand/package.json index cd74a48aa..512bf36d7 100644 --- a/platforms/algorand/package.json +++ b/platforms/algorand/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -96,7 +96,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-connect": "0.9.1", "algosdk": "2.7.0" }, "type": "module" diff --git a/platforms/algorand/protocols/core/package.json b/platforms/algorand/protocols/core/package.json index f6f7d6a74..255597b34 100644 --- a/platforms/algorand/protocols/core/package.json +++ b/platforms/algorand/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-algorand": "0.9.0" + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-algorand": "0.9.1" }, "type": "module", "exports": { diff --git a/platforms/algorand/protocols/tokenBridge/package.json b/platforms/algorand/protocols/tokenBridge/package.json index 227502315..2b6213c8d 100644 --- a/platforms/algorand/protocols/tokenBridge/package.json +++ b/platforms/algorand/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-algorand": "0.9.0", - "@wormhole-foundation/sdk-algorand-core": "0.9.0" + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-algorand": "0.9.1", + "@wormhole-foundation/sdk-algorand-core": "0.9.1" }, "type": "module", "exports": { diff --git a/platforms/aptos/package.json b/platforms/aptos/package.json index 22b91d78e..b465d760b 100644 --- a/platforms/aptos/package.json +++ b/platforms/aptos/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-connect": "0.9.1", "aptos": "1.21.0" }, "type": "module", diff --git a/platforms/aptos/protocols/core/package.json b/platforms/aptos/protocols/core/package.json index d06ed9cb5..cc121a4a8 100644 --- a/platforms/aptos/protocols/core/package.json +++ b/platforms/aptos/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-aptos": "0.9.0" + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-aptos": "0.9.1" }, "type": "module", "exports": { diff --git a/platforms/aptos/protocols/tokenBridge/package.json b/platforms/aptos/protocols/tokenBridge/package.json index 44060bc74..ef4c8c7fb 100644 --- a/platforms/aptos/protocols/tokenBridge/package.json +++ b/platforms/aptos/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-aptos": "0.9.0" + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-aptos": "0.9.1" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/package.json b/platforms/cosmwasm/package.json index 69f918435..4de4e9357 100644 --- a/platforms/cosmwasm/package.json +++ b/platforms/cosmwasm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-connect": "0.9.1", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", diff --git a/platforms/cosmwasm/protocols/core/package.json b/platforms/cosmwasm/protocols/core/package.json index e4cd566df..07b467d1c 100644 --- a/platforms/cosmwasm/protocols/core/package.json +++ b/platforms/cosmwasm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-cosmwasm": "0.9.0", + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-cosmwasm": "0.9.1", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2" diff --git a/platforms/cosmwasm/protocols/ibc/package.json b/platforms/cosmwasm/protocols/ibc/package.json index 8cf12f873..5b59f4717 100644 --- a/platforms/cosmwasm/protocols/ibc/package.json +++ b/platforms/cosmwasm/protocols/ibc/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,9 +57,9 @@ "@cosmjs/stargate": "^0.32.0", "cosmjs-types": "^0.9.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-cosmwasm": "0.9.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.9.0" + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-cosmwasm": "0.9.1", + "@wormhole-foundation/sdk-cosmwasm-core": "0.9.1" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/protocols/tokenBridge/package.json b/platforms/cosmwasm/protocols/tokenBridge/package.json index 1c7b22894..c4e2c4173 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/package.json +++ b/platforms/cosmwasm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -54,8 +54,8 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.14.13-beta.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-cosmwasm": "0.9.0" + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-cosmwasm": "0.9.1" }, "type": "module", "exports": { diff --git a/platforms/evm/package.json b/platforms/evm/package.json index 34bf2c9f7..cb21cad3d 100644 --- a/platforms/evm/package.json +++ b/platforms/evm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,7 +57,7 @@ "nock": "13.3.8" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-connect": "0.9.1", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index deebc8ba3..4c9be8ea2 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,8 +53,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-evm": "0.9.0", + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-evm": "0.9.1", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/core/package.json b/platforms/evm/protocols/core/package.json index 84ca47d8d..157238caf 100644 --- a/platforms/evm/protocols/core/package.json +++ b/platforms/evm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-evm": "0.9.0", + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-evm": "0.9.1", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/package.json b/platforms/evm/protocols/portico/package.json index 2904ea359..9c96046f1 100644 --- a/platforms/evm/protocols/portico/package.json +++ b/platforms/evm/protocols/portico/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,10 +52,10 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-evm": "0.9.0", - "@wormhole-foundation/sdk-evm-core": "0.9.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.9.0", + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-evm": "0.9.1", + "@wormhole-foundation/sdk-evm-core": "0.9.1", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.9.1", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/tokenBridge/package.json b/platforms/evm/protocols/tokenBridge/package.json index 5a592331c..fe3770bef 100644 --- a/platforms/evm/protocols/tokenBridge/package.json +++ b/platforms/evm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,9 +52,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-evm": "0.9.0", - "@wormhole-foundation/sdk-evm-core": "0.9.0", + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-evm": "0.9.1", + "@wormhole-foundation/sdk-evm-core": "0.9.1", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/solana/package.json b/platforms/solana/package.json index c1c18b267..eaa89ecd6 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -49,7 +49,7 @@ "nock": "^13.3.3" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-connect": "0.9.1", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index 3a40bf171..0ad3e3a3c 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -48,8 +48,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-solana": "0.9.0", + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-solana": "0.9.1", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7" diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index 2ecb1287c..e55d0e70f 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-solana": "0.9.0", + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-solana": "0.9.1", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/web3.js": "1.91.7" diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index 09fbaad62..affc4c20e 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-solana": "0.9.0", - "@wormhole-foundation/sdk-solana-core": "0.9.0", + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-solana": "0.9.1", + "@wormhole-foundation/sdk-solana-core": "0.9.1", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7" diff --git a/platforms/sui/package.json b/platforms/sui/package.json index b0c7faa6b..542aef271 100644 --- a/platforms/sui/package.json +++ b/platforms/sui/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.0", + "@wormhole-foundation/sdk-connect": "0.9.1", "@mysten/sui.js": "^0.50.1" }, "type": "module", diff --git a/platforms/sui/protocols/core/package.json b/platforms/sui/protocols/core/package.json index ea2206650..2ce5e574e 100644 --- a/platforms/sui/protocols/core/package.json +++ b/platforms/sui/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-sui": "0.9.0" + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-sui": "0.9.1" }, "type": "module", "exports": { diff --git a/platforms/sui/protocols/tokenBridge/package.json b/platforms/sui/protocols/tokenBridge/package.json index 8b2d55278..7368395d1 100644 --- a/platforms/sui/protocols/tokenBridge/package.json +++ b/platforms/sui/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,9 +46,9 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-sui": "0.9.0", - "@wormhole-foundation/sdk-sui-core": "0.9.0" + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-sui": "0.9.1", + "@wormhole-foundation/sdk-sui-core": "0.9.1" }, "type": "module", "exports": { diff --git a/platforms/sui/src/address.ts b/platforms/sui/src/address.ts index e7fbb6aad..00ab2fb42 100644 --- a/platforms/sui/src/address.ts +++ b/platforms/sui/src/address.ts @@ -53,7 +53,7 @@ export const getTableKeyType = (tableType: string): string => { export class SuiAddress implements Address { static readonly byteSize = 32; - static readonly platform = _platform; + static readonly platform = "Sui"; // Full 32 bytes of Address readonly address: Uint8Array; diff --git a/sdk/package.json b/sdk/package.json index 3c157b59e..c614332df 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk", - "version": "0.9.0", + "version": "0.9.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -384,31 +384,31 @@ } }, "dependencies": { - "@wormhole-foundation/sdk-base": "0.9.0", - "@wormhole-foundation/sdk-definitions": "0.9.0", - "@wormhole-foundation/sdk-connect": "0.9.0", - "@wormhole-foundation/sdk-evm": "0.9.0", - "@wormhole-foundation/sdk-evm-core": "0.9.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.9.0", - "@wormhole-foundation/sdk-evm-portico": "0.9.0", - "@wormhole-foundation/sdk-evm-cctp": "0.9.0", - "@wormhole-foundation/sdk-solana": "0.9.0", - "@wormhole-foundation/sdk-solana-core": "0.9.0", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.9.0", - "@wormhole-foundation/sdk-solana-cctp": "0.9.0", - "@wormhole-foundation/sdk-cosmwasm": "0.9.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.9.0", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.9.0", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.9.0", - "@wormhole-foundation/sdk-sui": "0.9.0", - "@wormhole-foundation/sdk-sui-core": "0.9.0", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.9.0", - "@wormhole-foundation/sdk-aptos": "0.9.0", - "@wormhole-foundation/sdk-aptos-core": "0.9.0", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.9.0", - "@wormhole-foundation/sdk-algorand": "0.9.0", - "@wormhole-foundation/sdk-algorand-core": "0.9.0", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.9.0" + "@wormhole-foundation/sdk-base": "0.9.1", + "@wormhole-foundation/sdk-definitions": "0.9.1", + "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-evm": "0.9.1", + "@wormhole-foundation/sdk-evm-core": "0.9.1", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.9.1", + "@wormhole-foundation/sdk-evm-portico": "0.9.1", + "@wormhole-foundation/sdk-evm-cctp": "0.9.1", + "@wormhole-foundation/sdk-solana": "0.9.1", + "@wormhole-foundation/sdk-solana-core": "0.9.1", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.9.1", + "@wormhole-foundation/sdk-solana-cctp": "0.9.1", + "@wormhole-foundation/sdk-cosmwasm": "0.9.1", + "@wormhole-foundation/sdk-cosmwasm-core": "0.9.1", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.9.1", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.9.1", + "@wormhole-foundation/sdk-sui": "0.9.1", + "@wormhole-foundation/sdk-sui-core": "0.9.1", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.9.1", + "@wormhole-foundation/sdk-aptos": "0.9.1", + "@wormhole-foundation/sdk-aptos-core": "0.9.1", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.9.1", + "@wormhole-foundation/sdk-algorand": "0.9.1", + "@wormhole-foundation/sdk-algorand-core": "0.9.1", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.9.1" }, "type": "module" } \ No newline at end of file From 1e8e7fb36bcad8af12d3706c4d494d7ffefdec21 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Wed, 7 Aug 2024 13:41:20 -0500 Subject: [PATCH 13/69] connect: Wormhole pass config to platform constructors (#660) We were not passing the config, which may contain overrides, to the platform constructors in the Wormhole class. This was causing the default RPCs to get used even if they were overridden in the config. --- connect/src/protocols/cctp/cctpTransfer.ts | 3 +-- connect/src/routes/portico/automatic.ts | 3 +-- connect/src/wormhole.ts | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/connect/src/protocols/cctp/cctpTransfer.ts b/connect/src/protocols/cctp/cctpTransfer.ts index 9fd358510..a4a3d103e 100644 --- a/connect/src/protocols/cctp/cctpTransfer.ts +++ b/connect/src/protocols/cctp/cctpTransfer.ts @@ -1,5 +1,5 @@ import type { Chain, Network } from "@wormhole-foundation/sdk-base"; -import { circle, encoding, toChain } from "@wormhole-foundation/sdk-base"; +import { circle, encoding, finality, toChain } from "@wormhole-foundation/sdk-base"; import type { Attestation, AttestationId, @@ -43,7 +43,6 @@ import { } from "../../types.js"; import { Wormhole } from "../../wormhole.js"; import type { WormholeTransfer } from "../wormholeTransfer.js"; -import { finality } from "@wormhole-foundation/sdk-base"; export class CircleTransfer implements WormholeTransfer diff --git a/connect/src/routes/portico/automatic.ts b/connect/src/routes/portico/automatic.ts index b03af7a70..af237d02c 100644 --- a/connect/src/routes/portico/automatic.ts +++ b/connect/src/routes/portico/automatic.ts @@ -1,4 +1,4 @@ -import { filters } from "@wormhole-foundation/sdk-base"; +import { filters, finality } from "@wormhole-foundation/sdk-base"; import type { StaticRouteMethods } from "../route.js"; import { AutomaticRoute } from "../route.js"; import type { @@ -36,7 +36,6 @@ import { } from "./../../index.js"; import type { ChainAddress } from "@wormhole-foundation/sdk-definitions"; import type { RouteTransferRequest } from "../request.js"; -import { finality } from "@wormhole-foundation/sdk-base"; export const SLIPPAGE_BPS = 15n; // 0.15% export const BPS_PER_HUNDRED_PERCENT = 10000n; diff --git a/connect/src/wormhole.ts b/connect/src/wormhole.ts index 5352da378..768c3fc14 100644 --- a/connect/src/wormhole.ts +++ b/connect/src/wormhole.ts @@ -12,6 +12,7 @@ import type { TokenAddress, TokenId, TxHash, + UniversalAddress, WormholeMessageId, deserialize, } from "@wormhole-foundation/sdk-definitions"; @@ -39,7 +40,6 @@ import { getVaaBytesWithRetry, getVaaWithRetry, } from "./whscan-api.js"; -import { UniversalAddress } from "@wormhole-foundation/sdk-definitions"; type PlatformMap = Map>; type ChainMap = Map>; @@ -58,7 +58,7 @@ export class Wormhole { this._chains = new Map(); this._platforms = new Map(); for (const p of platforms) { - this._platforms.set(p._platform, new p(network)); + this._platforms.set(p._platform, new p(network, this.config.chains)); } } From a71945aeac90a409887ff3194fe28398b2af9c6b Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Thu, 8 Aug 2024 12:04:14 -0700 Subject: [PATCH 14/69] new TransferState that represents a refunded transfer (#663) --- connect/src/types.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/connect/src/types.ts b/connect/src/types.ts index a555bc830..f2cf45266 100644 --- a/connect/src/types.ts +++ b/connect/src/types.ts @@ -16,6 +16,7 @@ export enum TransferState { SourceFinalized, // Source chain transactions are finalized or whenever we have a message id InReview, // Transfer is in review (e.g. held by governor) Attested, // VAA or Circle Attestation is available + Refunded, // Transfer failed and was refunded on the source chain DestinationInitiated, // Attestation is submitted to destination chain DestinationQueued, // Transfer is queued on destination chain DestinationFinalized, // Destination transaction is finalized @@ -70,6 +71,14 @@ export interface AttestedTransferReceipt; } +export interface RefundedTransferReceipt + extends BaseTransferReceipt { + state: TransferState.Refunded; + originTxs: TransactionId[]; + refundTxs: TransactionId[]; + attestation: AT; +} + export interface RedeemedTransferReceipt extends BaseTransferReceipt { state: TransferState.DestinationInitiated; @@ -131,6 +140,12 @@ export function isAttested( return receipt.state === TransferState.Attested; } +export function isRefunded( + receipt: TransferReceipt, +): receipt is RefundedTransferReceipt { + return receipt.state === TransferState.Refunded; +} + export function isRedeemed( receipt: TransferReceipt, ): receipt is RedeemedTransferReceipt { @@ -160,6 +175,7 @@ export type TransferReceipt | InReviewTransferReceipt | AttestedTransferReceipt + | RefundedTransferReceipt | RedeemedTransferReceipt | DestinationQueuedTransferReceipt | CompletedTransferReceipt; From 5f8ad99ec46bdd0f09e393b74be5a1b178158201 Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Thu, 8 Aug 2024 12:05:17 -0700 Subject: [PATCH 15/69] version bump --- connect/package.json | 6 +-- core/base/package.json | 2 +- core/definitions/package.json | 4 +- core/icons/package.json | 4 +- examples/package.json | 4 +- package.json | 2 +- platforms/algorand/package.json | 4 +- .../algorand/protocols/core/package.json | 6 +-- .../protocols/tokenBridge/package.json | 8 +-- platforms/aptos/package.json | 4 +- platforms/aptos/protocols/core/package.json | 6 +-- .../aptos/protocols/tokenBridge/package.json | 6 +-- platforms/cosmwasm/package.json | 4 +- .../cosmwasm/protocols/core/package.json | 6 +-- platforms/cosmwasm/protocols/ibc/package.json | 8 +-- .../protocols/tokenBridge/package.json | 6 +-- platforms/evm/package.json | 4 +- platforms/evm/protocols/cctp/package.json | 6 +-- platforms/evm/protocols/core/package.json | 6 +-- platforms/evm/protocols/portico/package.json | 10 ++-- .../evm/protocols/tokenBridge/package.json | 8 +-- platforms/solana/package.json | 4 +- platforms/solana/protocols/cctp/package.json | 6 +-- platforms/solana/protocols/core/package.json | 6 +-- .../solana/protocols/tokenBridge/package.json | 8 +-- platforms/sui/package.json | 4 +- platforms/sui/protocols/core/package.json | 6 +-- .../sui/protocols/tokenBridge/package.json | 8 +-- sdk/package.json | 52 +++++++++---------- 29 files changed, 104 insertions(+), 104 deletions(-) diff --git a/connect/package.json b/connect/package.json index 56595f173..4702b7cfe 100644 --- a/connect/package.json +++ b/connect/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-connect", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -98,8 +98,8 @@ }, "dependencies": { "axios": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.9.1", - "@wormhole-foundation/sdk-definitions": "0.9.1" + "@wormhole-foundation/sdk-base": "0.9.2", + "@wormhole-foundation/sdk-definitions": "0.9.2" }, "type": "module" } \ No newline at end of file diff --git a/core/base/package.json b/core/base/package.json index b0057389b..43b768684 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-base", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" diff --git a/core/definitions/package.json b/core/definitions/package.json index c47f5b241..67416c695 100644 --- a/core/definitions/package.json +++ b/core/definitions/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -86,7 +86,7 @@ "dependencies": { "@noble/hashes": "^1.3.1", "@noble/curves": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.9.1" + "@wormhole-foundation/sdk-base": "0.9.2" }, "type": "module" } \ No newline at end of file diff --git a/core/icons/package.json b/core/icons/package.json index 5515de7c0..168dd4454 100644 --- a/core/icons/package.json +++ b/core/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-icons", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -50,7 +50,7 @@ "dist/cjs" ], "dependencies": { - "@wormhole-foundation/sdk-base": "0.9.1" + "@wormhole-foundation/sdk-base": "0.9.2" }, "sideEffects": false, "scripts": { diff --git a/examples/package.json b/examples/package.json index e69b1decc..9c5189028 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -51,6 +51,6 @@ "tsx": "^4.7.0" }, "dependencies": { - "@wormhole-foundation/sdk": "0.9.1" + "@wormhole-foundation/sdk": "0.9.2" } } \ No newline at end of file diff --git a/package.json b/package.json index edbffae6e..47d80f292 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sdk", - "version": "0.9.1", + "version": "0.9.2", "license": "Apache-2.0", "directories": { "test": "__tests__" diff --git a/platforms/algorand/package.json b/platforms/algorand/package.json index 512bf36d7..a33ef382b 100644 --- a/platforms/algorand/package.json +++ b/platforms/algorand/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -96,7 +96,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-connect": "0.9.2", "algosdk": "2.7.0" }, "type": "module" diff --git a/platforms/algorand/protocols/core/package.json b/platforms/algorand/protocols/core/package.json index 255597b34..b4349cd9f 100644 --- a/platforms/algorand/protocols/core/package.json +++ b/platforms/algorand/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-algorand": "0.9.1" + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-algorand": "0.9.2" }, "type": "module", "exports": { diff --git a/platforms/algorand/protocols/tokenBridge/package.json b/platforms/algorand/protocols/tokenBridge/package.json index 2b6213c8d..ffaf921a9 100644 --- a/platforms/algorand/protocols/tokenBridge/package.json +++ b/platforms/algorand/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-algorand": "0.9.1", - "@wormhole-foundation/sdk-algorand-core": "0.9.1" + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-algorand": "0.9.2", + "@wormhole-foundation/sdk-algorand-core": "0.9.2" }, "type": "module", "exports": { diff --git a/platforms/aptos/package.json b/platforms/aptos/package.json index b465d760b..835fd0d04 100644 --- a/platforms/aptos/package.json +++ b/platforms/aptos/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-connect": "0.9.2", "aptos": "1.21.0" }, "type": "module", diff --git a/platforms/aptos/protocols/core/package.json b/platforms/aptos/protocols/core/package.json index cc121a4a8..ac1b0cc95 100644 --- a/platforms/aptos/protocols/core/package.json +++ b/platforms/aptos/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-aptos": "0.9.1" + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-aptos": "0.9.2" }, "type": "module", "exports": { diff --git a/platforms/aptos/protocols/tokenBridge/package.json b/platforms/aptos/protocols/tokenBridge/package.json index ef4c8c7fb..6efe164d1 100644 --- a/platforms/aptos/protocols/tokenBridge/package.json +++ b/platforms/aptos/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-aptos": "0.9.1" + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-aptos": "0.9.2" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/package.json b/platforms/cosmwasm/package.json index 4de4e9357..62b8865f7 100644 --- a/platforms/cosmwasm/package.json +++ b/platforms/cosmwasm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-connect": "0.9.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", diff --git a/platforms/cosmwasm/protocols/core/package.json b/platforms/cosmwasm/protocols/core/package.json index 07b467d1c..1397d3cb1 100644 --- a/platforms/cosmwasm/protocols/core/package.json +++ b/platforms/cosmwasm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-cosmwasm": "0.9.1", + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-cosmwasm": "0.9.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2" diff --git a/platforms/cosmwasm/protocols/ibc/package.json b/platforms/cosmwasm/protocols/ibc/package.json index 5b59f4717..5008c26ed 100644 --- a/platforms/cosmwasm/protocols/ibc/package.json +++ b/platforms/cosmwasm/protocols/ibc/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,9 +57,9 @@ "@cosmjs/stargate": "^0.32.0", "cosmjs-types": "^0.9.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-cosmwasm": "0.9.1", - "@wormhole-foundation/sdk-cosmwasm-core": "0.9.1" + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-cosmwasm": "0.9.2", + "@wormhole-foundation/sdk-cosmwasm-core": "0.9.2" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/protocols/tokenBridge/package.json b/platforms/cosmwasm/protocols/tokenBridge/package.json index c4e2c4173..77516fe2c 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/package.json +++ b/platforms/cosmwasm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -54,8 +54,8 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.14.13-beta.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-cosmwasm": "0.9.1" + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-cosmwasm": "0.9.2" }, "type": "module", "exports": { diff --git a/platforms/evm/package.json b/platforms/evm/package.json index cb21cad3d..af208ba96 100644 --- a/platforms/evm/package.json +++ b/platforms/evm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,7 +57,7 @@ "nock": "13.3.8" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-connect": "0.9.2", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index 4c9be8ea2..d62da7fa1 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,8 +53,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-evm": "0.9.1", + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-evm": "0.9.2", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/core/package.json b/platforms/evm/protocols/core/package.json index 157238caf..418035b49 100644 --- a/platforms/evm/protocols/core/package.json +++ b/platforms/evm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-evm": "0.9.1", + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-evm": "0.9.2", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/package.json b/platforms/evm/protocols/portico/package.json index 9c96046f1..b115918bb 100644 --- a/platforms/evm/protocols/portico/package.json +++ b/platforms/evm/protocols/portico/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,10 +52,10 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-evm": "0.9.1", - "@wormhole-foundation/sdk-evm-core": "0.9.1", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.9.1", + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-evm": "0.9.2", + "@wormhole-foundation/sdk-evm-core": "0.9.2", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.9.2", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/tokenBridge/package.json b/platforms/evm/protocols/tokenBridge/package.json index fe3770bef..173c074dc 100644 --- a/platforms/evm/protocols/tokenBridge/package.json +++ b/platforms/evm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,9 +52,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-evm": "0.9.1", - "@wormhole-foundation/sdk-evm-core": "0.9.1", + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-evm": "0.9.2", + "@wormhole-foundation/sdk-evm-core": "0.9.2", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/solana/package.json b/platforms/solana/package.json index eaa89ecd6..5aa077424 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -49,7 +49,7 @@ "nock": "^13.3.3" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-connect": "0.9.2", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index 0ad3e3a3c..ef5a84d4b 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -48,8 +48,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-solana": "0.9.1", + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-solana": "0.9.2", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7" diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index e55d0e70f..e622db03c 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-solana": "0.9.1", + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-solana": "0.9.2", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/web3.js": "1.91.7" diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index affc4c20e..c1a7650f1 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-solana": "0.9.1", - "@wormhole-foundation/sdk-solana-core": "0.9.1", + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-solana": "0.9.2", + "@wormhole-foundation/sdk-solana-core": "0.9.2", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7" diff --git a/platforms/sui/package.json b/platforms/sui/package.json index 542aef271..10e976162 100644 --- a/platforms/sui/package.json +++ b/platforms/sui/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.1", + "@wormhole-foundation/sdk-connect": "0.9.2", "@mysten/sui.js": "^0.50.1" }, "type": "module", diff --git a/platforms/sui/protocols/core/package.json b/platforms/sui/protocols/core/package.json index 2ce5e574e..6e9a51969 100644 --- a/platforms/sui/protocols/core/package.json +++ b/platforms/sui/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-sui": "0.9.1" + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-sui": "0.9.2" }, "type": "module", "exports": { diff --git a/platforms/sui/protocols/tokenBridge/package.json b/platforms/sui/protocols/tokenBridge/package.json index 7368395d1..0096bcc42 100644 --- a/platforms/sui/protocols/tokenBridge/package.json +++ b/platforms/sui/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,9 +46,9 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-sui": "0.9.1", - "@wormhole-foundation/sdk-sui-core": "0.9.1" + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-sui": "0.9.2", + "@wormhole-foundation/sdk-sui-core": "0.9.2" }, "type": "module", "exports": { diff --git a/sdk/package.json b/sdk/package.json index c614332df..6cb20f596 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk", - "version": "0.9.1", + "version": "0.9.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -384,31 +384,31 @@ } }, "dependencies": { - "@wormhole-foundation/sdk-base": "0.9.1", - "@wormhole-foundation/sdk-definitions": "0.9.1", - "@wormhole-foundation/sdk-connect": "0.9.1", - "@wormhole-foundation/sdk-evm": "0.9.1", - "@wormhole-foundation/sdk-evm-core": "0.9.1", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.9.1", - "@wormhole-foundation/sdk-evm-portico": "0.9.1", - "@wormhole-foundation/sdk-evm-cctp": "0.9.1", - "@wormhole-foundation/sdk-solana": "0.9.1", - "@wormhole-foundation/sdk-solana-core": "0.9.1", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.9.1", - "@wormhole-foundation/sdk-solana-cctp": "0.9.1", - "@wormhole-foundation/sdk-cosmwasm": "0.9.1", - "@wormhole-foundation/sdk-cosmwasm-core": "0.9.1", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.9.1", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.9.1", - "@wormhole-foundation/sdk-sui": "0.9.1", - "@wormhole-foundation/sdk-sui-core": "0.9.1", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.9.1", - "@wormhole-foundation/sdk-aptos": "0.9.1", - "@wormhole-foundation/sdk-aptos-core": "0.9.1", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.9.1", - "@wormhole-foundation/sdk-algorand": "0.9.1", - "@wormhole-foundation/sdk-algorand-core": "0.9.1", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.9.1" + "@wormhole-foundation/sdk-base": "0.9.2", + "@wormhole-foundation/sdk-definitions": "0.9.2", + "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-evm": "0.9.2", + "@wormhole-foundation/sdk-evm-core": "0.9.2", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.9.2", + "@wormhole-foundation/sdk-evm-portico": "0.9.2", + "@wormhole-foundation/sdk-evm-cctp": "0.9.2", + "@wormhole-foundation/sdk-solana": "0.9.2", + "@wormhole-foundation/sdk-solana-core": "0.9.2", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.9.2", + "@wormhole-foundation/sdk-solana-cctp": "0.9.2", + "@wormhole-foundation/sdk-cosmwasm": "0.9.2", + "@wormhole-foundation/sdk-cosmwasm-core": "0.9.2", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.9.2", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.9.2", + "@wormhole-foundation/sdk-sui": "0.9.2", + "@wormhole-foundation/sdk-sui-core": "0.9.2", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.9.2", + "@wormhole-foundation/sdk-aptos": "0.9.2", + "@wormhole-foundation/sdk-aptos-core": "0.9.2", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.9.2", + "@wormhole-foundation/sdk-algorand": "0.9.2", + "@wormhole-foundation/sdk-algorand-core": "0.9.2", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.9.2" }, "type": "module" } \ No newline at end of file From 3a77ef42f6a95a371d4e05ec2cf49d001cd9aefe Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:10:07 -0500 Subject: [PATCH 16/69] solana: fix determinePriorityFee method for VersionedTransactions (#665) We were not resolving the address lookup table accounts --- platforms/solana/src/signer.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/platforms/solana/src/signer.ts b/platforms/solana/src/signer.ts index 9c47e5029..5f0febfa6 100644 --- a/platforms/solana/src/signer.ts +++ b/platforms/solana/src/signer.ts @@ -4,8 +4,9 @@ import type { Transaction, TransactionInstruction, VersionedTransaction, - - PublicKey} from '@solana/web3.js'; + PublicKey, + AddressLookupTableAccount, +} from '@solana/web3.js'; import { ComputeBudgetProgram, Keypair, @@ -406,8 +407,19 @@ export async function determinePriorityFee( // Figure out which accounts need write lock let lockedWritableAccounts = []; if (isVersionedTransaction(transaction)) { + const luts = ( + await Promise.all( + transaction.message.addressTableLookups.map((acc) => + connection.getAddressLookupTable(acc.accountKey), + ), + ) + ) + .map((lut) => lut.value) + .filter((val) => val !== null) as AddressLookupTableAccount[]; const msg = transaction.message; - const keys = msg.getAccountKeys(); + const keys = msg.getAccountKeys({ + addressLookupTableAccounts: luts ?? undefined, + }); lockedWritableAccounts = msg.compiledInstructions .flatMap((ix) => ix.accountKeyIndexes) .map((k) => (msg.isAccountWritable(k) ? keys.get(k) : null)) From d45895480f663f391f50e36afe5a658e06618b1a Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Thu, 8 Aug 2024 14:13:30 -0700 Subject: [PATCH 17/69] static IS_AUTOMATIC & NATIVE_GAS_DROPOFF_SUPPORTED (#664) --- connect/src/routes/cctp/automatic.ts | 2 +- connect/src/routes/portico/automatic.ts | 2 +- connect/src/routes/route.ts | 17 ++++++++--------- connect/src/routes/tokenBridge/automatic.ts | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/connect/src/routes/cctp/automatic.ts b/connect/src/routes/cctp/automatic.ts index 8f44a9c81..2dff9da65 100644 --- a/connect/src/routes/cctp/automatic.ts +++ b/connect/src/routes/cctp/automatic.ts @@ -54,7 +54,7 @@ export class AutomaticCCTPRoute extends AutomaticRoute implements StaticRouteMethods { - NATIVE_GAS_DROPOFF_SUPPORTED = true; + static NATIVE_GAS_DROPOFF_SUPPORTED = true; static meta = { name: "AutomaticCCTP", diff --git a/connect/src/routes/portico/automatic.ts b/connect/src/routes/portico/automatic.ts index af237d02c..5ec53439e 100644 --- a/connect/src/routes/portico/automatic.ts +++ b/connect/src/routes/portico/automatic.ts @@ -72,7 +72,7 @@ export class AutomaticPorticoRoute extends AutomaticRoute implements StaticRouteMethods { - NATIVE_GAS_DROPOFF_SUPPORTED = false; + static NATIVE_GAS_DROPOFF_SUPPORTED = false; static meta = { name: "AutomaticPortico", diff --git a/connect/src/routes/route.ts b/connect/src/routes/route.ts index 1bf697f0d..04528f075 100644 --- a/connect/src/routes/route.ts +++ b/connect/src/routes/route.ts @@ -26,11 +26,6 @@ export abstract class Route< > { wh: Wormhole; - // true means this route supports native gas dropoff - abstract readonly NATIVE_GAS_DROPOFF_SUPPORTED: boolean; - // true means this is a one-transaction route (using a relayer) - abstract readonly IS_AUTOMATIC: boolean; - public constructor(wh: Wormhole) { this.wh = wh; } @@ -84,6 +79,10 @@ export interface RouteConstructor { new (wh: Wormhole): Route; /** Details about the route provided by the implementation */ readonly meta: RouteMeta; + /** true means this route supports native gas dropoff */ + readonly NATIVE_GAS_DROPOFF_SUPPORTED: boolean; + /** true means this is a one-transaction route (using a relayer) */ + readonly IS_AUTOMATIC: boolean; /** get the list of networks this route supports */ supportedNetworks(): Network[]; /** get the list of chains this route supports */ @@ -113,13 +112,13 @@ export abstract class AutomaticRoute< VP extends ValidatedTransferParams = ValidatedTransferParams, R extends Receipt = Receipt, > extends Route { - IS_AUTOMATIC = true; + static IS_AUTOMATIC = true; // TODO: search for usagees and update arg public abstract isAvailable(request: RouteTransferRequest): Promise; } export function isAutomatic(route: Route): route is AutomaticRoute { - return (route as AutomaticRoute).isAvailable !== undefined && route.IS_AUTOMATIC; + return (route as AutomaticRoute).isAvailable !== undefined && (route.constructor as RouteConstructor).IS_AUTOMATIC; } /** @@ -132,8 +131,8 @@ export abstract class ManualRoute< VP extends ValidatedTransferParams = ValidatedTransferParams, R extends Receipt = Receipt, > extends Route { - NATIVE_GAS_DROPOFF_SUPPORTED = false; - IS_AUTOMATIC = false; + static NATIVE_GAS_DROPOFF_SUPPORTED = false; + static IS_AUTOMATIC = false; public abstract complete(sender: Signer, receipt: R): Promise; public abstract resume(tx: TransactionId): Promise; } diff --git a/connect/src/routes/tokenBridge/automatic.ts b/connect/src/routes/tokenBridge/automatic.ts index bda878113..d19ae699d 100644 --- a/connect/src/routes/tokenBridge/automatic.ts +++ b/connect/src/routes/tokenBridge/automatic.ts @@ -55,7 +55,7 @@ export class AutomaticTokenBridgeRoute extends AutomaticRoute implements StaticRouteMethods { - NATIVE_GAS_DROPOFF_SUPPORTED = true; + static NATIVE_GAS_DROPOFF_SUPPORTED = true; static meta = { name: "AutomaticTokenBridge", From faf96ba3a2548931fcf5840666a100a6a286db58 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:28:38 -0500 Subject: [PATCH 18/69] 0.10.0 version bump (#666) --- connect/package.json | 6 +-- core/base/package.json | 2 +- core/definitions/package.json | 4 +- core/icons/package.json | 4 +- examples/package.json | 4 +- package.json | 2 +- platforms/algorand/package.json | 4 +- .../algorand/protocols/core/package.json | 6 +-- .../protocols/tokenBridge/package.json | 8 +-- platforms/aptos/package.json | 4 +- platforms/aptos/protocols/core/package.json | 6 +-- .../aptos/protocols/tokenBridge/package.json | 6 +-- platforms/cosmwasm/package.json | 4 +- .../cosmwasm/protocols/core/package.json | 6 +-- platforms/cosmwasm/protocols/ibc/package.json | 8 +-- .../protocols/tokenBridge/package.json | 6 +-- platforms/evm/package.json | 4 +- platforms/evm/protocols/cctp/package.json | 6 +-- platforms/evm/protocols/core/package.json | 6 +-- platforms/evm/protocols/portico/package.json | 10 ++-- .../evm/protocols/tokenBridge/package.json | 8 +-- platforms/solana/package.json | 4 +- platforms/solana/protocols/cctp/package.json | 6 +-- platforms/solana/protocols/core/package.json | 6 +-- .../solana/protocols/tokenBridge/package.json | 8 +-- platforms/sui/package.json | 4 +- platforms/sui/protocols/core/package.json | 6 +-- .../sui/protocols/tokenBridge/package.json | 8 +-- sdk/package.json | 52 +++++++++---------- 29 files changed, 104 insertions(+), 104 deletions(-) diff --git a/connect/package.json b/connect/package.json index 4702b7cfe..aaa9cacc8 100644 --- a/connect/package.json +++ b/connect/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-connect", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -98,8 +98,8 @@ }, "dependencies": { "axios": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.9.2", - "@wormhole-foundation/sdk-definitions": "0.9.2" + "@wormhole-foundation/sdk-base": "0.10.0", + "@wormhole-foundation/sdk-definitions": "0.10.0" }, "type": "module" } \ No newline at end of file diff --git a/core/base/package.json b/core/base/package.json index 43b768684..acfe99ba8 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-base", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" diff --git a/core/definitions/package.json b/core/definitions/package.json index 67416c695..6503b1042 100644 --- a/core/definitions/package.json +++ b/core/definitions/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -86,7 +86,7 @@ "dependencies": { "@noble/hashes": "^1.3.1", "@noble/curves": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.9.2" + "@wormhole-foundation/sdk-base": "0.10.0" }, "type": "module" } \ No newline at end of file diff --git a/core/icons/package.json b/core/icons/package.json index 168dd4454..6c166de99 100644 --- a/core/icons/package.json +++ b/core/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-icons", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -50,7 +50,7 @@ "dist/cjs" ], "dependencies": { - "@wormhole-foundation/sdk-base": "0.9.2" + "@wormhole-foundation/sdk-base": "0.10.0" }, "sideEffects": false, "scripts": { diff --git a/examples/package.json b/examples/package.json index 9c5189028..c02cbeb01 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -51,6 +51,6 @@ "tsx": "^4.7.0" }, "dependencies": { - "@wormhole-foundation/sdk": "0.9.2" + "@wormhole-foundation/sdk": "0.10.0" } } \ No newline at end of file diff --git a/package.json b/package.json index 47d80f292..de8c3961d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sdk", - "version": "0.9.2", + "version": "0.10.0", "license": "Apache-2.0", "directories": { "test": "__tests__" diff --git a/platforms/algorand/package.json b/platforms/algorand/package.json index a33ef382b..36c0cfbb5 100644 --- a/platforms/algorand/package.json +++ b/platforms/algorand/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -96,7 +96,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-connect": "0.10.0", "algosdk": "2.7.0" }, "type": "module" diff --git a/platforms/algorand/protocols/core/package.json b/platforms/algorand/protocols/core/package.json index b4349cd9f..cec98827e 100644 --- a/platforms/algorand/protocols/core/package.json +++ b/platforms/algorand/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-algorand": "0.9.2" + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-algorand": "0.10.0" }, "type": "module", "exports": { diff --git a/platforms/algorand/protocols/tokenBridge/package.json b/platforms/algorand/protocols/tokenBridge/package.json index ffaf921a9..5972f64f8 100644 --- a/platforms/algorand/protocols/tokenBridge/package.json +++ b/platforms/algorand/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-algorand": "0.9.2", - "@wormhole-foundation/sdk-algorand-core": "0.9.2" + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-algorand": "0.10.0", + "@wormhole-foundation/sdk-algorand-core": "0.10.0" }, "type": "module", "exports": { diff --git a/platforms/aptos/package.json b/platforms/aptos/package.json index 835fd0d04..57b444f92 100644 --- a/platforms/aptos/package.json +++ b/platforms/aptos/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-connect": "0.10.0", "aptos": "1.21.0" }, "type": "module", diff --git a/platforms/aptos/protocols/core/package.json b/platforms/aptos/protocols/core/package.json index ac1b0cc95..56f75de49 100644 --- a/platforms/aptos/protocols/core/package.json +++ b/platforms/aptos/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-aptos": "0.9.2" + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-aptos": "0.10.0" }, "type": "module", "exports": { diff --git a/platforms/aptos/protocols/tokenBridge/package.json b/platforms/aptos/protocols/tokenBridge/package.json index 6efe164d1..27df98a99 100644 --- a/platforms/aptos/protocols/tokenBridge/package.json +++ b/platforms/aptos/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-aptos": "0.9.2" + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-aptos": "0.10.0" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/package.json b/platforms/cosmwasm/package.json index 62b8865f7..0deaa965c 100644 --- a/platforms/cosmwasm/package.json +++ b/platforms/cosmwasm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-connect": "0.10.0", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", diff --git a/platforms/cosmwasm/protocols/core/package.json b/platforms/cosmwasm/protocols/core/package.json index 1397d3cb1..aab569ae5 100644 --- a/platforms/cosmwasm/protocols/core/package.json +++ b/platforms/cosmwasm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-cosmwasm": "0.9.2", + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm": "0.10.0", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2" diff --git a/platforms/cosmwasm/protocols/ibc/package.json b/platforms/cosmwasm/protocols/ibc/package.json index 5008c26ed..1d1b9aa8b 100644 --- a/platforms/cosmwasm/protocols/ibc/package.json +++ b/platforms/cosmwasm/protocols/ibc/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,9 +57,9 @@ "@cosmjs/stargate": "^0.32.0", "cosmjs-types": "^0.9.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-cosmwasm": "0.9.2", - "@wormhole-foundation/sdk-cosmwasm-core": "0.9.2" + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.0" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/protocols/tokenBridge/package.json b/platforms/cosmwasm/protocols/tokenBridge/package.json index 77516fe2c..dd4428a4f 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/package.json +++ b/platforms/cosmwasm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -54,8 +54,8 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.14.13-beta.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-cosmwasm": "0.9.2" + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm": "0.10.0" }, "type": "module", "exports": { diff --git a/platforms/evm/package.json b/platforms/evm/package.json index af208ba96..c0cd0a3e6 100644 --- a/platforms/evm/package.json +++ b/platforms/evm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,7 +57,7 @@ "nock": "13.3.8" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-connect": "0.10.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index d62da7fa1..e37db3beb 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,8 +53,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-evm": "0.9.2", + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-evm": "0.10.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/core/package.json b/platforms/evm/protocols/core/package.json index 418035b49..cae2dc720 100644 --- a/platforms/evm/protocols/core/package.json +++ b/platforms/evm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-evm": "0.9.2", + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-evm": "0.10.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/package.json b/platforms/evm/protocols/portico/package.json index b115918bb..3cd06fdbc 100644 --- a/platforms/evm/protocols/portico/package.json +++ b/platforms/evm/protocols/portico/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,10 +52,10 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-evm": "0.9.2", - "@wormhole-foundation/sdk-evm-core": "0.9.2", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.9.2", + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-evm": "0.10.0", + "@wormhole-foundation/sdk-evm-core": "0.10.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/tokenBridge/package.json b/platforms/evm/protocols/tokenBridge/package.json index 173c074dc..2994e41e7 100644 --- a/platforms/evm/protocols/tokenBridge/package.json +++ b/platforms/evm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,9 +52,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-evm": "0.9.2", - "@wormhole-foundation/sdk-evm-core": "0.9.2", + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-evm": "0.10.0", + "@wormhole-foundation/sdk-evm-core": "0.10.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/solana/package.json b/platforms/solana/package.json index 5aa077424..0502bb64f 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -49,7 +49,7 @@ "nock": "^13.3.3" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-connect": "0.10.0", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index ef5a84d4b..989ab7d30 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -48,8 +48,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-solana": "0.9.2", + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-solana": "0.10.0", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7" diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index e622db03c..0ec37a842 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-solana": "0.9.2", + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-solana": "0.10.0", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/web3.js": "1.91.7" diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index c1a7650f1..2750ad1cb 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-solana": "0.9.2", - "@wormhole-foundation/sdk-solana-core": "0.9.2", + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-solana": "0.10.0", + "@wormhole-foundation/sdk-solana-core": "0.10.0", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7" diff --git a/platforms/sui/package.json b/platforms/sui/package.json index 10e976162..f036bb308 100644 --- a/platforms/sui/package.json +++ b/platforms/sui/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.9.2", + "@wormhole-foundation/sdk-connect": "0.10.0", "@mysten/sui.js": "^0.50.1" }, "type": "module", diff --git a/platforms/sui/protocols/core/package.json b/platforms/sui/protocols/core/package.json index 6e9a51969..3753bb651 100644 --- a/platforms/sui/protocols/core/package.json +++ b/platforms/sui/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-sui": "0.9.2" + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-sui": "0.10.0" }, "type": "module", "exports": { diff --git a/platforms/sui/protocols/tokenBridge/package.json b/platforms/sui/protocols/tokenBridge/package.json index 0096bcc42..0d248ba1b 100644 --- a/platforms/sui/protocols/tokenBridge/package.json +++ b/platforms/sui/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,9 +46,9 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-sui": "0.9.2", - "@wormhole-foundation/sdk-sui-core": "0.9.2" + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-sui": "0.10.0", + "@wormhole-foundation/sdk-sui-core": "0.10.0" }, "type": "module", "exports": { diff --git a/sdk/package.json b/sdk/package.json index 6cb20f596..7e11fd649 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk", - "version": "0.9.2", + "version": "0.10.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -384,31 +384,31 @@ } }, "dependencies": { - "@wormhole-foundation/sdk-base": "0.9.2", - "@wormhole-foundation/sdk-definitions": "0.9.2", - "@wormhole-foundation/sdk-connect": "0.9.2", - "@wormhole-foundation/sdk-evm": "0.9.2", - "@wormhole-foundation/sdk-evm-core": "0.9.2", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.9.2", - "@wormhole-foundation/sdk-evm-portico": "0.9.2", - "@wormhole-foundation/sdk-evm-cctp": "0.9.2", - "@wormhole-foundation/sdk-solana": "0.9.2", - "@wormhole-foundation/sdk-solana-core": "0.9.2", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.9.2", - "@wormhole-foundation/sdk-solana-cctp": "0.9.2", - "@wormhole-foundation/sdk-cosmwasm": "0.9.2", - "@wormhole-foundation/sdk-cosmwasm-core": "0.9.2", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.9.2", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.9.2", - "@wormhole-foundation/sdk-sui": "0.9.2", - "@wormhole-foundation/sdk-sui-core": "0.9.2", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.9.2", - "@wormhole-foundation/sdk-aptos": "0.9.2", - "@wormhole-foundation/sdk-aptos-core": "0.9.2", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.9.2", - "@wormhole-foundation/sdk-algorand": "0.9.2", - "@wormhole-foundation/sdk-algorand-core": "0.9.2", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.9.2" + "@wormhole-foundation/sdk-base": "0.10.0", + "@wormhole-foundation/sdk-definitions": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-evm": "0.10.0", + "@wormhole-foundation/sdk-evm-core": "0.10.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.0", + "@wormhole-foundation/sdk-evm-portico": "0.10.0", + "@wormhole-foundation/sdk-evm-cctp": "0.10.0", + "@wormhole-foundation/sdk-solana": "0.10.0", + "@wormhole-foundation/sdk-solana-core": "0.10.0", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.0", + "@wormhole-foundation/sdk-solana-cctp": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.0", + "@wormhole-foundation/sdk-sui": "0.10.0", + "@wormhole-foundation/sdk-sui-core": "0.10.0", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.0", + "@wormhole-foundation/sdk-aptos": "0.10.0", + "@wormhole-foundation/sdk-aptos-core": "0.10.0", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.0", + "@wormhole-foundation/sdk-algorand": "0.10.0", + "@wormhole-foundation/sdk-algorand-core": "0.10.0", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.0" }, "type": "module" } \ No newline at end of file From 0bd3898b898e61d0c392fb00f9ec9e53b746b261 Mon Sep 17 00:00:00 2001 From: evgeniko <97796468+evgeniko@users.noreply.github.com> Date: Fri, 9 Aug 2024 16:47:21 +0200 Subject: [PATCH 19/69] remove outdated relayer api from cctp example & readme (#662) --- README.md | 6 ------ examples/src/cctp.ts | 8 +------- examples/src/helpers/helpers.ts | 8 -------- sdk/README.md | 6 ------ 4 files changed, 1 insertion(+), 27 deletions(-) diff --git a/README.md b/README.md index b558808e0..3abc32007 100644 --- a/README.md +++ b/README.md @@ -497,12 +497,6 @@ We can also transfer native USDC using [Circle's CCTP](https://www.circle.com/en const srcTxids = await xfer.initiateTransfer(src.signer); console.log(`Started Transfer: `, srcTxids); - if (req.automatic) { - const relayStatus = await waitForRelay(srcTxids[srcTxids.length - 1]!); - console.log(`Finished relay: `, relayStatus); - return; - } - // Note: Depending on chain finality, this timeout may need to be increased. // See https://developers.circle.com/stablecoin/docs/cctp-technical-reference#mainnet for more console.log("Waiting for Attestation"); diff --git a/examples/src/cctp.ts b/examples/src/cctp.ts index 54e91682e..1861fd023 100644 --- a/examples/src/cctp.ts +++ b/examples/src/cctp.ts @@ -3,7 +3,7 @@ import { CircleTransfer, amount, wormhole } from "@wormhole-foundation/sdk"; import evm from "@wormhole-foundation/sdk/evm"; import solana from "@wormhole-foundation/sdk/solana"; import type { SignerStuff } from "./helpers/index.js"; -import { getSigner, waitForRelay } from "./helpers/index.js"; +import { getSigner } from "./helpers/index.js"; /* Notes: @@ -96,12 +96,6 @@ async function cctpTransfer( const srcTxids = await xfer.initiateTransfer(src.signer); console.log(`Started Transfer: `, srcTxids); - if (req.automatic) { - const relayStatus = await waitForRelay(srcTxids[srcTxids.length - 1]!); - console.log(`Finished relay: `, relayStatus); - return; - } - // Note: Depending on chain finality, this timeout may need to be increased. // See https://developers.circle.com/stablecoin/docs/cctp-technical-reference#mainnet for more console.log("Waiting for Attestation"); diff --git a/examples/src/helpers/helpers.ts b/examples/src/helpers/helpers.ts index 536442544..e973985d4 100644 --- a/examples/src/helpers/helpers.ts +++ b/examples/src/helpers/helpers.ts @@ -111,11 +111,3 @@ export async function waitLog( } return receipt; } - -// Note: This API may change but it is currently the best place to pull -// the relay status from -export async function waitForRelay(txid: TxHash): Promise { - const relayerApi = "https://relayer.dev.stable.io"; - const task = () => api.getRelayStatus(relayerApi, txid); - return tasks.retry(task, 5000, 60 * 1000, "Wormhole:GetRelayStatus"); -} diff --git a/sdk/README.md b/sdk/README.md index 835f322fb..4e5271cab 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -388,12 +388,6 @@ We can also transfer native USDC using [Circle's CCTP](https://www.circle.com/en const srcTxids = await xfer.initiateTransfer(src.signer); console.log(`Started Transfer: `, srcTxids); - if (req.automatic) { - const relayStatus = await waitForRelay(srcTxids[srcTxids.length - 1]!); - console.log(`Finished relay: `, relayStatus); - return; - } - // Note: Depending on chain finality, this timeout may need to be increased. // See https://developers.circle.com/stablecoin/docs/cctp-technical-reference#mainnet for more console.log("Waiting for Attestation"); From 23666cadb52ecf6445d25cb8482d790d6d915023 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Tue, 13 Aug 2024 10:36:44 -0500 Subject: [PATCH 20/69] solana: added rpc-websockets dependency (#667) Fixes this issue: https://stackoverflow.com/questions/78566652/solana-web3-js-cannot-find-module-rpc-websockets-dist-lib-client --- package-lock.json | 216 +++++++++++++++++----------------- platforms/solana/package.json | 9 +- 2 files changed, 114 insertions(+), 111 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9a433da54..7d416796d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ts-sdk", - "version": "0.7.3-beta.0", + "version": "0.10.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ts-sdk", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "workspaces": [ "core/base", @@ -59,11 +59,11 @@ }, "connect": { "name": "@wormhole-foundation/sdk-connect", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-base": "0.7.3-beta.0", - "@wormhole-foundation/sdk-definitions": "0.7.3-beta.0", + "@wormhole-foundation/sdk-base": "0.10.0", + "@wormhole-foundation/sdk-definitions": "0.10.0", "axios": "^1.4.0" }, "engines": { @@ -72,7 +72,7 @@ }, "core/base": { "name": "@wormhole-foundation/sdk-base", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { "@scure/base": "^1.1.3" @@ -80,11 +80,11 @@ }, "core/definitions": { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.7.3-beta.0", + "version": "0.10.0", "dependencies": { "@noble/curves": "^1.4.0", "@noble/hashes": "^1.3.1", - "@wormhole-foundation/sdk-base": "0.7.3-beta.0" + "@wormhole-foundation/sdk-base": "0.10.0" } }, "core/definitions/node_modules/@noble/curves": { @@ -109,10 +109,10 @@ }, "core/icons": { "name": "@wormhole-foundation/sdk-icons", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-base": "0.7.3-beta.0" + "@wormhole-foundation/sdk-base": "0.10.0" }, "devDependencies": { "tsx": "^4.7.0" @@ -120,10 +120,10 @@ }, "examples": { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk": "0.7.3-beta.0" + "@wormhole-foundation/sdk": "0.10.0" }, "devDependencies": { "dotenv": "^16.3.1", @@ -7695,8 +7695,9 @@ } }, "node_modules/rpc-websockets": { - "version": "7.6.2", - "license": "LGPL-3.0-only", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.10.0.tgz", + "integrity": "sha512-cemZ6RiDtYZpPiBzYijdOrkQQzmBCmug0E9SdRH2gIUNT15ql4mwCYWIp0VnSZq6Qrw/JkGUygp4PrK1y9KfwQ==", "dependencies": { "@babel/runtime": "^7.17.2", "eventemitter3": "^4.0.7", @@ -8902,10 +8903,10 @@ }, "platforms/algorand": { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", + "@wormhole-foundation/sdk-connect": "0.10.0", "algosdk": "2.7.0" }, "engines": { @@ -8914,11 +8915,11 @@ }, "platforms/algorand/protocols/core": { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.7.3-beta.0", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0" + "@wormhole-foundation/sdk-algorand": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.0" }, "engines": { "node": ">=16" @@ -8926,12 +8927,12 @@ }, "platforms/algorand/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.7.3-beta.0", - "@wormhole-foundation/sdk-algorand-core": "0.7.3-beta.0", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0" + "@wormhole-foundation/sdk-algorand": "0.10.0", + "@wormhole-foundation/sdk-algorand-core": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.0" }, "engines": { "node": ">=16" @@ -8939,10 +8940,10 @@ }, "platforms/aptos": { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", + "@wormhole-foundation/sdk-connect": "0.10.0", "aptos": "1.21.0" }, "engines": { @@ -8951,11 +8952,11 @@ }, "platforms/aptos/protocols/core": { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.7.3-beta.0", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0" + "@wormhole-foundation/sdk-aptos": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.0" }, "engines": { "node": ">=16" @@ -8963,11 +8964,11 @@ }, "platforms/aptos/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.7.3-beta.0", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0" + "@wormhole-foundation/sdk-aptos": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.0" }, "engines": { "node": ">=16" @@ -8975,14 +8976,14 @@ }, "platforms/cosmwasm": { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", + "@wormhole-foundation/sdk-connect": "0.10.0", "cosmjs-types": "^0.9.0" }, "engines": { @@ -8991,14 +8992,14 @@ }, "platforms/cosmwasm/protocols/core": { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", - "@wormhole-foundation/sdk-cosmwasm": "0.7.3-beta.0" + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm": "0.10.0" }, "engines": { "node": ">=16" @@ -9006,15 +9007,15 @@ }, "platforms/cosmwasm/protocols/ibc": { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", - "@wormhole-foundation/sdk-cosmwasm": "0.7.3-beta.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.7.3-beta.0", + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.0", "cosmjs-types": "^0.9.0" }, "engines": { @@ -9023,13 +9024,13 @@ }, "platforms/cosmwasm/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", - "@wormhole-foundation/sdk-cosmwasm": "0.7.3-beta.0" + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm": "0.10.0" }, "engines": { "node": ">=16" @@ -9037,10 +9038,10 @@ }, "platforms/evm": { "name": "@wormhole-foundation/sdk-evm", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", + "@wormhole-foundation/sdk-connect": "0.10.0", "ethers": "^6.5.1" }, "devDependencies": { @@ -9052,11 +9053,11 @@ }, "platforms/evm/protocols/cctp": { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", - "@wormhole-foundation/sdk-evm": "0.7.3-beta.0", + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-evm": "0.10.0", "ethers": "^6.5.1" }, "engines": { @@ -9065,11 +9066,11 @@ }, "platforms/evm/protocols/core": { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", - "@wormhole-foundation/sdk-evm": "0.7.3-beta.0", + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-evm": "0.10.0", "ethers": "^6.5.1" }, "engines": { @@ -9078,13 +9079,13 @@ }, "platforms/evm/protocols/portico": { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", - "@wormhole-foundation/sdk-evm": "0.7.3-beta.0", - "@wormhole-foundation/sdk-evm-core": "0.7.3-beta.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.7.3-beta.0", + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-evm": "0.10.0", + "@wormhole-foundation/sdk-evm-core": "0.10.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.0", "ethers": "^6.5.1" }, "engines": { @@ -9093,12 +9094,12 @@ }, "platforms/evm/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", - "@wormhole-foundation/sdk-evm": "0.7.3-beta.0", - "@wormhole-foundation/sdk-evm-core": "0.7.3-beta.0", + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-evm": "0.10.0", + "@wormhole-foundation/sdk-evm-core": "0.10.0", "ethers": "^6.5.1" }, "engines": { @@ -9107,14 +9108,15 @@ }, "platforms/solana": { "name": "@wormhole-foundation/sdk-solana", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0" + "@wormhole-foundation/sdk-connect": "0.10.0", + "rpc-websockets": "^7.10.0" }, "devDependencies": { "nock": "^13.3.3" @@ -9125,14 +9127,14 @@ }, "platforms/solana/protocols/cctp": { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", - "@wormhole-foundation/sdk-solana": "0.7.3-beta.0" + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-solana": "0.10.0" }, "engines": { "node": ">=16" @@ -9140,14 +9142,14 @@ }, "platforms/solana/protocols/core": { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", - "@wormhole-foundation/sdk-solana": "0.7.3-beta.0" + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-solana": "0.10.0" }, "engines": { "node": ">=16" @@ -9155,15 +9157,15 @@ }, "platforms/solana/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", - "@wormhole-foundation/sdk-solana": "0.7.3-beta.0", - "@wormhole-foundation/sdk-solana-core": "0.7.3-beta.0" + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-solana": "0.10.0", + "@wormhole-foundation/sdk-solana-core": "0.10.0" }, "engines": { "node": ">=16" @@ -9171,11 +9173,11 @@ }, "platforms/sui": { "name": "@wormhole-foundation/sdk-sui", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0" + "@wormhole-foundation/sdk-connect": "0.10.0" }, "engines": { "node": ">=16" @@ -9183,12 +9185,12 @@ }, "platforms/sui/protocols/core": { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", - "@wormhole-foundation/sdk-sui": "0.7.3-beta.0" + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-sui": "0.10.0" }, "engines": { "node": ">=16" @@ -9196,13 +9198,13 @@ }, "platforms/sui/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", - "@wormhole-foundation/sdk-sui": "0.7.3-beta.0", - "@wormhole-foundation/sdk-sui-core": "0.7.3-beta.0" + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-sui": "0.10.0", + "@wormhole-foundation/sdk-sui-core": "0.10.0" }, "engines": { "node": ">=16" @@ -9210,34 +9212,34 @@ }, "sdk": { "name": "@wormhole-foundation/sdk", - "version": "0.7.3-beta.0", + "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.7.3-beta.0", - "@wormhole-foundation/sdk-algorand-core": "0.7.3-beta.0", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.7.3-beta.0", - "@wormhole-foundation/sdk-aptos": "0.7.3-beta.0", - "@wormhole-foundation/sdk-aptos-core": "0.7.3-beta.0", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.7.3-beta.0", - "@wormhole-foundation/sdk-base": "0.7.3-beta.0", - "@wormhole-foundation/sdk-connect": "0.7.3-beta.0", - "@wormhole-foundation/sdk-cosmwasm": "0.7.3-beta.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.7.3-beta.0", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.7.3-beta.0", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.7.3-beta.0", - "@wormhole-foundation/sdk-definitions": "0.7.3-beta.0", - "@wormhole-foundation/sdk-evm": "0.7.3-beta.0", - "@wormhole-foundation/sdk-evm-cctp": "0.7.3-beta.0", - "@wormhole-foundation/sdk-evm-core": "0.7.3-beta.0", - "@wormhole-foundation/sdk-evm-portico": "0.7.3-beta.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.7.3-beta.0", - "@wormhole-foundation/sdk-solana": "0.7.3-beta.0", - "@wormhole-foundation/sdk-solana-cctp": "0.7.3-beta.0", - "@wormhole-foundation/sdk-solana-core": "0.7.3-beta.0", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.7.3-beta.0", - "@wormhole-foundation/sdk-sui": "0.7.3-beta.0", - "@wormhole-foundation/sdk-sui-core": "0.7.3-beta.0", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.7.3-beta.0" + "@wormhole-foundation/sdk-algorand": "0.10.0", + "@wormhole-foundation/sdk-algorand-core": "0.10.0", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.0", + "@wormhole-foundation/sdk-aptos": "0.10.0", + "@wormhole-foundation/sdk-aptos-core": "0.10.0", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.0", + "@wormhole-foundation/sdk-base": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.0", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.0", + "@wormhole-foundation/sdk-definitions": "0.10.0", + "@wormhole-foundation/sdk-evm": "0.10.0", + "@wormhole-foundation/sdk-evm-cctp": "0.10.0", + "@wormhole-foundation/sdk-evm-core": "0.10.0", + "@wormhole-foundation/sdk-evm-portico": "0.10.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.0", + "@wormhole-foundation/sdk-solana": "0.10.0", + "@wormhole-foundation/sdk-solana-cctp": "0.10.0", + "@wormhole-foundation/sdk-solana-core": "0.10.0", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.0", + "@wormhole-foundation/sdk-sui": "0.10.0", + "@wormhole-foundation/sdk-sui-core": "0.10.0", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.0" }, "engines": { "node": ">=16" diff --git a/platforms/solana/package.json b/platforms/solana/package.json index 0502bb64f..2f63406d8 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -49,11 +49,12 @@ "nock": "^13.3.3" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", + "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", - "@solana/web3.js": "1.91.7" + "@solana/web3.js": "1.91.7", + "@wormhole-foundation/sdk-connect": "0.10.0", + "rpc-websockets": "^7.10.0" }, "type": "module", "typesVersions": { @@ -105,4 +106,4 @@ } } } -} \ No newline at end of file +} From d6cedff7eb8db19943262d2be39b1e45f7099dad Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Tue, 13 Aug 2024 10:47:36 -0500 Subject: [PATCH 21/69] 0.10.1 version bump (#670) --- connect/package.json | 6 +-- core/base/package.json | 2 +- core/definitions/package.json | 4 +- core/icons/package.json | 4 +- examples/package.json | 4 +- package-lock.json | 4 +- package.json | 2 +- platforms/algorand/package.json | 4 +- .../algorand/protocols/core/package.json | 6 +-- .../protocols/tokenBridge/package.json | 8 +-- platforms/aptos/package.json | 4 +- platforms/aptos/protocols/core/package.json | 6 +-- .../aptos/protocols/tokenBridge/package.json | 6 +-- platforms/cosmwasm/package.json | 4 +- .../cosmwasm/protocols/core/package.json | 6 +-- platforms/cosmwasm/protocols/ibc/package.json | 8 +-- .../protocols/tokenBridge/package.json | 6 +-- platforms/evm/package.json | 4 +- platforms/evm/protocols/cctp/package.json | 6 +-- platforms/evm/protocols/core/package.json | 6 +-- platforms/evm/protocols/portico/package.json | 10 ++-- .../evm/protocols/tokenBridge/package.json | 8 +-- platforms/solana/package.json | 6 +-- platforms/solana/protocols/cctp/package.json | 6 +-- platforms/solana/protocols/core/package.json | 6 +-- .../solana/protocols/tokenBridge/package.json | 8 +-- platforms/sui/package.json | 4 +- platforms/sui/protocols/core/package.json | 6 +-- .../sui/protocols/tokenBridge/package.json | 8 +-- sdk/package.json | 52 +++++++++---------- 30 files changed, 107 insertions(+), 107 deletions(-) diff --git a/connect/package.json b/connect/package.json index aaa9cacc8..c5331e1d5 100644 --- a/connect/package.json +++ b/connect/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-connect", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -98,8 +98,8 @@ }, "dependencies": { "axios": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.0", - "@wormhole-foundation/sdk-definitions": "0.10.0" + "@wormhole-foundation/sdk-base": "0.10.1", + "@wormhole-foundation/sdk-definitions": "0.10.1" }, "type": "module" } \ No newline at end of file diff --git a/core/base/package.json b/core/base/package.json index acfe99ba8..c744d8f97 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-base", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" diff --git a/core/definitions/package.json b/core/definitions/package.json index 6503b1042..9b5ab9e44 100644 --- a/core/definitions/package.json +++ b/core/definitions/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -86,7 +86,7 @@ "dependencies": { "@noble/hashes": "^1.3.1", "@noble/curves": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.0" + "@wormhole-foundation/sdk-base": "0.10.1" }, "type": "module" } \ No newline at end of file diff --git a/core/icons/package.json b/core/icons/package.json index 6c166de99..123d83189 100644 --- a/core/icons/package.json +++ b/core/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-icons", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -50,7 +50,7 @@ "dist/cjs" ], "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.0" + "@wormhole-foundation/sdk-base": "0.10.1" }, "sideEffects": false, "scripts": { diff --git a/examples/package.json b/examples/package.json index c02cbeb01..fcfcf85b3 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -51,6 +51,6 @@ "tsx": "^4.7.0" }, "dependencies": { - "@wormhole-foundation/sdk": "0.10.0" + "@wormhole-foundation/sdk": "0.10.1" } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7d416796d..700cbd960 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ts-sdk", - "version": "0.10.0", + "version": "0.10.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ts-sdk", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "workspaces": [ "core/base", diff --git a/package.json b/package.json index de8c3961d..c4cea9577 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sdk", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "directories": { "test": "__tests__" diff --git a/platforms/algorand/package.json b/platforms/algorand/package.json index 36c0cfbb5..9271fc616 100644 --- a/platforms/algorand/package.json +++ b/platforms/algorand/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -96,7 +96,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", "algosdk": "2.7.0" }, "type": "module" diff --git a/platforms/algorand/protocols/core/package.json b/platforms/algorand/protocols/core/package.json index cec98827e..1429e6cc7 100644 --- a/platforms/algorand/protocols/core/package.json +++ b/platforms/algorand/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-algorand": "0.10.0" + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-algorand": "0.10.1" }, "type": "module", "exports": { diff --git a/platforms/algorand/protocols/tokenBridge/package.json b/platforms/algorand/protocols/tokenBridge/package.json index 5972f64f8..c718476be 100644 --- a/platforms/algorand/protocols/tokenBridge/package.json +++ b/platforms/algorand/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-algorand": "0.10.0", - "@wormhole-foundation/sdk-algorand-core": "0.10.0" + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-algorand": "0.10.1", + "@wormhole-foundation/sdk-algorand-core": "0.10.1" }, "type": "module", "exports": { diff --git a/platforms/aptos/package.json b/platforms/aptos/package.json index 57b444f92..e8e86c5b3 100644 --- a/platforms/aptos/package.json +++ b/platforms/aptos/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", "aptos": "1.21.0" }, "type": "module", diff --git a/platforms/aptos/protocols/core/package.json b/platforms/aptos/protocols/core/package.json index 56f75de49..9947fc989 100644 --- a/platforms/aptos/protocols/core/package.json +++ b/platforms/aptos/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-aptos": "0.10.0" + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-aptos": "0.10.1" }, "type": "module", "exports": { diff --git a/platforms/aptos/protocols/tokenBridge/package.json b/platforms/aptos/protocols/tokenBridge/package.json index 27df98a99..c2923b79b 100644 --- a/platforms/aptos/protocols/tokenBridge/package.json +++ b/platforms/aptos/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-aptos": "0.10.0" + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-aptos": "0.10.1" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/package.json b/platforms/cosmwasm/package.json index 0deaa965c..affba76da 100644 --- a/platforms/cosmwasm/package.json +++ b/platforms/cosmwasm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", diff --git a/platforms/cosmwasm/protocols/core/package.json b/platforms/cosmwasm/protocols/core/package.json index aab569ae5..63273e715 100644 --- a/platforms/cosmwasm/protocols/core/package.json +++ b/platforms/cosmwasm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm": "0.10.1", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2" diff --git a/platforms/cosmwasm/protocols/ibc/package.json b/platforms/cosmwasm/protocols/ibc/package.json index 1d1b9aa8b..f068a521a 100644 --- a/platforms/cosmwasm/protocols/ibc/package.json +++ b/platforms/cosmwasm/protocols/ibc/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,9 +57,9 @@ "@cosmjs/stargate": "^0.32.0", "cosmjs-types": "^0.9.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.0" + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.1" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/protocols/tokenBridge/package.json b/platforms/cosmwasm/protocols/tokenBridge/package.json index dd4428a4f..29638655d 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/package.json +++ b/platforms/cosmwasm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -54,8 +54,8 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.14.13-beta.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm": "0.10.0" + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm": "0.10.1" }, "type": "module", "exports": { diff --git a/platforms/evm/package.json b/platforms/evm/package.json index c0cd0a3e6..209b018b5 100644 --- a/platforms/evm/package.json +++ b/platforms/evm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,7 +57,7 @@ "nock": "13.3.8" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index e37db3beb..164f14d9b 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,8 +53,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-evm": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-evm": "0.10.1", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/core/package.json b/platforms/evm/protocols/core/package.json index cae2dc720..e8e501ebb 100644 --- a/platforms/evm/protocols/core/package.json +++ b/platforms/evm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-evm": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-evm": "0.10.1", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/package.json b/platforms/evm/protocols/portico/package.json index 3cd06fdbc..d10efca69 100644 --- a/platforms/evm/protocols/portico/package.json +++ b/platforms/evm/protocols/portico/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,10 +52,10 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-evm": "0.10.0", - "@wormhole-foundation/sdk-evm-core": "0.10.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-evm": "0.10.1", + "@wormhole-foundation/sdk-evm-core": "0.10.1", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.1", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/tokenBridge/package.json b/platforms/evm/protocols/tokenBridge/package.json index 2994e41e7..fa122e19c 100644 --- a/platforms/evm/protocols/tokenBridge/package.json +++ b/platforms/evm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,9 +52,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-evm": "0.10.0", - "@wormhole-foundation/sdk-evm-core": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-evm": "0.10.1", + "@wormhole-foundation/sdk-evm-core": "0.10.1", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/solana/package.json b/platforms/solana/package.json index 2f63406d8..832a18353 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", "rpc-websockets": "^7.10.0" }, "type": "module", @@ -106,4 +106,4 @@ } } } -} +} \ No newline at end of file diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index 989ab7d30..26ff06f02 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -48,8 +48,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-solana": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-solana": "0.10.1", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7" diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index 0ec37a842..18c939bc6 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-solana": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-solana": "0.10.1", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/web3.js": "1.91.7" diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index 2750ad1cb..6867ff9c7 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-solana": "0.10.0", - "@wormhole-foundation/sdk-solana-core": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-solana": "0.10.1", + "@wormhole-foundation/sdk-solana-core": "0.10.1", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.7" diff --git a/platforms/sui/package.json b/platforms/sui/package.json index f036bb308..e413f7c22 100644 --- a/platforms/sui/package.json +++ b/platforms/sui/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", "@mysten/sui.js": "^0.50.1" }, "type": "module", diff --git a/platforms/sui/protocols/core/package.json b/platforms/sui/protocols/core/package.json index 3753bb651..7cfc3c676 100644 --- a/platforms/sui/protocols/core/package.json +++ b/platforms/sui/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-sui": "0.10.0" + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-sui": "0.10.1" }, "type": "module", "exports": { diff --git a/platforms/sui/protocols/tokenBridge/package.json b/platforms/sui/protocols/tokenBridge/package.json index 0d248ba1b..e885b9832 100644 --- a/platforms/sui/protocols/tokenBridge/package.json +++ b/platforms/sui/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,9 +46,9 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-sui": "0.10.0", - "@wormhole-foundation/sdk-sui-core": "0.10.0" + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-sui": "0.10.1", + "@wormhole-foundation/sdk-sui-core": "0.10.1" }, "type": "module", "exports": { diff --git a/sdk/package.json b/sdk/package.json index 7e11fd649..ffff81fb4 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk", - "version": "0.10.0", + "version": "0.10.1", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -384,31 +384,31 @@ } }, "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.0", - "@wormhole-foundation/sdk-definitions": "0.10.0", - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-evm": "0.10.0", - "@wormhole-foundation/sdk-evm-core": "0.10.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.0", - "@wormhole-foundation/sdk-evm-portico": "0.10.0", - "@wormhole-foundation/sdk-evm-cctp": "0.10.0", - "@wormhole-foundation/sdk-solana": "0.10.0", - "@wormhole-foundation/sdk-solana-core": "0.10.0", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.0", - "@wormhole-foundation/sdk-solana-cctp": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.0", - "@wormhole-foundation/sdk-sui": "0.10.0", - "@wormhole-foundation/sdk-sui-core": "0.10.0", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.0", - "@wormhole-foundation/sdk-aptos": "0.10.0", - "@wormhole-foundation/sdk-aptos-core": "0.10.0", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.0", - "@wormhole-foundation/sdk-algorand": "0.10.0", - "@wormhole-foundation/sdk-algorand-core": "0.10.0", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.0" + "@wormhole-foundation/sdk-base": "0.10.1", + "@wormhole-foundation/sdk-definitions": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-evm": "0.10.1", + "@wormhole-foundation/sdk-evm-core": "0.10.1", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.1", + "@wormhole-foundation/sdk-evm-portico": "0.10.1", + "@wormhole-foundation/sdk-evm-cctp": "0.10.1", + "@wormhole-foundation/sdk-solana": "0.10.1", + "@wormhole-foundation/sdk-solana-core": "0.10.1", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.1", + "@wormhole-foundation/sdk-solana-cctp": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.1", + "@wormhole-foundation/sdk-sui": "0.10.1", + "@wormhole-foundation/sdk-sui-core": "0.10.1", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.1", + "@wormhole-foundation/sdk-aptos": "0.10.1", + "@wormhole-foundation/sdk-aptos-core": "0.10.1", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.1", + "@wormhole-foundation/sdk-algorand": "0.10.1", + "@wormhole-foundation/sdk-algorand-core": "0.10.1", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.1" }, "type": "module" } \ No newline at end of file From e089eb8d96d555a749375fd5ff4380b7aaa0f5a9 Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Tue, 13 Aug 2024 15:43:26 -0400 Subject: [PATCH 22/69] bump web3.js and use ^ notation (#671) --- package-lock.json | 341 +++++++++++------- platforms/solana/package.json | 4 +- platforms/solana/protocols/cctp/package.json | 4 +- platforms/solana/protocols/core/package.json | 4 +- .../solana/protocols/tokenBridge/package.json | 4 +- 5 files changed, 213 insertions(+), 144 deletions(-) diff --git a/package-lock.json b/package-lock.json index 700cbd960..fd0f8d3eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,11 +59,11 @@ }, "connect": { "name": "@wormhole-foundation/sdk-connect", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.0", - "@wormhole-foundation/sdk-definitions": "0.10.0", + "@wormhole-foundation/sdk-base": "0.10.1", + "@wormhole-foundation/sdk-definitions": "0.10.1", "axios": "^1.4.0" }, "engines": { @@ -72,7 +72,7 @@ }, "core/base": { "name": "@wormhole-foundation/sdk-base", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { "@scure/base": "^1.1.3" @@ -80,11 +80,11 @@ }, "core/definitions": { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.10.0", + "version": "0.10.1", "dependencies": { "@noble/curves": "^1.4.0", "@noble/hashes": "^1.3.1", - "@wormhole-foundation/sdk-base": "0.10.0" + "@wormhole-foundation/sdk-base": "0.10.1" } }, "core/definitions/node_modules/@noble/curves": { @@ -109,10 +109,10 @@ }, "core/icons": { "name": "@wormhole-foundation/sdk-icons", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.0" + "@wormhole-foundation/sdk-base": "0.10.1" }, "devDependencies": { "tsx": "^4.7.0" @@ -120,10 +120,10 @@ }, "examples": { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk": "0.10.0" + "@wormhole-foundation/sdk": "0.10.1" }, "devDependencies": { "dotenv": "^16.3.1", @@ -758,8 +758,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.23.9", - "license": "MIT", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.0.tgz", + "integrity": "sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -2258,12 +2259,13 @@ } }, "node_modules/@solana/web3.js": { - "version": "1.91.7", - "license": "MIT", + "version": "1.95.2", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.95.2.tgz", + "integrity": "sha512-SjlHp0G4qhuhkQQc+YXdGkI8EerCqwxvgytMgBpzMUQTafrkNant3e7pgilBGgjy/iM40ICvWBLgASTPMrQU7w==", "dependencies": { - "@babel/runtime": "^7.23.4", - "@noble/curves": "^1.4.0", - "@noble/hashes": "^1.3.3", + "@babel/runtime": "^7.24.8", + "@noble/curves": "^1.4.2", + "@noble/hashes": "^1.4.0", "@solana/buffer-layout": "^4.0.1", "agentkeepalive": "^4.5.0", "bigint-buffer": "^1.1.5", @@ -2272,15 +2274,16 @@ "bs58": "^4.0.1", "buffer": "6.0.3", "fast-stable-stringify": "^1.0.0", - "jayson": "^4.1.0", + "jayson": "^4.1.1", "node-fetch": "^2.7.0", - "rpc-websockets": "^7.5.1", - "superstruct": "^0.14.2" + "rpc-websockets": "^9.0.2", + "superstruct": "^2.0.2" } }, "node_modules/@solana/web3.js/node_modules/@noble/curves": { - "version": "1.4.0", - "license": "MIT", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.5.0.tgz", + "integrity": "sha512-J5EKamIHnKPyClwVrzmaf5wSdQXgdHcPZIZLu3bwnbeCx8/7NPK5q2ZBWF+5FvYGByjiQQsJYX6jfgB2wDPn3A==", "dependencies": { "@noble/hashes": "1.4.0" }, @@ -2290,7 +2293,8 @@ }, "node_modules/@solana/web3.js/node_modules/@noble/hashes": { "version": "1.4.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", "engines": { "node": ">= 16" }, @@ -2298,14 +2302,61 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/@solana/web3.js/node_modules/@types/ws": { + "version": "8.5.12", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz", + "integrity": "sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@solana/web3.js/node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" + }, + "node_modules/@solana/web3.js/node_modules/rpc-websockets": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-9.0.2.tgz", + "integrity": "sha512-YzggvfItxMY3Lwuax5rC18inhbjJv9Py7JXRHxTIi94JOLrqBsSsUUc5bbl5W6c11tXhdfpDPK0KzBhoGe8jjw==", + "dependencies": { + "@swc/helpers": "^0.5.11", + "@types/uuid": "^8.3.4", + "@types/ws": "^8.2.2", + "buffer": "^6.0.3", + "eventemitter3": "^5.0.1", + "uuid": "^8.3.2", + "ws": "^8.5.0" + }, + "funding": { + "type": "paypal", + "url": "https://paypal.me/kozjak" + }, + "optionalDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + } + }, "node_modules/@solana/web3.js/node_modules/superstruct": { - "version": "0.14.2", - "license": "MIT" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-2.0.2.tgz", + "integrity": "sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==", + "engines": { + "node": ">=14.0.0" + } }, "node_modules/@suchipi/femver": { "version": "1.0.0", "license": "MIT" }, + "node_modules/@swc/helpers": { + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.12.tgz", + "integrity": "sha512-KMZNXiGibsW9kvZAO1Pam2JPTDBm+KSHMMHWdsyI/1DbIZjT2A6Gy3hblVXUMEDvUAKq+e0vL0X0o54owWji7g==", + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@szmarczak/http-timer": { "version": "4.0.6", "license": "MIT", @@ -2405,7 +2456,8 @@ }, "node_modules/@types/connect": { "version": "3.4.38", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", "dependencies": { "@types/node": "*" } @@ -2538,9 +2590,15 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/uuid": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==" + }, "node_modules/@types/ws": { "version": "7.4.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", + "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", "dependencies": { "@types/node": "*" } @@ -3788,7 +3846,8 @@ }, "node_modules/commander": { "version": "2.20.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, "node_modules/concat-map": { "version": "0.0.1", @@ -4036,7 +4095,8 @@ }, "node_modules/delay": { "version": "5.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", + "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", "engines": { "node": ">=10" }, @@ -4172,11 +4232,13 @@ }, "node_modules/es6-promise": { "version": "4.2.8", - "license": "MIT" + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" }, "node_modules/es6-promisify": { "version": "5.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", "dependencies": { "es6-promise": "^4.0.3" } @@ -4590,6 +4652,8 @@ }, "node_modules/eyes": { "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==", "engines": { "node": "> 0.1.90" } @@ -5503,8 +5567,9 @@ } }, "node_modules/jayson": { - "version": "4.1.0", - "license": "MIT", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/jayson/-/jayson-4.1.1.tgz", + "integrity": "sha512-5ZWm4Q/0DHPyeMfAsrwViwUS2DMVsQgWh8bEEIVTkfb3DzHZ2L3G5WUnF+AKmGjjM9r1uAv73SaqC1/U4RL45w==", "dependencies": { "@types/connect": "^3.4.33", "@types/node": "^12.12.54", @@ -5517,7 +5582,7 @@ "json-stringify-safe": "^5.0.1", "JSONStream": "^1.3.5", "uuid": "^8.3.2", - "ws": "^7.4.5" + "ws": "^7.5.10" }, "bin": { "jayson": "bin/jayson.js" @@ -5528,7 +5593,8 @@ }, "node_modules/jayson/node_modules/@types/node": { "version": "12.20.55", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" }, "node_modules/jayson/node_modules/ws": { "version": "7.5.10", @@ -6172,14 +6238,16 @@ }, "node_modules/jsonparse": { "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", "engines": [ "node >= 0.2.0" - ], - "license": "MIT" + ] }, "node_modules/JSONStream": { "version": "1.3.5", - "license": "(MIT OR Apache-2.0)", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "dependencies": { "jsonparse": "^1.2.0", "through": ">=2.2.7 <3" @@ -8164,7 +8232,8 @@ }, "node_modules/through": { "version": "2.3.8", - "license": "MIT" + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, "node_modules/tmpl": { "version": "1.0.5", @@ -8903,10 +8972,10 @@ }, "platforms/algorand": { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", "algosdk": "2.7.0" }, "engines": { @@ -8915,11 +8984,11 @@ }, "platforms/algorand/protocols/core": { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.10.0", - "@wormhole-foundation/sdk-connect": "0.10.0" + "@wormhole-foundation/sdk-algorand": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.1" }, "engines": { "node": ">=16" @@ -8927,12 +8996,12 @@ }, "platforms/algorand/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.10.0", - "@wormhole-foundation/sdk-algorand-core": "0.10.0", - "@wormhole-foundation/sdk-connect": "0.10.0" + "@wormhole-foundation/sdk-algorand": "0.10.1", + "@wormhole-foundation/sdk-algorand-core": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.1" }, "engines": { "node": ">=16" @@ -8940,10 +9009,10 @@ }, "platforms/aptos": { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", "aptos": "1.21.0" }, "engines": { @@ -8952,11 +9021,11 @@ }, "platforms/aptos/protocols/core": { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.10.0", - "@wormhole-foundation/sdk-connect": "0.10.0" + "@wormhole-foundation/sdk-aptos": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.1" }, "engines": { "node": ">=16" @@ -8964,11 +9033,11 @@ }, "platforms/aptos/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.10.0", - "@wormhole-foundation/sdk-connect": "0.10.0" + "@wormhole-foundation/sdk-aptos": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.1" }, "engines": { "node": ">=16" @@ -8976,14 +9045,14 @@ }, "platforms/cosmwasm": { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", "cosmjs-types": "^0.9.0" }, "engines": { @@ -8992,14 +9061,14 @@ }, "platforms/cosmwasm/protocols/core": { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm": "0.10.0" + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm": "0.10.1" }, "engines": { "node": ">=16" @@ -9007,15 +9076,15 @@ }, "platforms/cosmwasm/protocols/ibc": { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.1", "cosmjs-types": "^0.9.0" }, "engines": { @@ -9024,13 +9093,13 @@ }, "platforms/cosmwasm/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm": "0.10.0" + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm": "0.10.1" }, "engines": { "node": ">=16" @@ -9038,10 +9107,10 @@ }, "platforms/evm": { "name": "@wormhole-foundation/sdk-evm", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", "ethers": "^6.5.1" }, "devDependencies": { @@ -9053,11 +9122,11 @@ }, "platforms/evm/protocols/cctp": { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-evm": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-evm": "0.10.1", "ethers": "^6.5.1" }, "engines": { @@ -9066,11 +9135,11 @@ }, "platforms/evm/protocols/core": { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-evm": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-evm": "0.10.1", "ethers": "^6.5.1" }, "engines": { @@ -9079,13 +9148,13 @@ }, "platforms/evm/protocols/portico": { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-evm": "0.10.0", - "@wormhole-foundation/sdk-evm-core": "0.10.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-evm": "0.10.1", + "@wormhole-foundation/sdk-evm-core": "0.10.1", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.1", "ethers": "^6.5.1" }, "engines": { @@ -9094,12 +9163,12 @@ }, "platforms/evm/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-evm": "0.10.0", - "@wormhole-foundation/sdk-evm-core": "0.10.0", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-evm": "0.10.1", + "@wormhole-foundation/sdk-evm-core": "0.10.1", "ethers": "^6.5.1" }, "engines": { @@ -9108,14 +9177,14 @@ }, "platforms/solana": { "name": "@wormhole-foundation/sdk-solana", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", - "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.10.0", + "@solana/web3.js": "^1.95.2", + "@wormhole-foundation/sdk-connect": "0.10.1", "rpc-websockets": "^7.10.0" }, "devDependencies": { @@ -9127,14 +9196,14 @@ }, "platforms/solana/protocols/cctp": { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", - "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-solana": "0.10.0" + "@solana/web3.js": "^1.95.2", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-solana": "0.10.1" }, "engines": { "node": ">=16" @@ -9142,14 +9211,14 @@ }, "platforms/solana/protocols/core": { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", - "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-solana": "0.10.0" + "@solana/web3.js": "^1.95.2", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-solana": "0.10.1" }, "engines": { "node": ">=16" @@ -9157,15 +9226,15 @@ }, "platforms/solana/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", - "@solana/web3.js": "1.91.7", - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-solana": "0.10.0", - "@wormhole-foundation/sdk-solana-core": "0.10.0" + "@solana/web3.js": "^1.95.2", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-solana": "0.10.1", + "@wormhole-foundation/sdk-solana-core": "0.10.1" }, "engines": { "node": ">=16" @@ -9173,11 +9242,11 @@ }, "platforms/sui": { "name": "@wormhole-foundation/sdk-sui", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.0" + "@wormhole-foundation/sdk-connect": "0.10.1" }, "engines": { "node": ">=16" @@ -9185,12 +9254,12 @@ }, "platforms/sui/protocols/core": { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-sui": "0.10.0" + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-sui": "0.10.1" }, "engines": { "node": ">=16" @@ -9198,13 +9267,13 @@ }, "platforms/sui/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-sui": "0.10.0", - "@wormhole-foundation/sdk-sui-core": "0.10.0" + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-sui": "0.10.1", + "@wormhole-foundation/sdk-sui-core": "0.10.1" }, "engines": { "node": ">=16" @@ -9212,34 +9281,34 @@ }, "sdk": { "name": "@wormhole-foundation/sdk", - "version": "0.10.0", + "version": "0.10.1", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.10.0", - "@wormhole-foundation/sdk-algorand-core": "0.10.0", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.0", - "@wormhole-foundation/sdk-aptos": "0.10.0", - "@wormhole-foundation/sdk-aptos-core": "0.10.0", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.0", - "@wormhole-foundation/sdk-base": "0.10.0", - "@wormhole-foundation/sdk-connect": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.0", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.0", - "@wormhole-foundation/sdk-definitions": "0.10.0", - "@wormhole-foundation/sdk-evm": "0.10.0", - "@wormhole-foundation/sdk-evm-cctp": "0.10.0", - "@wormhole-foundation/sdk-evm-core": "0.10.0", - "@wormhole-foundation/sdk-evm-portico": "0.10.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.0", - "@wormhole-foundation/sdk-solana": "0.10.0", - "@wormhole-foundation/sdk-solana-cctp": "0.10.0", - "@wormhole-foundation/sdk-solana-core": "0.10.0", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.0", - "@wormhole-foundation/sdk-sui": "0.10.0", - "@wormhole-foundation/sdk-sui-core": "0.10.0", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.0" + "@wormhole-foundation/sdk-algorand": "0.10.1", + "@wormhole-foundation/sdk-algorand-core": "0.10.1", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.1", + "@wormhole-foundation/sdk-aptos": "0.10.1", + "@wormhole-foundation/sdk-aptos-core": "0.10.1", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.1", + "@wormhole-foundation/sdk-base": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.1", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.1", + "@wormhole-foundation/sdk-definitions": "0.10.1", + "@wormhole-foundation/sdk-evm": "0.10.1", + "@wormhole-foundation/sdk-evm-cctp": "0.10.1", + "@wormhole-foundation/sdk-evm-core": "0.10.1", + "@wormhole-foundation/sdk-evm-portico": "0.10.1", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.1", + "@wormhole-foundation/sdk-solana": "0.10.1", + "@wormhole-foundation/sdk-solana-cctp": "0.10.1", + "@wormhole-foundation/sdk-solana-core": "0.10.1", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.1", + "@wormhole-foundation/sdk-sui": "0.10.1", + "@wormhole-foundation/sdk-sui-core": "0.10.1", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.1" }, "engines": { "node": ">=16" diff --git a/platforms/solana/package.json b/platforms/solana/package.json index 832a18353..f31254848 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -52,7 +52,7 @@ "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", - "@solana/web3.js": "1.91.7", + "@solana/web3.js": "^1.95.2", "@wormhole-foundation/sdk-connect": "0.10.1", "rpc-websockets": "^7.10.0" }, @@ -106,4 +106,4 @@ } } } -} \ No newline at end of file +} diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index 26ff06f02..ba18e5c88 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -52,7 +52,7 @@ "@wormhole-foundation/sdk-solana": "0.10.1", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", - "@solana/web3.js": "1.91.7" + "@solana/web3.js": "^1.95.2" }, "type": "module", "exports": { @@ -77,4 +77,4 @@ } } } -} \ No newline at end of file +} diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index 18c939bc6..b8c93cdbe 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -49,7 +49,7 @@ "@wormhole-foundation/sdk-solana": "0.10.1", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", - "@solana/web3.js": "1.91.7" + "@solana/web3.js": "^1.95.2" }, "type": "module", "exports": { @@ -74,4 +74,4 @@ } } } -} \ No newline at end of file +} diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index 6867ff9c7..9e4fe5ac8 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -50,7 +50,7 @@ "@wormhole-foundation/sdk-solana-core": "0.10.1", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", - "@solana/web3.js": "1.91.7" + "@solana/web3.js": "^1.95.2" }, "type": "module", "exports": { @@ -75,4 +75,4 @@ } } } -} \ No newline at end of file +} From 45f43764dfbd89b0ab00b7c48a808f7ce849d6c5 Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Tue, 13 Aug 2024 16:24:06 -0400 Subject: [PATCH 23/69] 0.10.2 --- connect/package.json | 6 +- core/base/package.json | 2 +- core/definitions/package.json | 4 +- core/icons/package.json | 4 +- examples/package.json | 4 +- package-lock.json | 210 +++++++++--------- package.json | 2 +- platforms/algorand/package.json | 4 +- .../algorand/protocols/core/package.json | 6 +- .../protocols/tokenBridge/package.json | 8 +- platforms/aptos/package.json | 4 +- platforms/aptos/protocols/core/package.json | 6 +- .../aptos/protocols/tokenBridge/package.json | 6 +- platforms/cosmwasm/package.json | 4 +- .../cosmwasm/protocols/core/package.json | 6 +- platforms/cosmwasm/protocols/ibc/package.json | 8 +- .../protocols/tokenBridge/package.json | 6 +- platforms/evm/package.json | 4 +- platforms/evm/protocols/cctp/package.json | 6 +- platforms/evm/protocols/core/package.json | 6 +- platforms/evm/protocols/portico/package.json | 10 +- .../evm/protocols/tokenBridge/package.json | 8 +- platforms/solana/package.json | 6 +- platforms/solana/protocols/cctp/package.json | 8 +- platforms/solana/protocols/core/package.json | 8 +- .../solana/protocols/tokenBridge/package.json | 10 +- platforms/sui/package.json | 4 +- platforms/sui/protocols/core/package.json | 6 +- .../sui/protocols/tokenBridge/package.json | 8 +- sdk/package.json | 52 ++--- 30 files changed, 213 insertions(+), 213 deletions(-) diff --git a/connect/package.json b/connect/package.json index c5331e1d5..d9472bf3d 100644 --- a/connect/package.json +++ b/connect/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-connect", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -98,8 +98,8 @@ }, "dependencies": { "axios": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.1", - "@wormhole-foundation/sdk-definitions": "0.10.1" + "@wormhole-foundation/sdk-base": "0.10.2", + "@wormhole-foundation/sdk-definitions": "0.10.2" }, "type": "module" } \ No newline at end of file diff --git a/core/base/package.json b/core/base/package.json index c744d8f97..9d865aba9 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-base", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" diff --git a/core/definitions/package.json b/core/definitions/package.json index 9b5ab9e44..5a83eb475 100644 --- a/core/definitions/package.json +++ b/core/definitions/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -86,7 +86,7 @@ "dependencies": { "@noble/hashes": "^1.3.1", "@noble/curves": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.1" + "@wormhole-foundation/sdk-base": "0.10.2" }, "type": "module" } \ No newline at end of file diff --git a/core/icons/package.json b/core/icons/package.json index 123d83189..c13e892b0 100644 --- a/core/icons/package.json +++ b/core/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-icons", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -50,7 +50,7 @@ "dist/cjs" ], "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.1" + "@wormhole-foundation/sdk-base": "0.10.2" }, "sideEffects": false, "scripts": { diff --git a/examples/package.json b/examples/package.json index fcfcf85b3..f2fbfaf51 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -51,6 +51,6 @@ "tsx": "^4.7.0" }, "dependencies": { - "@wormhole-foundation/sdk": "0.10.1" + "@wormhole-foundation/sdk": "0.10.2" } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index fd0f8d3eb..1c377f015 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ts-sdk", - "version": "0.10.1", + "version": "0.10.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ts-sdk", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "workspaces": [ "core/base", @@ -59,11 +59,11 @@ }, "connect": { "name": "@wormhole-foundation/sdk-connect", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.1", - "@wormhole-foundation/sdk-definitions": "0.10.1", + "@wormhole-foundation/sdk-base": "0.10.2", + "@wormhole-foundation/sdk-definitions": "0.10.2", "axios": "^1.4.0" }, "engines": { @@ -72,7 +72,7 @@ }, "core/base": { "name": "@wormhole-foundation/sdk-base", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { "@scure/base": "^1.1.3" @@ -80,11 +80,11 @@ }, "core/definitions": { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.10.1", + "version": "0.10.2", "dependencies": { "@noble/curves": "^1.4.0", "@noble/hashes": "^1.3.1", - "@wormhole-foundation/sdk-base": "0.10.1" + "@wormhole-foundation/sdk-base": "0.10.2" } }, "core/definitions/node_modules/@noble/curves": { @@ -109,10 +109,10 @@ }, "core/icons": { "name": "@wormhole-foundation/sdk-icons", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.1" + "@wormhole-foundation/sdk-base": "0.10.2" }, "devDependencies": { "tsx": "^4.7.0" @@ -120,10 +120,10 @@ }, "examples": { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk": "0.10.1" + "@wormhole-foundation/sdk": "0.10.2" }, "devDependencies": { "dotenv": "^16.3.1", @@ -8972,10 +8972,10 @@ }, "platforms/algorand": { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", "algosdk": "2.7.0" }, "engines": { @@ -8984,11 +8984,11 @@ }, "platforms/algorand/protocols/core": { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.10.1", - "@wormhole-foundation/sdk-connect": "0.10.1" + "@wormhole-foundation/sdk-algorand": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.2" }, "engines": { "node": ">=16" @@ -8996,12 +8996,12 @@ }, "platforms/algorand/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.10.1", - "@wormhole-foundation/sdk-algorand-core": "0.10.1", - "@wormhole-foundation/sdk-connect": "0.10.1" + "@wormhole-foundation/sdk-algorand": "0.10.2", + "@wormhole-foundation/sdk-algorand-core": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.2" }, "engines": { "node": ">=16" @@ -9009,10 +9009,10 @@ }, "platforms/aptos": { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", "aptos": "1.21.0" }, "engines": { @@ -9021,11 +9021,11 @@ }, "platforms/aptos/protocols/core": { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.10.1", - "@wormhole-foundation/sdk-connect": "0.10.1" + "@wormhole-foundation/sdk-aptos": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.2" }, "engines": { "node": ">=16" @@ -9033,11 +9033,11 @@ }, "platforms/aptos/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.10.1", - "@wormhole-foundation/sdk-connect": "0.10.1" + "@wormhole-foundation/sdk-aptos": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.2" }, "engines": { "node": ">=16" @@ -9045,14 +9045,14 @@ }, "platforms/cosmwasm": { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", "cosmjs-types": "^0.9.0" }, "engines": { @@ -9061,14 +9061,14 @@ }, "platforms/cosmwasm/protocols/core": { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm": "0.10.2" }, "engines": { "node": ">=16" @@ -9076,15 +9076,15 @@ }, "platforms/cosmwasm/protocols/ibc": { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.2", "cosmjs-types": "^0.9.0" }, "engines": { @@ -9093,13 +9093,13 @@ }, "platforms/cosmwasm/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm": "0.10.2" }, "engines": { "node": ">=16" @@ -9107,10 +9107,10 @@ }, "platforms/evm": { "name": "@wormhole-foundation/sdk-evm", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", "ethers": "^6.5.1" }, "devDependencies": { @@ -9122,11 +9122,11 @@ }, "platforms/evm/protocols/cctp": { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-evm": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-evm": "0.10.2", "ethers": "^6.5.1" }, "engines": { @@ -9135,11 +9135,11 @@ }, "platforms/evm/protocols/core": { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-evm": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-evm": "0.10.2", "ethers": "^6.5.1" }, "engines": { @@ -9148,13 +9148,13 @@ }, "platforms/evm/protocols/portico": { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-evm": "0.10.1", - "@wormhole-foundation/sdk-evm-core": "0.10.1", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-evm": "0.10.2", + "@wormhole-foundation/sdk-evm-core": "0.10.2", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.2", "ethers": "^6.5.1" }, "engines": { @@ -9163,12 +9163,12 @@ }, "platforms/evm/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-evm": "0.10.1", - "@wormhole-foundation/sdk-evm-core": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-evm": "0.10.2", + "@wormhole-foundation/sdk-evm-core": "0.10.2", "ethers": "^6.5.1" }, "engines": { @@ -9177,14 +9177,14 @@ }, "platforms/solana": { "name": "@wormhole-foundation/sdk-solana", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", "rpc-websockets": "^7.10.0" }, "devDependencies": { @@ -9196,14 +9196,14 @@ }, "platforms/solana/protocols/cctp": { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-solana": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-solana": "0.10.2" }, "engines": { "node": ">=16" @@ -9211,14 +9211,14 @@ }, "platforms/solana/protocols/core": { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-solana": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-solana": "0.10.2" }, "engines": { "node": ">=16" @@ -9226,15 +9226,15 @@ }, "platforms/solana/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-solana": "0.10.1", - "@wormhole-foundation/sdk-solana-core": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-solana": "0.10.2", + "@wormhole-foundation/sdk-solana-core": "0.10.2" }, "engines": { "node": ">=16" @@ -9242,11 +9242,11 @@ }, "platforms/sui": { "name": "@wormhole-foundation/sdk-sui", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2" }, "engines": { "node": ">=16" @@ -9254,12 +9254,12 @@ }, "platforms/sui/protocols/core": { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-sui": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-sui": "0.10.2" }, "engines": { "node": ">=16" @@ -9267,13 +9267,13 @@ }, "platforms/sui/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-sui": "0.10.1", - "@wormhole-foundation/sdk-sui-core": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-sui": "0.10.2", + "@wormhole-foundation/sdk-sui-core": "0.10.2" }, "engines": { "node": ">=16" @@ -9281,34 +9281,34 @@ }, "sdk": { "name": "@wormhole-foundation/sdk", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.10.1", - "@wormhole-foundation/sdk-algorand-core": "0.10.1", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.1", - "@wormhole-foundation/sdk-aptos": "0.10.1", - "@wormhole-foundation/sdk-aptos-core": "0.10.1", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.1", - "@wormhole-foundation/sdk-base": "0.10.1", - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.1", - "@wormhole-foundation/sdk-definitions": "0.10.1", - "@wormhole-foundation/sdk-evm": "0.10.1", - "@wormhole-foundation/sdk-evm-cctp": "0.10.1", - "@wormhole-foundation/sdk-evm-core": "0.10.1", - "@wormhole-foundation/sdk-evm-portico": "0.10.1", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.1", - "@wormhole-foundation/sdk-solana": "0.10.1", - "@wormhole-foundation/sdk-solana-cctp": "0.10.1", - "@wormhole-foundation/sdk-solana-core": "0.10.1", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.1", - "@wormhole-foundation/sdk-sui": "0.10.1", - "@wormhole-foundation/sdk-sui-core": "0.10.1", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.1" + "@wormhole-foundation/sdk-algorand": "0.10.2", + "@wormhole-foundation/sdk-algorand-core": "0.10.2", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.2", + "@wormhole-foundation/sdk-aptos": "0.10.2", + "@wormhole-foundation/sdk-aptos-core": "0.10.2", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.2", + "@wormhole-foundation/sdk-base": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.2", + "@wormhole-foundation/sdk-definitions": "0.10.2", + "@wormhole-foundation/sdk-evm": "0.10.2", + "@wormhole-foundation/sdk-evm-cctp": "0.10.2", + "@wormhole-foundation/sdk-evm-core": "0.10.2", + "@wormhole-foundation/sdk-evm-portico": "0.10.2", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.2", + "@wormhole-foundation/sdk-solana": "0.10.2", + "@wormhole-foundation/sdk-solana-cctp": "0.10.2", + "@wormhole-foundation/sdk-solana-core": "0.10.2", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.2", + "@wormhole-foundation/sdk-sui": "0.10.2", + "@wormhole-foundation/sdk-sui-core": "0.10.2", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.2" }, "engines": { "node": ">=16" diff --git a/package.json b/package.json index c4cea9577..62cb2d61a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sdk", - "version": "0.10.1", + "version": "0.10.2", "license": "Apache-2.0", "directories": { "test": "__tests__" diff --git a/platforms/algorand/package.json b/platforms/algorand/package.json index 9271fc616..3d5933dd8 100644 --- a/platforms/algorand/package.json +++ b/platforms/algorand/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -96,7 +96,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", "algosdk": "2.7.0" }, "type": "module" diff --git a/platforms/algorand/protocols/core/package.json b/platforms/algorand/protocols/core/package.json index 1429e6cc7..c1e75e970 100644 --- a/platforms/algorand/protocols/core/package.json +++ b/platforms/algorand/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-algorand": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-algorand": "0.10.2" }, "type": "module", "exports": { diff --git a/platforms/algorand/protocols/tokenBridge/package.json b/platforms/algorand/protocols/tokenBridge/package.json index c718476be..b0b051525 100644 --- a/platforms/algorand/protocols/tokenBridge/package.json +++ b/platforms/algorand/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-algorand": "0.10.1", - "@wormhole-foundation/sdk-algorand-core": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-algorand": "0.10.2", + "@wormhole-foundation/sdk-algorand-core": "0.10.2" }, "type": "module", "exports": { diff --git a/platforms/aptos/package.json b/platforms/aptos/package.json index e8e86c5b3..f562aa475 100644 --- a/platforms/aptos/package.json +++ b/platforms/aptos/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", "aptos": "1.21.0" }, "type": "module", diff --git a/platforms/aptos/protocols/core/package.json b/platforms/aptos/protocols/core/package.json index 9947fc989..e03d94dd5 100644 --- a/platforms/aptos/protocols/core/package.json +++ b/platforms/aptos/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-aptos": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-aptos": "0.10.2" }, "type": "module", "exports": { diff --git a/platforms/aptos/protocols/tokenBridge/package.json b/platforms/aptos/protocols/tokenBridge/package.json index c2923b79b..287f3ac11 100644 --- a/platforms/aptos/protocols/tokenBridge/package.json +++ b/platforms/aptos/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-aptos": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-aptos": "0.10.2" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/package.json b/platforms/cosmwasm/package.json index affba76da..f35c6a4ca 100644 --- a/platforms/cosmwasm/package.json +++ b/platforms/cosmwasm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", diff --git a/platforms/cosmwasm/protocols/core/package.json b/platforms/cosmwasm/protocols/core/package.json index 63273e715..32511cdc3 100644 --- a/platforms/cosmwasm/protocols/core/package.json +++ b/platforms/cosmwasm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm": "0.10.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2" diff --git a/platforms/cosmwasm/protocols/ibc/package.json b/platforms/cosmwasm/protocols/ibc/package.json index f068a521a..a094e52f1 100644 --- a/platforms/cosmwasm/protocols/ibc/package.json +++ b/platforms/cosmwasm/protocols/ibc/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,9 +57,9 @@ "@cosmjs/stargate": "^0.32.0", "cosmjs-types": "^0.9.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.2" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/protocols/tokenBridge/package.json b/platforms/cosmwasm/protocols/tokenBridge/package.json index 29638655d..f26c290b4 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/package.json +++ b/platforms/cosmwasm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -54,8 +54,8 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.14.13-beta.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm": "0.10.2" }, "type": "module", "exports": { diff --git a/platforms/evm/package.json b/platforms/evm/package.json index 209b018b5..32b25d06c 100644 --- a/platforms/evm/package.json +++ b/platforms/evm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,7 +57,7 @@ "nock": "13.3.8" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index 164f14d9b..c4829d255 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,8 +53,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-evm": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-evm": "0.10.2", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/core/package.json b/platforms/evm/protocols/core/package.json index e8e501ebb..ad3f724a2 100644 --- a/platforms/evm/protocols/core/package.json +++ b/platforms/evm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-evm": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-evm": "0.10.2", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/package.json b/platforms/evm/protocols/portico/package.json index d10efca69..84cb04df2 100644 --- a/platforms/evm/protocols/portico/package.json +++ b/platforms/evm/protocols/portico/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,10 +52,10 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-evm": "0.10.1", - "@wormhole-foundation/sdk-evm-core": "0.10.1", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-evm": "0.10.2", + "@wormhole-foundation/sdk-evm-core": "0.10.2", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.2", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/tokenBridge/package.json b/platforms/evm/protocols/tokenBridge/package.json index fa122e19c..20ec30e4c 100644 --- a/platforms/evm/protocols/tokenBridge/package.json +++ b/platforms/evm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,9 +52,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-evm": "0.10.1", - "@wormhole-foundation/sdk-evm-core": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-evm": "0.10.2", + "@wormhole-foundation/sdk-evm-core": "0.10.2", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/solana/package.json b/platforms/solana/package.json index f31254848..47bb97e88 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", "rpc-websockets": "^7.10.0" }, "type": "module", @@ -106,4 +106,4 @@ } } } -} +} \ No newline at end of file diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index ba18e5c88..6ac553592 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -48,8 +48,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-solana": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-solana": "0.10.2", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" @@ -77,4 +77,4 @@ } } } -} +} \ No newline at end of file diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index b8c93cdbe..65ded1406 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-solana": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-solana": "0.10.2", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/web3.js": "^1.95.2" @@ -74,4 +74,4 @@ } } } -} +} \ No newline at end of file diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index 9e4fe5ac8..7c846f3af 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-solana": "0.10.1", - "@wormhole-foundation/sdk-solana-core": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-solana": "0.10.2", + "@wormhole-foundation/sdk-solana-core": "0.10.2", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" @@ -75,4 +75,4 @@ } } } -} +} \ No newline at end of file diff --git a/platforms/sui/package.json b/platforms/sui/package.json index e413f7c22..ead320e26 100644 --- a/platforms/sui/package.json +++ b/platforms/sui/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.1", + "@wormhole-foundation/sdk-connect": "0.10.2", "@mysten/sui.js": "^0.50.1" }, "type": "module", diff --git a/platforms/sui/protocols/core/package.json b/platforms/sui/protocols/core/package.json index 7cfc3c676..baa5b5a32 100644 --- a/platforms/sui/protocols/core/package.json +++ b/platforms/sui/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-sui": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-sui": "0.10.2" }, "type": "module", "exports": { diff --git a/platforms/sui/protocols/tokenBridge/package.json b/platforms/sui/protocols/tokenBridge/package.json index e885b9832..80e386d3f 100644 --- a/platforms/sui/protocols/tokenBridge/package.json +++ b/platforms/sui/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,9 +46,9 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-sui": "0.10.1", - "@wormhole-foundation/sdk-sui-core": "0.10.1" + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-sui": "0.10.2", + "@wormhole-foundation/sdk-sui-core": "0.10.2" }, "type": "module", "exports": { diff --git a/sdk/package.json b/sdk/package.json index ffff81fb4..ad9270721 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk", - "version": "0.10.1", + "version": "0.10.2", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -384,31 +384,31 @@ } }, "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.1", - "@wormhole-foundation/sdk-definitions": "0.10.1", - "@wormhole-foundation/sdk-connect": "0.10.1", - "@wormhole-foundation/sdk-evm": "0.10.1", - "@wormhole-foundation/sdk-evm-core": "0.10.1", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.1", - "@wormhole-foundation/sdk-evm-portico": "0.10.1", - "@wormhole-foundation/sdk-evm-cctp": "0.10.1", - "@wormhole-foundation/sdk-solana": "0.10.1", - "@wormhole-foundation/sdk-solana-core": "0.10.1", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.1", - "@wormhole-foundation/sdk-solana-cctp": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.1", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.1", - "@wormhole-foundation/sdk-sui": "0.10.1", - "@wormhole-foundation/sdk-sui-core": "0.10.1", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.1", - "@wormhole-foundation/sdk-aptos": "0.10.1", - "@wormhole-foundation/sdk-aptos-core": "0.10.1", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.1", - "@wormhole-foundation/sdk-algorand": "0.10.1", - "@wormhole-foundation/sdk-algorand-core": "0.10.1", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.1" + "@wormhole-foundation/sdk-base": "0.10.2", + "@wormhole-foundation/sdk-definitions": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-evm": "0.10.2", + "@wormhole-foundation/sdk-evm-core": "0.10.2", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.2", + "@wormhole-foundation/sdk-evm-portico": "0.10.2", + "@wormhole-foundation/sdk-evm-cctp": "0.10.2", + "@wormhole-foundation/sdk-solana": "0.10.2", + "@wormhole-foundation/sdk-solana-core": "0.10.2", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.2", + "@wormhole-foundation/sdk-solana-cctp": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.2", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.2", + "@wormhole-foundation/sdk-sui": "0.10.2", + "@wormhole-foundation/sdk-sui-core": "0.10.2", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.2", + "@wormhole-foundation/sdk-aptos": "0.10.2", + "@wormhole-foundation/sdk-aptos-core": "0.10.2", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.2", + "@wormhole-foundation/sdk-algorand": "0.10.2", + "@wormhole-foundation/sdk-algorand-core": "0.10.2", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.2" }, "type": "module" } \ No newline at end of file From cc33e756da49ef61f94bbfe0935bfa0236719272 Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Wed, 14 Aug 2024 16:25:43 -0400 Subject: [PATCH 24/69] ETA adjustments (#672) * add 5 sec of padding to ETAs for guardian network * raise Ethereum finality threshold --- connect/src/protocols/cctp/cctpTransfer.ts | 4 ++-- connect/src/protocols/tokenBridge/tokenTransfer.ts | 4 ++-- core/base/src/constants/finality.ts | 2 +- core/base/src/constants/guardians.ts | 4 ++++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/connect/src/protocols/cctp/cctpTransfer.ts b/connect/src/protocols/cctp/cctpTransfer.ts index a4a3d103e..63f3d7533 100644 --- a/connect/src/protocols/cctp/cctpTransfer.ts +++ b/connect/src/protocols/cctp/cctpTransfer.ts @@ -1,5 +1,5 @@ import type { Chain, Network } from "@wormhole-foundation/sdk-base"; -import { circle, encoding, finality, toChain } from "@wormhole-foundation/sdk-base"; +import { circle, encoding, finality, guardians, toChain } from "@wormhole-foundation/sdk-base"; import type { Attestation, AttestationId, @@ -592,7 +592,7 @@ export namespace CircleTransfer { // https://developers.circle.com/stablecoins/docs/required-block-confirmations const eta = - srcChain.chain === "Polygon" ? 2_000 * 200 : finality.estimateFinalityTime(srcChain.chain); + (srcChain.chain === "Polygon" ? 2_000 * 200 : finality.estimateFinalityTime(srcChain.chain)) + guardians.guardianAttestationEta; if (!transfer.automatic) { return { sourceToken: { token: srcToken, amount: transfer.amount }, diff --git a/connect/src/protocols/tokenBridge/tokenTransfer.ts b/connect/src/protocols/tokenBridge/tokenTransfer.ts index d9a6f1769..0677dd513 100644 --- a/connect/src/protocols/tokenBridge/tokenTransfer.ts +++ b/connect/src/protocols/tokenBridge/tokenTransfer.ts @@ -1,5 +1,5 @@ import type { Chain, Network } from "@wormhole-foundation/sdk-base"; -import { amount, encoding, finality, toChain as toChainName } from "@wormhole-foundation/sdk-base"; +import { amount, encoding, finality, guardians, toChain as toChainName } from "@wormhole-foundation/sdk-base"; import type { AttestationId, AutomaticTokenBridge, @@ -717,7 +717,7 @@ export namespace TokenTransfer { const dstDecimals = await dstChain.getDecimals(dstToken.address); const dstAmountReceivable = amount.scale(srcAmountTruncated, dstDecimals); - const eta = finality.estimateFinalityTime(srcChain.chain); + const eta = finality.estimateFinalityTime(srcChain.chain) + guardians.guardianAttestationEta; if (!transfer.automatic) { return { sourceToken: { diff --git a/core/base/src/constants/finality.ts b/core/base/src/constants/finality.ts index 8ff6477cf..a3617fda7 100644 --- a/core/base/src/constants/finality.ts +++ b/core/base/src/constants/finality.ts @@ -26,7 +26,7 @@ export const safeThreshold = constMap(safeThresholds); // Number of blocks before a transaction is considered "final" const finalityThresholds = [ ["Solana", 32], - ["Ethereum", 64], + ["Ethereum", 96], ["Bsc", 15], // Checkpointed to L1 after ~512 blocks ["Optimism", 512], diff --git a/core/base/src/constants/guardians.ts b/core/base/src/constants/guardians.ts index 722b6b343..b408077f9 100644 --- a/core/base/src/constants/guardians.ts +++ b/core/base/src/constants/guardians.ts @@ -38,3 +38,7 @@ export const guardianKeyToName = constMap(guardianKeyAndNameEntries, [1, [0, 2]] export const devnetGuardianPrivateKey = "cfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0"; + +// Number of seconds we expect to wait for attestation +// Used for eta calculation in route code +export const guardianAttestationEta = 5; From b2283dc02ee4ce8ffcd2fd4e45042c5a2aa19abf Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Thu, 22 Aug 2024 09:33:59 -0600 Subject: [PATCH 25/69] Added missing finality and block times (#674) --- core/base/src/constants/finality.ts | 8 ++++++++ core/base/src/constants/rpc.ts | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/base/src/constants/finality.ts b/core/base/src/constants/finality.ts index a3617fda7..a1e7fbeef 100644 --- a/core/base/src/constants/finality.ts +++ b/core/base/src/constants/finality.ts @@ -32,6 +32,10 @@ const finalityThresholds = [ ["Optimism", 512], ["Base", 512], ["Arbitrum", 4096], // TODO: validate, this is inferred from vaa metrics timing + ["Blast", 512], + ["Xlayer", 300], + ["Scroll", 300], + ["Mantle", 512], // Checkpointed after 32 blocks ["Polygon", 32], // Single block finality @@ -84,6 +88,7 @@ const blockTimeMilliseconds = [ ["Avalanche", 2_000], ["Base", 2_000], ["BaseSepolia", 2_000], + ["Blast", 2_000], ["Bsc", 3_000], ["Celo", 5_000], ["Cosmoshub", 5_000], @@ -96,6 +101,7 @@ const blockTimeMilliseconds = [ ["Karura", 12_000], ["Klaytn", 1_000], ["Kujira", 3_000], + ["Mantle", 2_000], ["Moonbeam", 12_000], ["Near", 1_500], ["Neon", 30_000], @@ -106,6 +112,7 @@ const blockTimeMilliseconds = [ ["Polygon", 2_000], ["PolygonSepolia", 2_000], ["Rootstock", 30_000], + ["Scroll", 3_000], ["Sei", 400], ["Sepolia", 15_000], ["Solana", 400], @@ -115,6 +122,7 @@ const blockTimeMilliseconds = [ ["Terra", 6_000], ["Terra2", 6_000], ["Xpla", 5_000], + ["Xlayer", 3_000], ["Wormchain", 5_000], ["Btc", 600_000], ["Pythnet", 400], diff --git a/core/base/src/constants/rpc.ts b/core/base/src/constants/rpc.ts index 7866307bb..ce0c2b5b2 100644 --- a/core/base/src/constants/rpc.ts +++ b/core/base/src/constants/rpc.ts @@ -44,6 +44,7 @@ const rpcConfig = [[ ["Gnosis", "https://rpc.ankr.com/gnosis"], ["Rootstock", "https://public-node.rsk.co"], ["Mantle", "https://rpc.mantle.xyz"], + ["Klaytn", "https://rpc.ankr.com/klaytn"], ]], [ "Testnet", [ ["Ethereum", "https://eth-goerli.public.blastapi.io"], @@ -84,7 +85,8 @@ const rpcConfig = [[ ["Xlayer", "https://testrpc.xlayer.tech/"], ["Scroll", "https://rpc.ankr.com/scroll_sepolia_testnet"], ["Rootstock", "https://public-node.testnet.rsk.co"], - ["Gnosis", "https://rpc.chiadochain.net"] + ["Gnosis", "https://rpc.chiadochain.net"], + ["Klaytn", "https://rpc.ankr.com/klaytn_testnet"], ]], [ "Devnet", [ ["Ethereum", "http://eth-devnet:8545"], From fb6e21a186a2ed25168468b61f4e3a069e3e6210 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:45:53 -0600 Subject: [PATCH 26/69] contracts: added arbitrum and optimism tb relayer addresses (#676) --- .../src/constants/contracts/tokenBridgeRelayer.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/base/src/constants/contracts/tokenBridgeRelayer.ts b/core/base/src/constants/contracts/tokenBridgeRelayer.ts index ad6247492..f878eea19 100644 --- a/core/base/src/constants/contracts/tokenBridgeRelayer.ts +++ b/core/base/src/constants/contracts/tokenBridgeRelayer.ts @@ -1,6 +1,6 @@ -import type { MapLevels } from './../../utils/index.js'; -import type { Network } from '../networks.js'; -import type { Chain } from '../chains.js'; +import type { MapLevels } from "./../../utils/index.js"; +import type { Network } from "../networks.js"; +import type { Chain } from "../chains.js"; // prettier-ignore export const tokenBridgeRelayerContracts = [[ @@ -15,6 +15,8 @@ export const tokenBridgeRelayerContracts = [[ ["Solana", "3vxKRPwUTiEkeUVyoZ9MXFe1V71sRLbLqu1gRYaWmehQ"], ["Base", "0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"], ["Moonbeam", "0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca"], + ["Arbitrum", "0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"], + ["Optimism", "0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"] ]], [ "Testnet", [ ["Ethereum", "0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"], @@ -28,8 +30,8 @@ export const tokenBridgeRelayerContracts = [[ ["Moonbeam", "0x9563a59c15842a6f322b10f69d1dd88b41f2e97b"], ["Solana", "3bPRWXqtSfUaCw3S4wdgvypQtsSzcmvDeaqSqPDkncrg"], ["Sepolia", ""], - ["ArbitrumSepolia", ""], - ["OptimismSepolia", ""], + ["ArbitrumSepolia", "0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"], + ["OptimismSepolia", "0xaE8dc4a7438801Ec4edC0B035EcCCcF3807F4CC1"], ["BaseSepolia", ""], ]], ] as const satisfies MapLevels<[Network, Chain, string]>; From 9abeccd45ac3d46fd2f9d0bb76b26956abec548c Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Mon, 26 Aug 2024 13:58:42 -0600 Subject: [PATCH 27/69] contracts: remove acala and karura standard relayer addresses (#677) these contracts are not actually deployed --- core/base/src/constants/contracts/relayer.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/base/src/constants/contracts/relayer.ts b/core/base/src/constants/contracts/relayer.ts index 4b96f9338..f80085f79 100644 --- a/core/base/src/constants/contracts/relayer.ts +++ b/core/base/src/constants/contracts/relayer.ts @@ -12,8 +12,6 @@ export const relayerContracts = [[ ["Fantom", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], ["Klaytn", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], ["Celo", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], - ["Acala", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], - ["Karura", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], ["Moonbeam", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], ["Base", "0x706f82e9bb5b0813501714ab5974216704980e31"], ["Arbitrum", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], From 02750914a7c442add7d14d6ee97199b5f19aa093 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Tue, 27 Aug 2024 10:04:49 -0500 Subject: [PATCH 28/69] 0.10.3 version bump (#681) --- connect/package.json | 6 +-- core/base/package.json | 2 +- core/definitions/package.json | 4 +- core/icons/package.json | 4 +- examples/package.json | 4 +- package.json | 2 +- platforms/algorand/package.json | 4 +- .../algorand/protocols/core/package.json | 6 +-- .../protocols/tokenBridge/package.json | 8 +-- platforms/aptos/package.json | 4 +- platforms/aptos/protocols/core/package.json | 6 +-- .../aptos/protocols/tokenBridge/package.json | 6 +-- platforms/cosmwasm/package.json | 4 +- .../cosmwasm/protocols/core/package.json | 6 +-- platforms/cosmwasm/protocols/ibc/package.json | 8 +-- .../protocols/tokenBridge/package.json | 6 +-- platforms/evm/package.json | 4 +- platforms/evm/protocols/cctp/package.json | 6 +-- platforms/evm/protocols/core/package.json | 6 +-- platforms/evm/protocols/portico/package.json | 10 ++-- .../evm/protocols/tokenBridge/package.json | 8 +-- platforms/solana/package.json | 4 +- platforms/solana/protocols/cctp/package.json | 6 +-- platforms/solana/protocols/core/package.json | 6 +-- .../solana/protocols/tokenBridge/package.json | 8 +-- platforms/sui/package.json | 4 +- platforms/sui/protocols/core/package.json | 6 +-- .../sui/protocols/tokenBridge/package.json | 8 +-- sdk/package.json | 52 +++++++++---------- 29 files changed, 104 insertions(+), 104 deletions(-) diff --git a/connect/package.json b/connect/package.json index d9472bf3d..6367c7c88 100644 --- a/connect/package.json +++ b/connect/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-connect", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -98,8 +98,8 @@ }, "dependencies": { "axios": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.2", - "@wormhole-foundation/sdk-definitions": "0.10.2" + "@wormhole-foundation/sdk-base": "0.10.3", + "@wormhole-foundation/sdk-definitions": "0.10.3" }, "type": "module" } \ No newline at end of file diff --git a/core/base/package.json b/core/base/package.json index 9d865aba9..911e9448e 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-base", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" diff --git a/core/definitions/package.json b/core/definitions/package.json index 5a83eb475..5715dff9f 100644 --- a/core/definitions/package.json +++ b/core/definitions/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -86,7 +86,7 @@ "dependencies": { "@noble/hashes": "^1.3.1", "@noble/curves": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.2" + "@wormhole-foundation/sdk-base": "0.10.3" }, "type": "module" } \ No newline at end of file diff --git a/core/icons/package.json b/core/icons/package.json index c13e892b0..6d9f9eaf8 100644 --- a/core/icons/package.json +++ b/core/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-icons", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -50,7 +50,7 @@ "dist/cjs" ], "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.2" + "@wormhole-foundation/sdk-base": "0.10.3" }, "sideEffects": false, "scripts": { diff --git a/examples/package.json b/examples/package.json index f2fbfaf51..5241a74de 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -51,6 +51,6 @@ "tsx": "^4.7.0" }, "dependencies": { - "@wormhole-foundation/sdk": "0.10.2" + "@wormhole-foundation/sdk": "0.10.3" } } \ No newline at end of file diff --git a/package.json b/package.json index 62cb2d61a..1a7ec94a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sdk", - "version": "0.10.2", + "version": "0.10.3", "license": "Apache-2.0", "directories": { "test": "__tests__" diff --git a/platforms/algorand/package.json b/platforms/algorand/package.json index 3d5933dd8..96ec36765 100644 --- a/platforms/algorand/package.json +++ b/platforms/algorand/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -96,7 +96,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.3", "algosdk": "2.7.0" }, "type": "module" diff --git a/platforms/algorand/protocols/core/package.json b/platforms/algorand/protocols/core/package.json index c1e75e970..2c20df532 100644 --- a/platforms/algorand/protocols/core/package.json +++ b/platforms/algorand/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-algorand": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-algorand": "0.10.3" }, "type": "module", "exports": { diff --git a/platforms/algorand/protocols/tokenBridge/package.json b/platforms/algorand/protocols/tokenBridge/package.json index b0b051525..331d9fba7 100644 --- a/platforms/algorand/protocols/tokenBridge/package.json +++ b/platforms/algorand/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-algorand": "0.10.2", - "@wormhole-foundation/sdk-algorand-core": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-algorand": "0.10.3", + "@wormhole-foundation/sdk-algorand-core": "0.10.3" }, "type": "module", "exports": { diff --git a/platforms/aptos/package.json b/platforms/aptos/package.json index f562aa475..d448f3866 100644 --- a/platforms/aptos/package.json +++ b/platforms/aptos/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.3", "aptos": "1.21.0" }, "type": "module", diff --git a/platforms/aptos/protocols/core/package.json b/platforms/aptos/protocols/core/package.json index e03d94dd5..0810c8327 100644 --- a/platforms/aptos/protocols/core/package.json +++ b/platforms/aptos/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-aptos": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-aptos": "0.10.3" }, "type": "module", "exports": { diff --git a/platforms/aptos/protocols/tokenBridge/package.json b/platforms/aptos/protocols/tokenBridge/package.json index 287f3ac11..8f982db8d 100644 --- a/platforms/aptos/protocols/tokenBridge/package.json +++ b/platforms/aptos/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-aptos": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-aptos": "0.10.3" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/package.json b/platforms/cosmwasm/package.json index f35c6a4ca..f8d6301a7 100644 --- a/platforms/cosmwasm/package.json +++ b/platforms/cosmwasm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.3", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", diff --git a/platforms/cosmwasm/protocols/core/package.json b/platforms/cosmwasm/protocols/core/package.json index 32511cdc3..7d1dfa9d5 100644 --- a/platforms/cosmwasm/protocols/core/package.json +++ b/platforms/cosmwasm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-cosmwasm": "0.10.3", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2" diff --git a/platforms/cosmwasm/protocols/ibc/package.json b/platforms/cosmwasm/protocols/ibc/package.json index a094e52f1..201a306bb 100644 --- a/platforms/cosmwasm/protocols/ibc/package.json +++ b/platforms/cosmwasm/protocols/ibc/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,9 +57,9 @@ "@cosmjs/stargate": "^0.32.0", "cosmjs-types": "^0.9.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-cosmwasm": "0.10.3", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.3" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/protocols/tokenBridge/package.json b/platforms/cosmwasm/protocols/tokenBridge/package.json index f26c290b4..a46d4dbfa 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/package.json +++ b/platforms/cosmwasm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -54,8 +54,8 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.14.13-beta.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-cosmwasm": "0.10.3" }, "type": "module", "exports": { diff --git a/platforms/evm/package.json b/platforms/evm/package.json index 32b25d06c..d3afc123b 100644 --- a/platforms/evm/package.json +++ b/platforms/evm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,7 +57,7 @@ "nock": "13.3.8" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.3", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index c4829d255..e54a440dd 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,8 +53,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-evm": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-evm": "0.10.3", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/core/package.json b/platforms/evm/protocols/core/package.json index ad3f724a2..3742f92b8 100644 --- a/platforms/evm/protocols/core/package.json +++ b/platforms/evm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-evm": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-evm": "0.10.3", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/package.json b/platforms/evm/protocols/portico/package.json index 84cb04df2..2d3b4b5ac 100644 --- a/platforms/evm/protocols/portico/package.json +++ b/platforms/evm/protocols/portico/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,10 +52,10 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-evm": "0.10.2", - "@wormhole-foundation/sdk-evm-core": "0.10.2", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-evm": "0.10.3", + "@wormhole-foundation/sdk-evm-core": "0.10.3", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.3", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/tokenBridge/package.json b/platforms/evm/protocols/tokenBridge/package.json index 20ec30e4c..894d4f64e 100644 --- a/platforms/evm/protocols/tokenBridge/package.json +++ b/platforms/evm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,9 +52,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-evm": "0.10.2", - "@wormhole-foundation/sdk-evm-core": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-evm": "0.10.3", + "@wormhole-foundation/sdk-evm-core": "0.10.3", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/solana/package.json b/platforms/solana/package.json index 47bb97e88..aa1e7bbe8 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.3", "rpc-websockets": "^7.10.0" }, "type": "module", diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index 6ac553592..bcb45e8f7 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -48,8 +48,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-solana": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-solana": "0.10.3", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index 65ded1406..58f282c1e 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-solana": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-solana": "0.10.3", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index 7c846f3af..b8e197e95 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-solana": "0.10.2", - "@wormhole-foundation/sdk-solana-core": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-solana": "0.10.3", + "@wormhole-foundation/sdk-solana-core": "0.10.3", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/sui/package.json b/platforms/sui/package.json index ead320e26..777a508ea 100644 --- a/platforms/sui/package.json +++ b/platforms/sui/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.10.3", "@mysten/sui.js": "^0.50.1" }, "type": "module", diff --git a/platforms/sui/protocols/core/package.json b/platforms/sui/protocols/core/package.json index baa5b5a32..f987b9a17 100644 --- a/platforms/sui/protocols/core/package.json +++ b/platforms/sui/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-sui": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-sui": "0.10.3" }, "type": "module", "exports": { diff --git a/platforms/sui/protocols/tokenBridge/package.json b/platforms/sui/protocols/tokenBridge/package.json index 80e386d3f..e274dc5aa 100644 --- a/platforms/sui/protocols/tokenBridge/package.json +++ b/platforms/sui/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,9 +46,9 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-sui": "0.10.2", - "@wormhole-foundation/sdk-sui-core": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-sui": "0.10.3", + "@wormhole-foundation/sdk-sui-core": "0.10.3" }, "type": "module", "exports": { diff --git a/sdk/package.json b/sdk/package.json index ad9270721..779e774df 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk", - "version": "0.10.2", + "version": "0.10.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -384,31 +384,31 @@ } }, "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.2", - "@wormhole-foundation/sdk-definitions": "0.10.2", - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-evm": "0.10.2", - "@wormhole-foundation/sdk-evm-core": "0.10.2", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.2", - "@wormhole-foundation/sdk-evm-portico": "0.10.2", - "@wormhole-foundation/sdk-evm-cctp": "0.10.2", - "@wormhole-foundation/sdk-solana": "0.10.2", - "@wormhole-foundation/sdk-solana-core": "0.10.2", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.2", - "@wormhole-foundation/sdk-solana-cctp": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.2", - "@wormhole-foundation/sdk-sui": "0.10.2", - "@wormhole-foundation/sdk-sui-core": "0.10.2", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.2", - "@wormhole-foundation/sdk-aptos": "0.10.2", - "@wormhole-foundation/sdk-aptos-core": "0.10.2", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.2", - "@wormhole-foundation/sdk-algorand": "0.10.2", - "@wormhole-foundation/sdk-algorand-core": "0.10.2", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.2" + "@wormhole-foundation/sdk-base": "0.10.3", + "@wormhole-foundation/sdk-definitions": "0.10.3", + "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-evm": "0.10.3", + "@wormhole-foundation/sdk-evm-core": "0.10.3", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.3", + "@wormhole-foundation/sdk-evm-portico": "0.10.3", + "@wormhole-foundation/sdk-evm-cctp": "0.10.3", + "@wormhole-foundation/sdk-solana": "0.10.3", + "@wormhole-foundation/sdk-solana-core": "0.10.3", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.3", + "@wormhole-foundation/sdk-solana-cctp": "0.10.3", + "@wormhole-foundation/sdk-cosmwasm": "0.10.3", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.3", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.3", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.3", + "@wormhole-foundation/sdk-sui": "0.10.3", + "@wormhole-foundation/sdk-sui-core": "0.10.3", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.3", + "@wormhole-foundation/sdk-aptos": "0.10.3", + "@wormhole-foundation/sdk-aptos-core": "0.10.3", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.3", + "@wormhole-foundation/sdk-algorand": "0.10.3", + "@wormhole-foundation/sdk-algorand-core": "0.10.3", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.3" }, "type": "module" } \ No newline at end of file From 007f61b27c650c1cf0fada2436f79940dfa4f211 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Tue, 27 Aug 2024 15:03:18 -0500 Subject: [PATCH 29/69] tests: fix finality tests, run CI tests on pull requests (#682) --- .github/workflows/build.yml | 7 ++++++- core/base/__tests__/finality.ts | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe8ad5cd9..01122ce4e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,10 @@ name: Node.js CI -on: [push] +on: + workflow_dispatch: + pull_request: + push: + branches: + - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/core/base/__tests__/finality.ts b/core/base/__tests__/finality.ts index a607dc733..c78923a09 100644 --- a/core/base/__tests__/finality.ts +++ b/core/base/__tests__/finality.ts @@ -3,11 +3,11 @@ import { ConsistencyLevels, finalityThreshold, consistencyLevelToBlock, -} from '../src/constants/finality.js'; +} from "../src/constants/finality.js"; describe("Finality tests", function () { test("Receive expected number of rounds", () => { - expect(finalityThreshold("Ethereum")).toEqual(64); + expect(finalityThreshold("Ethereum")).toEqual(96); expect(finalityThreshold("Algorand")).toEqual(0); expect(finalityThreshold("Solana")).toEqual(32); }); @@ -41,7 +41,7 @@ describe("Finality tests", function () { test("Estimates rounds from finalized consistency level", () => { // 100 + (# final rounds) expect(consistencyLevelToBlock("Ethereum", ConsistencyLevels.Finalized, fromBlock)).toEqual( - fromBlock + 64n, + fromBlock + 96n, ); expect(consistencyLevelToBlock("Solana", ConsistencyLevels.Finalized, fromBlock)).toEqual( fromBlock + 32n, From 830998561afc91d9c85da855c73a5b4bf2266789 Mon Sep 17 00:00:00 2001 From: bruce-riley <96066700+bruce-riley@users.noreply.github.com> Date: Thu, 29 Aug 2024 11:19:36 -0600 Subject: [PATCH 30/69] Add Snaxchain mainnet support (#673) --- core/base/src/constants/contracts/core.ts | 3 ++- core/base/src/constants/contracts/relayer.ts | 1 + core/base/src/constants/contracts/tokenBridge.ts | 1 + core/base/src/constants/nativeChainIds.ts | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/base/src/constants/contracts/core.ts b/core/base/src/constants/contracts/core.ts index 5a004b7eb..1c9e4ace4 100644 --- a/core/base/src/constants/contracts/core.ts +++ b/core/base/src/constants/contracts/core.ts @@ -38,7 +38,8 @@ export const coreBridgeContracts = [[ ["Neutron", "neutron16rerygcpahqcxx5t8vjla46ym8ccn7xz7rtc6ju5ujcd36cmc7zs9zrunh"], ["Blast", "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"], ["Scroll", "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"], - ["Mantle", "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"] + ["Mantle", "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"], + ["Snaxchain", "0xc1BA3CC4bFE724A08FbbFbF64F8db196738665f4"], ]], [ "Testnet", [ ["Solana", "3u8hJUVTA4jH1wYAyUur7FFZVQ8H635K3tSHHF4ssjQ5"], diff --git a/core/base/src/constants/contracts/relayer.ts b/core/base/src/constants/contracts/relayer.ts index f80085f79..195112fb0 100644 --- a/core/base/src/constants/contracts/relayer.ts +++ b/core/base/src/constants/contracts/relayer.ts @@ -20,6 +20,7 @@ export const relayerContracts = [[ ["Scroll", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], ["Mantle", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], ["Xlayer", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], + ["Snaxchain", "0x27428DD2d3DD32A4D7f7C497eAaa23130d894911"], ]], [ "Testnet", [ ["Ethereum", "0x28D8F1Be96f97C1387e94A53e00eCcFb4E75175a"], diff --git a/core/base/src/constants/contracts/tokenBridge.ts b/core/base/src/constants/contracts/tokenBridge.ts index 9a599f16c..8bce358d0 100644 --- a/core/base/src/constants/contracts/tokenBridge.ts +++ b/core/base/src/constants/contracts/tokenBridge.ts @@ -35,6 +35,7 @@ export const tokenBridgeContracts = [[ ["Blast", "0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"], ["Scroll", "0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"], ["Mantle", "0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"], + ["Snaxchain", "0x8B94bfE456B48a6025b92E11Be393BAa86e68410"], ]], [ "Testnet", [ ["Solana", "DZnkkTmCiFWfYTfT41X3Rd1kDgozqzxWaHqsw6W4x2oe"], diff --git a/core/base/src/constants/nativeChainIds.ts b/core/base/src/constants/nativeChainIds.ts index e3791fdaa..882540d44 100644 --- a/core/base/src/constants/nativeChainIds.ts +++ b/core/base/src/constants/nativeChainIds.ts @@ -53,6 +53,7 @@ const chainNetworkNativeChainIdEntries = [ ["Scroll", 534352n], ["Blast", 81457n], ["Linea", 59144n], + ["Snaxchain", 2192n], ], ], [ @@ -104,7 +105,7 @@ const chainNetworkNativeChainIdEntries = [ ["Mantle", 5003n], // Sepolia testnet ["Scroll", 534351n], ["Berachain", 80084n], // Testnet v2 - ["Snaxchain", 2192n], + ["Snaxchain", 13001n], ["Xlayer", 195n], ["Linea", 59141n], // Sepolia ], From 430477a78f17b26e372852c4ddd3b97087697e88 Mon Sep 17 00:00:00 2001 From: Andreas <41449730+nonergodic@users.noreply.github.com> Date: Tue, 3 Sep 2024 08:44:58 -0700 Subject: [PATCH 31/69] move some solana utils from ntt sdk (#685) --- .../core/src/utils/instructions/governance.ts | 4 +- .../tokenBridge/instructions/governance.ts | 4 +- platforms/solana/src/utils/utils/account.ts | 12 +++-- .../src/utils/utils/bpfLoaderUpgradeable.ts | 45 ++++++++++++++++--- 4 files changed, 51 insertions(+), 14 deletions(-) diff --git a/platforms/solana/protocols/core/src/utils/instructions/governance.ts b/platforms/solana/protocols/core/src/utils/instructions/governance.ts index b418af5ea..852a26da3 100644 --- a/platforms/solana/protocols/core/src/utils/instructions/governance.ts +++ b/platforms/solana/protocols/core/src/utils/instructions/governance.ts @@ -248,11 +248,11 @@ export function getUpgradeContractAccounts( upgradeAuthority: deriveUpgradeAuthorityKey(wormholeProgramId), spill: new PublicKey(spill === undefined ? payer : spill), implementation: new SolanaAddress(newContract).unwrap(), - programData: utils.deriveUpgradeableProgramKey(wormholeProgramId), + programData: utils.deriveProgramDataAddress(wormholeProgramId), wormholeProgram: new PublicKey(wormholeProgramId), rent: SYSVAR_RENT_PUBKEY, clock: SYSVAR_CLOCK_PUBKEY, - bpfLoaderUpgradeable: utils.BpfLoaderUpgradeable.programId, + bpfLoaderUpgradeable: utils.BPF_LOADER_UPGRADEABLE_PROGRAM_ID, systemProgram: SystemProgram.programId, }; } diff --git a/platforms/solana/protocols/tokenBridge/src/utils/tokenBridge/instructions/governance.ts b/platforms/solana/protocols/tokenBridge/src/utils/tokenBridge/instructions/governance.ts index 855c70b98..050288665 100644 --- a/platforms/solana/protocols/tokenBridge/src/utils/tokenBridge/instructions/governance.ts +++ b/platforms/solana/protocols/tokenBridge/src/utils/tokenBridge/instructions/governance.ts @@ -144,11 +144,11 @@ export function getUpgradeContractAccounts( upgradeAuthority: CoreUtils.deriveUpgradeAuthorityKey(tokenBridgeProgramId), spill: new PublicKey(spill === undefined ? payer : spill), implementation: new PublicKey(vaa.payload.actionArgs.newContract), - programData: utils.deriveUpgradeableProgramKey(tokenBridgeProgramId), + programData: utils.deriveProgramDataAddress(tokenBridgeProgramId), tokenBridgeProgram: new PublicKey(tokenBridgeProgramId), rent: SYSVAR_RENT_PUBKEY, clock: SYSVAR_CLOCK_PUBKEY, - bpfLoaderUpgradeable: utils.BpfLoaderUpgradeable.programId, + bpfLoaderUpgradeable: utils.BPF_LOADER_UPGRADEABLE_PROGRAM_ID, systemProgram: SystemProgram.programId, }; } diff --git a/platforms/solana/src/utils/utils/account.ts b/platforms/solana/src/utils/utils/account.ts index 80501fe59..f8320e79b 100644 --- a/platforms/solana/src/utils/utils/account.ts +++ b/platforms/solana/src/utils/utils/account.ts @@ -8,15 +8,21 @@ import { PublicKey } from '@solana/web3.js'; /** * Find valid program address. See {@link PublicKey.findProgramAddressSync} for details. * - * @param {(Buffer | Uint8Array)[]} seeds - seeds for PDA + * @param {string | Buffer | Uint8Array | + * readonly (string | Buffer | Uint8Array)[]} seeds - seeds for PDA * @param {PublicKeyInitData} programId - program address * @returns PDA */ +type Seed = string | Buffer | Uint8Array; +const toBytes = (s: Seed) => typeof s === "string" ? Buffer.from(s) : s; export function deriveAddress( - seeds: (Buffer | Uint8Array)[], + seeds: Seed | readonly Seed[], programId: PublicKeyInitData, ): PublicKey { - return PublicKey.findProgramAddressSync(seeds, new PublicKey(programId))[0]; + return PublicKey.findProgramAddressSync( + Array.isArray(seeds) ? seeds.map(toBytes) : [toBytes(seeds as Seed)], + new PublicKey(programId) + )[0]; } /** diff --git a/platforms/solana/src/utils/utils/bpfLoaderUpgradeable.ts b/platforms/solana/src/utils/utils/bpfLoaderUpgradeable.ts index b587e142f..d9dddc461 100644 --- a/platforms/solana/src/utils/utils/bpfLoaderUpgradeable.ts +++ b/platforms/solana/src/utils/utils/bpfLoaderUpgradeable.ts @@ -2,15 +2,46 @@ import type { PublicKeyInitData } from '@solana/web3.js'; import { PublicKey } from '@solana/web3.js'; import { deriveAddress } from './account.js'; -export class BpfLoaderUpgradeable { - static programId: PublicKey = new PublicKey( - 'BPFLoaderUpgradeab1e11111111111111111111111', - ); -} +import type { CustomConversion, Layout } from '@wormhole-foundation/sdk-connect'; + +export const BPF_LOADER_UPGRADEABLE_PROGRAM_ID = new PublicKey( + "BPFLoaderUpgradeab1e11111111111111111111111" +); -export function deriveUpgradeableProgramKey(programId: PublicKeyInitData) { +export function deriveProgramDataAddress(programId: PublicKeyInitData): PublicKey { return deriveAddress( [new PublicKey(programId).toBuffer()], - BpfLoaderUpgradeable.programId, + BPF_LOADER_UPGRADEABLE_PROGRAM_ID, ); } + +const pubKeyConversion = { //TODO find a better place for this + to: (encoded: Uint8Array) => new PublicKey(encoded), + from: (decoded: PublicKey) => decoded.toBytes(), +} as const satisfies CustomConversion; + +//neither anchor nor solana web3 have a built-in way to parse this +//see here: https://docs.rs/solana-program/latest/solana_program/bpf_loader_upgradeable/enum.UpgradeableLoaderState.html +export const programDataLayout = [ + { name: "slot", binary: "uint", endianness: "little", size: 8 }, + { + name: "upgradeAuthority", + binary: "switch", + idSize: 1, + idTag: "isSome", + layouts: [ + [[0, false], []], + [ + [1, true], + [ + { + name: "value", + binary: "bytes", + size: 32, + custom: pubKeyConversion, + }, + ], + ], + ], + }, +] as const satisfies Layout; From 95912bcebca360362b06a8c105d313a8c6b88e05 Mon Sep 17 00:00:00 2001 From: evgeniko <97796468+evgeniko@users.noreply.github.com> Date: Thu, 5 Sep 2024 16:19:44 +0200 Subject: [PATCH 32/69] Sepolia finality threshold (#688) * add missing sepolia network to finality threshold * adjust threshold variable --- core/base/src/constants/finality.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/base/src/constants/finality.ts b/core/base/src/constants/finality.ts index a1e7fbeef..d78f6ebbe 100644 --- a/core/base/src/constants/finality.ts +++ b/core/base/src/constants/finality.ts @@ -68,6 +68,12 @@ const finalityThresholds = [ ["Stargaze", 0], ["Dymension", 0], ["Provenance",0], + // Testnets + ["Sepolia", 96], + ["ArbitrumSepolia", 4096], + ["BaseSepolia", 512], + ["OptimismSepolia", 512], + ["PolygonSepolia", 32], ] as const satisfies MapLevel; /** From 9bb6fe361ca9c8fa4d83d171f9893cd88d8eb14a Mon Sep 17 00:00:00 2001 From: evgeniko <97796468+evgeniko@users.noreply.github.com> Date: Thu, 5 Sep 2024 16:37:16 +0200 Subject: [PATCH 33/69] 0.10.4 version bump (#689) --- connect/package.json | 6 +-- core/base/package.json | 2 +- core/definitions/package.json | 4 +- core/icons/package.json | 4 +- examples/package.json | 4 +- package.json | 2 +- platforms/algorand/package.json | 4 +- .../algorand/protocols/core/package.json | 6 +-- .../protocols/tokenBridge/package.json | 8 +-- platforms/aptos/package.json | 4 +- platforms/aptos/protocols/core/package.json | 6 +-- .../aptos/protocols/tokenBridge/package.json | 6 +-- platforms/cosmwasm/package.json | 4 +- .../cosmwasm/protocols/core/package.json | 6 +-- platforms/cosmwasm/protocols/ibc/package.json | 8 +-- .../protocols/tokenBridge/package.json | 6 +-- platforms/evm/package.json | 4 +- platforms/evm/protocols/cctp/package.json | 6 +-- platforms/evm/protocols/core/package.json | 6 +-- platforms/evm/protocols/portico/package.json | 10 ++-- .../evm/protocols/tokenBridge/package.json | 8 +-- platforms/solana/package.json | 4 +- platforms/solana/protocols/cctp/package.json | 6 +-- platforms/solana/protocols/core/package.json | 6 +-- .../solana/protocols/tokenBridge/package.json | 8 +-- platforms/sui/package.json | 4 +- platforms/sui/protocols/core/package.json | 6 +-- .../sui/protocols/tokenBridge/package.json | 8 +-- sdk/package.json | 52 +++++++++---------- 29 files changed, 104 insertions(+), 104 deletions(-) diff --git a/connect/package.json b/connect/package.json index 6367c7c88..780d4f125 100644 --- a/connect/package.json +++ b/connect/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-connect", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -98,8 +98,8 @@ }, "dependencies": { "axios": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.3", - "@wormhole-foundation/sdk-definitions": "0.10.3" + "@wormhole-foundation/sdk-base": "0.10.4", + "@wormhole-foundation/sdk-definitions": "0.10.4" }, "type": "module" } \ No newline at end of file diff --git a/core/base/package.json b/core/base/package.json index 911e9448e..6b18ba738 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-base", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" diff --git a/core/definitions/package.json b/core/definitions/package.json index 5715dff9f..682fe4b53 100644 --- a/core/definitions/package.json +++ b/core/definitions/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -86,7 +86,7 @@ "dependencies": { "@noble/hashes": "^1.3.1", "@noble/curves": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.3" + "@wormhole-foundation/sdk-base": "0.10.4" }, "type": "module" } \ No newline at end of file diff --git a/core/icons/package.json b/core/icons/package.json index 6d9f9eaf8..3b67c1cf8 100644 --- a/core/icons/package.json +++ b/core/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-icons", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -50,7 +50,7 @@ "dist/cjs" ], "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.3" + "@wormhole-foundation/sdk-base": "0.10.4" }, "sideEffects": false, "scripts": { diff --git a/examples/package.json b/examples/package.json index 5241a74de..de79f6274 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -51,6 +51,6 @@ "tsx": "^4.7.0" }, "dependencies": { - "@wormhole-foundation/sdk": "0.10.3" + "@wormhole-foundation/sdk": "0.10.4" } } \ No newline at end of file diff --git a/package.json b/package.json index 1a7ec94a0..5ae5283bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sdk", - "version": "0.10.3", + "version": "0.10.4", "license": "Apache-2.0", "directories": { "test": "__tests__" diff --git a/platforms/algorand/package.json b/platforms/algorand/package.json index 96ec36765..67f9f733d 100644 --- a/platforms/algorand/package.json +++ b/platforms/algorand/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -96,7 +96,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-connect": "0.10.4", "algosdk": "2.7.0" }, "type": "module" diff --git a/platforms/algorand/protocols/core/package.json b/platforms/algorand/protocols/core/package.json index 2c20df532..64efe475b 100644 --- a/platforms/algorand/protocols/core/package.json +++ b/platforms/algorand/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-algorand": "0.10.3" + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-algorand": "0.10.4" }, "type": "module", "exports": { diff --git a/platforms/algorand/protocols/tokenBridge/package.json b/platforms/algorand/protocols/tokenBridge/package.json index 331d9fba7..8bcf74fd2 100644 --- a/platforms/algorand/protocols/tokenBridge/package.json +++ b/platforms/algorand/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-algorand": "0.10.3", - "@wormhole-foundation/sdk-algorand-core": "0.10.3" + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-algorand": "0.10.4", + "@wormhole-foundation/sdk-algorand-core": "0.10.4" }, "type": "module", "exports": { diff --git a/platforms/aptos/package.json b/platforms/aptos/package.json index d448f3866..c85c89809 100644 --- a/platforms/aptos/package.json +++ b/platforms/aptos/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-connect": "0.10.4", "aptos": "1.21.0" }, "type": "module", diff --git a/platforms/aptos/protocols/core/package.json b/platforms/aptos/protocols/core/package.json index 0810c8327..9e6e2355a 100644 --- a/platforms/aptos/protocols/core/package.json +++ b/platforms/aptos/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-aptos": "0.10.3" + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-aptos": "0.10.4" }, "type": "module", "exports": { diff --git a/platforms/aptos/protocols/tokenBridge/package.json b/platforms/aptos/protocols/tokenBridge/package.json index 8f982db8d..f5e3b9b9c 100644 --- a/platforms/aptos/protocols/tokenBridge/package.json +++ b/platforms/aptos/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-aptos": "0.10.3" + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-aptos": "0.10.4" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/package.json b/platforms/cosmwasm/package.json index f8d6301a7..f9f4812c3 100644 --- a/platforms/cosmwasm/package.json +++ b/platforms/cosmwasm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-connect": "0.10.4", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", diff --git a/platforms/cosmwasm/protocols/core/package.json b/platforms/cosmwasm/protocols/core/package.json index 7d1dfa9d5..e6e9b27b5 100644 --- a/platforms/cosmwasm/protocols/core/package.json +++ b/platforms/cosmwasm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-cosmwasm": "0.10.3", + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-cosmwasm": "0.10.4", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2" diff --git a/platforms/cosmwasm/protocols/ibc/package.json b/platforms/cosmwasm/protocols/ibc/package.json index 201a306bb..7a54ca02e 100644 --- a/platforms/cosmwasm/protocols/ibc/package.json +++ b/platforms/cosmwasm/protocols/ibc/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,9 +57,9 @@ "@cosmjs/stargate": "^0.32.0", "cosmjs-types": "^0.9.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-cosmwasm": "0.10.3", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.3" + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-cosmwasm": "0.10.4", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.4" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/protocols/tokenBridge/package.json b/platforms/cosmwasm/protocols/tokenBridge/package.json index a46d4dbfa..bf0c6f824 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/package.json +++ b/platforms/cosmwasm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -54,8 +54,8 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.14.13-beta.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-cosmwasm": "0.10.3" + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-cosmwasm": "0.10.4" }, "type": "module", "exports": { diff --git a/platforms/evm/package.json b/platforms/evm/package.json index d3afc123b..a61aff5e7 100644 --- a/platforms/evm/package.json +++ b/platforms/evm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,7 +57,7 @@ "nock": "13.3.8" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-connect": "0.10.4", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index e54a440dd..d17139c98 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,8 +53,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-evm": "0.10.3", + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-evm": "0.10.4", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/core/package.json b/platforms/evm/protocols/core/package.json index 3742f92b8..563e2e31e 100644 --- a/platforms/evm/protocols/core/package.json +++ b/platforms/evm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-evm": "0.10.3", + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-evm": "0.10.4", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/package.json b/platforms/evm/protocols/portico/package.json index 2d3b4b5ac..33318bd8f 100644 --- a/platforms/evm/protocols/portico/package.json +++ b/platforms/evm/protocols/portico/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,10 +52,10 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-evm": "0.10.3", - "@wormhole-foundation/sdk-evm-core": "0.10.3", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.3", + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-evm": "0.10.4", + "@wormhole-foundation/sdk-evm-core": "0.10.4", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.4", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/tokenBridge/package.json b/platforms/evm/protocols/tokenBridge/package.json index 894d4f64e..bac89357c 100644 --- a/platforms/evm/protocols/tokenBridge/package.json +++ b/platforms/evm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,9 +52,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-evm": "0.10.3", - "@wormhole-foundation/sdk-evm-core": "0.10.3", + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-evm": "0.10.4", + "@wormhole-foundation/sdk-evm-core": "0.10.4", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/solana/package.json b/platforms/solana/package.json index aa1e7bbe8..c5c9afc99 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-connect": "0.10.4", "rpc-websockets": "^7.10.0" }, "type": "module", diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index bcb45e8f7..89f9a4df5 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -48,8 +48,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-solana": "0.10.3", + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-solana": "0.10.4", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index 58f282c1e..e555eeae8 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-solana": "0.10.3", + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-solana": "0.10.4", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index b8e197e95..42eb4d52e 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-solana": "0.10.3", - "@wormhole-foundation/sdk-solana-core": "0.10.3", + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-solana": "0.10.4", + "@wormhole-foundation/sdk-solana-core": "0.10.4", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/sui/package.json b/platforms/sui/package.json index 777a508ea..e7235f7d5 100644 --- a/platforms/sui/package.json +++ b/platforms/sui/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.3", + "@wormhole-foundation/sdk-connect": "0.10.4", "@mysten/sui.js": "^0.50.1" }, "type": "module", diff --git a/platforms/sui/protocols/core/package.json b/platforms/sui/protocols/core/package.json index f987b9a17..f08429f13 100644 --- a/platforms/sui/protocols/core/package.json +++ b/platforms/sui/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-sui": "0.10.3" + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-sui": "0.10.4" }, "type": "module", "exports": { diff --git a/platforms/sui/protocols/tokenBridge/package.json b/platforms/sui/protocols/tokenBridge/package.json index e274dc5aa..f6594a474 100644 --- a/platforms/sui/protocols/tokenBridge/package.json +++ b/platforms/sui/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,9 +46,9 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-sui": "0.10.3", - "@wormhole-foundation/sdk-sui-core": "0.10.3" + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-sui": "0.10.4", + "@wormhole-foundation/sdk-sui-core": "0.10.4" }, "type": "module", "exports": { diff --git a/sdk/package.json b/sdk/package.json index 779e774df..c5e68ef7c 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk", - "version": "0.10.3", + "version": "0.10.4", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -384,31 +384,31 @@ } }, "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.3", - "@wormhole-foundation/sdk-definitions": "0.10.3", - "@wormhole-foundation/sdk-connect": "0.10.3", - "@wormhole-foundation/sdk-evm": "0.10.3", - "@wormhole-foundation/sdk-evm-core": "0.10.3", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.3", - "@wormhole-foundation/sdk-evm-portico": "0.10.3", - "@wormhole-foundation/sdk-evm-cctp": "0.10.3", - "@wormhole-foundation/sdk-solana": "0.10.3", - "@wormhole-foundation/sdk-solana-core": "0.10.3", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.3", - "@wormhole-foundation/sdk-solana-cctp": "0.10.3", - "@wormhole-foundation/sdk-cosmwasm": "0.10.3", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.3", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.3", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.3", - "@wormhole-foundation/sdk-sui": "0.10.3", - "@wormhole-foundation/sdk-sui-core": "0.10.3", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.3", - "@wormhole-foundation/sdk-aptos": "0.10.3", - "@wormhole-foundation/sdk-aptos-core": "0.10.3", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.3", - "@wormhole-foundation/sdk-algorand": "0.10.3", - "@wormhole-foundation/sdk-algorand-core": "0.10.3", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.3" + "@wormhole-foundation/sdk-base": "0.10.4", + "@wormhole-foundation/sdk-definitions": "0.10.4", + "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-evm": "0.10.4", + "@wormhole-foundation/sdk-evm-core": "0.10.4", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.4", + "@wormhole-foundation/sdk-evm-portico": "0.10.4", + "@wormhole-foundation/sdk-evm-cctp": "0.10.4", + "@wormhole-foundation/sdk-solana": "0.10.4", + "@wormhole-foundation/sdk-solana-core": "0.10.4", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.4", + "@wormhole-foundation/sdk-solana-cctp": "0.10.4", + "@wormhole-foundation/sdk-cosmwasm": "0.10.4", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.4", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.4", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.4", + "@wormhole-foundation/sdk-sui": "0.10.4", + "@wormhole-foundation/sdk-sui-core": "0.10.4", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.4", + "@wormhole-foundation/sdk-aptos": "0.10.4", + "@wormhole-foundation/sdk-aptos-core": "0.10.4", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.4", + "@wormhole-foundation/sdk-algorand": "0.10.4", + "@wormhole-foundation/sdk-algorand-core": "0.10.4", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.4" }, "type": "module" } \ No newline at end of file From 5810ebbd3635aaf1b5ab675da3f99f62aec2210f Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Mon, 9 Sep 2024 21:25:14 -0500 Subject: [PATCH 34/69] solana cctp: create ata if not exists in redeem function (#692) * solana cctp: create ata if not exists in redeem function Addresses #691 * 0.10.5 version bump --- connect/package.json | 6 +-- core/base/package.json | 2 +- core/definitions/package.json | 4 +- core/icons/package.json | 4 +- examples/package.json | 4 +- package.json | 2 +- platforms/algorand/package.json | 4 +- .../algorand/protocols/core/package.json | 6 +-- .../protocols/tokenBridge/package.json | 8 +-- platforms/aptos/package.json | 4 +- platforms/aptos/protocols/core/package.json | 6 +-- .../aptos/protocols/tokenBridge/package.json | 6 +-- platforms/cosmwasm/package.json | 4 +- .../cosmwasm/protocols/core/package.json | 6 +-- platforms/cosmwasm/protocols/ibc/package.json | 8 +-- .../protocols/tokenBridge/package.json | 6 +-- platforms/evm/package.json | 4 +- platforms/evm/protocols/cctp/package.json | 6 +-- platforms/evm/protocols/core/package.json | 6 +-- platforms/evm/protocols/portico/package.json | 10 ++-- .../evm/protocols/tokenBridge/package.json | 8 +-- platforms/solana/package.json | 4 +- platforms/solana/protocols/cctp/package.json | 6 +-- .../solana/protocols/cctp/src/circleBridge.ts | 25 ++++++++- platforms/solana/protocols/core/package.json | 6 +-- .../solana/protocols/tokenBridge/package.json | 8 +-- platforms/sui/package.json | 4 +- platforms/sui/protocols/core/package.json | 6 +-- .../sui/protocols/tokenBridge/package.json | 8 +-- sdk/package.json | 52 +++++++++---------- 30 files changed, 128 insertions(+), 105 deletions(-) diff --git a/connect/package.json b/connect/package.json index 780d4f125..92c841205 100644 --- a/connect/package.json +++ b/connect/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-connect", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -98,8 +98,8 @@ }, "dependencies": { "axios": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.4", - "@wormhole-foundation/sdk-definitions": "0.10.4" + "@wormhole-foundation/sdk-base": "0.10.5", + "@wormhole-foundation/sdk-definitions": "0.10.5" }, "type": "module" } \ No newline at end of file diff --git a/core/base/package.json b/core/base/package.json index 6b18ba738..d17a9442c 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-base", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" diff --git a/core/definitions/package.json b/core/definitions/package.json index 682fe4b53..9c60bfc53 100644 --- a/core/definitions/package.json +++ b/core/definitions/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -86,7 +86,7 @@ "dependencies": { "@noble/hashes": "^1.3.1", "@noble/curves": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.4" + "@wormhole-foundation/sdk-base": "0.10.5" }, "type": "module" } \ No newline at end of file diff --git a/core/icons/package.json b/core/icons/package.json index 3b67c1cf8..ddc83bc2d 100644 --- a/core/icons/package.json +++ b/core/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-icons", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -50,7 +50,7 @@ "dist/cjs" ], "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.4" + "@wormhole-foundation/sdk-base": "0.10.5" }, "sideEffects": false, "scripts": { diff --git a/examples/package.json b/examples/package.json index de79f6274..09959e49f 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -51,6 +51,6 @@ "tsx": "^4.7.0" }, "dependencies": { - "@wormhole-foundation/sdk": "0.10.4" + "@wormhole-foundation/sdk": "0.10.5" } } \ No newline at end of file diff --git a/package.json b/package.json index 5ae5283bb..8eece4d26 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sdk", - "version": "0.10.4", + "version": "0.10.5", "license": "Apache-2.0", "directories": { "test": "__tests__" diff --git a/platforms/algorand/package.json b/platforms/algorand/package.json index 67f9f733d..3a47ff8ef 100644 --- a/platforms/algorand/package.json +++ b/platforms/algorand/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -96,7 +96,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-connect": "0.10.5", "algosdk": "2.7.0" }, "type": "module" diff --git a/platforms/algorand/protocols/core/package.json b/platforms/algorand/protocols/core/package.json index 64efe475b..ea9bc2e63 100644 --- a/platforms/algorand/protocols/core/package.json +++ b/platforms/algorand/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-algorand": "0.10.4" + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-algorand": "0.10.5" }, "type": "module", "exports": { diff --git a/platforms/algorand/protocols/tokenBridge/package.json b/platforms/algorand/protocols/tokenBridge/package.json index 8bcf74fd2..fdb5b9825 100644 --- a/platforms/algorand/protocols/tokenBridge/package.json +++ b/platforms/algorand/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-algorand": "0.10.4", - "@wormhole-foundation/sdk-algorand-core": "0.10.4" + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-algorand": "0.10.5", + "@wormhole-foundation/sdk-algorand-core": "0.10.5" }, "type": "module", "exports": { diff --git a/platforms/aptos/package.json b/platforms/aptos/package.json index c85c89809..64b23c40a 100644 --- a/platforms/aptos/package.json +++ b/platforms/aptos/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-connect": "0.10.5", "aptos": "1.21.0" }, "type": "module", diff --git a/platforms/aptos/protocols/core/package.json b/platforms/aptos/protocols/core/package.json index 9e6e2355a..7e00e1ff0 100644 --- a/platforms/aptos/protocols/core/package.json +++ b/platforms/aptos/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-aptos": "0.10.4" + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-aptos": "0.10.5" }, "type": "module", "exports": { diff --git a/platforms/aptos/protocols/tokenBridge/package.json b/platforms/aptos/protocols/tokenBridge/package.json index f5e3b9b9c..0d8f825b7 100644 --- a/platforms/aptos/protocols/tokenBridge/package.json +++ b/platforms/aptos/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-aptos": "0.10.4" + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-aptos": "0.10.5" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/package.json b/platforms/cosmwasm/package.json index f9f4812c3..bf984cd7c 100644 --- a/platforms/cosmwasm/package.json +++ b/platforms/cosmwasm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-connect": "0.10.5", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", diff --git a/platforms/cosmwasm/protocols/core/package.json b/platforms/cosmwasm/protocols/core/package.json index e6e9b27b5..f500d4b86 100644 --- a/platforms/cosmwasm/protocols/core/package.json +++ b/platforms/cosmwasm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-cosmwasm": "0.10.4", + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-cosmwasm": "0.10.5", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2" diff --git a/platforms/cosmwasm/protocols/ibc/package.json b/platforms/cosmwasm/protocols/ibc/package.json index 7a54ca02e..0c8b66467 100644 --- a/platforms/cosmwasm/protocols/ibc/package.json +++ b/platforms/cosmwasm/protocols/ibc/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,9 +57,9 @@ "@cosmjs/stargate": "^0.32.0", "cosmjs-types": "^0.9.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-cosmwasm": "0.10.4", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.4" + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-cosmwasm": "0.10.5", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.5" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/protocols/tokenBridge/package.json b/platforms/cosmwasm/protocols/tokenBridge/package.json index bf0c6f824..f4db37a53 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/package.json +++ b/platforms/cosmwasm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -54,8 +54,8 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.14.13-beta.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-cosmwasm": "0.10.4" + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-cosmwasm": "0.10.5" }, "type": "module", "exports": { diff --git a/platforms/evm/package.json b/platforms/evm/package.json index a61aff5e7..fc10663b1 100644 --- a/platforms/evm/package.json +++ b/platforms/evm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,7 +57,7 @@ "nock": "13.3.8" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-connect": "0.10.5", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index d17139c98..f87a53c3a 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,8 +53,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-evm": "0.10.4", + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-evm": "0.10.5", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/core/package.json b/platforms/evm/protocols/core/package.json index 563e2e31e..bf956f300 100644 --- a/platforms/evm/protocols/core/package.json +++ b/platforms/evm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-evm": "0.10.4", + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-evm": "0.10.5", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/package.json b/platforms/evm/protocols/portico/package.json index 33318bd8f..2bd1bb69f 100644 --- a/platforms/evm/protocols/portico/package.json +++ b/platforms/evm/protocols/portico/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,10 +52,10 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-evm": "0.10.4", - "@wormhole-foundation/sdk-evm-core": "0.10.4", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.4", + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-evm": "0.10.5", + "@wormhole-foundation/sdk-evm-core": "0.10.5", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.5", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/tokenBridge/package.json b/platforms/evm/protocols/tokenBridge/package.json index bac89357c..a3c804757 100644 --- a/platforms/evm/protocols/tokenBridge/package.json +++ b/platforms/evm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,9 +52,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-evm": "0.10.4", - "@wormhole-foundation/sdk-evm-core": "0.10.4", + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-evm": "0.10.5", + "@wormhole-foundation/sdk-evm-core": "0.10.5", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/solana/package.json b/platforms/solana/package.json index c5c9afc99..2553f4321 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-connect": "0.10.5", "rpc-websockets": "^7.10.0" }, "type": "module", diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index 89f9a4df5..333670058 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -48,8 +48,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-solana": "0.10.4", + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-solana": "0.10.5", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/cctp/src/circleBridge.ts b/platforms/solana/protocols/cctp/src/circleBridge.ts index a6e75eed0..d28f22206 100644 --- a/platforms/solana/protocols/cctp/src/circleBridge.ts +++ b/platforms/solana/protocols/cctp/src/circleBridge.ts @@ -14,7 +14,10 @@ import { CircleBridge, circle } from '@wormhole-foundation/sdk-connect'; import type { Program } from '@coral-xyz/anchor'; import BN from 'bn.js'; -import { getAssociatedTokenAddressSync } from '@solana/spl-token'; +import { + createAssociatedTokenAccountInstruction, + getAssociatedTokenAddressSync, +} from '@solana/spl-token'; import type { SolanaChains, SolanaTransaction, @@ -100,6 +103,26 @@ export class SolanaCircleBridge const senderPk = new SolanaAddress(sender).unwrap(); + // If the ATA doesn't exist then create it + const mintRecipient = new SolanaAddress( + message.payload.mintRecipient, + ).unwrap(); + const ata = await this.connection.getAccountInfo(mintRecipient); + + if (!ata) { + const transaction = new Transaction().add( + createAssociatedTokenAccountInstruction( + senderPk, + mintRecipient, + senderPk, + usdc, + ), + ); + + transaction.feePayer = senderPk; + yield this.createUnsignedTx({ transaction }, 'CircleBridge.CreateATA'); + } + const ix = await createReceiveMessageInstruction( this.messageTransmitter.programId, this.tokenMessenger.programId, diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index e555eeae8..a561ddc64 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-solana": "0.10.4", + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-solana": "0.10.5", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index 42eb4d52e..a1bc84740 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-solana": "0.10.4", - "@wormhole-foundation/sdk-solana-core": "0.10.4", + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-solana": "0.10.5", + "@wormhole-foundation/sdk-solana-core": "0.10.5", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/sui/package.json b/platforms/sui/package.json index e7235f7d5..c2bcd485f 100644 --- a/platforms/sui/package.json +++ b/platforms/sui/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.4", + "@wormhole-foundation/sdk-connect": "0.10.5", "@mysten/sui.js": "^0.50.1" }, "type": "module", diff --git a/platforms/sui/protocols/core/package.json b/platforms/sui/protocols/core/package.json index f08429f13..5ad1774de 100644 --- a/platforms/sui/protocols/core/package.json +++ b/platforms/sui/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-sui": "0.10.4" + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-sui": "0.10.5" }, "type": "module", "exports": { diff --git a/platforms/sui/protocols/tokenBridge/package.json b/platforms/sui/protocols/tokenBridge/package.json index f6594a474..0d19465df 100644 --- a/platforms/sui/protocols/tokenBridge/package.json +++ b/platforms/sui/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,9 +46,9 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-sui": "0.10.4", - "@wormhole-foundation/sdk-sui-core": "0.10.4" + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-sui": "0.10.5", + "@wormhole-foundation/sdk-sui-core": "0.10.5" }, "type": "module", "exports": { diff --git a/sdk/package.json b/sdk/package.json index c5e68ef7c..db00e639c 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk", - "version": "0.10.4", + "version": "0.10.5", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -384,31 +384,31 @@ } }, "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.4", - "@wormhole-foundation/sdk-definitions": "0.10.4", - "@wormhole-foundation/sdk-connect": "0.10.4", - "@wormhole-foundation/sdk-evm": "0.10.4", - "@wormhole-foundation/sdk-evm-core": "0.10.4", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.4", - "@wormhole-foundation/sdk-evm-portico": "0.10.4", - "@wormhole-foundation/sdk-evm-cctp": "0.10.4", - "@wormhole-foundation/sdk-solana": "0.10.4", - "@wormhole-foundation/sdk-solana-core": "0.10.4", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.4", - "@wormhole-foundation/sdk-solana-cctp": "0.10.4", - "@wormhole-foundation/sdk-cosmwasm": "0.10.4", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.4", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.4", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.4", - "@wormhole-foundation/sdk-sui": "0.10.4", - "@wormhole-foundation/sdk-sui-core": "0.10.4", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.4", - "@wormhole-foundation/sdk-aptos": "0.10.4", - "@wormhole-foundation/sdk-aptos-core": "0.10.4", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.4", - "@wormhole-foundation/sdk-algorand": "0.10.4", - "@wormhole-foundation/sdk-algorand-core": "0.10.4", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.4" + "@wormhole-foundation/sdk-base": "0.10.5", + "@wormhole-foundation/sdk-definitions": "0.10.5", + "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-evm": "0.10.5", + "@wormhole-foundation/sdk-evm-core": "0.10.5", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.5", + "@wormhole-foundation/sdk-evm-portico": "0.10.5", + "@wormhole-foundation/sdk-evm-cctp": "0.10.5", + "@wormhole-foundation/sdk-solana": "0.10.5", + "@wormhole-foundation/sdk-solana-core": "0.10.5", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.5", + "@wormhole-foundation/sdk-solana-cctp": "0.10.5", + "@wormhole-foundation/sdk-cosmwasm": "0.10.5", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.5", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.5", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.5", + "@wormhole-foundation/sdk-sui": "0.10.5", + "@wormhole-foundation/sdk-sui-core": "0.10.5", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.5", + "@wormhole-foundation/sdk-aptos": "0.10.5", + "@wormhole-foundation/sdk-aptos-core": "0.10.5", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.5", + "@wormhole-foundation/sdk-algorand": "0.10.5", + "@wormhole-foundation/sdk-algorand-core": "0.10.5", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.5" }, "type": "module" } \ No newline at end of file From cc51d7c5baa96e8fa79174cbe49037475d9aed24 Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Thu, 12 Sep 2024 16:17:10 -0400 Subject: [PATCH 35/69] Custom error class for minimum amount error (#321) * custom error class for minimum amount error this should be used to communicate that validate() or quote() have failed, but only because the user's transfer amount was too small. UI should use this to show a helpful error so the user can increase their transfer size. * new special error type: UnavailableError --- connect/src/routes/tokenBridge/automatic.ts | 10 +++---- connect/src/routes/types.ts | 29 ++++++++++++++++++++- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/connect/src/routes/tokenBridge/automatic.ts b/connect/src/routes/tokenBridge/automatic.ts index d19ae699d..0aeee76f2 100644 --- a/connect/src/routes/tokenBridge/automatic.ts +++ b/connect/src/routes/tokenBridge/automatic.ts @@ -14,6 +14,9 @@ import { TransferState } from "../../types.js"; import { Wormhole } from "../../wormhole.js"; import type { StaticRouteMethods } from "../route.js"; import { AutomaticRoute } from "../route.js"; +import { + MinAmountError, +} from '../types.js'; import type { Quote, QuoteResult, @@ -167,12 +170,7 @@ export class AutomaticTokenBridgeRoute // Min amount is fee + 5% const minAmount = (fee * 105n) / 100n; if (amount.units(amt) < minAmount) { - throw new Error( - `Minimum amount is ${amount.display({ - amount: minAmount.toString(), - decimals: amt.decimals, - })}`, - ); + throw new MinAmountError(amount.fromBaseUnits(minAmount, amt.decimals)); } const redeemableAmount = amount.units(amt) - fee; diff --git a/connect/src/routes/types.ts b/connect/src/routes/types.ts index e68e36888..2975d8aa7 100644 --- a/connect/src/routes/types.ts +++ b/connect/src/routes/types.ts @@ -1,6 +1,6 @@ import type { TokenId } from "@wormhole-foundation/sdk-definitions"; import type { AttestationReceipt, TransferReceipt } from "../types.js"; -import type { amount } from "@wormhole-foundation/sdk-base"; +import { amount } from "@wormhole-foundation/sdk-base"; import type { QuoteWarning } from "../warnings.js"; // Extend Options to provide custom options @@ -84,3 +84,30 @@ export type QuoteError = { success: false; error: Error; }; + +// Special error to return from quote() or validate() when the +// given transfer amount is too small. Used to helpfully +// show a minimum amount in the interface. +export class MinAmountError extends Error { + min: amount.Amount; + + constructor(min: amount.Amount) { + super(`Minimum transfer amount is ${amount.display(min)}`); + this.min = min; + } + + minAmount(): amount.Amount { + return this.min; + } +} + +// Special error to return from quote() or validate() when the +// protocol can't provide a quote. +export class UnavailableError extends Error { + internalError: Error; + + constructor(internalErr: Error) { + super(`Unable to fetch a quote`); + this.internalError = internalErr; + } +} From d61cc30b747e92ad7abe41cf33005788d720d2f1 Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Fri, 13 Sep 2024 10:03:50 -0400 Subject: [PATCH 36/69] `amount.display`: Don't add trailing zeros by default (#696) * don't add trailing zeros by default * put padEnd back * fix test --- core/base/__tests__/amount.ts | 2 +- core/base/src/utils/amount.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/base/__tests__/amount.ts b/core/base/__tests__/amount.ts index 839328894..f95f966d5 100644 --- a/core/base/__tests__/amount.ts +++ b/core/base/__tests__/amount.ts @@ -79,7 +79,7 @@ describe("Amount Tests", function () { [{ amount: "1", decimals: 18 }, 20, "0.00000000000000000100"], [{ amount: "5020", decimals: 2 }, 0, "50.2"], [{ amount: "5020", decimals: 2 }, 4, "50.2000"], - [{ amount: "5020", decimals: 2 }, undefined, "50.20"], + [{ amount: "5020", decimals: 2 }, undefined, "50.2"], [{ amount: "1", decimals: 0 }, 0, "1"], ]; diff --git a/core/base/src/utils/amount.ts b/core/base/src/utils/amount.ts index 1a1d0b72b..65a57a759 100644 --- a/core/base/src/utils/amount.ts +++ b/core/base/src/utils/amount.ts @@ -157,6 +157,10 @@ export function display(amount: Amount, precision?: number): string { partial = partial.substring(0, partial.length - 1); } partial = partial.padEnd(precision, "0"); + } else { + // If no specific precision is given, just trim trailing zeroes + // and return all significant digits. + partial = partial.replace(/0+$/, ''); } return partial.length > 0 ? `${whole}.${partial}` : whole; From 3607933800ddc888e3f6ee1b57a7d9d02ea008ed Mon Sep 17 00:00:00 2001 From: Paul Noel <35237584+panoel@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:55:48 -0400 Subject: [PATCH 37/69] core/base: add snaxchain mainnet rpc (#697) --- core/base/src/constants/rpc.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/core/base/src/constants/rpc.ts b/core/base/src/constants/rpc.ts index ce0c2b5b2..b71344b2b 100644 --- a/core/base/src/constants/rpc.ts +++ b/core/base/src/constants/rpc.ts @@ -45,6 +45,7 @@ const rpcConfig = [[ ["Rootstock", "https://public-node.rsk.co"], ["Mantle", "https://rpc.mantle.xyz"], ["Klaytn", "https://rpc.ankr.com/klaytn"], + ["Snaxchain", "https://mainnet.snaxchain.io"], ]], [ "Testnet", [ ["Ethereum", "https://eth-goerli.public.blastapi.io"], From dbbbc7c365db602dd3b534f6d615ac80c3d2aaf1 Mon Sep 17 00:00:00 2001 From: Erin Shaben Date: Wed, 18 Sep 2024 18:42:31 -0400 Subject: [PATCH 38/69] Remove duplicate configs (#699) --- core/base/src/constants/finality.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/base/src/constants/finality.ts b/core/base/src/constants/finality.ts index d78f6ebbe..64af98221 100644 --- a/core/base/src/constants/finality.ts +++ b/core/base/src/constants/finality.ts @@ -123,8 +123,6 @@ const blockTimeMilliseconds = [ ["Sepolia", 15_000], ["Solana", 400], ["Sui", 3_000], - ["Scroll", 4_000], - ["Mantle", 2_000], ["Terra", 6_000], ["Terra2", 6_000], ["Xpla", 5_000], From b2268aaf8cf4e0df8f340995194528565c73fb02 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:32:47 -0500 Subject: [PATCH 39/69] tokenBridge: fromIdentifier amount scaling fix (#700) * tokenBridge: fromIdentifier amount scaling fix We were not scaling the transfer amount on the VAA to the source chain amount correctly. Fixes #580 * fix toNative chain --- .../protocols/tokenBridge/tokenTransfer.ts | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/connect/src/protocols/tokenBridge/tokenTransfer.ts b/connect/src/protocols/tokenBridge/tokenTransfer.ts index 0677dd513..03eb569b1 100644 --- a/connect/src/protocols/tokenBridge/tokenTransfer.ts +++ b/connect/src/protocols/tokenBridge/tokenTransfer.ts @@ -1,5 +1,11 @@ import type { Chain, Network } from "@wormhole-foundation/sdk-base"; -import { amount, encoding, finality, guardians, toChain as toChainName } from "@wormhole-foundation/sdk-base"; +import { + amount, + encoding, + finality, + guardians, + toChain as toChainName, +} from "@wormhole-foundation/sdk-base"; import type { AttestationId, AutomaticTokenBridge, @@ -167,9 +173,20 @@ export class TokenTransfer let from = { chain: vaa.emitterChain, address: vaa.emitterAddress }; let { token, to } = vaa.payload; + let nativeAddress: NativeAddress; + if (token.chain === from.chain) { + nativeAddress = await wh.getTokenNativeAddress(from.chain, token.chain, token.address); + } else { + const fromChain = await wh.getChain(from.chain); + const tb = await fromChain.getTokenBridge(); + const wrapped = await tb.getWrappedAsset(token); + nativeAddress = toNative(from.chain, wrapped.toString()); + } + + const decimals = await wh.getDecimals(from.chain, nativeAddress); const scaledAmount = amount.scale( - amount.fromBaseUnits(token.amount, TokenTransfer.MAX_DECIMALS), - await wh.getDecimals(token.chain, token.address), + amount.fromBaseUnits(token.amount, Math.min(decimals, TokenTransfer.MAX_DECIMALS)), + decimals, ); let nativeGasAmount: bigint = 0n; From 1249937a874bf689d670492fb43fc58f2f3281a7 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Mon, 23 Sep 2024 13:33:15 -0500 Subject: [PATCH 40/69] 0.10.8 version bump (#702) --- connect/package.json | 6 +-- core/base/package.json | 2 +- core/definitions/package.json | 4 +- core/icons/package.json | 4 +- examples/package.json | 4 +- package.json | 2 +- platforms/algorand/package.json | 4 +- .../algorand/protocols/core/package.json | 6 +-- .../protocols/tokenBridge/package.json | 8 +-- platforms/aptos/package.json | 4 +- platforms/aptos/protocols/core/package.json | 6 +-- .../aptos/protocols/tokenBridge/package.json | 6 +-- platforms/cosmwasm/package.json | 4 +- .../cosmwasm/protocols/core/package.json | 6 +-- platforms/cosmwasm/protocols/ibc/package.json | 8 +-- .../protocols/tokenBridge/package.json | 6 +-- platforms/evm/package.json | 4 +- platforms/evm/protocols/cctp/package.json | 6 +-- platforms/evm/protocols/core/package.json | 6 +-- platforms/evm/protocols/portico/package.json | 10 ++-- .../evm/protocols/tokenBridge/package.json | 8 +-- platforms/solana/package.json | 4 +- platforms/solana/protocols/cctp/package.json | 6 +-- platforms/solana/protocols/core/package.json | 6 +-- .../solana/protocols/tokenBridge/package.json | 8 +-- platforms/sui/package.json | 4 +- platforms/sui/protocols/core/package.json | 6 +-- .../sui/protocols/tokenBridge/package.json | 8 +-- sdk/package.json | 52 +++++++++---------- 29 files changed, 104 insertions(+), 104 deletions(-) diff --git a/connect/package.json b/connect/package.json index 92c841205..a3e5e2f32 100644 --- a/connect/package.json +++ b/connect/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-connect", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -98,8 +98,8 @@ }, "dependencies": { "axios": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.5", - "@wormhole-foundation/sdk-definitions": "0.10.5" + "@wormhole-foundation/sdk-base": "0.10.8", + "@wormhole-foundation/sdk-definitions": "0.10.8" }, "type": "module" } \ No newline at end of file diff --git a/core/base/package.json b/core/base/package.json index d17a9442c..743e64b32 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-base", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" diff --git a/core/definitions/package.json b/core/definitions/package.json index 9c60bfc53..869806d29 100644 --- a/core/definitions/package.json +++ b/core/definitions/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -86,7 +86,7 @@ "dependencies": { "@noble/hashes": "^1.3.1", "@noble/curves": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.5" + "@wormhole-foundation/sdk-base": "0.10.8" }, "type": "module" } \ No newline at end of file diff --git a/core/icons/package.json b/core/icons/package.json index ddc83bc2d..332db355a 100644 --- a/core/icons/package.json +++ b/core/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-icons", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -50,7 +50,7 @@ "dist/cjs" ], "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.5" + "@wormhole-foundation/sdk-base": "0.10.8" }, "sideEffects": false, "scripts": { diff --git a/examples/package.json b/examples/package.json index 09959e49f..4cebf9685 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -51,6 +51,6 @@ "tsx": "^4.7.0" }, "dependencies": { - "@wormhole-foundation/sdk": "0.10.5" + "@wormhole-foundation/sdk": "0.10.8" } } \ No newline at end of file diff --git a/package.json b/package.json index 8eece4d26..2f00a961b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sdk", - "version": "0.10.5", + "version": "0.10.8", "license": "Apache-2.0", "directories": { "test": "__tests__" diff --git a/platforms/algorand/package.json b/platforms/algorand/package.json index 3a47ff8ef..a2d22fe78 100644 --- a/platforms/algorand/package.json +++ b/platforms/algorand/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -96,7 +96,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-connect": "0.10.8", "algosdk": "2.7.0" }, "type": "module" diff --git a/platforms/algorand/protocols/core/package.json b/platforms/algorand/protocols/core/package.json index ea9bc2e63..c43acf11e 100644 --- a/platforms/algorand/protocols/core/package.json +++ b/platforms/algorand/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-algorand": "0.10.5" + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-algorand": "0.10.8" }, "type": "module", "exports": { diff --git a/platforms/algorand/protocols/tokenBridge/package.json b/platforms/algorand/protocols/tokenBridge/package.json index fdb5b9825..04bd523b5 100644 --- a/platforms/algorand/protocols/tokenBridge/package.json +++ b/platforms/algorand/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-algorand": "0.10.5", - "@wormhole-foundation/sdk-algorand-core": "0.10.5" + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-algorand": "0.10.8", + "@wormhole-foundation/sdk-algorand-core": "0.10.8" }, "type": "module", "exports": { diff --git a/platforms/aptos/package.json b/platforms/aptos/package.json index 64b23c40a..1c9da7a4a 100644 --- a/platforms/aptos/package.json +++ b/platforms/aptos/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-connect": "0.10.8", "aptos": "1.21.0" }, "type": "module", diff --git a/platforms/aptos/protocols/core/package.json b/platforms/aptos/protocols/core/package.json index 7e00e1ff0..35b241c5a 100644 --- a/platforms/aptos/protocols/core/package.json +++ b/platforms/aptos/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-aptos": "0.10.5" + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-aptos": "0.10.8" }, "type": "module", "exports": { diff --git a/platforms/aptos/protocols/tokenBridge/package.json b/platforms/aptos/protocols/tokenBridge/package.json index 0d8f825b7..dc5573310 100644 --- a/platforms/aptos/protocols/tokenBridge/package.json +++ b/platforms/aptos/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-aptos": "0.10.5" + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-aptos": "0.10.8" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/package.json b/platforms/cosmwasm/package.json index bf984cd7c..b17e705ed 100644 --- a/platforms/cosmwasm/package.json +++ b/platforms/cosmwasm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-connect": "0.10.8", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", diff --git a/platforms/cosmwasm/protocols/core/package.json b/platforms/cosmwasm/protocols/core/package.json index f500d4b86..729e565ff 100644 --- a/platforms/cosmwasm/protocols/core/package.json +++ b/platforms/cosmwasm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-cosmwasm": "0.10.5", + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-cosmwasm": "0.10.8", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2" diff --git a/platforms/cosmwasm/protocols/ibc/package.json b/platforms/cosmwasm/protocols/ibc/package.json index 0c8b66467..dd5500f5e 100644 --- a/platforms/cosmwasm/protocols/ibc/package.json +++ b/platforms/cosmwasm/protocols/ibc/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,9 +57,9 @@ "@cosmjs/stargate": "^0.32.0", "cosmjs-types": "^0.9.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-cosmwasm": "0.10.5", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.5" + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-cosmwasm": "0.10.8", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.8" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/protocols/tokenBridge/package.json b/platforms/cosmwasm/protocols/tokenBridge/package.json index f4db37a53..961befa64 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/package.json +++ b/platforms/cosmwasm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -54,8 +54,8 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.14.13-beta.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-cosmwasm": "0.10.5" + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-cosmwasm": "0.10.8" }, "type": "module", "exports": { diff --git a/platforms/evm/package.json b/platforms/evm/package.json index fc10663b1..7ece4a0ff 100644 --- a/platforms/evm/package.json +++ b/platforms/evm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,7 +57,7 @@ "nock": "13.3.8" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-connect": "0.10.8", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index f87a53c3a..f8b70a64c 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,8 +53,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-evm": "0.10.5", + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-evm": "0.10.8", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/core/package.json b/platforms/evm/protocols/core/package.json index bf956f300..75c5c6cb6 100644 --- a/platforms/evm/protocols/core/package.json +++ b/platforms/evm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-evm": "0.10.5", + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-evm": "0.10.8", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/package.json b/platforms/evm/protocols/portico/package.json index 2bd1bb69f..5ec59f283 100644 --- a/platforms/evm/protocols/portico/package.json +++ b/platforms/evm/protocols/portico/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,10 +52,10 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-evm": "0.10.5", - "@wormhole-foundation/sdk-evm-core": "0.10.5", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.5", + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-evm": "0.10.8", + "@wormhole-foundation/sdk-evm-core": "0.10.8", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.8", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/tokenBridge/package.json b/platforms/evm/protocols/tokenBridge/package.json index a3c804757..ebc69a9a6 100644 --- a/platforms/evm/protocols/tokenBridge/package.json +++ b/platforms/evm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,9 +52,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-evm": "0.10.5", - "@wormhole-foundation/sdk-evm-core": "0.10.5", + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-evm": "0.10.8", + "@wormhole-foundation/sdk-evm-core": "0.10.8", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/solana/package.json b/platforms/solana/package.json index 2553f4321..60bc32bb6 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-connect": "0.10.8", "rpc-websockets": "^7.10.0" }, "type": "module", diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index 333670058..d2920a0aa 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -48,8 +48,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-solana": "0.10.5", + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-solana": "0.10.8", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index a561ddc64..ce014bdec 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-solana": "0.10.5", + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-solana": "0.10.8", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index a1bc84740..dabbade4c 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-solana": "0.10.5", - "@wormhole-foundation/sdk-solana-core": "0.10.5", + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-solana": "0.10.8", + "@wormhole-foundation/sdk-solana-core": "0.10.8", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/sui/package.json b/platforms/sui/package.json index c2bcd485f..e51127a7a 100644 --- a/platforms/sui/package.json +++ b/platforms/sui/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.5", + "@wormhole-foundation/sdk-connect": "0.10.8", "@mysten/sui.js": "^0.50.1" }, "type": "module", diff --git a/platforms/sui/protocols/core/package.json b/platforms/sui/protocols/core/package.json index 5ad1774de..cc2eae42c 100644 --- a/platforms/sui/protocols/core/package.json +++ b/platforms/sui/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-sui": "0.10.5" + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-sui": "0.10.8" }, "type": "module", "exports": { diff --git a/platforms/sui/protocols/tokenBridge/package.json b/platforms/sui/protocols/tokenBridge/package.json index 0d19465df..8b351a0dc 100644 --- a/platforms/sui/protocols/tokenBridge/package.json +++ b/platforms/sui/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,9 +46,9 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-sui": "0.10.5", - "@wormhole-foundation/sdk-sui-core": "0.10.5" + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-sui": "0.10.8", + "@wormhole-foundation/sdk-sui-core": "0.10.8" }, "type": "module", "exports": { diff --git a/sdk/package.json b/sdk/package.json index db00e639c..c46db07cd 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk", - "version": "0.10.5", + "version": "0.10.8", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -384,31 +384,31 @@ } }, "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.5", - "@wormhole-foundation/sdk-definitions": "0.10.5", - "@wormhole-foundation/sdk-connect": "0.10.5", - "@wormhole-foundation/sdk-evm": "0.10.5", - "@wormhole-foundation/sdk-evm-core": "0.10.5", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.5", - "@wormhole-foundation/sdk-evm-portico": "0.10.5", - "@wormhole-foundation/sdk-evm-cctp": "0.10.5", - "@wormhole-foundation/sdk-solana": "0.10.5", - "@wormhole-foundation/sdk-solana-core": "0.10.5", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.5", - "@wormhole-foundation/sdk-solana-cctp": "0.10.5", - "@wormhole-foundation/sdk-cosmwasm": "0.10.5", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.5", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.5", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.5", - "@wormhole-foundation/sdk-sui": "0.10.5", - "@wormhole-foundation/sdk-sui-core": "0.10.5", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.5", - "@wormhole-foundation/sdk-aptos": "0.10.5", - "@wormhole-foundation/sdk-aptos-core": "0.10.5", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.5", - "@wormhole-foundation/sdk-algorand": "0.10.5", - "@wormhole-foundation/sdk-algorand-core": "0.10.5", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.5" + "@wormhole-foundation/sdk-base": "0.10.8", + "@wormhole-foundation/sdk-definitions": "0.10.8", + "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-evm": "0.10.8", + "@wormhole-foundation/sdk-evm-core": "0.10.8", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.8", + "@wormhole-foundation/sdk-evm-portico": "0.10.8", + "@wormhole-foundation/sdk-evm-cctp": "0.10.8", + "@wormhole-foundation/sdk-solana": "0.10.8", + "@wormhole-foundation/sdk-solana-core": "0.10.8", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.8", + "@wormhole-foundation/sdk-solana-cctp": "0.10.8", + "@wormhole-foundation/sdk-cosmwasm": "0.10.8", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.8", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.8", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.8", + "@wormhole-foundation/sdk-sui": "0.10.8", + "@wormhole-foundation/sdk-sui-core": "0.10.8", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.8", + "@wormhole-foundation/sdk-aptos": "0.10.8", + "@wormhole-foundation/sdk-aptos-core": "0.10.8", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.8", + "@wormhole-foundation/sdk-algorand": "0.10.8", + "@wormhole-foundation/sdk-algorand-core": "0.10.8", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.8" }, "type": "module" } \ No newline at end of file From 94d966ac6169a899fe2098c6f52d61a198502da3 Mon Sep 17 00:00:00 2001 From: Andreas <41449730+nonergodic@users.noreply.github.com> Date: Tue, 24 Sep 2024 19:48:49 -0700 Subject: [PATCH 41/69] fix wrong bpfUpgradeableLoader layout (#704) --- .../src/utils/utils/bpfLoaderUpgradeable.ts | 42 ++++++++++++------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/platforms/solana/src/utils/utils/bpfLoaderUpgradeable.ts b/platforms/solana/src/utils/utils/bpfLoaderUpgradeable.ts index d9dddc461..b163e8413 100644 --- a/platforms/solana/src/utils/utils/bpfLoaderUpgradeable.ts +++ b/platforms/solana/src/utils/utils/bpfLoaderUpgradeable.ts @@ -15,33 +15,45 @@ export function deriveProgramDataAddress(programId: PublicKeyInitData): PublicKe ); } +//the program data pda coincides with the address that's stored in the program id account (i.e. the +// account that's found at the program id address), which is of type UpgradeLoaderState::Program: +// https://docs.rs/solana-program/latest/src/solana_program/bpf_loader_upgradeable.rs.html#40-43 +export function programDataAddress(programId: PublicKeyInitData) { + return PublicKey.findProgramAddressSync([new PublicKey(programId).toBytes()], BPF_LOADER_UPGRADEABLE_PROGRAM_ID)[0]; +} + +const onChainUint = { binary: "uint", endianness: "little" } as const; + const pubKeyConversion = { //TODO find a better place for this to: (encoded: Uint8Array) => new PublicKey(encoded), from: (decoded: PublicKey) => decoded.toBytes(), } as const satisfies CustomConversion; -//neither anchor nor solana web3 have a built-in way to parse this -//see here: https://docs.rs/solana-program/latest/solana_program/bpf_loader_upgradeable/enum.UpgradeableLoaderState.html +//Describes the layout of an account that holds a UpgradeableLoaderState::ProgramData enum: +// https://docs.rs/solana-program/latest/src/solana_program/bpf_loader_upgradeable.rs.html#45-52 +// because neither Anchor nor Solana web3 seem to have a built-in way to parse this. +//The bpf_loader_upgradeable program uses Rust's serde crate and bincode to serialize its structs, +// which encodes enum variants as 4 byte little endian uints: +// https://github.com/serde-rs/serde/blob/9f8c579bf5f7478f91108c1186cd0d3f85aff29d/serde_derive/src/ser.rs#L399-L408 +// and Options with a single byte 0 or 1 tag: +// https://docs.rs/bincode/latest/src/bincode/ser/mod.rs.html#137-147 +//However, even if the program is made immutable the bpf_loader_upgradeable program will keep the +// last value of the enum variant and only set the option byte tag to 0, presumably so they don't +// have to memcopy the entire subsequent bytecode (they didn't really think that one through). +//See https://explorer.solana.com/address/GDDMwNyyx8uB6zrqwBFHjLLG3TBYk2F8Az4yrQC5RzMp +// as an example of an immutable program data account. export const programDataLayout = [ - { name: "slot", binary: "uint", endianness: "little", size: 8 }, + { name: "programDataEnumVariant", ...onChainUint, size: 4, custom: 3, omit: true }, + { name: "slot", ...onChainUint, size: 8 }, { name: "upgradeAuthority", binary: "switch", idSize: 1, idTag: "isSome", layouts: [ - [[0, false], []], - [ - [1, true], - [ - { - name: "value", - binary: "bytes", - size: 32, - custom: pubKeyConversion, - }, - ], - ], + [[0, false], [{ name: "_lastValueBeforeImmutability", binary: "bytes", size: 32 }]], + [[1, true], [{ name: "value", binary: "bytes", size: 32, custom: pubKeyConversion }]], ], }, + { name: "bytecode", binary: "bytes" }, ] as const satisfies Layout; From 36322234d88f5d7e0c2390f74c177db0429f6e7a Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Fri, 27 Sep 2024 10:43:19 -0500 Subject: [PATCH 42/69] automatic cctp: use MinAmountError (#703) --- connect/src/routes/cctp/automatic.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/connect/src/routes/cctp/automatic.ts b/connect/src/routes/cctp/automatic.ts index 2dff9da65..5f600fafc 100644 --- a/connect/src/routes/cctp/automatic.ts +++ b/connect/src/routes/cctp/automatic.ts @@ -13,6 +13,7 @@ import { TransferState } from "../../types.js"; import { Wormhole } from "../../wormhole.js"; import type { StaticRouteMethods } from "../route.js"; import { AutomaticRoute } from "../route.js"; +import { MinAmountError } from "../types.js"; import type { Quote, QuoteResult, @@ -163,9 +164,7 @@ export class AutomaticCCTPRoute const minAmount = (fee * 105n) / 100n; if (amount.units(amt) < minAmount) { - throw new Error( - `Minimum amount is ${amount.display(request.amountFromBaseUnits(minAmount))}`, - ); + throw new MinAmountError(amount.fromBaseUnits(minAmount, amt.decimals)); } const redeemableAmount = amount.units(amt) - fee; From fa4ba4bc349a7caada809f209090d79a3c5962fe Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Fri, 27 Sep 2024 10:51:38 -0500 Subject: [PATCH 43/69] 0.10.9 version bump (#707) --- connect/package.json | 6 +-- core/base/package.json | 2 +- core/definitions/package.json | 4 +- core/icons/package.json | 4 +- examples/package.json | 4 +- package.json | 2 +- platforms/algorand/package.json | 4 +- .../algorand/protocols/core/package.json | 6 +-- .../protocols/tokenBridge/package.json | 8 +-- platforms/aptos/package.json | 4 +- platforms/aptos/protocols/core/package.json | 6 +-- .../aptos/protocols/tokenBridge/package.json | 6 +-- platforms/cosmwasm/package.json | 4 +- .../cosmwasm/protocols/core/package.json | 6 +-- platforms/cosmwasm/protocols/ibc/package.json | 8 +-- .../protocols/tokenBridge/package.json | 6 +-- platforms/evm/package.json | 4 +- platforms/evm/protocols/cctp/package.json | 6 +-- platforms/evm/protocols/core/package.json | 6 +-- platforms/evm/protocols/portico/package.json | 10 ++-- .../evm/protocols/tokenBridge/package.json | 8 +-- platforms/solana/package.json | 4 +- platforms/solana/protocols/cctp/package.json | 6 +-- platforms/solana/protocols/core/package.json | 6 +-- .../solana/protocols/tokenBridge/package.json | 8 +-- platforms/sui/package.json | 4 +- platforms/sui/protocols/core/package.json | 6 +-- .../sui/protocols/tokenBridge/package.json | 8 +-- sdk/package.json | 52 +++++++++---------- 29 files changed, 104 insertions(+), 104 deletions(-) diff --git a/connect/package.json b/connect/package.json index a3e5e2f32..01cb79aed 100644 --- a/connect/package.json +++ b/connect/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-connect", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -98,8 +98,8 @@ }, "dependencies": { "axios": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.8", - "@wormhole-foundation/sdk-definitions": "0.10.8" + "@wormhole-foundation/sdk-base": "0.10.9", + "@wormhole-foundation/sdk-definitions": "0.10.9" }, "type": "module" } \ No newline at end of file diff --git a/core/base/package.json b/core/base/package.json index 743e64b32..f7b0e6df8 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-base", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" diff --git a/core/definitions/package.json b/core/definitions/package.json index 869806d29..1f7cb4cf1 100644 --- a/core/definitions/package.json +++ b/core/definitions/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -86,7 +86,7 @@ "dependencies": { "@noble/hashes": "^1.3.1", "@noble/curves": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.8" + "@wormhole-foundation/sdk-base": "0.10.9" }, "type": "module" } \ No newline at end of file diff --git a/core/icons/package.json b/core/icons/package.json index 332db355a..5e82b4228 100644 --- a/core/icons/package.json +++ b/core/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-icons", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -50,7 +50,7 @@ "dist/cjs" ], "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.8" + "@wormhole-foundation/sdk-base": "0.10.9" }, "sideEffects": false, "scripts": { diff --git a/examples/package.json b/examples/package.json index 4cebf9685..7af064642 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -51,6 +51,6 @@ "tsx": "^4.7.0" }, "dependencies": { - "@wormhole-foundation/sdk": "0.10.8" + "@wormhole-foundation/sdk": "0.10.9" } } \ No newline at end of file diff --git a/package.json b/package.json index 2f00a961b..537385ad0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sdk", - "version": "0.10.8", + "version": "0.10.9", "license": "Apache-2.0", "directories": { "test": "__tests__" diff --git a/platforms/algorand/package.json b/platforms/algorand/package.json index a2d22fe78..34b866db4 100644 --- a/platforms/algorand/package.json +++ b/platforms/algorand/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -96,7 +96,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-connect": "0.10.9", "algosdk": "2.7.0" }, "type": "module" diff --git a/platforms/algorand/protocols/core/package.json b/platforms/algorand/protocols/core/package.json index c43acf11e..4bf322005 100644 --- a/platforms/algorand/protocols/core/package.json +++ b/platforms/algorand/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-algorand": "0.10.8" + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-algorand": "0.10.9" }, "type": "module", "exports": { diff --git a/platforms/algorand/protocols/tokenBridge/package.json b/platforms/algorand/protocols/tokenBridge/package.json index 04bd523b5..a28b1f6ef 100644 --- a/platforms/algorand/protocols/tokenBridge/package.json +++ b/platforms/algorand/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-algorand": "0.10.8", - "@wormhole-foundation/sdk-algorand-core": "0.10.8" + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-algorand": "0.10.9", + "@wormhole-foundation/sdk-algorand-core": "0.10.9" }, "type": "module", "exports": { diff --git a/platforms/aptos/package.json b/platforms/aptos/package.json index 1c9da7a4a..89e71a7c0 100644 --- a/platforms/aptos/package.json +++ b/platforms/aptos/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-connect": "0.10.9", "aptos": "1.21.0" }, "type": "module", diff --git a/platforms/aptos/protocols/core/package.json b/platforms/aptos/protocols/core/package.json index 35b241c5a..5323dcb1e 100644 --- a/platforms/aptos/protocols/core/package.json +++ b/platforms/aptos/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-aptos": "0.10.8" + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-aptos": "0.10.9" }, "type": "module", "exports": { diff --git a/platforms/aptos/protocols/tokenBridge/package.json b/platforms/aptos/protocols/tokenBridge/package.json index dc5573310..2e9d6bdc1 100644 --- a/platforms/aptos/protocols/tokenBridge/package.json +++ b/platforms/aptos/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-aptos": "0.10.8" + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-aptos": "0.10.9" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/package.json b/platforms/cosmwasm/package.json index b17e705ed..ac3478f1b 100644 --- a/platforms/cosmwasm/package.json +++ b/platforms/cosmwasm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-connect": "0.10.9", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", diff --git a/platforms/cosmwasm/protocols/core/package.json b/platforms/cosmwasm/protocols/core/package.json index 729e565ff..61a1bf6af 100644 --- a/platforms/cosmwasm/protocols/core/package.json +++ b/platforms/cosmwasm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-cosmwasm": "0.10.8", + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-cosmwasm": "0.10.9", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2" diff --git a/platforms/cosmwasm/protocols/ibc/package.json b/platforms/cosmwasm/protocols/ibc/package.json index dd5500f5e..4512bf869 100644 --- a/platforms/cosmwasm/protocols/ibc/package.json +++ b/platforms/cosmwasm/protocols/ibc/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,9 +57,9 @@ "@cosmjs/stargate": "^0.32.0", "cosmjs-types": "^0.9.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-cosmwasm": "0.10.8", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.8" + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-cosmwasm": "0.10.9", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.9" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/protocols/tokenBridge/package.json b/platforms/cosmwasm/protocols/tokenBridge/package.json index 961befa64..3b947e5a5 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/package.json +++ b/platforms/cosmwasm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -54,8 +54,8 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.14.13-beta.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-cosmwasm": "0.10.8" + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-cosmwasm": "0.10.9" }, "type": "module", "exports": { diff --git a/platforms/evm/package.json b/platforms/evm/package.json index 7ece4a0ff..d362486da 100644 --- a/platforms/evm/package.json +++ b/platforms/evm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,7 +57,7 @@ "nock": "13.3.8" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-connect": "0.10.9", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index f8b70a64c..9fb76ca58 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,8 +53,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-evm": "0.10.8", + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-evm": "0.10.9", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/core/package.json b/platforms/evm/protocols/core/package.json index 75c5c6cb6..64fcfcb3f 100644 --- a/platforms/evm/protocols/core/package.json +++ b/platforms/evm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-evm": "0.10.8", + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-evm": "0.10.9", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/package.json b/platforms/evm/protocols/portico/package.json index 5ec59f283..2fdaa0e3e 100644 --- a/platforms/evm/protocols/portico/package.json +++ b/platforms/evm/protocols/portico/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,10 +52,10 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-evm": "0.10.8", - "@wormhole-foundation/sdk-evm-core": "0.10.8", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.8", + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-evm": "0.10.9", + "@wormhole-foundation/sdk-evm-core": "0.10.9", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.9", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/tokenBridge/package.json b/platforms/evm/protocols/tokenBridge/package.json index ebc69a9a6..0240fae0c 100644 --- a/platforms/evm/protocols/tokenBridge/package.json +++ b/platforms/evm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,9 +52,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-evm": "0.10.8", - "@wormhole-foundation/sdk-evm-core": "0.10.8", + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-evm": "0.10.9", + "@wormhole-foundation/sdk-evm-core": "0.10.9", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/solana/package.json b/platforms/solana/package.json index 60bc32bb6..da99154cc 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-connect": "0.10.9", "rpc-websockets": "^7.10.0" }, "type": "module", diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index d2920a0aa..3ab0c7f3e 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -48,8 +48,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-solana": "0.10.8", + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-solana": "0.10.9", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index ce014bdec..500485079 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-solana": "0.10.8", + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-solana": "0.10.9", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index dabbade4c..5e67699ea 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-solana": "0.10.8", - "@wormhole-foundation/sdk-solana-core": "0.10.8", + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-solana": "0.10.9", + "@wormhole-foundation/sdk-solana-core": "0.10.9", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/sui/package.json b/platforms/sui/package.json index e51127a7a..e507fe82e 100644 --- a/platforms/sui/package.json +++ b/platforms/sui/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.8", + "@wormhole-foundation/sdk-connect": "0.10.9", "@mysten/sui.js": "^0.50.1" }, "type": "module", diff --git a/platforms/sui/protocols/core/package.json b/platforms/sui/protocols/core/package.json index cc2eae42c..0d191234a 100644 --- a/platforms/sui/protocols/core/package.json +++ b/platforms/sui/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-sui": "0.10.8" + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-sui": "0.10.9" }, "type": "module", "exports": { diff --git a/platforms/sui/protocols/tokenBridge/package.json b/platforms/sui/protocols/tokenBridge/package.json index 8b351a0dc..599c312b7 100644 --- a/platforms/sui/protocols/tokenBridge/package.json +++ b/platforms/sui/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,9 +46,9 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-sui": "0.10.8", - "@wormhole-foundation/sdk-sui-core": "0.10.8" + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-sui": "0.10.9", + "@wormhole-foundation/sdk-sui-core": "0.10.9" }, "type": "module", "exports": { diff --git a/sdk/package.json b/sdk/package.json index c46db07cd..6dcc14d96 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk", - "version": "0.10.8", + "version": "0.10.9", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -384,31 +384,31 @@ } }, "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.8", - "@wormhole-foundation/sdk-definitions": "0.10.8", - "@wormhole-foundation/sdk-connect": "0.10.8", - "@wormhole-foundation/sdk-evm": "0.10.8", - "@wormhole-foundation/sdk-evm-core": "0.10.8", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.8", - "@wormhole-foundation/sdk-evm-portico": "0.10.8", - "@wormhole-foundation/sdk-evm-cctp": "0.10.8", - "@wormhole-foundation/sdk-solana": "0.10.8", - "@wormhole-foundation/sdk-solana-core": "0.10.8", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.8", - "@wormhole-foundation/sdk-solana-cctp": "0.10.8", - "@wormhole-foundation/sdk-cosmwasm": "0.10.8", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.8", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.8", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.8", - "@wormhole-foundation/sdk-sui": "0.10.8", - "@wormhole-foundation/sdk-sui-core": "0.10.8", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.8", - "@wormhole-foundation/sdk-aptos": "0.10.8", - "@wormhole-foundation/sdk-aptos-core": "0.10.8", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.8", - "@wormhole-foundation/sdk-algorand": "0.10.8", - "@wormhole-foundation/sdk-algorand-core": "0.10.8", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.8" + "@wormhole-foundation/sdk-base": "0.10.9", + "@wormhole-foundation/sdk-definitions": "0.10.9", + "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-evm": "0.10.9", + "@wormhole-foundation/sdk-evm-core": "0.10.9", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.9", + "@wormhole-foundation/sdk-evm-portico": "0.10.9", + "@wormhole-foundation/sdk-evm-cctp": "0.10.9", + "@wormhole-foundation/sdk-solana": "0.10.9", + "@wormhole-foundation/sdk-solana-core": "0.10.9", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.9", + "@wormhole-foundation/sdk-solana-cctp": "0.10.9", + "@wormhole-foundation/sdk-cosmwasm": "0.10.9", + "@wormhole-foundation/sdk-cosmwasm-core": "0.10.9", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.9", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.9", + "@wormhole-foundation/sdk-sui": "0.10.9", + "@wormhole-foundation/sdk-sui-core": "0.10.9", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.9", + "@wormhole-foundation/sdk-aptos": "0.10.9", + "@wormhole-foundation/sdk-aptos-core": "0.10.9", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.9", + "@wormhole-foundation/sdk-algorand": "0.10.9", + "@wormhole-foundation/sdk-algorand-core": "0.10.9", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.9" }, "type": "module" } \ No newline at end of file From 0d4bceb856e3bd813e20e905f8ef051f60ff3be1 Mon Sep 17 00:00:00 2001 From: bruce-riley <96066700+bruce-riley@users.noreply.github.com> Date: Thu, 10 Oct 2024 10:01:18 -0600 Subject: [PATCH 44/69] Unichain testnet support (#713) --- core/base/src/constants/chains.ts | 1 + core/base/src/constants/contracts/core.ts | 1 + .../src/constants/contracts/tokenBridge.ts | 1 + core/base/src/constants/finality.ts | 1 + core/base/src/constants/nativeChainIds.ts | 1 + core/base/src/constants/platforms.ts | 1 + core/icons/src/constants/chainIcons.ts | 5 ++ core/icons/src/images/chains/Unichain.svg | 48 +++++++++++++++++++ 8 files changed, 59 insertions(+) create mode 100755 core/icons/src/images/chains/Unichain.svg diff --git a/core/base/src/constants/chains.ts b/core/base/src/constants/chains.ts index b37822e0c..08ceb99df 100644 --- a/core/base/src/constants/chains.ts +++ b/core/base/src/constants/chains.ts @@ -48,6 +48,7 @@ const chainIdAndChainEntries = [ [ 39, "Berachain" ], [ 40, "Seievm" ], [ 43, "Snaxchain" ], + [ 44, "Unichain" ], [ 3104, "Wormchain" ], [ 4000, "Cosmoshub" ], [ 4001, "Evmos" ], diff --git a/core/base/src/constants/contracts/core.ts b/core/base/src/constants/contracts/core.ts index 1c9e4ace4..342ea47ef 100644 --- a/core/base/src/constants/contracts/core.ts +++ b/core/base/src/constants/contracts/core.ts @@ -85,6 +85,7 @@ export const coreBridgeContracts = [[ ["Blast", "0x473e002D7add6fB67a4964F13bFd61280Ca46886"], ["Berachain", "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"], ["Snaxchain", "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"], + ["Unichain", "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"], ["Xlayer", "0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"], ["Linea", "0x79A1027a6A159502049F10906D333EC57E95F083"], ]], [ diff --git a/core/base/src/constants/contracts/tokenBridge.ts b/core/base/src/constants/contracts/tokenBridge.ts index 8bce358d0..bff76ace0 100644 --- a/core/base/src/constants/contracts/tokenBridge.ts +++ b/core/base/src/constants/contracts/tokenBridge.ts @@ -77,6 +77,7 @@ export const tokenBridgeContracts = [[ ["Xlayer", "0xdA91a06299BBF302091B053c6B9EF86Eff0f930D"], ["Berachain", "0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"], ["Snaxchain", "0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"], + ["Unichain", "0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"], ["Linea", "0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"], ]], [ "Devnet", [ diff --git a/core/base/src/constants/finality.ts b/core/base/src/constants/finality.ts index 64af98221..694655a5d 100644 --- a/core/base/src/constants/finality.ts +++ b/core/base/src/constants/finality.ts @@ -60,6 +60,7 @@ const finalityThresholds = [ ["Injective", 0], ["Berachain", 0], ["Snaxchain", 0], + ["Unichain", 0], ["Cosmoshub", 0], ["Evmos", 0], ["Kujira", 0], diff --git a/core/base/src/constants/nativeChainIds.ts b/core/base/src/constants/nativeChainIds.ts index 882540d44..94c3a7d8b 100644 --- a/core/base/src/constants/nativeChainIds.ts +++ b/core/base/src/constants/nativeChainIds.ts @@ -106,6 +106,7 @@ const chainNetworkNativeChainIdEntries = [ ["Scroll", 534351n], ["Berachain", 80084n], // Testnet v2 ["Snaxchain", 13001n], + ["Unichain", 1301n], ["Xlayer", 195n], ["Linea", 59141n], // Sepolia ], diff --git a/core/base/src/constants/platforms.ts b/core/base/src/constants/platforms.ts index 1862a6ed2..9d841b587 100644 --- a/core/base/src/constants/platforms.ts +++ b/core/base/src/constants/platforms.ts @@ -37,6 +37,7 @@ const platformAndChainsEntries = [[ "Berachain", "Seievm", "Snaxchain", + "Unichain", ]], [ "Solana", [ "Solana", diff --git a/core/icons/src/constants/chainIcons.ts b/core/icons/src/constants/chainIcons.ts index cce58c355..800755e48 100644 --- a/core/icons/src/constants/chainIcons.ts +++ b/core/icons/src/constants/chainIcons.ts @@ -195,6 +195,11 @@ export function chainToIcon(chain: Chain): string { PREFIX + "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMjQuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIJIHZpZXdCb3g9IjAgMCAxOTIgMTkyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxOTIgMTkyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlIHR5cGU9InRleHQvY3NzIj4JLnN0MHtmaWxsOnVybCgjU1ZHSURfMV8pO30JLnN0MXtmaWxsOiMwMEQxRkY7fTwvc3R5bGU+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjU3LjYzIC05Ny42NjkpIj4JPGcgdHJhbnNmb3JtPSJtYXRyaXgoLjI2NDU4IDAgMCAuMjY0NTggLTI1Ny42MyA5Ny42NjkpIj4JCQkJCTxsaW5lYXJHcmFkaWVudCBpZD0iU1ZHSURfMV8iIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMTYyMS40OTQ4IiB5MT0iMjI1LjQ4OTIiIHgyPSIxNjIxLjQ5NDgiIHkyPSItMzAuNTEwOCIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgwLjc1IDAgMCAtMC43NSAtODUzLjI3MTIgMTY5LjExNDgpIj4JCQk8c3RvcCAgb2Zmc2V0PSIwIiBzdHlsZT0ic3RvcC1jb2xvcjojMDkwMjIwIi8+CQkJPHN0b3AgIG9mZnNldD0iMSIgc3R5bGU9InN0b3AtY29sb3I6IzE3MDY1OSIvPgkJPC9saW5lYXJHcmFkaWVudD4JCTxjaXJjbGUgY2xhc3M9InN0MCIgY3g9IjM2Mi44IiBjeT0iMzYyLjgiIHI9IjM2Mi44Ii8+CQk8Zz4JCQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNMjQzLjMsMjcyLjZjLTIuOS0zLjYtNy4zLTUuNi0xMi01LjZoLTk2LjljLTAuOCwwLTEuNS0wLjMtMi4xLTAuOGMtMC41LTAuNS0wLjgtMS4xLTAuOC0xLjh2LTY1LjMJCQkJYzAtMC43LDAuMy0xLjMsMC44LTEuOGMwLjYtMC42LDEuMy0wLjksMi4xLTAuOGgxMDIuNGMyNS44LDAsNDguMSwxMC42LDY2LjksMzEuN2wyNC45LDMwLjRsLTQ4LjUsNTkuMUwyNDMuMywyNzIuNnoJCQkJIE00MjIuMywyMjcuOWMxOC43LTIwLjksNDEuMS0zMS40LDY3LjItMzEuNGgxMDIuMWMwLjctMC4xLDEuNCwwLjIsMS45LDAuNmMwLjUsMC41LDAuNywxLjIsMC42LDJ2NjUuM2MwLDAuNy0wLjIsMS4zLTAuNiwxLjgJCQkJYy0wLjUsMC42LTEuMiwwLjktMS45LDAuOGgtOTYuOWMtNC42LTAuMS05LDItMTIsNS42bC03MS40LDg2LjlMNDgzLDQ0N2MyLjksMy4zLDcuMiw1LjMsMTEuNiw1LjJoOTYuOWMwLjctMC4xLDEuNSwwLjMsMS45LDAuOAkJCQljMC40LDAuNiwwLjcsMS40LDAuNiwyLjF2NjUuM2MwLDAuNy0wLjIsMS4zLTAuNiwxLjhjLTAuNSwwLjYtMS4yLDAuOS0xLjksMC44SDQ4OS41Yy0yNi4xLDAtNDguMy0xMC42LTY2LjktMzEuN2wtNTkuNC03Mi41CQkJCWwtNTkuNCw3Mi41Yy0xOC43LDIxLjEtNDEuMSwzMS43LTY3LjIsMzEuN0gxMzQuNGMtMC43LDAuMS0xLjUtMC4zLTEuOS0wLjhjLTAuNS0wLjYtMC43LTEuNC0wLjYtMi4xdi02NS4zCQkJCWMwLTAuNywwLjItMS4zLDAuNi0xLjhjMC41LTAuNiwxLjItMC45LDEuOS0wLjhoOTYuOWM0LjYsMCw5LTIuMSwxMi01LjZsNzAuMS04NS42TDQyMi4zLDIyNy45eiIvPgkJPC9nPgk8L2c+PC9nPjwvc3ZnPg==" ); + } else if (chain === "Unichain") { + return ( + PREFIX + + "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMjQuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIJIHZpZXdCb3g9IjAgMCAxNjguMyAxOTMuOCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTY4LjMgMTkzLjg7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPgkuc3Qwe2ZpbGw6I0ZGMDA3QTt9CS5zdDF7ZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7ZmlsbDojRkYwMDdBO308L3N0eWxlPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik02Niw0NC4xYy0yLjEtMC4zLTIuMi0wLjQtMS4yLTAuNWMxLjktMC4zLDYuMywwLjEsOS40LDAuOGM3LjIsMS43LDEzLjcsNi4xLDIwLjYsMTMuOGwxLjgsMi4xbDIuNi0wLjQJYzExLjEtMS44LDIyLjUtMC40LDMyLDRjMi42LDEuMiw2LjcsMy42LDcuMiw0LjJjMC4yLDAuMiwwLjUsMS41LDAuNywyLjhjMC43LDQuNywwLjQsOC4yLTEuMSwxMC45Yy0wLjgsMS41LTAuOCwxLjktMC4zLDMuMgljMC40LDEsMS42LDEuNywyLjcsMS43YzIuNCwwLDQuOS0zLjgsNi4xLTkuMWwwLjUtMi4xbDAuOSwxYzUuMSw1LjcsOS4xLDEzLjYsOS43LDE5LjJsMC4yLDEuNWwtMC45LTEuM2MtMS41LTIuMy0yLjktMy44LTQuOC01LjEJYy0zLjQtMi4zLTctMy0xNi41LTMuNWMtOC42LTAuNS0xMy41LTEuMi0xOC4zLTIuOGMtOC4yLTIuNy0xMi40LTYuMi0yMi4xLTE5LjFjLTQuMy01LjctNy04LjgtOS43LTExLjQJQzc5LjYsNDguMyw3My43LDQ1LjMsNjYsNDQuMXoiLz48cGF0aCBjbGFzcz0ic3QwIiBkPSJNMTQwLjUsNTYuOGMwLjItMy44LDAuNy02LjMsMS44LTguNmMwLjQtMC45LDAuOC0xLjcsMC45LTEuN2MwLjEsMC0wLjEsMC43LTAuNCwxLjVjLTAuOCwyLjItMC45LDUuMy0wLjQsOC44CWMwLjcsNC41LDEsNS4xLDUuOCwxMGMyLjIsMi4zLDQuOCw1LjIsNS44LDYuNGwxLjcsMi4ybC0xLjctMS42Yy0yLjEtMi02LjktNS44LTgtNi4zYy0wLjctMC40LTAuOC0wLjQtMS4zLDAuMQljLTAuNCwwLjQtMC41LDEtMC41LDMuOWMtMC4xLDQuNS0wLjcsNy4zLTIuMiwxMC4yYy0wLjgsMS41LTAuOSwxLjItMC4yLTAuNWMwLjUtMS4zLDAuNi0xLjksMC42LTYuMmMwLTguNy0xLTEwLjgtNy4xLTE0LjMJYy0xLjUtMC45LTQuMS0yLjItNS42LTIuOWMtMS42LTAuNy0yLjgtMS4zLTIuNy0xLjNjMC4yLTAuMiw2LjEsMS41LDguNCwyLjVjMy41LDEuNCw0LjEsMS41LDQuNSwxLjQJQzE0MC4yLDYwLjEsMTQwLjQsNTkuMywxNDAuNSw1Ni44eiIvPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik03MC4xLDcxLjdjLTQuMi01LjgtNi45LTE0LjgtNi4zLTIxLjVsMC4yLTIuMWwxLDAuMmMxLjgsMC4zLDQuOSwxLjUsNi40LDIuNGM0LDIuNCw1LjgsNS43LDcuNSwxMy45CWMwLjUsMi40LDEuMiw1LjIsMS41LDYuMWMwLjUsMS41LDIuNCw1LDQsNy4yYzEuMSwxLjYsMC40LDIuNC0yLjEsMi4yQzc4LjUsNzkuNyw3My40LDc2LjIsNzAuMSw3MS43eiIvPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMzUuNCwxMTUuMmMtMTkuOC04LTI2LjgtMTQuOS0yNi44LTI2LjZjMC0xLjcsMC4xLTMuMSwwLjEtMy4xYzAuMSwwLDAuOCwwLjYsMS43LDEuM2M0LDMuMiw4LjUsNC42LDIxLDYuNAljNy4zLDEuMSwxMS41LDEuOSwxNS4zLDMuMmMxMi4xLDQsMTkuNiwxMi4yLDIxLjQsMjMuM2MwLjUsMy4yLDAuMiw5LjMtMC42LDEyLjVjLTAuNywyLjUtMi43LDcuMS0zLjIsNy4yYy0wLjEsMC0wLjMtMC41LTAuMy0xLjMJYy0wLjItNC4yLTIuMy04LjItNS44LTExLjNDMTU0LDEyMy4yLDE0OC42LDEyMC41LDEzNS40LDExNS4yeiIvPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMjEuNCwxMTguNWMtMC4yLTEuNS0wLjctMy40LTEtNC4ybC0wLjUtMS41bDAuOSwxLjFjMS4zLDEuNSwyLjMsMy4zLDMuMiw1LjhjMC43LDEuOSwwLjcsMi41LDAuNyw1LjYJYzAsMy0wLjEsMy43LTAuNyw1LjRjLTEsMi43LTIuMiw0LjYtNC4yLDYuN2MtMy42LDMuNy04LjMsNS43LTE1LDYuNmMtMS4yLDAuMS00LjYsMC40LTcuNiwwLjZjLTcuNSwwLjQtMTIuNSwxLjItMTcsMi44CWMtMC42LDAuMi0xLjIsMC40LTEuMywwLjNjLTAuMi0wLjIsMi45LTIsNS40LTMuMmMzLjUtMS43LDcuMS0yLjYsMTUtNGMzLjktMC42LDcuOS0xLjQsOC45LTEuOEMxMTguMSwxMzUuNiwxMjMsMTI3LjksMTIxLjQsMTE4LjUJeiIvPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMzAuNSwxMzQuNmMtMi42LTUuNy0zLjItMTEuMS0xLjgtMTYuMmMwLjItMC41LDAuNC0xLDAuNi0xYzAuMiwwLDAuOCwwLjMsMS40LDAuN2MxLjIsMC44LDMuNywyLjIsMTAuMSw1LjcJYzguMSw0LjQsMTIuNyw3LjgsMTUuOSwxMS43YzIuOCwzLjQsNC41LDcuMyw1LjMsMTIuMWMwLjUsMi43LDAuMiw5LjItMC41LDExLjljLTIuMiw4LjUtNy4yLDE1LjMtMTQuNSwxOS4yYy0xLjEsMC42LTIsMS0yLjEsMQljLTAuMSwwLDAuMy0xLDAuOS0yLjJjMi40LTUuMSwyLjctMTAsMC45LTE1LjVjLTEuMS0zLjQtMy40LTcuNS04LTE0LjRDMTMzLjIsMTM5LjYsMTMxLjksMTM3LjUsMTMwLjUsMTM0LjZ6Ii8+PHBhdGggY2xhc3M9InN0MCIgZD0iTTU2LDE2NS4yYzcuNC02LjIsMTYuNS0xMC42LDI0LjktMTJjMy42LTAuNiw5LjYtMC40LDEyLjksMC41YzUuMywxLjQsMTAuMSw0LjQsMTIuNiw4LjEJYzIuNCwzLjYsMy41LDYuNyw0LjYsMTMuNmMwLjQsMi43LDAuOSw1LjUsMSw2LjFjMC44LDMuNiwyLjQsNi40LDQuNCw3LjljMy4xLDIuMyw4LjUsMi40LDEzLjgsMC40YzAuOS0wLjMsMS43LTAuNiwxLjctMC41CWMwLjIsMC4yLTIuNSwyLTQuMywyLjljLTIuNSwxLjMtNC41LDEuNy03LjIsMS43Yy00LjgsMC04LjktMi41LTEyLjItNy41Yy0wLjctMS0yLjEtMy45LTMuMy02LjZjLTMuNS04LjEtNS4zLTEwLjUtOS40LTEzLjIJYy0zLjYtMi4zLTguMi0yLjgtMTEuNy0xLjFjLTQuNiwyLjItNS44LDguMS0yLjYsMTEuN2MxLjMsMS41LDMuNywyLjcsNS43LDNjMy43LDAuNSw2LjktMi40LDYuOS02LjFjMC0yLjQtMC45LTMuOC0zLjMtNC45CWMtMy4yLTEuNC02LjcsMC4yLTYuNiwzLjNjMCwxLjMsMC42LDIuMSwxLjksMi43YzAuOCwwLjQsMC44LDAuNCwwLjIsMC4zYy0yLjktMC42LTMuNi00LjItMS4zLTYuNWMyLjgtMi44LDguNy0xLjYsMTAuNywyLjMJYzAuOCwxLjYsMC45LDQuOCwwLjIsNi44Yy0xLjcsNC40LTYuNSw2LjctMTEuNCw1LjRjLTMuMy0wLjktNC43LTEuOC04LjctNS45Yy03LTcuMi05LjctOC42LTE5LjctMTAuMWwtMS45LTAuM0w1NiwxNjUuMnoiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJNMy40LDQuM2MyMy4zLDI4LjMsNTkuMiw3Mi4zLDYxLDc0LjdjMS41LDIsMC45LDMuOS0xLjYsNS4zYy0xLjQsMC44LTQuMywxLjYtNS43LDEuNmMtMS42LDAtMy41LTAuOC00LjgtMi4xCWMtMC45LTAuOS00LjgtNi42LTEzLjYtMjAuM2MtNi43LTEwLjUtMTIuNC0xOS4yLTEyLjUtMTkuM0MyNS44LDQ0LDI1LjgsNDQsMzgsNjUuOEM0NS43LDc5LjUsNDguMiw4NC40LDQ4LjIsODVjMCwxLjMtMC40LDItMiwzLjgJYy0yLjcsMy0zLjksNi40LTQuOCwxMy41Yy0xLDcuOS0zLjcsMTMuNS0xMS40LDIzYy00LjUsNS42LTUuMiw2LjYtNi4zLDguOWMtMS40LDIuOC0xLjgsNC40LTIsOGMtMC4yLDMuOCwwLjIsNi4yLDEuMyw5LjgJYzEsMy4yLDIuMSw1LjMsNC44LDkuNGMyLjMsMy42LDMuNyw2LjMsMy43LDcuM2MwLDAuOCwwLjIsMC44LDMuOCwwYzguNi0yLDE1LjctNS40LDE5LjYtOS42YzIuNC0yLjYsMy00LDMtNy42CWMwLTIuMy0wLjEtMi44LTAuNy00LjJjLTEtMi4yLTIuOS00LTctNi44Yy01LjQtMy43LTcuNy02LjctOC4zLTEwLjdjLTAuNS0zLjQsMC4xLTUuNywzLjEtMTJjMy4xLTYuNSwzLjktOS4yLDQuNC0xNS44CWMwLjMtNC4yLDAuOC01LjksMi03LjJjMS4zLTEuNCwyLjQtMS45LDUuNS0yLjNjNS4xLTAuNyw4LjQtMiwxMS00LjVjMi4zLTIuMSwzLjMtNC4yLDMuNC03LjNsMC4xLTIuM0w3MC4xLDc3QzY1LjQsNzEuNiwwLjMsMCwwLDAJQy0wLjEsMCwxLjUsMS45LDMuNCw0LjN6IE0zNC4xLDE0Ni41YzEuMS0xLjksMC41LTQuMy0xLjMtNS41Yy0xLjctMS4xLTQuMy0wLjYtNC4zLDAuOWMwLDAuNCwwLjIsMC44LDAuOCwxYzAuOSwwLjUsMSwxLDAuMywyLjEJYy0wLjcsMS4xLTAuNywyLjEsMC4yLDIuOEMzMS4yLDE0OC45LDMzLjEsMTQ4LjMsMzQuMSwxNDYuNXoiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJNNzQuNiw5My45Yy0yLjQsMC43LTQuNywzLjMtNS40LDUuOWMtMC40LDEuNi0wLjIsNC41LDAuNSw1LjRjMS4xLDEuNCwyLjEsMS44LDQuOSwxLjgJYzUuNSwwLDEwLjItMi40LDEwLjctNS4zYzAuNS0yLjQtMS42LTUuNy00LjUtNy4yQzc5LjMsOTMuNyw3Ni4yLDkzLjQsNzQuNiw5My45eiBNODEsOTguOWMwLjgtMS4yLDAuNS0yLjUtMS0zLjQJYy0yLjctMS43LTYuOC0wLjMtNi44LDIuM2MwLDEuMywyLjEsMi43LDQuMSwyLjdDNzguNiwxMDAuNSw4MC40LDk5LjcsODEsOTguOXoiLz48L3N2Zz4=" + ); } else if (chain === "Wormchain") { return ( PREFIX + diff --git a/core/icons/src/images/chains/Unichain.svg b/core/icons/src/images/chains/Unichain.svg new file mode 100755 index 000000000..fa31aeaa1 --- /dev/null +++ b/core/icons/src/images/chains/Unichain.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + From e997fce51a98a0eab36eeb510ff151110ac8b8cc Mon Sep 17 00:00:00 2001 From: bruce-riley <96066700+bruce-riley@users.noreply.github.com> Date: Thu, 10 Oct 2024 12:46:17 -0600 Subject: [PATCH 45/69] Set unichain testnet RPC (#714) --- core/base/src/constants/rpc.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/base/src/constants/rpc.ts b/core/base/src/constants/rpc.ts index b71344b2b..57a295f1f 100644 --- a/core/base/src/constants/rpc.ts +++ b/core/base/src/constants/rpc.ts @@ -88,6 +88,8 @@ const rpcConfig = [[ ["Rootstock", "https://public-node.testnet.rsk.co"], ["Gnosis", "https://rpc.chiadochain.net"], ["Klaytn", "https://rpc.ankr.com/klaytn_testnet"], + ["Snaxchain", "https://testnet.snaxchain.io"], + ["Unichain", "https://sepolia.unichain.org"], ]], [ "Devnet", [ ["Ethereum", "http://eth-devnet:8545"], From 0e7e158e9d1520dafb989ce3374684f65e05992b Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Fri, 11 Oct 2024 17:31:42 -0500 Subject: [PATCH 46/69] 0.11.0 version bump (#719) --- connect/package.json | 6 +- core/base/package.json | 2 +- core/definitions/package.json | 4 +- core/icons/package.json | 4 +- examples/package.json | 4 +- package-lock.json | 210 +++++++++--------- package.json | 2 +- platforms/algorand/package.json | 4 +- .../algorand/protocols/core/package.json | 6 +- .../protocols/tokenBridge/package.json | 8 +- platforms/aptos/package.json | 4 +- platforms/aptos/protocols/core/package.json | 6 +- .../aptos/protocols/tokenBridge/package.json | 6 +- platforms/cosmwasm/package.json | 4 +- .../cosmwasm/protocols/core/package.json | 6 +- platforms/cosmwasm/protocols/ibc/package.json | 8 +- .../protocols/tokenBridge/package.json | 6 +- platforms/evm/package.json | 4 +- platforms/evm/protocols/cctp/package.json | 6 +- platforms/evm/protocols/core/package.json | 6 +- platforms/evm/protocols/portico/package.json | 10 +- .../evm/protocols/tokenBridge/package.json | 8 +- platforms/solana/package.json | 4 +- platforms/solana/protocols/cctp/package.json | 6 +- platforms/solana/protocols/core/package.json | 6 +- .../solana/protocols/tokenBridge/package.json | 8 +- platforms/sui/package.json | 4 +- platforms/sui/protocols/core/package.json | 6 +- .../sui/protocols/tokenBridge/package.json | 8 +- sdk/package.json | 52 ++--- 30 files changed, 209 insertions(+), 209 deletions(-) diff --git a/connect/package.json b/connect/package.json index 01cb79aed..ae4306b5a 100644 --- a/connect/package.json +++ b/connect/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-connect", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -98,8 +98,8 @@ }, "dependencies": { "axios": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.9", - "@wormhole-foundation/sdk-definitions": "0.10.9" + "@wormhole-foundation/sdk-base": "0.11.0", + "@wormhole-foundation/sdk-definitions": "0.11.0" }, "type": "module" } \ No newline at end of file diff --git a/core/base/package.json b/core/base/package.json index f7b0e6df8..e46189e62 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-base", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" diff --git a/core/definitions/package.json b/core/definitions/package.json index 1f7cb4cf1..c3aef8042 100644 --- a/core/definitions/package.json +++ b/core/definitions/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -86,7 +86,7 @@ "dependencies": { "@noble/hashes": "^1.3.1", "@noble/curves": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.10.9" + "@wormhole-foundation/sdk-base": "0.11.0" }, "type": "module" } \ No newline at end of file diff --git a/core/icons/package.json b/core/icons/package.json index 5e82b4228..cd7675c45 100644 --- a/core/icons/package.json +++ b/core/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-icons", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -50,7 +50,7 @@ "dist/cjs" ], "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.9" + "@wormhole-foundation/sdk-base": "0.11.0" }, "sideEffects": false, "scripts": { diff --git a/examples/package.json b/examples/package.json index 7af064642..783a9798a 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -51,6 +51,6 @@ "tsx": "^4.7.0" }, "dependencies": { - "@wormhole-foundation/sdk": "0.10.9" + "@wormhole-foundation/sdk": "0.11.0" } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 1c377f015..a7610c658 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ts-sdk", - "version": "0.10.2", + "version": "0.11.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ts-sdk", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "workspaces": [ "core/base", @@ -59,11 +59,11 @@ }, "connect": { "name": "@wormhole-foundation/sdk-connect", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.2", - "@wormhole-foundation/sdk-definitions": "0.10.2", + "@wormhole-foundation/sdk-base": "0.11.0", + "@wormhole-foundation/sdk-definitions": "0.11.0", "axios": "^1.4.0" }, "engines": { @@ -72,7 +72,7 @@ }, "core/base": { "name": "@wormhole-foundation/sdk-base", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { "@scure/base": "^1.1.3" @@ -80,11 +80,11 @@ }, "core/definitions": { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.10.2", + "version": "0.11.0", "dependencies": { "@noble/curves": "^1.4.0", "@noble/hashes": "^1.3.1", - "@wormhole-foundation/sdk-base": "0.10.2" + "@wormhole-foundation/sdk-base": "0.11.0" } }, "core/definitions/node_modules/@noble/curves": { @@ -109,10 +109,10 @@ }, "core/icons": { "name": "@wormhole-foundation/sdk-icons", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.2" + "@wormhole-foundation/sdk-base": "0.11.0" }, "devDependencies": { "tsx": "^4.7.0" @@ -120,10 +120,10 @@ }, "examples": { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk": "0.10.2" + "@wormhole-foundation/sdk": "0.11.0" }, "devDependencies": { "dotenv": "^16.3.1", @@ -8972,10 +8972,10 @@ }, "platforms/algorand": { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.11.0", "algosdk": "2.7.0" }, "engines": { @@ -8984,11 +8984,11 @@ }, "platforms/algorand/protocols/core": { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.10.2", - "@wormhole-foundation/sdk-connect": "0.10.2" + "@wormhole-foundation/sdk-algorand": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.11.0" }, "engines": { "node": ">=16" @@ -8996,12 +8996,12 @@ }, "platforms/algorand/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.10.2", - "@wormhole-foundation/sdk-algorand-core": "0.10.2", - "@wormhole-foundation/sdk-connect": "0.10.2" + "@wormhole-foundation/sdk-algorand": "0.11.0", + "@wormhole-foundation/sdk-algorand-core": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.11.0" }, "engines": { "node": ">=16" @@ -9009,10 +9009,10 @@ }, "platforms/aptos": { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.11.0", "aptos": "1.21.0" }, "engines": { @@ -9021,11 +9021,11 @@ }, "platforms/aptos/protocols/core": { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.10.2", - "@wormhole-foundation/sdk-connect": "0.10.2" + "@wormhole-foundation/sdk-aptos": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.11.0" }, "engines": { "node": ">=16" @@ -9033,11 +9033,11 @@ }, "platforms/aptos/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.10.2", - "@wormhole-foundation/sdk-connect": "0.10.2" + "@wormhole-foundation/sdk-aptos": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.11.0" }, "engines": { "node": ">=16" @@ -9045,14 +9045,14 @@ }, "platforms/cosmwasm": { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.11.0", "cosmjs-types": "^0.9.0" }, "engines": { @@ -9061,14 +9061,14 @@ }, "platforms/cosmwasm/protocols/core": { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm": "0.11.0" }, "engines": { "node": ">=16" @@ -9076,15 +9076,15 @@ }, "platforms/cosmwasm/protocols/ibc": { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.11.0", "cosmjs-types": "^0.9.0" }, "engines": { @@ -9093,13 +9093,13 @@ }, "platforms/cosmwasm/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm": "0.11.0" }, "engines": { "node": ">=16" @@ -9107,10 +9107,10 @@ }, "platforms/evm": { "name": "@wormhole-foundation/sdk-evm", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.11.0", "ethers": "^6.5.1" }, "devDependencies": { @@ -9122,11 +9122,11 @@ }, "platforms/evm/protocols/cctp": { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-evm": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-evm": "0.11.0", "ethers": "^6.5.1" }, "engines": { @@ -9135,11 +9135,11 @@ }, "platforms/evm/protocols/core": { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-evm": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-evm": "0.11.0", "ethers": "^6.5.1" }, "engines": { @@ -9148,13 +9148,13 @@ }, "platforms/evm/protocols/portico": { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-evm": "0.10.2", - "@wormhole-foundation/sdk-evm-core": "0.10.2", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-evm": "0.11.0", + "@wormhole-foundation/sdk-evm-core": "0.11.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.11.0", "ethers": "^6.5.1" }, "engines": { @@ -9163,12 +9163,12 @@ }, "platforms/evm/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-evm": "0.10.2", - "@wormhole-foundation/sdk-evm-core": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-evm": "0.11.0", + "@wormhole-foundation/sdk-evm-core": "0.11.0", "ethers": "^6.5.1" }, "engines": { @@ -9177,14 +9177,14 @@ }, "platforms/solana": { "name": "@wormhole-foundation/sdk-solana", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.10.2", + "@wormhole-foundation/sdk-connect": "0.11.0", "rpc-websockets": "^7.10.0" }, "devDependencies": { @@ -9196,14 +9196,14 @@ }, "platforms/solana/protocols/cctp": { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-solana": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-solana": "0.11.0" }, "engines": { "node": ">=16" @@ -9211,14 +9211,14 @@ }, "platforms/solana/protocols/core": { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-solana": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-solana": "0.11.0" }, "engines": { "node": ">=16" @@ -9226,15 +9226,15 @@ }, "platforms/solana/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-solana": "0.10.2", - "@wormhole-foundation/sdk-solana-core": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-solana": "0.11.0", + "@wormhole-foundation/sdk-solana-core": "0.11.0" }, "engines": { "node": ">=16" @@ -9242,11 +9242,11 @@ }, "platforms/sui": { "name": "@wormhole-foundation/sdk-sui", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.11.0" }, "engines": { "node": ">=16" @@ -9254,12 +9254,12 @@ }, "platforms/sui/protocols/core": { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-sui": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-sui": "0.11.0" }, "engines": { "node": ">=16" @@ -9267,13 +9267,13 @@ }, "platforms/sui/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-sui": "0.10.2", - "@wormhole-foundation/sdk-sui-core": "0.10.2" + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-sui": "0.11.0", + "@wormhole-foundation/sdk-sui-core": "0.11.0" }, "engines": { "node": ">=16" @@ -9281,34 +9281,34 @@ }, "sdk": { "name": "@wormhole-foundation/sdk", - "version": "0.10.2", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.10.2", - "@wormhole-foundation/sdk-algorand-core": "0.10.2", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.2", - "@wormhole-foundation/sdk-aptos": "0.10.2", - "@wormhole-foundation/sdk-aptos-core": "0.10.2", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.2", - "@wormhole-foundation/sdk-base": "0.10.2", - "@wormhole-foundation/sdk-connect": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.2", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.2", - "@wormhole-foundation/sdk-definitions": "0.10.2", - "@wormhole-foundation/sdk-evm": "0.10.2", - "@wormhole-foundation/sdk-evm-cctp": "0.10.2", - "@wormhole-foundation/sdk-evm-core": "0.10.2", - "@wormhole-foundation/sdk-evm-portico": "0.10.2", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.2", - "@wormhole-foundation/sdk-solana": "0.10.2", - "@wormhole-foundation/sdk-solana-cctp": "0.10.2", - "@wormhole-foundation/sdk-solana-core": "0.10.2", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.2", - "@wormhole-foundation/sdk-sui": "0.10.2", - "@wormhole-foundation/sdk-sui-core": "0.10.2", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.2" + "@wormhole-foundation/sdk-algorand": "0.11.0", + "@wormhole-foundation/sdk-algorand-core": "0.11.0", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.11.0", + "@wormhole-foundation/sdk-aptos": "0.11.0", + "@wormhole-foundation/sdk-aptos-core": "0.11.0", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.11.0", + "@wormhole-foundation/sdk-base": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.11.0", + "@wormhole-foundation/sdk-definitions": "0.11.0", + "@wormhole-foundation/sdk-evm": "0.11.0", + "@wormhole-foundation/sdk-evm-cctp": "0.11.0", + "@wormhole-foundation/sdk-evm-core": "0.11.0", + "@wormhole-foundation/sdk-evm-portico": "0.11.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.11.0", + "@wormhole-foundation/sdk-solana": "0.11.0", + "@wormhole-foundation/sdk-solana-cctp": "0.11.0", + "@wormhole-foundation/sdk-solana-core": "0.11.0", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.11.0", + "@wormhole-foundation/sdk-sui": "0.11.0", + "@wormhole-foundation/sdk-sui-core": "0.11.0", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.11.0" }, "engines": { "node": ">=16" diff --git a/package.json b/package.json index 537385ad0..5834b08ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sdk", - "version": "0.10.9", + "version": "0.11.0", "license": "Apache-2.0", "directories": { "test": "__tests__" diff --git a/platforms/algorand/package.json b/platforms/algorand/package.json index 34b866db4..6485e1aaa 100644 --- a/platforms/algorand/package.json +++ b/platforms/algorand/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -96,7 +96,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-connect": "0.11.0", "algosdk": "2.7.0" }, "type": "module" diff --git a/platforms/algorand/protocols/core/package.json b/platforms/algorand/protocols/core/package.json index 4bf322005..33b2e343a 100644 --- a/platforms/algorand/protocols/core/package.json +++ b/platforms/algorand/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-algorand": "0.10.9" + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-algorand": "0.11.0" }, "type": "module", "exports": { diff --git a/platforms/algorand/protocols/tokenBridge/package.json b/platforms/algorand/protocols/tokenBridge/package.json index a28b1f6ef..618787200 100644 --- a/platforms/algorand/protocols/tokenBridge/package.json +++ b/platforms/algorand/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-algorand": "0.10.9", - "@wormhole-foundation/sdk-algorand-core": "0.10.9" + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-algorand": "0.11.0", + "@wormhole-foundation/sdk-algorand-core": "0.11.0" }, "type": "module", "exports": { diff --git a/platforms/aptos/package.json b/platforms/aptos/package.json index 89e71a7c0..6f5779515 100644 --- a/platforms/aptos/package.json +++ b/platforms/aptos/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-connect": "0.11.0", "aptos": "1.21.0" }, "type": "module", diff --git a/platforms/aptos/protocols/core/package.json b/platforms/aptos/protocols/core/package.json index 5323dcb1e..53a2b60b8 100644 --- a/platforms/aptos/protocols/core/package.json +++ b/platforms/aptos/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-aptos": "0.10.9" + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-aptos": "0.11.0" }, "type": "module", "exports": { diff --git a/platforms/aptos/protocols/tokenBridge/package.json b/platforms/aptos/protocols/tokenBridge/package.json index 2e9d6bdc1..01be3f5d2 100644 --- a/platforms/aptos/protocols/tokenBridge/package.json +++ b/platforms/aptos/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-aptos": "0.10.9" + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-aptos": "0.11.0" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/package.json b/platforms/cosmwasm/package.json index ac3478f1b..36444f949 100644 --- a/platforms/cosmwasm/package.json +++ b/platforms/cosmwasm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-connect": "0.11.0", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", diff --git a/platforms/cosmwasm/protocols/core/package.json b/platforms/cosmwasm/protocols/core/package.json index 61a1bf6af..66c6f004d 100644 --- a/platforms/cosmwasm/protocols/core/package.json +++ b/platforms/cosmwasm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-cosmwasm": "0.10.9", + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm": "0.11.0", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2" diff --git a/platforms/cosmwasm/protocols/ibc/package.json b/platforms/cosmwasm/protocols/ibc/package.json index 4512bf869..770770cea 100644 --- a/platforms/cosmwasm/protocols/ibc/package.json +++ b/platforms/cosmwasm/protocols/ibc/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,9 +57,9 @@ "@cosmjs/stargate": "^0.32.0", "cosmjs-types": "^0.9.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-cosmwasm": "0.10.9", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.9" + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.11.0" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/protocols/tokenBridge/package.json b/platforms/cosmwasm/protocols/tokenBridge/package.json index 3b947e5a5..8c44d96ca 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/package.json +++ b/platforms/cosmwasm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -54,8 +54,8 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.14.13-beta.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-cosmwasm": "0.10.9" + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm": "0.11.0" }, "type": "module", "exports": { diff --git a/platforms/evm/package.json b/platforms/evm/package.json index d362486da..533a87ac2 100644 --- a/platforms/evm/package.json +++ b/platforms/evm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,7 +57,7 @@ "nock": "13.3.8" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-connect": "0.11.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index 9fb76ca58..efed6f215 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,8 +53,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-evm": "0.10.9", + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-evm": "0.11.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/core/package.json b/platforms/evm/protocols/core/package.json index 64fcfcb3f..2ab6cfdaf 100644 --- a/platforms/evm/protocols/core/package.json +++ b/platforms/evm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-evm": "0.10.9", + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-evm": "0.11.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/package.json b/platforms/evm/protocols/portico/package.json index 2fdaa0e3e..d4702cf35 100644 --- a/platforms/evm/protocols/portico/package.json +++ b/platforms/evm/protocols/portico/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,10 +52,10 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-evm": "0.10.9", - "@wormhole-foundation/sdk-evm-core": "0.10.9", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.9", + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-evm": "0.11.0", + "@wormhole-foundation/sdk-evm-core": "0.11.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.11.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/tokenBridge/package.json b/platforms/evm/protocols/tokenBridge/package.json index 0240fae0c..ef7ecae90 100644 --- a/platforms/evm/protocols/tokenBridge/package.json +++ b/platforms/evm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,9 +52,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-evm": "0.10.9", - "@wormhole-foundation/sdk-evm-core": "0.10.9", + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-evm": "0.11.0", + "@wormhole-foundation/sdk-evm-core": "0.11.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/solana/package.json b/platforms/solana/package.json index da99154cc..6fe42f1a4 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-connect": "0.11.0", "rpc-websockets": "^7.10.0" }, "type": "module", diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index 3ab0c7f3e..22fa37077 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -48,8 +48,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-solana": "0.10.9", + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-solana": "0.11.0", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index 500485079..591346b1c 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-solana": "0.10.9", + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-solana": "0.11.0", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index 5e67699ea..0b2c0f5ca 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-solana": "0.10.9", - "@wormhole-foundation/sdk-solana-core": "0.10.9", + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-solana": "0.11.0", + "@wormhole-foundation/sdk-solana-core": "0.11.0", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/sui/package.json b/platforms/sui/package.json index e507fe82e..cd084e057 100644 --- a/platforms/sui/package.json +++ b/platforms/sui/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.10.9", + "@wormhole-foundation/sdk-connect": "0.11.0", "@mysten/sui.js": "^0.50.1" }, "type": "module", diff --git a/platforms/sui/protocols/core/package.json b/platforms/sui/protocols/core/package.json index 0d191234a..723708693 100644 --- a/platforms/sui/protocols/core/package.json +++ b/platforms/sui/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-sui": "0.10.9" + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-sui": "0.11.0" }, "type": "module", "exports": { diff --git a/platforms/sui/protocols/tokenBridge/package.json b/platforms/sui/protocols/tokenBridge/package.json index 599c312b7..588840272 100644 --- a/platforms/sui/protocols/tokenBridge/package.json +++ b/platforms/sui/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,9 +46,9 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-sui": "0.10.9", - "@wormhole-foundation/sdk-sui-core": "0.10.9" + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-sui": "0.11.0", + "@wormhole-foundation/sdk-sui-core": "0.11.0" }, "type": "module", "exports": { diff --git a/sdk/package.json b/sdk/package.json index 6dcc14d96..6ddf01e79 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk", - "version": "0.10.9", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -384,31 +384,31 @@ } }, "dependencies": { - "@wormhole-foundation/sdk-base": "0.10.9", - "@wormhole-foundation/sdk-definitions": "0.10.9", - "@wormhole-foundation/sdk-connect": "0.10.9", - "@wormhole-foundation/sdk-evm": "0.10.9", - "@wormhole-foundation/sdk-evm-core": "0.10.9", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.10.9", - "@wormhole-foundation/sdk-evm-portico": "0.10.9", - "@wormhole-foundation/sdk-evm-cctp": "0.10.9", - "@wormhole-foundation/sdk-solana": "0.10.9", - "@wormhole-foundation/sdk-solana-core": "0.10.9", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.10.9", - "@wormhole-foundation/sdk-solana-cctp": "0.10.9", - "@wormhole-foundation/sdk-cosmwasm": "0.10.9", - "@wormhole-foundation/sdk-cosmwasm-core": "0.10.9", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.10.9", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.10.9", - "@wormhole-foundation/sdk-sui": "0.10.9", - "@wormhole-foundation/sdk-sui-core": "0.10.9", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.10.9", - "@wormhole-foundation/sdk-aptos": "0.10.9", - "@wormhole-foundation/sdk-aptos-core": "0.10.9", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.10.9", - "@wormhole-foundation/sdk-algorand": "0.10.9", - "@wormhole-foundation/sdk-algorand-core": "0.10.9", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.10.9" + "@wormhole-foundation/sdk-base": "0.11.0", + "@wormhole-foundation/sdk-definitions": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-evm": "0.11.0", + "@wormhole-foundation/sdk-evm-core": "0.11.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.11.0", + "@wormhole-foundation/sdk-evm-portico": "0.11.0", + "@wormhole-foundation/sdk-evm-cctp": "0.11.0", + "@wormhole-foundation/sdk-solana": "0.11.0", + "@wormhole-foundation/sdk-solana-core": "0.11.0", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.11.0", + "@wormhole-foundation/sdk-solana-cctp": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.11.0", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.11.0", + "@wormhole-foundation/sdk-sui": "0.11.0", + "@wormhole-foundation/sdk-sui-core": "0.11.0", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.11.0", + "@wormhole-foundation/sdk-aptos": "0.11.0", + "@wormhole-foundation/sdk-aptos-core": "0.11.0", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.11.0", + "@wormhole-foundation/sdk-algorand": "0.11.0", + "@wormhole-foundation/sdk-algorand-core": "0.11.0", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.11.0" }, "type": "module" } \ No newline at end of file From 3f4c8e936f593c7db4b31571b52431af627e3ec8 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Wed, 16 Oct 2024 08:53:00 -0500 Subject: [PATCH 47/69] Added Portico Bridge USDT support (#552) * Added Portico Bridge USDT support USDT uses PancakeSwap if available on the chain * Added native USDT tokens * removed unused portico api * add missing wstETHbsc token * removed wstETHbsc token (no portico pool) * progress * more progress * working * revert router example changes * added celo usdt * Revert "added celo usdt" This reverts commit 24a386ede46333919fee15441145b5878542aee2. * Reapply "added celo usdt" This reverts commit a0ad1e8511f8ab2dbe5c2f78cbe7dab91e61e5ca. * added comment on decimals scaling * bump version to 0.12.0 --- connect/package.json | 6 +- connect/src/routes/portico/README.md | 6 +- connect/src/routes/portico/automatic.ts | 206 ++++++++------- connect/src/routes/request.ts | 6 +- connect/src/wormhole.ts | 4 +- core/base/package.json | 2 +- core/base/src/constants/contracts/portico.ts | 44 +++- core/base/src/constants/tokens/mainnet.ts | 56 ++++ core/definitions/package.json | 4 +- .../src/protocols/portico/portico.ts | 24 +- .../src/protocols/portico/porticoLayout.ts | 5 +- core/icons/package.json | 4 +- examples/package.json | 4 +- package-lock.json | 210 +++++++-------- package.json | 2 +- platforms/algorand/package.json | 4 +- .../algorand/protocols/core/package.json | 6 +- .../protocols/tokenBridge/package.json | 8 +- platforms/aptos/package.json | 4 +- platforms/aptos/protocols/core/package.json | 6 +- .../aptos/protocols/tokenBridge/package.json | 6 +- platforms/cosmwasm/package.json | 4 +- .../cosmwasm/protocols/core/package.json | 6 +- platforms/cosmwasm/protocols/ibc/package.json | 8 +- .../protocols/tokenBridge/package.json | 6 +- platforms/evm/package.json | 4 +- platforms/evm/protocols/cctp/package.json | 6 +- platforms/evm/protocols/core/package.json | 6 +- platforms/evm/protocols/portico/package.json | 10 +- platforms/evm/protocols/portico/src/api.ts | 248 +----------------- platforms/evm/protocols/portico/src/bridge.ts | 161 ++++++++---- platforms/evm/protocols/portico/src/consts.ts | 46 +++- .../evm/protocols/tokenBridge/package.json | 8 +- platforms/solana/package.json | 4 +- platforms/solana/protocols/cctp/package.json | 6 +- platforms/solana/protocols/core/package.json | 6 +- .../solana/protocols/tokenBridge/package.json | 8 +- platforms/sui/package.json | 4 +- platforms/sui/protocols/core/package.json | 6 +- .../sui/protocols/tokenBridge/package.json | 8 +- sdk/package.json | 52 ++-- 41 files changed, 594 insertions(+), 630 deletions(-) diff --git a/connect/package.json b/connect/package.json index ae4306b5a..619f97f04 100644 --- a/connect/package.json +++ b/connect/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-connect", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -98,8 +98,8 @@ }, "dependencies": { "axios": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.11.0", - "@wormhole-foundation/sdk-definitions": "0.11.0" + "@wormhole-foundation/sdk-base": "0.12.0", + "@wormhole-foundation/sdk-definitions": "0.12.0" }, "type": "module" } \ No newline at end of file diff --git a/connect/src/routes/portico/README.md b/connect/src/routes/portico/README.md index 7c26fcb11..ffeaeedbb 100644 --- a/connect/src/routes/portico/README.md +++ b/connect/src/routes/portico/README.md @@ -41,7 +41,7 @@ The current table of input tokens, to bridging tokens, to final tokens is as follows ``` -| inputs | 'native' | ETH | wETH | wstETH -| bridging token | xETH | wstETH -| outputs | 'native' | ETH | wETH | wstETH +| inputs | 'native' | ETH | wETH | wstETH | USDT | +| bridging token | xETH | xwstETH | xUSDT | +| outputs | 'native' | ETH | wETH | wstETH | USDT | ``` diff --git a/connect/src/routes/portico/automatic.ts b/connect/src/routes/portico/automatic.ts index 5ec53439e..b8bf35404 100644 --- a/connect/src/routes/portico/automatic.ts +++ b/connect/src/routes/portico/automatic.ts @@ -11,8 +11,10 @@ import type { } from "../types.js"; import type { AttestationReceipt, + AttestedTransferReceipt, Chain, ChainContext, + CompletedTransferReceipt, Network, Signer, SourceInitiatedTransferReceipt, @@ -26,19 +28,19 @@ import { Wormhole, amount, canonicalAddress, - chainToPlatform, contracts, isAttested, - isNative, + isSourceFinalized, isSourceInitiated, resolveWrappedToken, signSendWait, } from "./../../index.js"; -import type { ChainAddress } from "@wormhole-foundation/sdk-definitions"; +import type { ChainAddress, WormholeMessageId } from "@wormhole-foundation/sdk-definitions"; import type { RouteTransferRequest } from "../request.js"; export const SLIPPAGE_BPS = 15n; // 0.15% -export const BPS_PER_HUNDRED_PERCENT = 10000n; +export const MAX_SLIPPAGE_BPS = 100n; // 1% +export const BPS_PER_HUNDRED_PERCENT = 10_000n; export namespace PorticoRoute { export type Options = {}; @@ -78,8 +80,6 @@ export class AutomaticPorticoRoute name: "AutomaticPortico", }; - private static _supportedTokens = ["WETH", "WSTETH"]; - static supportedNetworks(): Network[] { return ["Mainnet"]; } @@ -92,19 +92,12 @@ export class AutomaticPorticoRoute } static async supportedSourceTokens(fromChain: ChainContext): Promise { - const { chain } = fromChain; - const supported = this._supportedTokens - .map((symbol) => { - return filters.bySymbol(fromChain.config.tokenMap!, symbol) ?? []; - }) - .flat() - .filter((td) => { - const localOrEth = !td.original || td.original === "Ethereum"; - const isAvax = chain === "Avalanche" && isNative(td.address); - return localOrEth && !isAvax; - }); - - return supported.map((td) => Wormhole.tokenId(chain, td.address)); + const pb = await fromChain.getPorticoBridge(); + const { tokenMap } = fromChain.config; + return pb + .supportedTokens() + .filter((t) => !tokenMap || filters.byAddress(tokenMap, canonicalAddress(t.token))) + .map((t) => t.token); } static async supportedDestinationTokens( @@ -119,43 +112,32 @@ export class AutomaticPorticoRoute ); const tokenAddress = canonicalAddress(srcTokenAddress); - // The token that will be used to bridge const pb = await fromChain.getPorticoBridge(); - const transferrableToken = pb.getTransferrableToken(tokenAddress); - // The tokens that _will_ be received on redemption - const redeemToken = await TokenTransfer.lookupDestinationToken( - fromChain, - toChain, - transferrableToken, - ); + try { + // The highway token that will be used to bridge + const transferrableToken = await pb.getTransferrableToken(tokenAddress); + // Make sure it exists on the destination chain + await TokenTransfer.lookupDestinationToken(fromChain, toChain, transferrableToken); + } catch { + return []; + } - // Grab the symbol for the token that gets redeemed - const redeemTokenDetails = filters.byAddress( - toChain.config.tokenMap!, - canonicalAddress(redeemToken), - )!; - - // Find the local/native version of the same token by symbol - const locallyRedeemable = ( - filters.bySymbol(toChain.config.tokenMap!, redeemTokenDetails.symbol) ?? [] - ) - .filter((td) => { - return !td.original; - }) - .map((td) => { - switch (td.symbol) { - case "ETH": - case "WETH": - return Wormhole.tokenId(toChain.chain, td.address); - case "WSTETH": - return Wormhole.tokenId(toChain.chain, td.address); - default: - throw new Error("Unknown symbol: " + redeemTokenDetails.symbol); - } - }); - - return locallyRedeemable; + // Find the destination token(s) in the same group + const toPb = await toChain.getPorticoBridge(); + const tokens = toPb.supportedTokens(); + const { tokenMap } = toChain.config; + const group = pb.getTokenGroup(tokenAddress); + return tokens + .filter( + (t) => + (t.group === group || + // ETH/WETH supports wrapping/unwrapping + (t.group === "ETH" && group === "WETH") || + (t.group === "WETH" && group === "ETH")) && + (!tokenMap || filters.byAddress(tokenMap, canonicalAddress(t.token))), + ) + .map((t) => t.token); } static isProtocolSupported(chain: ChainContext): boolean { @@ -163,7 +145,6 @@ export class AutomaticPorticoRoute } async isAvailable(): Promise { - // TODO: return true; } @@ -174,10 +155,10 @@ export class AutomaticPorticoRoute async validate(request: RouteTransferRequest, params: TP): Promise { try { if ( - chainToPlatform(request.fromChain.chain) !== "Evm" || - chainToPlatform(request.toChain.chain) !== "Evm" + !AutomaticPorticoRoute.isProtocolSupported(request.fromChain) || + !AutomaticPorticoRoute.isProtocolSupported(request.toChain) ) { - throw new Error("Only EVM chains are supported"); + throw new Error("Protocol not supported"); } const { fromChain, toChain, source, destination } = request; @@ -190,9 +171,11 @@ export class AutomaticPorticoRoute const fromPb = await fromChain.getPorticoBridge(); const toPb = await toChain.getPorticoBridge(); - const canonicalSourceToken = fromPb.getTransferrableToken(canonicalAddress(sourceToken)); + const canonicalSourceToken = await fromPb.getTransferrableToken( + canonicalAddress(sourceToken), + ); - const canonicalDestinationToken = toPb.getTransferrableToken( + const canonicalDestinationToken = await toPb.getTransferrableToken( canonicalAddress(destinationToken), ); @@ -216,7 +199,25 @@ export class AutomaticPorticoRoute async quote(request: RouteTransferRequest, params: VP): Promise { try { - const swapAmounts = await this.quoteUniswap(request, params); + const swapAmounts = await this.fetchSwapQuote(request, params); + + // destination token may have a different number of decimals than the source token + // so we need to scale the amounts to the token with the most decimals + // before comparing them + const maxDecimals = Math.max(request.source.decimals, request.destination.decimals); + const scaledAmount = amount.units(amount.scale(params.normalizedParams.amount, maxDecimals)); + const scaledMinAmountFinish = amount.units( + amount.scale( + amount.fromBaseUnits(swapAmounts.minAmountFinish, request.destination.decimals), + maxDecimals, + ), + ); + // if the slippage is more than 100bps, this likely means that the pools are unbalanced + if ( + scaledMinAmountFinish < + scaledAmount - (scaledAmount * MAX_SLIPPAGE_BPS) / BPS_PER_HUNDRED_PERCENT + ) + throw new Error("Slippage too high"); const pb = await request.toChain.getPorticoBridge(); @@ -230,9 +231,9 @@ export class AutomaticPorticoRoute relayerFee: fee, }; - let destinationAmount = details.swapAmounts.minAmountFinish - fee; + const destinationAmount = details.swapAmounts.minAmountFinish - fee; - if (Number(destinationAmount) < 0) { + if (destinationAmount < 0n) { return { success: false, error: new Error( @@ -275,6 +276,9 @@ export class AutomaticPorticoRoute const destToken = request.destination!.id; const fromPorticoBridge = await request.fromChain.getPorticoBridge(); + const tokenGroup = fromPorticoBridge.getTokenGroup(sourceToken.toString()); + const toPorticoBridge = await request.toChain.getPorticoBridge(); + const destPorticoAddress = toPorticoBridge.getPorticoAddress(tokenGroup); const xfer = fromPorticoBridge.transfer( Wormhole.parseAddress(sender.chain(), sender.address()), @@ -282,6 +286,7 @@ export class AutomaticPorticoRoute sourceToken, amount.units(params.normalizedParams.amount), destToken!, + destPorticoAddress, details!, ); @@ -296,14 +301,49 @@ export class AutomaticPorticoRoute } async *track(receipt: R, timeout?: number) { - if (!isSourceInitiated(receipt)) throw new Error("Source must be initiated"); + if (isSourceInitiated(receipt) || isSourceFinalized(receipt)) { + const { txid } = receipt.originTxs[receipt.originTxs.length - 1]!; + + const vaa = await this.wh.getVaa(txid, "PorticoBridge:Transfer", timeout); + if (!vaa) throw new Error("No VAA found for transaction: " + txid); + + const msgId: WormholeMessageId = { + chain: vaa.emitterChain, + emitter: vaa.emitterAddress, + sequence: vaa.sequence, + }; + + receipt = { + ...receipt, + state: TransferState.Attested, + attestation: { + id: msgId, + attestation: vaa, + }, + } satisfies AttestedTransferReceipt>; - const { txid } = receipt.originTxs[receipt.originTxs.length - 1]!; - const vaa = await this.wh.getVaa(txid, "TokenBridge:TransferWithPayload", timeout); - if (!vaa) throw new Error("No VAA found for transaction: " + txid); + yield receipt; + } + + if (isAttested(receipt)) { + const toChain = this.wh.getChain(receipt.to); + const toPorticoBridge = await toChain.getPorticoBridge(); + const isCompleted = await toPorticoBridge.isTransferCompleted( + receipt.attestation.attestation, + ); + if (isCompleted) { + receipt = { + ...receipt, + state: TransferState.DestinationFinalized, + } satisfies CompletedTransferReceipt>; + + yield receipt; + } + } + + // TODO: handle swap failed case (highway token received) - const parsed = PorticoBridge.deserializePayload(vaa.payload.payload); - yield { ...receipt, vaa, parsed }; + yield receipt; } async complete(signer: Signer, receipt: R): Promise { @@ -316,22 +356,26 @@ export class AutomaticPorticoRoute return await signSendWait(toChain, xfer, signer); } - private async quoteUniswap(request: RouteTransferRequest, params: VP) { - const fromPorticoBridge = await request.fromChain.getPorticoBridge(); - const startQuote = await fromPorticoBridge.quoteSwap( + private async fetchSwapQuote(request: RouteTransferRequest, params: VP) { + const fromPb = await request.fromChain.getPorticoBridge(); + const xferAmount = amount.units(params.normalizedParams.amount); + const tokenGroup = fromPb.getTokenGroup(canonicalAddress(params.normalizedParams.sourceToken)); + const startQuote = await fromPb.quoteSwap( params.normalizedParams.sourceToken.address, params.normalizedParams.canonicalSourceToken.address, - amount.units(params.normalizedParams.amount), + tokenGroup, + xferAmount, ); const startSlippage = (startQuote * SLIPPAGE_BPS) / BPS_PER_HUNDRED_PERCENT; if (startSlippage >= startQuote) throw new Error("Start slippage too high"); - const toPorticoBridge = await request.toChain.getPorticoBridge(); + const toPb = await request.toChain.getPorticoBridge(); const minAmountStart = startQuote - startSlippage; - const finishQuote = await toPorticoBridge.quoteSwap( + const finishQuote = await toPb.quoteSwap( params.normalizedParams.canonicalDestinationToken.address, params.normalizedParams.destinationToken.address, + tokenGroup, minAmountStart, ); const finishSlippage = (finishQuote * SLIPPAGE_BPS) / BPS_PER_HUNDRED_PERCENT; @@ -339,24 +383,10 @@ export class AutomaticPorticoRoute if (finishSlippage >= finishQuote) throw new Error("Finish slippage too high"); const minAmountFinish = finishQuote - finishSlippage; - const amountFinishQuote = await toPorticoBridge.quoteSwap( - params.normalizedParams.canonicalDestinationToken.address, - params.normalizedParams.destinationToken.address, - startQuote, // no slippage - ); - // the expected receive amount is the amount out from the swap - // minus 5bps slippage - const amountFinishSlippage = (amountFinishQuote * 5n) / BPS_PER_HUNDRED_PERCENT; - if (amountFinishSlippage >= amountFinishQuote) - throw new Error("Amount finish slippage too high"); - - const amountFinish = amountFinishQuote - amountFinishSlippage; - if (amountFinish <= minAmountFinish) throw new Error("Amount finish too low"); return { minAmountStart: minAmountStart, minAmountFinish: minAmountFinish, - amountFinish: amountFinish, }; } } diff --git a/connect/src/routes/request.ts b/connect/src/routes/request.ts index 9662691b6..34685114a 100644 --- a/connect/src/routes/request.ts +++ b/connect/src/routes/request.ts @@ -53,9 +53,13 @@ export class RouteTransferRequest { }; if (quote.relayFee) { + const relayFeeChain = + quote.relayFee.token.chain === this.fromChain.chain ? this.fromChain : this.toChain; + const relayFeeDecimals = await relayFeeChain.getDecimals(quote.relayFee.token.address); + dq.relayFee = { token: quote.relayFee.token, - amount: amount.fromBaseUnits(quote.relayFee.amount, this.source.decimals), + amount: amount.fromBaseUnits(quote.relayFee.amount, relayFeeDecimals), }; } diff --git a/connect/src/wormhole.ts b/connect/src/wormhole.ts index 768c3fc14..630a3eed3 100644 --- a/connect/src/wormhole.ts +++ b/connect/src/wormhole.ts @@ -416,7 +416,7 @@ export class Wormhole { } /** - * Parse an address from its canonincal string format to a NativeAddress + * Parse an address from its canonical string format to a NativeAddress * * @param chain The chain the address is for * @param address The native address in canonical string format @@ -427,7 +427,7 @@ export class Wormhole { } /** - * Parse an address from its canonincal string format to a NativeAddress + * Parse an address from its canonical string format to a NativeAddress * * @param chain The chain the address is for * @param address The native address in canonical string format or the string "native" diff --git a/core/base/package.json b/core/base/package.json index e46189e62..d45baaeb4 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-base", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" diff --git a/core/base/src/constants/contracts/portico.ts b/core/base/src/constants/contracts/portico.ts index e8fde82bd..f8f961a5b 100644 --- a/core/base/src/constants/contracts/portico.ts +++ b/core/base/src/constants/contracts/portico.ts @@ -1,10 +1,12 @@ -import type { MapLevels } from './../../utils/index.js'; -import type { Chain } from '../chains.js'; -import type { Network } from '../networks.js'; +import type { MapLevels } from "./../../utils/index.js"; +import type { Chain } from "../chains.js"; +import type { Network } from "../networks.js"; export type PorticoContracts = { - portico: string; + porticoUniswap: string; uniswapQuoterV2: string; + porticoPancakeSwap?: string; + pancakeSwapQuoterV2?: string; }; // prettier-ignore @@ -13,32 +15,52 @@ export const porticoContracts = [ "Mainnet", [ ["Ethereum", { - portico: '0x48b6101128C0ed1E208b7C910e60542A2ee6f476', + porticoUniswap: '0x48b6101128C0ed1E208b7C910e60542A2ee6f476', uniswapQuoterV2: '0x61fFE014bA17989E743c5F6cB21bF9697530B21e', + porticoPancakeSwap: '0x4db1683d60e0a933A9A477a19FA32F472bB9d06e', + pancakeSwapQuoterV2: '0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997', }], ["Polygon", { - portico: '0x227bABe533fa9a1085f5261210E0B7137E44437B', + porticoUniswap: '0x227bABe533fa9a1085f5261210E0B7137E44437B', uniswapQuoterV2: '0x61fFE014bA17989E743c5F6cB21bF9697530B21e', + porticoPancakeSwap: undefined, + pancakeSwapQuoterV2: undefined, }], ["Bsc", { - portico: '0x05498574BD0Fa99eeCB01e1241661E7eE58F8a85', + porticoUniswap: '0x05498574BD0Fa99eeCB01e1241661E7eE58F8a85', uniswapQuoterV2: '0x78D78E420Da98ad378D7799bE8f4AF69033EB077', + porticoPancakeSwap: '0xF352DC165783538A26e38A536e76DceF227d90F2', + pancakeSwapQuoterV2: '0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997', }], ["Avalanche", { - portico: '0xE565E118e75304dD3cF83dff409c90034b7EA18a', + porticoUniswap: '0xE565E118e75304dD3cF83dff409c90034b7EA18a', uniswapQuoterV2: '0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F', + porticoPancakeSwap: undefined, + pancakeSwapQuoterV2: undefined, }], ["Arbitrum", { - portico: '0x48fa7528bFD6164DdF09dF0Ed22451cF59c84130', + porticoUniswap: '0x48fa7528bFD6164DdF09dF0Ed22451cF59c84130', uniswapQuoterV2: '0x61fFE014bA17989E743c5F6cB21bF9697530B21e', + porticoPancakeSwap: '0xE70946692E2e56ae47BfAe2d93d31bd60952B090', + pancakeSwapQuoterV2: '0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997', }], ["Optimism", { - portico: '0x9ae506cDDd27DEe1275fd1fe6627E5dc65257061', + porticoUniswap: '0x9ae506cDDd27DEe1275fd1fe6627E5dc65257061', uniswapQuoterV2: '0x61fFE014bA17989E743c5F6cB21bF9697530B21e', + porticoPancakeSwap: undefined, + pancakeSwapQuoterV2: undefined, }], ["Base", { - portico: '0x610d4DFAC3EC32e0be98D18DDb280DACD76A1889', + porticoUniswap: '0x610d4DFAC3EC32e0be98D18DDb280DACD76A1889', uniswapQuoterV2: '0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a', + porticoPancakeSwap: '0x4568aa1eA0ED54db666c58B4526B3FC9BD9be9bf', + pancakeSwapQuoterV2: '0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997', }], + ["Celo", { + porticoUniswap: '0xE565E118e75304dD3cF83dff409c90034b7EA18a', + uniswapQuoterV2: '0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8', + porticoPancakeSwap: undefined, + pancakeSwapQuoterV2: undefined, + }] ] ]] as const satisfies MapLevels<[Network, Chain, PorticoContracts]> diff --git a/core/base/src/constants/tokens/mainnet.ts b/core/base/src/constants/tokens/mainnet.ts index 191a3ccf7..e0f4598f6 100644 --- a/core/base/src/constants/tokens/mainnet.ts +++ b/core/base/src/constants/tokens/mainnet.ts @@ -559,6 +559,14 @@ const mainnetTokenEntries = [ original: "Solana", }, ], + [ + "USDTbsc", + { + symbol: "USDT", + decimals: 18, + address: "0x55d398326f99059fF775485246999027B3197955", + }, + ], ], ], [ @@ -874,6 +882,14 @@ const mainnetTokenEntries = [ original: "Solana", }, ], + [ + "USDTpolygon", + { + symbol: "USDT", + decimals: 6, + address: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", + }, + ], ], ], [ @@ -1137,6 +1153,14 @@ const mainnetTokenEntries = [ original: "Solana", }, ], + [ + "USDTavax", + { + symbol: "USDT", + decimals: 6, + address: "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7", + }, + ], ], ], [ @@ -1523,6 +1547,14 @@ const mainnetTokenEntries = [ address: "0x471ece3750da237f93b8e339c536989b8978a438", }, ], + [ + "USDT", + { + symbol: "USDT", + decimals: 6, + address: "0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e", + }, + ], [ "WGLMR", { @@ -2941,6 +2973,14 @@ const mainnetTokenEntries = [ original: "Solana", }, ], + [ + "USDTbase", + { + symbol: "USDT", + decimals: 6, + address: "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2", + }, + ], ], ], [ @@ -3239,6 +3279,14 @@ const mainnetTokenEntries = [ original: "Solana", }, ], + [ + "USDTarbitrum", + { + symbol: "USDT", + decimals: 6, + address: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", + }, + ], ], ], [ @@ -3537,6 +3585,14 @@ const mainnetTokenEntries = [ original: "Solana", }, ], + [ + "USDToptimism", + { + symbol: "USDT", + decimals: 6, + address: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58", + }, + ], ], ], [ diff --git a/core/definitions/package.json b/core/definitions/package.json index c3aef8042..61012b768 100644 --- a/core/definitions/package.json +++ b/core/definitions/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -86,7 +86,7 @@ "dependencies": { "@noble/hashes": "^1.3.1", "@noble/curves": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.11.0" + "@wormhole-foundation/sdk-base": "0.12.0" }, "type": "module" } \ No newline at end of file diff --git a/core/definitions/src/protocols/portico/portico.ts b/core/definitions/src/protocols/portico/portico.ts index 50ef42a56..7da0bdb94 100644 --- a/core/definitions/src/protocols/portico/portico.ts +++ b/core/definitions/src/protocols/portico/portico.ts @@ -27,7 +27,6 @@ export namespace PorticoBridge { export interface SwapAmounts { minAmountStart: bigint; minAmountFinish: bigint; - amountFinish: bigint; } export type Quote = { @@ -73,7 +72,7 @@ export namespace PorticoBridge { */ export interface PorticoBridge { // Checks if a transfer VAA has been redeemed - //isTransferCompleted(vaa: PorticoBridge.VAA): Promise; + isTransferCompleted(vaa: PorticoBridge.VAA): Promise; /** Initiate a transfer of some token to another chain */ transfer( @@ -82,6 +81,7 @@ export interface PorticoBridge, amount: bigint, destToken: TokenId, + destPorticoAddress: string, quote: PorticoBridge.Quote, ): AsyncGenerator>; @@ -92,9 +92,25 @@ export interface PorticoBridge>; /** quote token conversion */ - quoteSwap(input: TokenAddress, output: TokenAddress, amount: bigint): Promise; + quoteSwap( + input: TokenAddress, + output: TokenAddress, + tokenGroup: string, + amount: bigint, + ): Promise; + /** quote relay on destination with conversion */ quoteRelay(token: TokenAddress, destination: TokenAddress): Promise; - getTransferrableToken(address: string): TokenId; + /** Get the "highway" token for this token */ + getTransferrableToken(address: string): Promise; + + /** Tokens supported on this chain */ + supportedTokens(): { group: string; token: TokenId }[]; + + /** Get the group that a token belongs to e.g. ETH, WETH, wstETH, USDT */ + getTokenGroup(address: string): string; + + /** Get the Portico contract address for the token group */ + getPorticoAddress(group: string): string; } diff --git a/core/definitions/src/protocols/portico/porticoLayout.ts b/core/definitions/src/protocols/portico/porticoLayout.ts index 760adcc4e..af279194d 100644 --- a/core/definitions/src/protocols/portico/porticoLayout.ts +++ b/core/definitions/src/protocols/portico/porticoLayout.ts @@ -3,6 +3,7 @@ import { bitsetItem } from "@wormhole-foundation/sdk-base"; import { amountItem, universalAddressItem } from "./../../layout-items/index.js"; import type { NamedPayloads, RegisterPayloadTypes } from "./../../vaa/index.js"; import { registerPayloadTypes } from "./../../vaa/index.js"; +import { transferWithPayloadLayout } from "../tokenBridge/tokenBridgeLayout.js"; //weirdly, if defined in place, the type is not inferred properly const flagsItem = bitsetItem(["shouldWrapNative", "shouldUnwrapNative"]); @@ -38,7 +39,9 @@ export const porticoPayloadLayout = [ { name: "relayerFee", ...amountItem }, ] as const satisfies Layout; -export const namedPayloads = [["Transfer", porticoFlagSetLayout]] as const satisfies NamedPayloads; +export const namedPayloads = [ + ["Transfer", transferWithPayloadLayout(porticoPayloadLayout)], +] as const satisfies NamedPayloads; // factory registration: import "../../registry.js"; diff --git a/core/icons/package.json b/core/icons/package.json index cd7675c45..855eb0603 100644 --- a/core/icons/package.json +++ b/core/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-icons", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -50,7 +50,7 @@ "dist/cjs" ], "dependencies": { - "@wormhole-foundation/sdk-base": "0.11.0" + "@wormhole-foundation/sdk-base": "0.12.0" }, "sideEffects": false, "scripts": { diff --git a/examples/package.json b/examples/package.json index 783a9798a..0120edde4 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -51,6 +51,6 @@ "tsx": "^4.7.0" }, "dependencies": { - "@wormhole-foundation/sdk": "0.11.0" + "@wormhole-foundation/sdk": "0.12.0" } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index a7610c658..7d1359e8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ts-sdk", - "version": "0.11.0", + "version": "0.12.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ts-sdk", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "workspaces": [ "core/base", @@ -59,11 +59,11 @@ }, "connect": { "name": "@wormhole-foundation/sdk-connect", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-base": "0.11.0", - "@wormhole-foundation/sdk-definitions": "0.11.0", + "@wormhole-foundation/sdk-base": "0.12.0", + "@wormhole-foundation/sdk-definitions": "0.12.0", "axios": "^1.4.0" }, "engines": { @@ -72,7 +72,7 @@ }, "core/base": { "name": "@wormhole-foundation/sdk-base", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { "@scure/base": "^1.1.3" @@ -80,11 +80,11 @@ }, "core/definitions": { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.11.0", + "version": "0.12.0", "dependencies": { "@noble/curves": "^1.4.0", "@noble/hashes": "^1.3.1", - "@wormhole-foundation/sdk-base": "0.11.0" + "@wormhole-foundation/sdk-base": "0.12.0" } }, "core/definitions/node_modules/@noble/curves": { @@ -109,10 +109,10 @@ }, "core/icons": { "name": "@wormhole-foundation/sdk-icons", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-base": "0.11.0" + "@wormhole-foundation/sdk-base": "0.12.0" }, "devDependencies": { "tsx": "^4.7.0" @@ -120,10 +120,10 @@ }, "examples": { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk": "0.11.0" + "@wormhole-foundation/sdk": "0.12.0" }, "devDependencies": { "dotenv": "^16.3.1", @@ -8972,10 +8972,10 @@ }, "platforms/algorand": { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", "algosdk": "2.7.0" }, "engines": { @@ -8984,11 +8984,11 @@ }, "platforms/algorand/protocols/core": { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.11.0", - "@wormhole-foundation/sdk-connect": "0.11.0" + "@wormhole-foundation/sdk-algorand": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.12.0" }, "engines": { "node": ">=16" @@ -8996,12 +8996,12 @@ }, "platforms/algorand/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.11.0", - "@wormhole-foundation/sdk-algorand-core": "0.11.0", - "@wormhole-foundation/sdk-connect": "0.11.0" + "@wormhole-foundation/sdk-algorand": "0.12.0", + "@wormhole-foundation/sdk-algorand-core": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.12.0" }, "engines": { "node": ">=16" @@ -9009,10 +9009,10 @@ }, "platforms/aptos": { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", "aptos": "1.21.0" }, "engines": { @@ -9021,11 +9021,11 @@ }, "platforms/aptos/protocols/core": { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.11.0", - "@wormhole-foundation/sdk-connect": "0.11.0" + "@wormhole-foundation/sdk-aptos": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.12.0" }, "engines": { "node": ">=16" @@ -9033,11 +9033,11 @@ }, "platforms/aptos/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.11.0", - "@wormhole-foundation/sdk-connect": "0.11.0" + "@wormhole-foundation/sdk-aptos": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.12.0" }, "engines": { "node": ">=16" @@ -9045,14 +9045,14 @@ }, "platforms/cosmwasm": { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", "cosmjs-types": "^0.9.0" }, "engines": { @@ -9061,14 +9061,14 @@ }, "platforms/cosmwasm/protocols/core": { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm": "0.12.0" }, "engines": { "node": ">=16" @@ -9076,15 +9076,15 @@ }, "platforms/cosmwasm/protocols/ibc": { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.12.0", "cosmjs-types": "^0.9.0" }, "engines": { @@ -9093,13 +9093,13 @@ }, "platforms/cosmwasm/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm": "0.12.0" }, "engines": { "node": ">=16" @@ -9107,10 +9107,10 @@ }, "platforms/evm": { "name": "@wormhole-foundation/sdk-evm", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", "ethers": "^6.5.1" }, "devDependencies": { @@ -9122,11 +9122,11 @@ }, "platforms/evm/protocols/cctp": { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-evm": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-evm": "0.12.0", "ethers": "^6.5.1" }, "engines": { @@ -9135,11 +9135,11 @@ }, "platforms/evm/protocols/core": { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-evm": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-evm": "0.12.0", "ethers": "^6.5.1" }, "engines": { @@ -9148,13 +9148,13 @@ }, "platforms/evm/protocols/portico": { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-evm": "0.11.0", - "@wormhole-foundation/sdk-evm-core": "0.11.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-evm": "0.12.0", + "@wormhole-foundation/sdk-evm-core": "0.12.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.12.0", "ethers": "^6.5.1" }, "engines": { @@ -9163,12 +9163,12 @@ }, "platforms/evm/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-evm": "0.11.0", - "@wormhole-foundation/sdk-evm-core": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-evm": "0.12.0", + "@wormhole-foundation/sdk-evm-core": "0.12.0", "ethers": "^6.5.1" }, "engines": { @@ -9177,14 +9177,14 @@ }, "platforms/solana": { "name": "@wormhole-foundation/sdk-solana", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", "rpc-websockets": "^7.10.0" }, "devDependencies": { @@ -9196,14 +9196,14 @@ }, "platforms/solana/protocols/cctp": { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-solana": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-solana": "0.12.0" }, "engines": { "node": ">=16" @@ -9211,14 +9211,14 @@ }, "platforms/solana/protocols/core": { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-solana": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-solana": "0.12.0" }, "engines": { "node": ">=16" @@ -9226,15 +9226,15 @@ }, "platforms/solana/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-solana": "0.11.0", - "@wormhole-foundation/sdk-solana-core": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-solana": "0.12.0", + "@wormhole-foundation/sdk-solana-core": "0.12.0" }, "engines": { "node": ">=16" @@ -9242,11 +9242,11 @@ }, "platforms/sui": { "name": "@wormhole-foundation/sdk-sui", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0" }, "engines": { "node": ">=16" @@ -9254,12 +9254,12 @@ }, "platforms/sui/protocols/core": { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-sui": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-sui": "0.12.0" }, "engines": { "node": ">=16" @@ -9267,13 +9267,13 @@ }, "platforms/sui/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-sui": "0.11.0", - "@wormhole-foundation/sdk-sui-core": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-sui": "0.12.0", + "@wormhole-foundation/sdk-sui-core": "0.12.0" }, "engines": { "node": ">=16" @@ -9281,34 +9281,34 @@ }, "sdk": { "name": "@wormhole-foundation/sdk", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.11.0", - "@wormhole-foundation/sdk-algorand-core": "0.11.0", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.11.0", - "@wormhole-foundation/sdk-aptos": "0.11.0", - "@wormhole-foundation/sdk-aptos-core": "0.11.0", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.11.0", - "@wormhole-foundation/sdk-base": "0.11.0", - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.11.0", - "@wormhole-foundation/sdk-definitions": "0.11.0", - "@wormhole-foundation/sdk-evm": "0.11.0", - "@wormhole-foundation/sdk-evm-cctp": "0.11.0", - "@wormhole-foundation/sdk-evm-core": "0.11.0", - "@wormhole-foundation/sdk-evm-portico": "0.11.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.11.0", - "@wormhole-foundation/sdk-solana": "0.11.0", - "@wormhole-foundation/sdk-solana-cctp": "0.11.0", - "@wormhole-foundation/sdk-solana-core": "0.11.0", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.11.0", - "@wormhole-foundation/sdk-sui": "0.11.0", - "@wormhole-foundation/sdk-sui-core": "0.11.0", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.11.0" + "@wormhole-foundation/sdk-algorand": "0.12.0", + "@wormhole-foundation/sdk-algorand-core": "0.12.0", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.12.0", + "@wormhole-foundation/sdk-aptos": "0.12.0", + "@wormhole-foundation/sdk-aptos-core": "0.12.0", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.12.0", + "@wormhole-foundation/sdk-base": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.12.0", + "@wormhole-foundation/sdk-definitions": "0.12.0", + "@wormhole-foundation/sdk-evm": "0.12.0", + "@wormhole-foundation/sdk-evm-cctp": "0.12.0", + "@wormhole-foundation/sdk-evm-core": "0.12.0", + "@wormhole-foundation/sdk-evm-portico": "0.12.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.12.0", + "@wormhole-foundation/sdk-solana": "0.12.0", + "@wormhole-foundation/sdk-solana-cctp": "0.12.0", + "@wormhole-foundation/sdk-solana-core": "0.12.0", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.12.0", + "@wormhole-foundation/sdk-sui": "0.12.0", + "@wormhole-foundation/sdk-sui-core": "0.12.0", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.12.0" }, "engines": { "node": ">=16" diff --git a/package.json b/package.json index 5834b08ab..9deda5860 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sdk", - "version": "0.11.0", + "version": "0.12.0", "license": "Apache-2.0", "directories": { "test": "__tests__" diff --git a/platforms/algorand/package.json b/platforms/algorand/package.json index 6485e1aaa..72433b5b9 100644 --- a/platforms/algorand/package.json +++ b/platforms/algorand/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -96,7 +96,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", "algosdk": "2.7.0" }, "type": "module" diff --git a/platforms/algorand/protocols/core/package.json b/platforms/algorand/protocols/core/package.json index 33b2e343a..11f803ddc 100644 --- a/platforms/algorand/protocols/core/package.json +++ b/platforms/algorand/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-algorand": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-algorand": "0.12.0" }, "type": "module", "exports": { diff --git a/platforms/algorand/protocols/tokenBridge/package.json b/platforms/algorand/protocols/tokenBridge/package.json index 618787200..8f626e5a7 100644 --- a/platforms/algorand/protocols/tokenBridge/package.json +++ b/platforms/algorand/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-algorand": "0.11.0", - "@wormhole-foundation/sdk-algorand-core": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-algorand": "0.12.0", + "@wormhole-foundation/sdk-algorand-core": "0.12.0" }, "type": "module", "exports": { diff --git a/platforms/aptos/package.json b/platforms/aptos/package.json index 6f5779515..d3c70b0eb 100644 --- a/platforms/aptos/package.json +++ b/platforms/aptos/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", "aptos": "1.21.0" }, "type": "module", diff --git a/platforms/aptos/protocols/core/package.json b/platforms/aptos/protocols/core/package.json index 53a2b60b8..d84c10196 100644 --- a/platforms/aptos/protocols/core/package.json +++ b/platforms/aptos/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-aptos": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-aptos": "0.12.0" }, "type": "module", "exports": { diff --git a/platforms/aptos/protocols/tokenBridge/package.json b/platforms/aptos/protocols/tokenBridge/package.json index 01be3f5d2..188db889e 100644 --- a/platforms/aptos/protocols/tokenBridge/package.json +++ b/platforms/aptos/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-aptos": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-aptos": "0.12.0" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/package.json b/platforms/cosmwasm/package.json index 36444f949..ccd74eac3 100644 --- a/platforms/cosmwasm/package.json +++ b/platforms/cosmwasm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", diff --git a/platforms/cosmwasm/protocols/core/package.json b/platforms/cosmwasm/protocols/core/package.json index 66c6f004d..e3080e07c 100644 --- a/platforms/cosmwasm/protocols/core/package.json +++ b/platforms/cosmwasm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm": "0.12.0", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2" diff --git a/platforms/cosmwasm/protocols/ibc/package.json b/platforms/cosmwasm/protocols/ibc/package.json index 770770cea..c0f2f0b28 100644 --- a/platforms/cosmwasm/protocols/ibc/package.json +++ b/platforms/cosmwasm/protocols/ibc/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,9 +57,9 @@ "@cosmjs/stargate": "^0.32.0", "cosmjs-types": "^0.9.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.12.0" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/protocols/tokenBridge/package.json b/platforms/cosmwasm/protocols/tokenBridge/package.json index 8c44d96ca..0b30d5ca5 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/package.json +++ b/platforms/cosmwasm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -54,8 +54,8 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.14.13-beta.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm": "0.12.0" }, "type": "module", "exports": { diff --git a/platforms/evm/package.json b/platforms/evm/package.json index 533a87ac2..7597778a7 100644 --- a/platforms/evm/package.json +++ b/platforms/evm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,7 +57,7 @@ "nock": "13.3.8" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index efed6f215..9e570fe0e 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,8 +53,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-evm": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-evm": "0.12.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/core/package.json b/platforms/evm/protocols/core/package.json index 2ab6cfdaf..54f771e39 100644 --- a/platforms/evm/protocols/core/package.json +++ b/platforms/evm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-evm": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-evm": "0.12.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/package.json b/platforms/evm/protocols/portico/package.json index d4702cf35..ddc79df4d 100644 --- a/platforms/evm/protocols/portico/package.json +++ b/platforms/evm/protocols/portico/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,10 +52,10 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-evm": "0.11.0", - "@wormhole-foundation/sdk-evm-core": "0.11.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-evm": "0.12.0", + "@wormhole-foundation/sdk-evm-core": "0.12.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.12.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/src/api.ts b/platforms/evm/protocols/portico/src/api.ts index 847f79736..5e41bc49b 100644 --- a/platforms/evm/protocols/portico/src/api.ts +++ b/platforms/evm/protocols/portico/src/api.ts @@ -1,60 +1,13 @@ -import type { - Chain, - ChainAddress, - Network, - TokenAddress, - TokenId, -} from '@wormhole-foundation/sdk-connect'; +import type { Chain, TokenAddress } from '@wormhole-foundation/sdk-connect'; import { - PorticoBridge, - canonicalAddress, - contracts, encoding, - isEqualCaseInsensitive, isNative, - nativeChainIds, - resolveWrappedToken, toChainId, } from '@wormhole-foundation/sdk-connect'; -import type { EvmChains } from '@wormhole-foundation/sdk-evm'; import axios from 'axios'; -import { porticoAbi } from './abis.js'; -import { FEE_TIER } from './consts.js'; export const RELAYER_FEE_API_URL = 'https://gfx.relayers.xlabs.xyz/api/v1/swap/quote'; -export const OKU_TRADE_BASE_URL = 'https://oku.trade/app'; - -const CREATE_ORDER_API_URL = 'https://thermae.fly.dev/api/order/create'; - -export interface CreateOrderRequest { - // Native chain id (eip155) - startingChainId: number; - destinationChainId: number; - - startingToken: string; - startingTokenAmount: string; - destinationToken: string; - destinationAddress: string; - relayerFee: string; - feeTierStart: number; - feeTierEnd: number; - minAmountStart: string; - minAmountEnd: string; - bridgeNonce: number; - shouldWrapNative: boolean; - shouldUnwrapNative: boolean; - porticoAddress: string; - destinationPorticoAddress: string; -} - -export interface CreateOrderResponse { - transactionData: string; - transactionTarget: string; - transactionValue: string; - startParameters: string[]; - estimatedAmountOut: string; -} export interface RelayerQuoteResponse { fee: string; @@ -62,205 +15,6 @@ export interface RelayerQuoteResponse { } export class PorticoApi { - // Post the order to the portico API - static async createOrder( - network: N, - chain: C, - receiver: ChainAddress, - token: TokenAddress, - amount: bigint, - destToken: TokenId, - quote: PorticoBridge.Quote, - nonce: number, - ): Promise { - try { - const { minAmountStart, minAmountFinish } = quote.swapAmounts; - - const receiverAddress = canonicalAddress(receiver); - - const [isStartTokenNative, startToken] = resolveWrappedToken( - network, - chain, - token, - ); - - const [isFinalTokenNative, finalToken] = resolveWrappedToken( - network, - receiver.chain, - destToken, - ); - - const startTokenAddress = canonicalAddress(startToken); - const finalTokenAddress = canonicalAddress(finalToken); - - const sourcePorticoAddress = contracts.portico.get( - network, - chain, - )!.portico; - - const destinationPorticoAddress = contracts.portico.get( - network, - receiver.chain, - )!.portico; - - const startingChainId = nativeChainIds.networkChainToNativeChainId.get( - network, - chain, - ) as bigint; - - const destinationChainId = nativeChainIds.networkChainToNativeChainId.get( - network, - receiver.chain, - ) as bigint; - - // Create the order - const orderRequest: CreateOrderRequest = { - startingChainId: Number(startingChainId), - startingToken: startTokenAddress.toLowerCase(), - destinationChainId: Number(destinationChainId), - destinationToken: finalTokenAddress.toLowerCase(), - destinationAddress: receiverAddress, - porticoAddress: sourcePorticoAddress, - destinationPorticoAddress: destinationPorticoAddress, - startingTokenAmount: amount.toString(), - minAmountStart: minAmountStart.toString(), - minAmountEnd: minAmountFinish.toString(), - bridgeNonce: nonce, - relayerFee: quote.relayerFee.toString(), - feeTierStart: FEE_TIER, - feeTierEnd: FEE_TIER, - shouldWrapNative: isStartTokenNative, - shouldUnwrapNative: isFinalTokenNative, - }; - - const response = await axios.post( - CREATE_ORDER_API_URL, - orderRequest, - ); - // Validate the response, not strictly necessary but if some details are wrong we want to know - this.validateCreateOrderResponse(response.data, orderRequest); - return response.data; - } catch (e) { - if (axios.isAxiosError(e)) { - const message = `${e.response?.statusText}: ${e.response?.data.message}`; - throw new Error(`Could not create order: ${message},`); - } - throw e; - } - } - - /** - * Validates that the response from the order creation API matches the request - * throws an error if there is a mismatch - */ - static validateCreateOrderResponse = ( - response: CreateOrderResponse, - request: CreateOrderRequest, - ): void => { - if ( - !isEqualCaseInsensitive( - request.porticoAddress || '', - response.transactionTarget, - ) - ) { - throw new Error('portico address mismatch'); - } - - const decoded = porticoAbi.decodeFunctionData( - 'start', - response.transactionData, - ); - if (decoded.length !== 1 || decoded[0].length !== 10) { - throw new Error('decoded length mismatch'); - } - - const flagSetBuffer = encoding.hex.decode(decoded[0][0]); - if (flagSetBuffer.length !== 32) { - throw new Error('flag set length mismatch'); - } - - const { recipientChain, feeTierStart, feeTierFinish, flags } = - PorticoBridge.deserializeFlagSet(flagSetBuffer); - - const { shouldWrapNative, shouldUnwrapNative } = flags; - - const [_, expectedChain] = - nativeChainIds.platformNativeChainIdToNetworkChain( - 'Evm', - BigInt(request.destinationChainId), - ); - if (recipientChain !== toChainId(expectedChain)) { - throw new Error('recipient chain mismatch'); - } - - if (feeTierStart !== request.feeTierStart) { - throw new Error('fee tier start mismatch'); - } - - if (feeTierFinish !== request.feeTierEnd) { - throw new Error('fee tier end mismatch'); - } - - if (!!shouldWrapNative !== request.shouldWrapNative) { - throw new Error('should wrap native mismatch'); - } - - if (!!shouldUnwrapNative !== request.shouldUnwrapNative) { - throw new Error('should unwrap native mismatch'); - } - - const startTokenAddress: string = decoded[0][1]; - if (!isEqualCaseInsensitive(startTokenAddress, request.startingToken)) { - throw new Error('start token address mismatch'); - } - - // const startTokenId = Wormhole.chainAddress(toChain(request.startingChainId), startTokenAddress); - // const canonicalTokenAddress: string = decoded[0][2]; - // if (!isEqualCaseInsensitive(canonicalTokenAddress, getOriginalAddress("Mainnet", startTokenId))) { - // throw new Error("canonical token address mismatch"); - // } - - const finalTokenAddress: string = decoded[0][3]; - if (!isEqualCaseInsensitive(finalTokenAddress, request.destinationToken)) { - throw new Error('final token address mismatch'); - } - - const recipientAddress: string = decoded[0][4]; - if (!isEqualCaseInsensitive(recipientAddress, request.destinationAddress)) { - throw new Error('recipient address mismatch'); - } - - const destinationPorticoAddress = decoded[0][5]; - if ( - !isEqualCaseInsensitive( - destinationPorticoAddress, - request.destinationPorticoAddress || '', - ) - ) { - throw new Error('destination portico address mismatch'); - } - - const amountSpecified: bigint = decoded[0][6]; - if (amountSpecified.toString() !== request.startingTokenAmount) { - throw new Error('amount mismatch'); - } - - const minAmountStart: bigint = decoded[0][7]; - if (minAmountStart.toString() !== request.minAmountStart) { - throw new Error('min amount start mismatch'); - } - - const minAmountFinish: bigint = decoded[0][8]; - if (minAmountFinish.toString() !== request.minAmountEnd) { - throw new Error('min amount finish mismatch'); - } - - const relayerFee: bigint = decoded[0][9]; - if (relayerFee.toString() !== request.relayerFee) { - throw new Error('relayer fee mismatch'); - } - }; - static async quoteRelayer( chain: Chain, from: TokenAddress, diff --git a/platforms/evm/protocols/portico/src/bridge.ts b/platforms/evm/protocols/portico/src/bridge.ts index f50255e8c..227f30a2e 100644 --- a/platforms/evm/protocols/portico/src/bridge.ts +++ b/platforms/evm/protocols/portico/src/bridge.ts @@ -12,11 +12,11 @@ import { PorticoBridge, Wormhole, canonicalAddress, - contracts, isEqualCaseInsensitive, nativeChainIds, resolveWrappedToken, serialize, + toChain, toChainId, } from '@wormhole-foundation/sdk-connect'; import type { EvmChains } from '@wormhole-foundation/sdk-evm'; @@ -28,16 +28,13 @@ import { addFrom, } from '@wormhole-foundation/sdk-evm'; import type { Provider, TransactionRequest } from 'ethers'; -import { ethers } from 'ethers'; +import { ethers, keccak256 } from 'ethers'; import { porticoAbi, uniswapQuoterV2Abi } from './abis.js'; import { PorticoApi } from './api.js'; -import { FEE_TIER } from './consts.js'; -import { - getTokensBySymbol, - getTokenByAddress, -} from '@wormhole-foundation/sdk-connect/tokens'; +import { FEE_TIER, supportedTokens } from './consts.js'; import { EvmWormholeCore } from '@wormhole-foundation/sdk-evm-core'; +import { EvmTokenBridge } from '@wormhole-foundation/sdk-evm-tokenbridge'; import '@wormhole-foundation/sdk-evm-tokenbridge'; @@ -47,13 +44,11 @@ export class EvmPorticoBridge< > implements PorticoBridge { chainId: bigint; - porticoAddress: string; - uniswapAddress: string; - porticoContract: ethers.Contract; - uniswapContract: ethers.Contract; core: EvmWormholeCore; + tokenBridge: EvmTokenBridge; + constructor( readonly network: N, readonly chain: C, @@ -65,28 +60,12 @@ export class EvmPorticoBridge< this.core = new EvmWormholeCore(network, chain, provider, contracts); - const { portico: porticoAddress, uniswapQuoterV2: uniswapAddress } = - contracts.portico; - - this.porticoAddress = porticoAddress; - this.uniswapAddress = uniswapAddress; + this.tokenBridge = new EvmTokenBridge(network, chain, provider, contracts); this.chainId = nativeChainIds.networkChainToNativeChainId.get( network, chain, ) as bigint; - - this.porticoContract = new ethers.Contract( - this.porticoAddress, - porticoAbi.fragments, - this.provider, - ); - - this.uniswapContract = new ethers.Contract( - this.uniswapAddress, - uniswapQuoterV2Abi.fragments, - this.provider, - ); } static async fromRpc( @@ -108,6 +87,7 @@ export class EvmPorticoBridge< token: TokenAddress, amount: bigint, destToken: TokenId, + destinationPorticoAddress: string, quote: PorticoBridge.Quote, ) { const { minAmountStart, minAmountFinish } = quote.swapAmounts; @@ -131,19 +111,15 @@ export class EvmPorticoBridge< const startTokenAddress = canonicalAddress(startToken); const cannonTokenAddress = canonicalAddress( - this.getTransferrableToken(startTokenAddress), + await this.getTransferrableToken(startTokenAddress), ); const receiverAddress = canonicalAddress(receiver); const finalTokenAddress = canonicalAddress(finalToken); - const destinationPorticoAddress = contracts.portico.get( - this.network, - receiver.chain, - )!.portico; - const nonce = new Date().valueOf() % 2 ** 4; + const flags = PorticoBridge.serializeFlagSet({ flags: { shouldWrapNative: isStartTokenNative, @@ -171,19 +147,22 @@ export class EvmPorticoBridge< ], ]); + const group = this.getTokenGroup(startToken.address.toString()); + const porticoAddress = this.getPorticoAddress(group); + // Approve the token if necessary if (!isStartTokenNative) yield* this.approve( startTokenAddress, senderAddress, amount, - this.porticoAddress, + porticoAddress, ); const messageFee = await this.core.getMessageFee(); const tx = { - to: this.porticoAddress, + to: porticoAddress, data: transactionData, value: messageFee + (isStartTokenNative ? amount : 0n), }; @@ -194,7 +173,18 @@ export class EvmPorticoBridge< } async *redeem(sender: AccountAddress, vaa: PorticoBridge.VAA) { - const txReq = await this.porticoContract + const recipientChain = toChain(vaa.payload.payload.flagSet.recipientChain); + const tokenAddress = vaa.payload.payload.finalTokenAddress + .toNative(recipientChain) + .toString(); + const group = this.getTokenGroup(tokenAddress); + const porticoAddress = this.getPorticoAddress(group); + const contract = new ethers.Contract( + porticoAddress, + porticoAbi.fragments, + this.provider, + ); + const txReq = await contract .getFunction('receiveMessageAndSwap') .populateTransaction(serialize(vaa)); @@ -206,9 +196,17 @@ export class EvmPorticoBridge< ); } + async isTransferCompleted(vaa: PorticoBridge.VAA): Promise { + const isCompleted = await this.tokenBridge.tokenBridge.isTransferCompleted( + keccak256(vaa.hash), + ); + return isCompleted; + } + async quoteSwap( input: TokenAddress, output: TokenAddress, + tokenGroup: string, amount: bigint, ): Promise { const [, inputTokenId] = resolveWrappedToken( @@ -228,7 +226,13 @@ export class EvmPorticoBridge< if (isEqualCaseInsensitive(inputAddress, outputAddress)) return amount; - const result = await this.uniswapContract + const quoterAddress = this.getQuoterAddress(tokenGroup); + const quoter = new ethers.Contract( + quoterAddress, + uniswapQuoterV2Abi.fragments, + this.provider, + ); + const result = await quoter .getFunction('quoteExactInputSingle') .staticCall([inputAddress, outputAddress, amount, FEE_TIER, 0]); @@ -239,28 +243,57 @@ export class EvmPorticoBridge< return await PorticoApi.quoteRelayer(this.chain, startToken, endToken); } - // For a given token, return the corresponding - // Wormhole wrapped token that originated on Ethereum - getTransferrableToken(address: string): TokenId { - if (this.chain === 'Ethereum') return Wormhole.tokenId('Ethereum', address); - - // get the nativeTokenDetails - const nToken = getTokenByAddress(this.network, this.chain, address); - if (!nToken) throw new Error('Unsupported source token: ' + address); - - const xToken = getTokensBySymbol( + // For a given token, return the Wormhole-wrapped/highway token + // that actually gets bridged from this chain + async getTransferrableToken(address: string): Promise { + const token = Wormhole.tokenId(this.chain, address); + const [, wrappedToken] = resolveWrappedToken( this.network, this.chain, - nToken.symbol, - )?.find((orig) => { - return orig.original === 'Ethereum'; - }); - if (!xToken) + token, + ); + if (this.chain === 'Ethereum') return wrappedToken; + + // Find the group that this token belongs to + const group = Object.values(supportedTokens).find((tokens) => + tokens.find( + (t) => + t.chain === this.chain && + canonicalAddress(t) === canonicalAddress(wrappedToken), + ), + ); + if (!group) + throw new Error(`No token group found for ${address} on ${this.chain}`); + + // Find the token in this group that originates on Ethereum + const tokenOnEthereum = group.find((t) => t.chain === 'Ethereum'); + if (!tokenOnEthereum) throw new Error( - `Unsupported symbol for chain ${nToken.symbol}: ${this.chain} `, + `No Ethereum origin token found for ${address} on ${this.chain}`, ); - return Wormhole.tokenId(xToken.chain, xToken.address); + // Now find the corresponding Wormhole-wrapped/highway token on this chain + const highwayTokenAddr = + await this.tokenBridge.getWrappedAsset(tokenOnEthereum); + + return Wormhole.tokenId(this.chain, highwayTokenAddr.toString()); + } + + supportedTokens(): { group: string; token: TokenId }[] { + const result = []; + for (const [group, tokens] of Object.entries(supportedTokens)) { + for (const token of tokens) { + if (token.chain === this.chain) result.push({ group, token }); + } + } + return result; + } + + getTokenGroup(address: string): string { + const tokens = this.supportedTokens(); + const token = tokens.find((t) => canonicalAddress(t.token) === address); + if (!token) throw new Error('Token not found'); + return token.group; } private async *approve( @@ -298,4 +331,22 @@ export class EvmPorticoBridge< false, ); } + + getPorticoAddress(group: string) { + const portico = this.contracts.portico!; + if (group === 'USDT') { + // Use PancakeSwap if available for USDT + return portico.porticoPancakeSwap || portico.porticoUniswap; + } + return portico.porticoUniswap; + } + + private getQuoterAddress(group: string) { + const portico = this.contracts.portico!; + if (group === 'USDT') { + // Use PancakeSwap if available for USDT + return portico.pancakeSwapQuoterV2 || portico.uniswapQuoterV2; + } + return portico.uniswapQuoterV2; + } } diff --git a/platforms/evm/protocols/portico/src/consts.ts b/platforms/evm/protocols/portico/src/consts.ts index 01a7807f9..2a717c9f2 100644 --- a/platforms/evm/protocols/portico/src/consts.ts +++ b/platforms/evm/protocols/portico/src/consts.ts @@ -1,10 +1,38 @@ +import { Wormhole } from '@wormhole-foundation/sdk-connect'; + export const FEE_TIER = 100; -export const SWAP_ERROR = - 'This transaction will not succeed due to price movement.'; -export const swapErrors = [ - 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT', - 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT', - 'Too little received', - 'Too much requested', - 'STF', -]; + +export const supportedTokens = { + ETH: [ + Wormhole.tokenId('Arbitrum', 'native'), + Wormhole.tokenId('Base', 'native'), + Wormhole.tokenId('Ethereum', 'native'), + Wormhole.tokenId('Optimism', 'native'), + ], + WETH: [ + Wormhole.tokenId('Arbitrum', '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1'), + Wormhole.tokenId('Avalanche', '0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB'), + Wormhole.tokenId('Base', '0x4200000000000000000000000000000000000006'), + Wormhole.tokenId('Bsc', '0x2170Ed0880ac9A755fd29B2688956BD959F933F8'), + Wormhole.tokenId('Ethereum', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'), + Wormhole.tokenId('Optimism', '0x4200000000000000000000000000000000000006'), + Wormhole.tokenId('Polygon', '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619'), + ], + wstETH: [ + Wormhole.tokenId('Arbitrum', '0x5979D7b546E38E414F7E9822514be443A4800529'), + Wormhole.tokenId('Base', '0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452'), + Wormhole.tokenId('Ethereum', '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0'), + Wormhole.tokenId('Optimism', '0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb'), + Wormhole.tokenId('Polygon', '0x03b54A6e9a984069379fae1a4fC4dBAE93B3bCCD'), + ], + USDT: [ + Wormhole.tokenId('Arbitrum', '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9'), + Wormhole.tokenId('Avalanche', '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7'), + Wormhole.tokenId('Base', '0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2'), + Wormhole.tokenId('Bsc', '0x55d398326f99059fF775485246999027B3197955'), + Wormhole.tokenId('Ethereum', '0xdAC17F958D2ee523a2206206994597C13D831ec7'), + Wormhole.tokenId('Optimism', '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58'), + Wormhole.tokenId('Polygon', '0xc2132D05D31c914a87C6611C10748AEb04B58e8F'), + Wormhole.tokenId('Celo', '0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e'), + ], +} as const; diff --git a/platforms/evm/protocols/tokenBridge/package.json b/platforms/evm/protocols/tokenBridge/package.json index ef7ecae90..637fec9b4 100644 --- a/platforms/evm/protocols/tokenBridge/package.json +++ b/platforms/evm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,9 +52,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-evm": "0.11.0", - "@wormhole-foundation/sdk-evm-core": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-evm": "0.12.0", + "@wormhole-foundation/sdk-evm-core": "0.12.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/solana/package.json b/platforms/solana/package.json index 6fe42f1a4..00d18ea56 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", "rpc-websockets": "^7.10.0" }, "type": "module", diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index 22fa37077..1d4154bc6 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -48,8 +48,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-solana": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-solana": "0.12.0", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index 591346b1c..0c8b3c5a3 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-solana": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-solana": "0.12.0", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index 0b2c0f5ca..4e3fefcd2 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-solana": "0.11.0", - "@wormhole-foundation/sdk-solana-core": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-solana": "0.12.0", + "@wormhole-foundation/sdk-solana-core": "0.12.0", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/sui/package.json b/platforms/sui/package.json index cd084e057..9a193ef8b 100644 --- a/platforms/sui/package.json +++ b/platforms/sui/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.11.0", + "@wormhole-foundation/sdk-connect": "0.12.0", "@mysten/sui.js": "^0.50.1" }, "type": "module", diff --git a/platforms/sui/protocols/core/package.json b/platforms/sui/protocols/core/package.json index 723708693..b8789ed1f 100644 --- a/platforms/sui/protocols/core/package.json +++ b/platforms/sui/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-sui": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-sui": "0.12.0" }, "type": "module", "exports": { diff --git a/platforms/sui/protocols/tokenBridge/package.json b/platforms/sui/protocols/tokenBridge/package.json index 588840272..1452f8621 100644 --- a/platforms/sui/protocols/tokenBridge/package.json +++ b/platforms/sui/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,9 +46,9 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-sui": "0.11.0", - "@wormhole-foundation/sdk-sui-core": "0.11.0" + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-sui": "0.12.0", + "@wormhole-foundation/sdk-sui-core": "0.12.0" }, "type": "module", "exports": { diff --git a/sdk/package.json b/sdk/package.json index 6ddf01e79..0c99c5212 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk", - "version": "0.11.0", + "version": "0.12.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -384,31 +384,31 @@ } }, "dependencies": { - "@wormhole-foundation/sdk-base": "0.11.0", - "@wormhole-foundation/sdk-definitions": "0.11.0", - "@wormhole-foundation/sdk-connect": "0.11.0", - "@wormhole-foundation/sdk-evm": "0.11.0", - "@wormhole-foundation/sdk-evm-core": "0.11.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.11.0", - "@wormhole-foundation/sdk-evm-portico": "0.11.0", - "@wormhole-foundation/sdk-evm-cctp": "0.11.0", - "@wormhole-foundation/sdk-solana": "0.11.0", - "@wormhole-foundation/sdk-solana-core": "0.11.0", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.11.0", - "@wormhole-foundation/sdk-solana-cctp": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.11.0", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.11.0", - "@wormhole-foundation/sdk-sui": "0.11.0", - "@wormhole-foundation/sdk-sui-core": "0.11.0", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.11.0", - "@wormhole-foundation/sdk-aptos": "0.11.0", - "@wormhole-foundation/sdk-aptos-core": "0.11.0", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.11.0", - "@wormhole-foundation/sdk-algorand": "0.11.0", - "@wormhole-foundation/sdk-algorand-core": "0.11.0", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.11.0" + "@wormhole-foundation/sdk-base": "0.12.0", + "@wormhole-foundation/sdk-definitions": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-evm": "0.12.0", + "@wormhole-foundation/sdk-evm-core": "0.12.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.12.0", + "@wormhole-foundation/sdk-evm-portico": "0.12.0", + "@wormhole-foundation/sdk-evm-cctp": "0.12.0", + "@wormhole-foundation/sdk-solana": "0.12.0", + "@wormhole-foundation/sdk-solana-core": "0.12.0", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.12.0", + "@wormhole-foundation/sdk-solana-cctp": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.12.0", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.12.0", + "@wormhole-foundation/sdk-sui": "0.12.0", + "@wormhole-foundation/sdk-sui-core": "0.12.0", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.12.0", + "@wormhole-foundation/sdk-aptos": "0.12.0", + "@wormhole-foundation/sdk-aptos-core": "0.12.0", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.12.0", + "@wormhole-foundation/sdk-algorand": "0.12.0", + "@wormhole-foundation/sdk-algorand-core": "0.12.0", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.12.0" }, "type": "module" } \ No newline at end of file From 5325c121573afd1882df61716c1ee53636667322 Mon Sep 17 00:00:00 2001 From: bruce-riley <96066700+bruce-riley@users.noreply.github.com> Date: Mon, 21 Oct 2024 14:54:49 -0500 Subject: [PATCH 48/69] Add Worldchain testnet (#721) --- core/base/src/constants/chains.ts | 1 + core/base/src/constants/contracts/core.ts | 1 + .../src/constants/contracts/tokenBridge.ts | 1 + core/base/src/constants/finality.ts | 1 + core/base/src/constants/nativeChainIds.ts | 1 + core/base/src/constants/platforms.ts | 1 + core/base/src/constants/rpc.ts | 1 + core/icons/src/constants/chainIcons.ts | 5 ++++ core/icons/src/images/chains/Worldchain.svg | 26 +++++++++++++++++++ 9 files changed, 38 insertions(+) create mode 100644 core/icons/src/images/chains/Worldchain.svg diff --git a/core/base/src/constants/chains.ts b/core/base/src/constants/chains.ts index 08ceb99df..118c846c1 100644 --- a/core/base/src/constants/chains.ts +++ b/core/base/src/constants/chains.ts @@ -49,6 +49,7 @@ const chainIdAndChainEntries = [ [ 40, "Seievm" ], [ 43, "Snaxchain" ], [ 44, "Unichain" ], + [ 45, "Worldchain" ], [ 3104, "Wormchain" ], [ 4000, "Cosmoshub" ], [ 4001, "Evmos" ], diff --git a/core/base/src/constants/contracts/core.ts b/core/base/src/constants/contracts/core.ts index 342ea47ef..31396b692 100644 --- a/core/base/src/constants/contracts/core.ts +++ b/core/base/src/constants/contracts/core.ts @@ -86,6 +86,7 @@ export const coreBridgeContracts = [[ ["Berachain", "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"], ["Snaxchain", "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"], ["Unichain", "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"], + ["Worldchain", "0xe5E02cD12B6FcA153b0d7fF4bF55730AE7B3C93A"], ["Xlayer", "0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"], ["Linea", "0x79A1027a6A159502049F10906D333EC57E95F083"], ]], [ diff --git a/core/base/src/constants/contracts/tokenBridge.ts b/core/base/src/constants/contracts/tokenBridge.ts index bff76ace0..a4ca4ffad 100644 --- a/core/base/src/constants/contracts/tokenBridge.ts +++ b/core/base/src/constants/contracts/tokenBridge.ts @@ -78,6 +78,7 @@ export const tokenBridgeContracts = [[ ["Berachain", "0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"], ["Snaxchain", "0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"], ["Unichain", "0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"], + ["Worldchain", "0x430855B4D43b8AEB9D2B9869B74d58dda79C0dB2"], ["Linea", "0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"], ]], [ "Devnet", [ diff --git a/core/base/src/constants/finality.ts b/core/base/src/constants/finality.ts index 694655a5d..8fdbbb95b 100644 --- a/core/base/src/constants/finality.ts +++ b/core/base/src/constants/finality.ts @@ -61,6 +61,7 @@ const finalityThresholds = [ ["Berachain", 0], ["Snaxchain", 0], ["Unichain", 0], + ["Worldchain",0], ["Cosmoshub", 0], ["Evmos", 0], ["Kujira", 0], diff --git a/core/base/src/constants/nativeChainIds.ts b/core/base/src/constants/nativeChainIds.ts index 94c3a7d8b..54b20e8a0 100644 --- a/core/base/src/constants/nativeChainIds.ts +++ b/core/base/src/constants/nativeChainIds.ts @@ -107,6 +107,7 @@ const chainNetworkNativeChainIdEntries = [ ["Berachain", 80084n], // Testnet v2 ["Snaxchain", 13001n], ["Unichain", 1301n], + ["Worldchain", 4801n], ["Xlayer", 195n], ["Linea", 59141n], // Sepolia ], diff --git a/core/base/src/constants/platforms.ts b/core/base/src/constants/platforms.ts index 9d841b587..92299cd29 100644 --- a/core/base/src/constants/platforms.ts +++ b/core/base/src/constants/platforms.ts @@ -38,6 +38,7 @@ const platformAndChainsEntries = [[ "Seievm", "Snaxchain", "Unichain", + "Worldchain", ]], [ "Solana", [ "Solana", diff --git a/core/base/src/constants/rpc.ts b/core/base/src/constants/rpc.ts index 57a295f1f..8abe49466 100644 --- a/core/base/src/constants/rpc.ts +++ b/core/base/src/constants/rpc.ts @@ -90,6 +90,7 @@ const rpcConfig = [[ ["Klaytn", "https://rpc.ankr.com/klaytn_testnet"], ["Snaxchain", "https://testnet.snaxchain.io"], ["Unichain", "https://sepolia.unichain.org"], + ["Worldchain", "https://worldchain-sepolia.g.alchemy.com/public"], ]], [ "Devnet", [ ["Ethereum", "http://eth-devnet:8545"], diff --git a/core/icons/src/constants/chainIcons.ts b/core/icons/src/constants/chainIcons.ts index 800755e48..6d80404d2 100644 --- a/core/icons/src/constants/chainIcons.ts +++ b/core/icons/src/constants/chainIcons.ts @@ -200,6 +200,11 @@ export function chainToIcon(chain: Chain): string { PREFIX + "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMjQuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIJIHZpZXdCb3g9IjAgMCAxNjguMyAxOTMuOCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTY4LjMgMTkzLjg7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPgkuc3Qwe2ZpbGw6I0ZGMDA3QTt9CS5zdDF7ZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7ZmlsbDojRkYwMDdBO308L3N0eWxlPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik02Niw0NC4xYy0yLjEtMC4zLTIuMi0wLjQtMS4yLTAuNWMxLjktMC4zLDYuMywwLjEsOS40LDAuOGM3LjIsMS43LDEzLjcsNi4xLDIwLjYsMTMuOGwxLjgsMi4xbDIuNi0wLjQJYzExLjEtMS44LDIyLjUtMC40LDMyLDRjMi42LDEuMiw2LjcsMy42LDcuMiw0LjJjMC4yLDAuMiwwLjUsMS41LDAuNywyLjhjMC43LDQuNywwLjQsOC4yLTEuMSwxMC45Yy0wLjgsMS41LTAuOCwxLjktMC4zLDMuMgljMC40LDEsMS42LDEuNywyLjcsMS43YzIuNCwwLDQuOS0zLjgsNi4xLTkuMWwwLjUtMi4xbDAuOSwxYzUuMSw1LjcsOS4xLDEzLjYsOS43LDE5LjJsMC4yLDEuNWwtMC45LTEuM2MtMS41LTIuMy0yLjktMy44LTQuOC01LjEJYy0zLjQtMi4zLTctMy0xNi41LTMuNWMtOC42LTAuNS0xMy41LTEuMi0xOC4zLTIuOGMtOC4yLTIuNy0xMi40LTYuMi0yMi4xLTE5LjFjLTQuMy01LjctNy04LjgtOS43LTExLjQJQzc5LjYsNDguMyw3My43LDQ1LjMsNjYsNDQuMXoiLz48cGF0aCBjbGFzcz0ic3QwIiBkPSJNMTQwLjUsNTYuOGMwLjItMy44LDAuNy02LjMsMS44LTguNmMwLjQtMC45LDAuOC0xLjcsMC45LTEuN2MwLjEsMC0wLjEsMC43LTAuNCwxLjVjLTAuOCwyLjItMC45LDUuMy0wLjQsOC44CWMwLjcsNC41LDEsNS4xLDUuOCwxMGMyLjIsMi4zLDQuOCw1LjIsNS44LDYuNGwxLjcsMi4ybC0xLjctMS42Yy0yLjEtMi02LjktNS44LTgtNi4zYy0wLjctMC40LTAuOC0wLjQtMS4zLDAuMQljLTAuNCwwLjQtMC41LDEtMC41LDMuOWMtMC4xLDQuNS0wLjcsNy4zLTIuMiwxMC4yYy0wLjgsMS41LTAuOSwxLjItMC4yLTAuNWMwLjUtMS4zLDAuNi0xLjksMC42LTYuMmMwLTguNy0xLTEwLjgtNy4xLTE0LjMJYy0xLjUtMC45LTQuMS0yLjItNS42LTIuOWMtMS42LTAuNy0yLjgtMS4zLTIuNy0xLjNjMC4yLTAuMiw2LjEsMS41LDguNCwyLjVjMy41LDEuNCw0LjEsMS41LDQuNSwxLjQJQzE0MC4yLDYwLjEsMTQwLjQsNTkuMywxNDAuNSw1Ni44eiIvPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik03MC4xLDcxLjdjLTQuMi01LjgtNi45LTE0LjgtNi4zLTIxLjVsMC4yLTIuMWwxLDAuMmMxLjgsMC4zLDQuOSwxLjUsNi40LDIuNGM0LDIuNCw1LjgsNS43LDcuNSwxMy45CWMwLjUsMi40LDEuMiw1LjIsMS41LDYuMWMwLjUsMS41LDIuNCw1LDQsNy4yYzEuMSwxLjYsMC40LDIuNC0yLjEsMi4yQzc4LjUsNzkuNyw3My40LDc2LjIsNzAuMSw3MS43eiIvPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMzUuNCwxMTUuMmMtMTkuOC04LTI2LjgtMTQuOS0yNi44LTI2LjZjMC0xLjcsMC4xLTMuMSwwLjEtMy4xYzAuMSwwLDAuOCwwLjYsMS43LDEuM2M0LDMuMiw4LjUsNC42LDIxLDYuNAljNy4zLDEuMSwxMS41LDEuOSwxNS4zLDMuMmMxMi4xLDQsMTkuNiwxMi4yLDIxLjQsMjMuM2MwLjUsMy4yLDAuMiw5LjMtMC42LDEyLjVjLTAuNywyLjUtMi43LDcuMS0zLjIsNy4yYy0wLjEsMC0wLjMtMC41LTAuMy0xLjMJYy0wLjItNC4yLTIuMy04LjItNS44LTExLjNDMTU0LDEyMy4yLDE0OC42LDEyMC41LDEzNS40LDExNS4yeiIvPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMjEuNCwxMTguNWMtMC4yLTEuNS0wLjctMy40LTEtNC4ybC0wLjUtMS41bDAuOSwxLjFjMS4zLDEuNSwyLjMsMy4zLDMuMiw1LjhjMC43LDEuOSwwLjcsMi41LDAuNyw1LjYJYzAsMy0wLjEsMy43LTAuNyw1LjRjLTEsMi43LTIuMiw0LjYtNC4yLDYuN2MtMy42LDMuNy04LjMsNS43LTE1LDYuNmMtMS4yLDAuMS00LjYsMC40LTcuNiwwLjZjLTcuNSwwLjQtMTIuNSwxLjItMTcsMi44CWMtMC42LDAuMi0xLjIsMC40LTEuMywwLjNjLTAuMi0wLjIsMi45LTIsNS40LTMuMmMzLjUtMS43LDcuMS0yLjYsMTUtNGMzLjktMC42LDcuOS0xLjQsOC45LTEuOEMxMTguMSwxMzUuNiwxMjMsMTI3LjksMTIxLjQsMTE4LjUJeiIvPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMzAuNSwxMzQuNmMtMi42LTUuNy0zLjItMTEuMS0xLjgtMTYuMmMwLjItMC41LDAuNC0xLDAuNi0xYzAuMiwwLDAuOCwwLjMsMS40LDAuN2MxLjIsMC44LDMuNywyLjIsMTAuMSw1LjcJYzguMSw0LjQsMTIuNyw3LjgsMTUuOSwxMS43YzIuOCwzLjQsNC41LDcuMyw1LjMsMTIuMWMwLjUsMi43LDAuMiw5LjItMC41LDExLjljLTIuMiw4LjUtNy4yLDE1LjMtMTQuNSwxOS4yYy0xLjEsMC42LTIsMS0yLjEsMQljLTAuMSwwLDAuMy0xLDAuOS0yLjJjMi40LTUuMSwyLjctMTAsMC45LTE1LjVjLTEuMS0zLjQtMy40LTcuNS04LTE0LjRDMTMzLjIsMTM5LjYsMTMxLjksMTM3LjUsMTMwLjUsMTM0LjZ6Ii8+PHBhdGggY2xhc3M9InN0MCIgZD0iTTU2LDE2NS4yYzcuNC02LjIsMTYuNS0xMC42LDI0LjktMTJjMy42LTAuNiw5LjYtMC40LDEyLjksMC41YzUuMywxLjQsMTAuMSw0LjQsMTIuNiw4LjEJYzIuNCwzLjYsMy41LDYuNyw0LjYsMTMuNmMwLjQsMi43LDAuOSw1LjUsMSw2LjFjMC44LDMuNiwyLjQsNi40LDQuNCw3LjljMy4xLDIuMyw4LjUsMi40LDEzLjgsMC40YzAuOS0wLjMsMS43LTAuNiwxLjctMC41CWMwLjIsMC4yLTIuNSwyLTQuMywyLjljLTIuNSwxLjMtNC41LDEuNy03LjIsMS43Yy00LjgsMC04LjktMi41LTEyLjItNy41Yy0wLjctMS0yLjEtMy45LTMuMy02LjZjLTMuNS04LjEtNS4zLTEwLjUtOS40LTEzLjIJYy0zLjYtMi4zLTguMi0yLjgtMTEuNy0xLjFjLTQuNiwyLjItNS44LDguMS0yLjYsMTEuN2MxLjMsMS41LDMuNywyLjcsNS43LDNjMy43LDAuNSw2LjktMi40LDYuOS02LjFjMC0yLjQtMC45LTMuOC0zLjMtNC45CWMtMy4yLTEuNC02LjcsMC4yLTYuNiwzLjNjMCwxLjMsMC42LDIuMSwxLjksMi43YzAuOCwwLjQsMC44LDAuNCwwLjIsMC4zYy0yLjktMC42LTMuNi00LjItMS4zLTYuNWMyLjgtMi44LDguNy0xLjYsMTAuNywyLjMJYzAuOCwxLjYsMC45LDQuOCwwLjIsNi44Yy0xLjcsNC40LTYuNSw2LjctMTEuNCw1LjRjLTMuMy0wLjktNC43LTEuOC04LjctNS45Yy03LTcuMi05LjctOC42LTE5LjctMTAuMWwtMS45LTAuM0w1NiwxNjUuMnoiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJNMy40LDQuM2MyMy4zLDI4LjMsNTkuMiw3Mi4zLDYxLDc0LjdjMS41LDIsMC45LDMuOS0xLjYsNS4zYy0xLjQsMC44LTQuMywxLjYtNS43LDEuNmMtMS42LDAtMy41LTAuOC00LjgtMi4xCWMtMC45LTAuOS00LjgtNi42LTEzLjYtMjAuM2MtNi43LTEwLjUtMTIuNC0xOS4yLTEyLjUtMTkuM0MyNS44LDQ0LDI1LjgsNDQsMzgsNjUuOEM0NS43LDc5LjUsNDguMiw4NC40LDQ4LjIsODVjMCwxLjMtMC40LDItMiwzLjgJYy0yLjcsMy0zLjksNi40LTQuOCwxMy41Yy0xLDcuOS0zLjcsMTMuNS0xMS40LDIzYy00LjUsNS42LTUuMiw2LjYtNi4zLDguOWMtMS40LDIuOC0xLjgsNC40LTIsOGMtMC4yLDMuOCwwLjIsNi4yLDEuMyw5LjgJYzEsMy4yLDIuMSw1LjMsNC44LDkuNGMyLjMsMy42LDMuNyw2LjMsMy43LDcuM2MwLDAuOCwwLjIsMC44LDMuOCwwYzguNi0yLDE1LjctNS40LDE5LjYtOS42YzIuNC0yLjYsMy00LDMtNy42CWMwLTIuMy0wLjEtMi44LTAuNy00LjJjLTEtMi4yLTIuOS00LTctNi44Yy01LjQtMy43LTcuNy02LjctOC4zLTEwLjdjLTAuNS0zLjQsMC4xLTUuNywzLjEtMTJjMy4xLTYuNSwzLjktOS4yLDQuNC0xNS44CWMwLjMtNC4yLDAuOC01LjksMi03LjJjMS4zLTEuNCwyLjQtMS45LDUuNS0yLjNjNS4xLTAuNyw4LjQtMiwxMS00LjVjMi4zLTIuMSwzLjMtNC4yLDMuNC03LjNsMC4xLTIuM0w3MC4xLDc3QzY1LjQsNzEuNiwwLjMsMCwwLDAJQy0wLjEsMCwxLjUsMS45LDMuNCw0LjN6IE0zNC4xLDE0Ni41YzEuMS0xLjksMC41LTQuMy0xLjMtNS41Yy0xLjctMS4xLTQuMy0wLjYtNC4zLDAuOWMwLDAuNCwwLjIsMC44LDAuOCwxYzAuOSwwLjUsMSwxLDAuMywyLjEJYy0wLjcsMS4xLTAuNywyLjEsMC4yLDIuOEMzMS4yLDE0OC45LDMzLjEsMTQ4LjMsMzQuMSwxNDYuNXoiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJNNzQuNiw5My45Yy0yLjQsMC43LTQuNywzLjMtNS40LDUuOWMtMC40LDEuNi0wLjIsNC41LDAuNSw1LjRjMS4xLDEuNCwyLjEsMS44LDQuOSwxLjgJYzUuNSwwLDEwLjItMi40LDEwLjctNS4zYzAuNS0yLjQtMS42LTUuNy00LjUtNy4yQzc5LjMsOTMuNyw3Ni4yLDkzLjQsNzQuNiw5My45eiBNODEsOTguOWMwLjgtMS4yLDAuNS0yLjUtMS0zLjQJYy0yLjctMS43LTYuOC0wLjMtNi44LDIuM2MwLDEuMywyLjEsMi43LDQuMSwyLjdDNzguNiwxMDAuNSw4MC40LDk5LjcsODEsOTguOXoiLz48L3N2Zz4=" ); + } else if (chain === "Worldchain") { + return ( + PREFIX + + "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4gIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiMwMDAiIHJ4PSIyNTYiIC8+ICA8ZyBjbGlwLXBhdGg9InVybCgjd29ybGQtY2hhaW4tYSkiPiAgICA8bWFzayAgICAgIGlkPSJ3b3JsZC1jaGFpbi1iIiAgICAgIHdpZHRoPSIzMjkiICAgICAgaGVpZ2h0PSIzMjkiICAgICAgeD0iOTIiICAgICAgeT0iOTEiICAgICAgbWFza1VuaXRzPSJ1c2VyU3BhY2VPblVzZSIgICAgPiAgICAgIDxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik05MiA5MWgzMjl2MzI5SDkyVjkxWiIgLz4gICAgPC9tYXNrPiAgICA8ZyBtYXNrPSJ1cmwoI3dvcmxkLWNoYWluLWIpIj4gICAgICA8cGF0aCAgICAgICAgZmlsbD0iI2ZmZiIgICAgICAgIGQ9Ik00MDguMDQ5IDE5MS40NzJjLTguMjk0LTE5LjYwMS0yMC4xNDktMzcuMTY4LTM1LjI1MS01Mi4yNy0xNS4xMDItMTUuMTAzLTMyLjcwOC0yNi45NTctNTIuMjctMzUuMjUyQzMwMC4yMjIgOTUuMzQzIDI3OC43MDMgOTEgMjU2LjQ4MSA5MWMtMjIuMTg0IDAtNDMuNzQyIDQuMzQzLTY0LjA0OCAxMi45NTEtMTkuNjAxIDguMjk0LTM3LjE2OSAyMC4xNDktNTIuMjcgMzUuMjUxLTE1LjEwMiAxNS4xMDItMjYuOTU3IDMyLjcwOC0zNS4yNTIgNTIuMjdDOTYuMzQzIDIxMS43MzkgOTIgMjMzLjI5NyA5MiAyNTUuNDgxYzAgMjIuMTgzIDQuMzQzIDQzLjc0MSAxMi45NTEgNjQuMDQ3IDguMjk0IDE5LjYwMSAyMC4xNDkgMzcuMTY4IDM1LjI1MSA1Mi4yNyAxNS4xMDIgMTUuMTAyIDMyLjcwOCAyNi45NTcgNTIuMjcgMzUuMjUxQzIxMi43NzggNDE1LjYxOCAyMzQuMjk3IDQyMCAyNTYuNTE5IDQyMGMyMi4xODQgMCA0My43NDItNC4zNDMgNjQuMDQ4LTEyLjk1MSAxOS42MDEtOC4yOTQgMzcuMTY4LTIwLjE0OSA1Mi4yNy0zNS4yNTEgMTUuMTAyLTE1LjEwMiAyNi45NTctMzIuNzA4IDM1LjI1Mi01Mi4yNyA4LjU2OC0yMC4zMDYgMTIuOTUtNDEuODI1IDEyLjk1LTY0LjA0Ny0uMDM5LTIyLjE4NC00LjQyMS00My43NDItMTIuOTktNjQuMDA5Wm0tMjA2LjE4NyA0OC41NTRjNi44NDctMjYuMjkyIDMwLjc5MS00NS43MzcgNTkuMjM1LTQ1LjczN2gxMTQuMjA1YzcuMzU2IDE0LjIwMyAxMi4wNTEgMjkuNjU3IDEzLjg5IDQ1LjczN2gtMTg3LjMzWm0xODcuMzMgMzAuOTA5YTEzMi42ODYgMTMyLjY4NiAwIDAgMS0xMy44OSA0NS43MzdIMjYxLjA5N2MtMjguNDA1IDAtNTIuMzQ5LTE5LjQ0Ni01OS4yMzUtNDUuNzM3aDE4Ny4zM1pNMTYyLjAzMyAxNjEuMDMzYzI1LjIzNi0yNS4yMzUgNTguNzY1LTM5LjEyNCA5NC40NDgtMzkuMTI0IDM1LjY4MSAwIDY5LjIxMSAxMy44ODkgOTQuNDQ2IDM5LjEyNC43NjcuNzczIDEuNTI0IDEuNTU1IDIuMjcgMi4zNDhoLTkyLjFjLTI0LjYwOSAwLTQ3LjczMiA5LjU4Ni02NS4xNDMgMjYuOTk2LTEzLjY5MyAxMy42OTQtMjIuNTM1IDMwLjk0Ny0yNS43MDUgNDkuNjg4aC00Ni40NDFjMy40MDQtMjkuODUyIDE2LjY2Ny01Ny40NzQgMzguMjI1LTc5LjAzMlptOTQuNDQ4IDIyOC4wNThjLTM1LjY4MyAwLTY5LjIxMi0xMy44ODktOTQuNDQ4LTM5LjEyNC0yMS41NTgtMjEuNTU4LTM0LjgyMS00OS4xOC0zOC4yMjUtNzguOTkzaDQ2LjQ0MWMzLjEzIDE4Ljc0MSAxMi4wMTIgMzUuOTk1IDI1LjcwNSA0OS42ODkgMTcuNDExIDE3LjQxIDQwLjUzNCAyNi45OTYgNjUuMTQzIDI2Ljk5Nmg5Mi4xMzljLS43NDMuNzgyLTEuNTI2IDEuNTY0LTIuMjY5IDIuMzQ3LTI1LjIzNiAyNS4xNTctNTguODA1IDM5LjA4NS05NC40ODYgMzkuMDg1WiIgICAgICAvPiAgICA8L2c+ICA8L2c+ICA8ZGVmcz4gICAgPGNsaXBQYXRoIGlkPSJ3b3JsZC1jaGFpbi1hIj4gICAgICA8cGF0aCBmaWxsPSIjZmZmIiBkPSJNOTIgOTFoMzI5djMyOUg5MnoiIC8+ICAgIDwvY2xpcFBhdGg+ICA8L2RlZnM+PC9zdmc+" + ); } else if (chain === "Wormchain") { return ( PREFIX + diff --git a/core/icons/src/images/chains/Worldchain.svg b/core/icons/src/images/chains/Worldchain.svg new file mode 100644 index 000000000..70771259c --- /dev/null +++ b/core/icons/src/images/chains/Worldchain.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + From 194b44a6f3ca55c0832f70e69a33340fc0abd455 Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Wed, 23 Oct 2024 12:31:22 -0400 Subject: [PATCH 49/69] a little README grooming (#723) --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3abc32007..c8206a715 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ -# Wormhole TS SDK +# Wormhole TypeScript SDK -The Wormhole Typescript SDK is useful for interacting with the chains Wormhole supports and the [protocols](#protocols) built on top of Wormhole. - -## Warning +[![npm version](https://img.shields.io/npm/v/@wormhole-foundation/sdk.svg)](https://www.npmjs.com/package/@wormhole-foundation/sdk) -:warning: This package is a Work in Progress so the interface may change and there are likely bugs. Please [report](https://github.com/wormhole-foundation/connect-sdk/issues) any issues you find. :warning: +The Wormhole Typescript SDK is useful for interacting with the chains Wormhole supports and the [protocols](#protocols) built on top of Wormhole. ## Installation From b44cd1a8d243706bfbadafb516d7a8ddbf67d568 Mon Sep 17 00:00:00 2001 From: bruce-riley <96066700+bruce-riley@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:43:01 -0500 Subject: [PATCH 50/69] Add Monad Devnet support (#726) * Add Monad Devnet support * Code review rework --- core/base/src/constants/chains.ts | 1 + core/base/src/constants/contracts/core.ts | 1 + core/base/src/constants/finality.ts | 9 +++++---- core/base/src/constants/nativeChainIds.ts | 1 + core/base/src/constants/platforms.ts | 1 + core/base/src/constants/rpc.ts | 1 + core/icons/src/constants/chainIcons.ts | 5 +++++ core/icons/src/images/chains/MonadDevnet.svg | 3 +++ 8 files changed, 18 insertions(+), 4 deletions(-) create mode 100755 core/icons/src/images/chains/MonadDevnet.svg diff --git a/core/base/src/constants/chains.ts b/core/base/src/constants/chains.ts index 118c846c1..dffca0d0a 100644 --- a/core/base/src/constants/chains.ts +++ b/core/base/src/constants/chains.ts @@ -66,6 +66,7 @@ const chainIdAndChainEntries = [ [10005, "OptimismSepolia"], [10006, "Holesky" ], [10007, "PolygonSepolia" ], + [10008, "MonadDevnet" ], ] as const satisfies MapLevel; export const [chainIds, chains] = zip(chainIdAndChainEntries); diff --git a/core/base/src/constants/contracts/core.ts b/core/base/src/constants/contracts/core.ts index 31396b692..fb0a120b6 100644 --- a/core/base/src/constants/contracts/core.ts +++ b/core/base/src/constants/contracts/core.ts @@ -89,6 +89,7 @@ export const coreBridgeContracts = [[ ["Worldchain", "0xe5E02cD12B6FcA153b0d7fF4bF55730AE7B3C93A"], ["Xlayer", "0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"], ["Linea", "0x79A1027a6A159502049F10906D333EC57E95F083"], + ["MonadDevnet", "0x376428e7f26D5867e69201b275553C45B09EE090"], ]], [ "Devnet", [ ["Solana", "Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"], diff --git a/core/base/src/constants/finality.ts b/core/base/src/constants/finality.ts index 8fdbbb95b..cff29db91 100644 --- a/core/base/src/constants/finality.ts +++ b/core/base/src/constants/finality.ts @@ -58,10 +58,10 @@ const finalityThresholds = [ ["Terra2", 0], ["Xpla", 0], ["Injective", 0], - ["Berachain", 0], - ["Snaxchain", 0], - ["Unichain", 0], - ["Worldchain",0], + ["Berachain", 1], + ["Snaxchain", 512], + ["Unichain", 512], + ["Worldchain",512], ["Cosmoshub", 0], ["Evmos", 0], ["Kujira", 0], @@ -76,6 +76,7 @@ const finalityThresholds = [ ["BaseSepolia", 512], ["OptimismSepolia", 512], ["PolygonSepolia", 32], + ["MonadDevnet", 1], ] as const satisfies MapLevel; /** diff --git a/core/base/src/constants/nativeChainIds.ts b/core/base/src/constants/nativeChainIds.ts index 54b20e8a0..84d6b1a8a 100644 --- a/core/base/src/constants/nativeChainIds.ts +++ b/core/base/src/constants/nativeChainIds.ts @@ -110,6 +110,7 @@ const chainNetworkNativeChainIdEntries = [ ["Worldchain", 4801n], ["Xlayer", 195n], ["Linea", 59141n], // Sepolia + ["MonadDevnet", 41454n], ], ], [ diff --git a/core/base/src/constants/platforms.ts b/core/base/src/constants/platforms.ts index 92299cd29..af5419e83 100644 --- a/core/base/src/constants/platforms.ts +++ b/core/base/src/constants/platforms.ts @@ -39,6 +39,7 @@ const platformAndChainsEntries = [[ "Snaxchain", "Unichain", "Worldchain", + "MonadDevnet", ]], [ "Solana", [ "Solana", diff --git a/core/base/src/constants/rpc.ts b/core/base/src/constants/rpc.ts index 8abe49466..cff7a9bd9 100644 --- a/core/base/src/constants/rpc.ts +++ b/core/base/src/constants/rpc.ts @@ -91,6 +91,7 @@ const rpcConfig = [[ ["Snaxchain", "https://testnet.snaxchain.io"], ["Unichain", "https://sepolia.unichain.org"], ["Worldchain", "https://worldchain-sepolia.g.alchemy.com/public"], + ["MonadDevnet", ""], // TODO: No public rpc is currently available, override with a custom rpc for now. ]], [ "Devnet", [ ["Ethereum", "http://eth-devnet:8545"], diff --git a/core/icons/src/constants/chainIcons.ts b/core/icons/src/constants/chainIcons.ts index 6d80404d2..026fb98a6 100644 --- a/core/icons/src/constants/chainIcons.ts +++ b/core/icons/src/constants/chainIcons.ts @@ -255,6 +255,11 @@ export function chainToIcon(chain: Chain): string { PREFIX + "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSJub25lIj48cGF0aCBmaWxsPSIjMkE3REUxIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yNjUuMjMzIDIuNTQ1YTE5LjI5OCAxOS4yOTggMCAwIDAtMTkuMTU2IDBsLTIwNS41IDExOC43MzRBMTkuMDIgMTkuMDIgMCAwIDAgMzEgMTM3Ljc1OHYyMzcuNDdhMTkuMDE3IDE5LjAxNyAwIDAgMCA5LjU3OCAxNi40NzlsODMuMjQyIDQ4LjE3VjE5OS4xNjhhMTkuMjkxIDE5LjI5MSAwIDAgMSA5LjAxNC0xNi4wNTdsNTYuMzQtMzQuOTMgNTYuMzQtMzQuNTA4YTE5LjAyMiAxOS4wMjIgMCAwIDEgMjAgMGw1Ni4zNCAzNC41MDggNTYuMzQgMzQuOTNhMTkuMyAxOS4zIDAgMCAxIDkuMDE0IDE2LjMzOXYxMTMuOTQ1YTE5LjAwNyAxOS4wMDcgMCAwIDEtOS4wMTQgMTYuMzM5bC01Ni4zNCAzNS4wNzEtNTYuMzQgMzQuMzY3Yy01LjM1MiAzLjM4LTEwLjcwNC0yLjExMy0xMC43MDQtOC40NTFWMzQ1LjY1YTE4LjQ1NyAxOC40NTcgMCAwIDEgMTAuNzA0LTE0LjA4NWw0Ny4xODUtMjkuMTU2YTE5LjI5NCAxOS4yOTQgMCAwIDAgOS4wMTQtMTYuMzM4VjIzOS40NWExOC44NjcgMTguODY3IDAgMCAwLTkuMDE0LTE1LjkxNWwtNDYuOTAzLTI4LjE3YTE5LjAxMyAxOS4wMTMgMCAwIDAtMjAgMGwtNDYuNzYzIDI4LjE3YTE4Ljc0MSAxOC43NDEgMCAwIDAtOS4yOTYgMTUuOTE1djIzNC43OTNjLjA3Ljg0NC4wNyAxLjY5MiAwIDIuNTM2bDU2LjM0IDMyLjY3NmExOS4yOTMgMTkuMjkzIDAgMCAwIDE5LjE1NiAwbDIwNS42NC0xMTguNzM0YTE5LjAxOCAxOS4wMTggMCAwIDAgOS41NzgtMTYuNDc5VjEzNy43NThhMTkuMDE0IDE5LjAxNCAwIDAgMC05LjU3OC0xNi40NzlMMjY1LjIzMyAyLjU0NVoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==" ); + } else if (chain === "MonadDevnet") { + return ( + PREFIX + + "PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTUuOTk5OSAwQzExLjM3OTUgMCAwIDExLjM3OTIgMCAxNS45OTk5QzAgMjAuNjIwNiAxMS4zNzk1IDMyIDE1Ljk5OTkgMzJDMjAuNjIwMyAzMiAzMiAyMC42MjA0IDMyIDE1Ljk5OTlDMzIgMTEuMzc5NCAyMC42MjA1IDAgMTUuOTk5OSAwWk0xMy41MDY2IDI1LjE0OTJDMTEuNTU4MiAyNC42MTgzIDYuMzE5ODEgMTUuNDU1IDYuODUwODMgMTMuNTA2NkM3LjM4MTg1IDExLjU1ODEgMTYuNTQ1IDYuMzE5NzkgMTguNDkzMyA2Ljg1MDhDMjAuNDQxOCA3LjM4MTczIDI1LjY4MDIgMTYuNTQ0OSAyNS4xNDkyIDE4LjQ5MzRDMjQuNjE4MiAyMC40NDE4IDE1LjQ1NSAyNS42ODAyIDEzLjUwNjYgMjUuMTQ5MloiIGZpbGw9IiM4MzZFRjkiLz48L3N2Zz4=" + ); } else { // This case is never reached const _: never = chain; diff --git a/core/icons/src/images/chains/MonadDevnet.svg b/core/icons/src/images/chains/MonadDevnet.svg new file mode 100755 index 000000000..5700dc202 --- /dev/null +++ b/core/icons/src/images/chains/MonadDevnet.svg @@ -0,0 +1,3 @@ + + + From 8d3a68064c11510566f4c5437b030cc1089750f8 Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Mon, 28 Oct 2024 15:29:31 -0400 Subject: [PATCH 51/69] Sui CCTP support (#718) --- core/base/src/constants/circle.ts | 4 + core/base/src/constants/contracts/circle.ts | 12 + examples/package.json | 2 +- examples/src/cctp.ts | 21 +- package-lock.json | 18 ++ package.json | 3 +- platforms/evm/protocols/cctp/package.json | 2 +- platforms/sui/protocols/cctp/package.json | 75 ++++++ .../sui/protocols/cctp/src/circleBridge.ts | 254 ++++++++++++++++++ platforms/sui/protocols/cctp/src/index.ts | 6 + platforms/sui/protocols/cctp/src/objects.ts | 23 ++ .../sui/protocols/cctp/tsconfig.cjs.json | 8 + .../sui/protocols/cctp/tsconfig.esm.json | 8 + platforms/sui/protocols/cctp/typedoc.json | 4 + platforms/sui/src/platform.ts | 2 +- sdk/src/platforms/sui.ts | 1 + 16 files changed, 435 insertions(+), 8 deletions(-) create mode 100644 platforms/sui/protocols/cctp/package.json create mode 100644 platforms/sui/protocols/cctp/src/circleBridge.ts create mode 100644 platforms/sui/protocols/cctp/src/index.ts create mode 100644 platforms/sui/protocols/cctp/src/objects.ts create mode 100644 platforms/sui/protocols/cctp/tsconfig.cjs.json create mode 100644 platforms/sui/protocols/cctp/tsconfig.esm.json create mode 100644 platforms/sui/protocols/cctp/typedoc.json diff --git a/core/base/src/constants/circle.ts b/core/base/src/constants/circle.ts index 8c065d55a..ed6d6f85e 100644 --- a/core/base/src/constants/circle.ts +++ b/core/base/src/constants/circle.ts @@ -19,6 +19,7 @@ const usdcContracts = [[ ["Solana", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"], ["Base", "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"], ["Polygon", "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359"], + ["Sui", "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC"], ]], [ "Testnet", [ ["Sepolia", "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"], @@ -28,6 +29,7 @@ const usdcContracts = [[ ["Solana", "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU"], ["BaseSepolia", "0x036CbD53842c5426634e7929541eC2318f3dCF7e"], ["Polygon", "0x9999f7fea5938fd3b1e26a12c3f2fb024e194f97"], + ["Sui", "0xa1ec7fc00a6f40db9693ad1415d0c193ad3906494428cf252621037bd7117e29::usdc::USDC"], ]], ] as const satisfies MapLevel>; export const usdcContract = constMap(usdcContracts); @@ -43,6 +45,7 @@ const circleDomains = [[ ["Solana", 5], ["Base", 6], ["Polygon", 7], + ["Sui", 8], ]], [ "Testnet", [ ["Sepolia", 0], @@ -52,6 +55,7 @@ const circleDomains = [[ ["Solana", 5], ["BaseSepolia", 6], ["Polygon", 7], + ["Sui", 8], ]], ] as const satisfies MapLevel>; diff --git a/core/base/src/constants/contracts/circle.ts b/core/base/src/constants/contracts/circle.ts index 587ad720f..83da6ba4c 100644 --- a/core/base/src/constants/contracts/circle.ts +++ b/core/base/src/constants/contracts/circle.ts @@ -53,6 +53,12 @@ export const circleContracts = [[ messageTransmitter: "0xF3be9355363857F3e001be68856A2f96b4C39Ba9", wormholeRelayer: "0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2", wormhole: "0x0FF28217dCc90372345954563486528aa865cDd6", + }], [ + "Sui", { + tokenMessenger: "0x410d70c8baad60f310f45c13b9656ecbfed46fdf970e051f0cac42891a848856", + messageTransmitter: "0x34c884874be4cb4b84e79fa280d7b041f186f4d1ef08be1dc74b20e94376951a", + wormholeRelayer: "", + wormhole: "", }], ]], [ "Testnet", [[ @@ -97,6 +103,12 @@ export const circleContracts = [[ messageTransmitter: "0xe09A679F56207EF33F5b9d8fb4499Ec00792eA73", wormholeRelayer: "0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2", wormhole: "0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c", + }], [ + "Sui", { + tokenMessenger: "0x4e16078afc5ebfc244a8107ded4044970df5d84db384e7194b7fc444090683fd", + messageTransmitter: "0x4741a96a5903c80613f2d013492a47741cf10c6246ea38a724d354a09895cf8f", + wormholeRelayer: "", + wormhole: "", }], ]], ] as const satisfies MapLevels<[Network, Chain, CircleContracts]>; diff --git a/examples/package.json b/examples/package.json index 0120edde4..7d6a31bed 100644 --- a/examples/package.json +++ b/examples/package.json @@ -53,4 +53,4 @@ "dependencies": { "@wormhole-foundation/sdk": "0.12.0" } -} \ No newline at end of file +} diff --git a/examples/src/cctp.ts b/examples/src/cctp.ts index 1861fd023..84ca5fc57 100644 --- a/examples/src/cctp.ts +++ b/examples/src/cctp.ts @@ -1,7 +1,8 @@ import type { Network, Signer, TransactionId, Wormhole } from "@wormhole-foundation/sdk"; -import { CircleTransfer, amount, wormhole } from "@wormhole-foundation/sdk"; +import { CircleTransfer, TransferState, amount, wormhole } from "@wormhole-foundation/sdk"; import evm from "@wormhole-foundation/sdk/evm"; import solana from "@wormhole-foundation/sdk/solana"; +import sui from "@wormhole-foundation/sdk/sui"; import type { SignerStuff } from "./helpers/index.js"; import { getSigner } from "./helpers/index.js"; @@ -16,11 +17,11 @@ AutoRelayer takes a 0.1usdc fee when xfering to any chain beside goerli, which i (async function () { // init Wormhole object, passing config for which network // to use (e.g. Mainnet/Testnet) and what Platforms to support - const wh = await wormhole("Testnet", [evm, solana]); + const wh = await wormhole("Testnet", [evm, solana, sui]); // Grab chain Contexts const sendChain = wh.getChain("Avalanche"); - const rcvChain = wh.getChain("Solana"); + const rcvChain = wh.getChain("Sui"); // Get signer from local key but anything that implements // Signer interface (e.g. wrapper around web wallet) should work @@ -28,7 +29,7 @@ AutoRelayer takes a 0.1usdc fee when xfering to any chain beside goerli, which i const destination = await getSigner(rcvChain); // 6 decimals for USDC (except for bsc, so check decimals before using this) - const amt = amount.units(amount.parse("0.2", 6)); + const amt = amount.units(amount.parse("0.01", 6)); // Choose whether or not to have the attestation delivered for you const automatic = false; @@ -105,6 +106,18 @@ async function cctpTransfer( console.log("Completing Transfer"); const dstTxids = await xfer.completeTransfer(dst.signer); console.log(`Completed Transfer: `, dstTxids); + + console.log("Tracking Transfer Progress"); + let receipt = CircleTransfer.getReceipt(xfer); + + for await (receipt of CircleTransfer.track(wh, receipt)) { + console.log("Receipt State:", receipt.state); + if (receipt.state === TransferState.DestinationFinalized) { + console.log("Transfer Confirmed Complete"); + break; + } + } + // EXAMPLE_CCTP_TRANSFER } diff --git a/package-lock.json b/package-lock.json index 7d1359e8e..4f8ad19bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ "platforms/sui", "platforms/sui/protocols/core", "platforms/sui/protocols/tokenBridge", + "platforms/sui/protocols/cctp", "platforms/aptos", "platforms/aptos/protocols/core", "platforms/aptos/protocols/tokenBridge", @@ -2931,6 +2932,10 @@ "resolved": "platforms/sui", "link": true }, + "node_modules/@wormhole-foundation/sdk-sui-cctp": { + "resolved": "platforms/sui/protocols/cctp", + "link": true + }, "node_modules/@wormhole-foundation/sdk-sui-core": { "resolved": "platforms/sui/protocols/core", "link": true @@ -9252,6 +9257,19 @@ "node": ">=16" } }, + "platforms/sui/protocols/cctp": { + "name": "@wormhole-foundation/sdk-sui-cctp", + "version": "0.12.0", + "license": "Apache-2.0", + "dependencies": { + "@mysten/sui.js": "^0.50.1", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-sui": "0.12.0" + }, + "engines": { + "node": ">=16" + } + }, "platforms/sui/protocols/core": { "name": "@wormhole-foundation/sdk-sui-core", "version": "0.12.0", diff --git a/package.json b/package.json index 9deda5860..536e4dbe9 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "platforms/sui", "platforms/sui/protocols/core", "platforms/sui/protocols/tokenBridge", + "platforms/sui/protocols/cctp", "platforms/aptos", "platforms/aptos/protocols/core", "platforms/aptos/protocols/tokenBridge", @@ -67,4 +68,4 @@ "unreleased": [ "tokenRegistry" ] -} \ No newline at end of file +} diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index 9e570fe0e..adfd77d8b 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -80,4 +80,4 @@ } } } -} \ No newline at end of file +} diff --git a/platforms/sui/protocols/cctp/package.json b/platforms/sui/protocols/cctp/package.json new file mode 100644 index 000000000..9f3953151 --- /dev/null +++ b/platforms/sui/protocols/cctp/package.json @@ -0,0 +1,75 @@ +{ + "name": "@wormhole-foundation/sdk-sui-cctp", + "version": "0.12.0", + "repository": { + "type": "git", + "url": "git+https://github.com/wormhole-foundation/wormhole-sdk-ts.git" + }, + "bugs": { + "url": "https://github.com/wormhole-foundation/wormhole-sdk-ts/issues" + }, + "homepage": "https://github.com/wormhole-foundation/wormhole-sdk-ts#readme", + "directories": { + "test": "tests" + }, + "license": "Apache-2.0", + "main": "./dist/cjs/index.js", + "types": "./dist/cjs/index.d.ts", + "module": "./dist/esm/index.js", + "description": "SDK for Sui chains, used in conjunction with @wormhole-foundation/sdk", + "files": [ + "dist/esm", + "dist/cjs" + ], + "keywords": [ + "wormhole", + "sdk", + "typescript", + "connect", + "sui" + ], + "engines": { + "node": ">=16" + }, + "sideEffects": [ + "./dist/cjs/index.js", + "./dist/esm/index.js" + ], + "scripts": { + "build:cjs": "tsc -p ./tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json", + "build:esm": "tsc -p ./tsconfig.esm.json", + "build": "npm run build:esm && npm run build:cjs", + "rebuild": "npm run clean && npm run build", + "clean": "rm -rf ./dist && rm -rf ./.turbo", + "lint": "npm run prettier && eslint --fix ./src --ext .ts", + "prettier": "prettier --write ./src" + }, + "dependencies": { + "@mysten/sui.js": "^0.50.1", + "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-sui": "0.12.0" + }, + "type": "module", + "exports": { + ".": { + "react-native": { + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js", + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.js" + }, + "default": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.js" + } + } + } +} diff --git a/platforms/sui/protocols/cctp/src/circleBridge.ts b/platforms/sui/protocols/cctp/src/circleBridge.ts new file mode 100644 index 000000000..0d4032110 --- /dev/null +++ b/platforms/sui/protocols/cctp/src/circleBridge.ts @@ -0,0 +1,254 @@ +import type { SuiClient } from "@mysten/sui.js/client"; +import { TransactionBlock } from "@mysten/sui.js/transactions"; +import { SuiPlatform, type SuiChains, SuiUnsignedTransaction, uint8ArrayToBCS } from "@wormhole-foundation/sdk-sui"; +import type { + AccountAddress, + ChainAddress, + ChainsConfig, + Network, + Platform, +} from '@wormhole-foundation/sdk-connect'; +import { + CircleBridge, + CircleTransferMessage, + circle, + Contracts, + encoding, +} from '@wormhole-foundation/sdk-connect'; + +import { suiCircleObjects } from "./objects.js"; + + +export class SuiCircleBridge + implements CircleBridge { + + readonly usdcId: string; + readonly usdcTreasuryId: string; + readonly tokenMessengerId: string; + readonly tokenMessengerStateId: string; + readonly messageTransmitterId: string; + readonly messageTransmitterStateId: string; + + constructor( + readonly network: N, + readonly chain: C, + readonly provider: SuiClient, + readonly contracts: Contracts, + ) { + if (network === 'Devnet') + throw new Error('CircleBridge not supported on Devnet'); + + const usdcId = circle.usdcContract.get(this.network, this.chain); + if (!usdcId) { + throw new Error(`No USDC contract configured for network=${this.network} chain=${this.chain}`); + } + + const { + tokenMessengerState, + messageTransmitterState, + usdcTreasury, + } = suiCircleObjects(network as "Mainnet" | "Testnet"); + + if (!contracts.cctp?.tokenMessenger) + throw new Error( + `Circle Token Messenger contract for domain ${chain} not found`, + ); + + if (!contracts.cctp?.messageTransmitter) + throw new Error( + `Circle Message Transmitter contract for domain ${chain} not found`, + ); + + this.usdcId = usdcId; + this.usdcTreasuryId = usdcTreasury; + this.tokenMessengerId = contracts.cctp?.tokenMessenger; + this.messageTransmitterId = contracts.cctp?.messageTransmitter; + this.tokenMessengerStateId = tokenMessengerState; + this.messageTransmitterStateId = messageTransmitterState; + } + + async *transfer( + sender: AccountAddress, + recipient: ChainAddress, + amount: bigint, + ): AsyncGenerator> { + const tx = new TransactionBlock(); + + const destinationDomain = circle.circleChainId.get( + this.network, + recipient.chain, + )!; + + const [primaryCoin, ...mergeCoins] = await SuiPlatform.getCoins(this.provider, sender, this.usdcId); + + if (primaryCoin === undefined) { + throw new Error('No USDC in wallet'); + } + + const primaryCoinInput = tx.object(primaryCoin.coinObjectId); + if (mergeCoins.length > 0) { + tx.mergeCoins(primaryCoinInput, mergeCoins.map((coin) => tx.object(coin.coinObjectId))); + } + + const [coin] = tx.splitCoins( + primaryCoinInput, + [amount] + ); + + tx.moveCall({ + target: `${this.tokenMessengerId}::deposit_for_burn::deposit_for_burn`, + arguments: [ + coin!, + tx.pure.u32(destinationDomain), // destination_domain + tx.pure.address(recipient.address.toUniversalAddress().toString()), // mint_recipient + tx.object(this.tokenMessengerStateId), // token_messenger_minter state + tx.object(this.messageTransmitterStateId), // message_transmitter state + tx.object("0x403"), // deny_list id, fixed address + tx.object(this.usdcTreasuryId) // treasury object Treasury + ], + typeArguments: [this.usdcId], + }); + + yield this.createUnsignedTx(tx, "Sui.CircleBridge.Transfer") + } + + async isTransferCompleted(message: CircleBridge.Message): Promise { + const tx = new TransactionBlock(); + + tx.moveCall({ + target: `${this.messageTransmitterId}::state::is_nonce_used`, + arguments: [ + tx.object(this.messageTransmitterStateId), + tx.pure.u32(message.sourceDomain), + tx.pure.u64(message.nonce), + ], + }); + + const result = await this.provider.devInspectTransactionBlock({ + sender: "0x0000000000000000000000000000000000000000000000000000000000000000", + transactionBlock: tx, + }); + + try { + /* @ts-ignore */ + const isNonceUsed = Boolean(result.results![0].returnValues![0][0][0]); + return isNonceUsed; + } catch (e) { + console.error(`Error reading if nonce was used: ${e}`); + return false; + } + } + + async *redeem( + sender: AccountAddress, + message: CircleBridge.Message, + attestation: string, + ): AsyncGenerator> { + const tx = new TransactionBlock(); + + const [receipt] = tx.moveCall({ + target: `${this.messageTransmitterId}::receive_message::receive_message`, + arguments: [ + tx.pure(uint8ArrayToBCS(CircleBridge.serialize(message))), + tx.pure(uint8ArrayToBCS(encoding.hex.decode(attestation))), + tx.object(this.messageTransmitterStateId) // message_transmitter state + ] + }); + + if (!receipt) throw new Error('Failed to produce receipt'); + + const [stampedReceipt] = tx.moveCall({ + target: `${this.tokenMessengerId}::handle_receive_message::handle_receive_message`, + arguments: [ + receipt, // Receipt object returned from receive_message call + tx.object(this.tokenMessengerStateId), // token_messenger_minter state + tx.object(this.messageTransmitterStateId), // message_transmitter state + tx.object("0x403"), // deny list, fixed address + tx.object(this.usdcTreasuryId), // usdc treasury object Treasury + ], + typeArguments: [this.usdcId], + }); + + if (!stampedReceipt) throw new Error('Failed to produce stamped receipt'); + + tx.moveCall({ + target: `${this.messageTransmitterId}::receive_message::complete_receive_message`, + arguments: [ + stampedReceipt, // Stamped receipt object returned from handle_receive_message call + tx.object(this.messageTransmitterStateId) // message_transmitter state + ] + }); + + yield this.createUnsignedTx(tx, 'Sui.CircleBridge.Redeem'); + } + + async parseTransactionDetails(digest: string): Promise { + const tx = await this.provider.waitForTransactionBlock({ + digest, + options: { showEvents: true, showEffects: true, showInput: true }, + }); + + if (!tx) { + throw new Error('Transaction not found'); + } + if (!tx.events) { + throw new Error('Transaction events not found'); + } + + const circleMessageSentEvent = (tx.events?.find((event) => + event.type.includes("send_message::MessageSent") + )); + + if (!circleMessageSentEvent) { + throw new Error('No MessageSent event found'); + } + + const circleMessage = new Uint8Array((circleMessageSentEvent?.parsedJson as any).message); + + const [msg, hash] = CircleBridge.deserialize(circleMessage); + const { payload: body } = msg; + + const xferSender = body.messageSender; + const xferReceiver = body.mintRecipient; + + const sendChain = circle.toCircleChain(this.network, msg.sourceDomain); + const rcvChain = circle.toCircleChain(this.network, msg.destinationDomain); + + const token = { chain: sendChain, address: body.burnToken }; + + return { + from: { chain: sendChain, address: xferSender }, + to: { chain: rcvChain, address: xferReceiver }, + token: token, + amount: body.amount, + message: msg, + id: { hash }, + }; + } + + static async fromRpc( + provider: SuiClient, + config: ChainsConfig, + ): Promise> { + const [network, chain] = await SuiPlatform.chainFromRpc(provider); + const conf = config[chain]!; + if (conf.network !== network) { + throw new Error(`Network mismatch: ${conf.network} != ${network}`); + } + + return new SuiCircleBridge( + network as N, + chain, + provider, + conf.contracts, + ); + } + + private createUnsignedTx( + txReq: TransactionBlock, + description: string, + parallelizable: boolean = false, + ): SuiUnsignedTransaction { + return new SuiUnsignedTransaction(txReq, this.network, this.chain, description, parallelizable); + } +} diff --git a/platforms/sui/protocols/cctp/src/index.ts b/platforms/sui/protocols/cctp/src/index.ts new file mode 100644 index 000000000..25f4c581a --- /dev/null +++ b/platforms/sui/protocols/cctp/src/index.ts @@ -0,0 +1,6 @@ +import { registerProtocol } from '@wormhole-foundation/sdk-connect'; + +import { SuiCircleBridge } from "./circleBridge.js"; + +registerProtocol("Sui", "CircleBridge", SuiCircleBridge); +export * from './circleBridge.js'; diff --git a/platforms/sui/protocols/cctp/src/objects.ts b/platforms/sui/protocols/cctp/src/objects.ts new file mode 100644 index 000000000..94dbe7363 --- /dev/null +++ b/platforms/sui/protocols/cctp/src/objects.ts @@ -0,0 +1,23 @@ +import { constMap, type MapLevels, type Network } from "@wormhole-foundation/sdk-connect"; + +type SuiCircleObjects = { + tokenMessengerState: string; + messageTransmitterState: string; + usdcTreasury: string; +} + +export const _suiCircleObjects = [[ + "Testnet", { + tokenMessengerState:"0xf410286d2c2d11722e8ef90260b942e8dd598d1b7dc9c72214ef814a4e2220b8", + messageTransmitterState: "0x18855ad15df31f43aa3e5c23433a3c62b15a9297716de66756f06d1464a0a6f7", + usdcTreasury: "0x7170137d4a6431bf83351ac025baf462909bffe2877d87716374fb42b9629ebe", + }, +], [ + "Mainnet", { + tokenMessengerState:"0x9887393d8c9eccad3e25d7ac04d7b5a1fb53b557df2f84e48d2846903b109b32", + messageTransmitterState: "0xd89e73191571cd3de6247ec00d6af48d89c245a7582c39fde20d08456c9b52f8", + usdcTreasury: "0x57d6725e7a8b49a7b2a612f6bd66ab5f39fc95332ca48be421c3229d514a6de7", + } +]] as const satisfies MapLevels<[Network, SuiCircleObjects]>; + +export const suiCircleObjects = constMap(_suiCircleObjects, [0, 1]); diff --git a/platforms/sui/protocols/cctp/tsconfig.cjs.json b/platforms/sui/protocols/cctp/tsconfig.cjs.json new file mode 100644 index 000000000..73a0e681f --- /dev/null +++ b/platforms/sui/protocols/cctp/tsconfig.cjs.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../tsconfig.cjs.json", + "include": ["src"], + "compilerOptions": { + "outDir": "dist/cjs", + "rootDir": "src" + } +} diff --git a/platforms/sui/protocols/cctp/tsconfig.esm.json b/platforms/sui/protocols/cctp/tsconfig.esm.json new file mode 100644 index 000000000..a9c110d37 --- /dev/null +++ b/platforms/sui/protocols/cctp/tsconfig.esm.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../tsconfig.esm.json", + "include": ["src"], + "compilerOptions": { + "outDir": "dist/esm", + "rootDir": "src" + } +} diff --git a/platforms/sui/protocols/cctp/typedoc.json b/platforms/sui/protocols/cctp/typedoc.json new file mode 100644 index 000000000..f2fbd427c --- /dev/null +++ b/platforms/sui/protocols/cctp/typedoc.json @@ -0,0 +1,4 @@ +{ + "extends": ["../../../../typedoc.base.json"], + "entryPoints": ["src/index.ts"], + } \ No newline at end of file diff --git a/platforms/sui/src/platform.ts b/platforms/sui/src/platform.ts index 1d9594638..4ae0f19f8 100644 --- a/platforms/sui/src/platform.ts +++ b/platforms/sui/src/platform.ts @@ -82,7 +82,7 @@ export class SuiPlatform if (fields && "decimals" in fields) return fields["decimals"]; } catch {} - const metadata = await rpc.getCoinMetadata({ coinType: parsedAddress.getCoinType() }); + const metadata = await rpc.getCoinMetadata({ coinType: parsedAddress.toString() }); if (metadata === null) throw new Error(`Can't fetch decimals for token ${parsedAddress.toString()}`); diff --git a/sdk/src/platforms/sui.ts b/sdk/src/platforms/sui.ts index 5eeca1322..224a8fa9a 100644 --- a/sdk/src/platforms/sui.ts +++ b/sdk/src/platforms/sui.ts @@ -9,6 +9,7 @@ const sui: PlatformDefinition = { protocols: { WormholeCore: () => import("@wormhole-foundation/sdk-sui-core"), TokenBridge: () => import("@wormhole-foundation/sdk-sui-tokenbridge"), + CircleBridge: () => import("@wormhole-foundation/sdk-sui-cctp"), }, getChain: (network, chain, overrides?) => new _sui.SuiChain( From 6ff334b2c3d4dbab1007d5d0d8df04c8d23dcafa Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:34:00 -0500 Subject: [PATCH 52/69] 0.14.0 version bump (#727) * 0.14.0 version bump * rebase --------- Co-authored-by: Artur Sapek --- connect/package.json | 6 +-- core/base/package.json | 2 +- core/definitions/package.json | 4 +- core/icons/package.json | 4 +- examples/package.json | 6 +-- package.json | 4 +- platforms/algorand/package.json | 4 +- .../algorand/protocols/core/package.json | 6 +-- .../protocols/tokenBridge/package.json | 8 +-- platforms/aptos/package.json | 4 +- platforms/aptos/protocols/core/package.json | 6 +-- .../aptos/protocols/tokenBridge/package.json | 6 +-- platforms/cosmwasm/package.json | 4 +- .../cosmwasm/protocols/core/package.json | 6 +-- platforms/cosmwasm/protocols/ibc/package.json | 8 +-- .../protocols/tokenBridge/package.json | 6 +-- platforms/evm/package.json | 4 +- platforms/evm/protocols/cctp/package.json | 8 +-- platforms/evm/protocols/core/package.json | 6 +-- platforms/evm/protocols/portico/package.json | 10 ++-- .../evm/protocols/tokenBridge/package.json | 8 +-- platforms/solana/package.json | 4 +- platforms/solana/protocols/cctp/package.json | 6 +-- platforms/solana/protocols/core/package.json | 6 +-- .../solana/protocols/tokenBridge/package.json | 8 +-- platforms/sui/package.json | 4 +- platforms/sui/protocols/cctp/package.json | 8 +-- platforms/sui/protocols/core/package.json | 6 +-- .../sui/protocols/tokenBridge/package.json | 8 +-- sdk/package.json | 52 +++++++++---------- 30 files changed, 111 insertions(+), 111 deletions(-) diff --git a/connect/package.json b/connect/package.json index 619f97f04..d0c0415f4 100644 --- a/connect/package.json +++ b/connect/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-connect", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -98,8 +98,8 @@ }, "dependencies": { "axios": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.12.0", - "@wormhole-foundation/sdk-definitions": "0.12.0" + "@wormhole-foundation/sdk-base": "0.14.0", + "@wormhole-foundation/sdk-definitions": "0.14.0" }, "type": "module" } \ No newline at end of file diff --git a/core/base/package.json b/core/base/package.json index d45baaeb4..13671a519 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-base", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" diff --git a/core/definitions/package.json b/core/definitions/package.json index 61012b768..774664e45 100644 --- a/core/definitions/package.json +++ b/core/definitions/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -86,7 +86,7 @@ "dependencies": { "@noble/hashes": "^1.3.1", "@noble/curves": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.12.0" + "@wormhole-foundation/sdk-base": "0.14.0" }, "type": "module" } \ No newline at end of file diff --git a/core/icons/package.json b/core/icons/package.json index 855eb0603..98f6c522e 100644 --- a/core/icons/package.json +++ b/core/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-icons", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -50,7 +50,7 @@ "dist/cjs" ], "dependencies": { - "@wormhole-foundation/sdk-base": "0.12.0" + "@wormhole-foundation/sdk-base": "0.14.0" }, "sideEffects": false, "scripts": { diff --git a/examples/package.json b/examples/package.json index 7d6a31bed..8e5d5192d 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -51,6 +51,6 @@ "tsx": "^4.7.0" }, "dependencies": { - "@wormhole-foundation/sdk": "0.12.0" + "@wormhole-foundation/sdk": "0.14.0" } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 536e4dbe9..98d5d1180 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sdk", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "directories": { "test": "__tests__" @@ -68,4 +68,4 @@ "unreleased": [ "tokenRegistry" ] -} +} \ No newline at end of file diff --git a/platforms/algorand/package.json b/platforms/algorand/package.json index 72433b5b9..a0f613f20 100644 --- a/platforms/algorand/package.json +++ b/platforms/algorand/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -96,7 +96,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", "algosdk": "2.7.0" }, "type": "module" diff --git a/platforms/algorand/protocols/core/package.json b/platforms/algorand/protocols/core/package.json index 11f803ddc..2a3752159 100644 --- a/platforms/algorand/protocols/core/package.json +++ b/platforms/algorand/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-algorand": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-algorand": "0.14.0" }, "type": "module", "exports": { diff --git a/platforms/algorand/protocols/tokenBridge/package.json b/platforms/algorand/protocols/tokenBridge/package.json index 8f626e5a7..e13e8a109 100644 --- a/platforms/algorand/protocols/tokenBridge/package.json +++ b/platforms/algorand/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-algorand": "0.12.0", - "@wormhole-foundation/sdk-algorand-core": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-algorand": "0.14.0", + "@wormhole-foundation/sdk-algorand-core": "0.14.0" }, "type": "module", "exports": { diff --git a/platforms/aptos/package.json b/platforms/aptos/package.json index d3c70b0eb..a9f725564 100644 --- a/platforms/aptos/package.json +++ b/platforms/aptos/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", "aptos": "1.21.0" }, "type": "module", diff --git a/platforms/aptos/protocols/core/package.json b/platforms/aptos/protocols/core/package.json index d84c10196..872745fe6 100644 --- a/platforms/aptos/protocols/core/package.json +++ b/platforms/aptos/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-aptos": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-aptos": "0.14.0" }, "type": "module", "exports": { diff --git a/platforms/aptos/protocols/tokenBridge/package.json b/platforms/aptos/protocols/tokenBridge/package.json index 188db889e..ff91a5a71 100644 --- a/platforms/aptos/protocols/tokenBridge/package.json +++ b/platforms/aptos/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-aptos": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-aptos": "0.14.0" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/package.json b/platforms/cosmwasm/package.json index ccd74eac3..9fbf67fef 100644 --- a/platforms/cosmwasm/package.json +++ b/platforms/cosmwasm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", diff --git a/platforms/cosmwasm/protocols/core/package.json b/platforms/cosmwasm/protocols/core/package.json index e3080e07c..62b132522 100644 --- a/platforms/cosmwasm/protocols/core/package.json +++ b/platforms/cosmwasm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm": "0.14.0", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2" diff --git a/platforms/cosmwasm/protocols/ibc/package.json b/platforms/cosmwasm/protocols/ibc/package.json index c0f2f0b28..f22063932 100644 --- a/platforms/cosmwasm/protocols/ibc/package.json +++ b/platforms/cosmwasm/protocols/ibc/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,9 +57,9 @@ "@cosmjs/stargate": "^0.32.0", "cosmjs-types": "^0.9.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.14.0" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/protocols/tokenBridge/package.json b/platforms/cosmwasm/protocols/tokenBridge/package.json index 0b30d5ca5..bde3ad304 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/package.json +++ b/platforms/cosmwasm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -54,8 +54,8 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.14.13-beta.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm": "0.14.0" }, "type": "module", "exports": { diff --git a/platforms/evm/package.json b/platforms/evm/package.json index 7597778a7..22448b5fe 100644 --- a/platforms/evm/package.json +++ b/platforms/evm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,7 +57,7 @@ "nock": "13.3.8" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index adfd77d8b..df2c3f85f 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,8 +53,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-evm": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-evm": "0.14.0", "ethers": "^6.5.1" }, "type": "module", @@ -80,4 +80,4 @@ } } } -} +} \ No newline at end of file diff --git a/platforms/evm/protocols/core/package.json b/platforms/evm/protocols/core/package.json index 54f771e39..5670e7f5f 100644 --- a/platforms/evm/protocols/core/package.json +++ b/platforms/evm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-evm": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-evm": "0.14.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/package.json b/platforms/evm/protocols/portico/package.json index ddc79df4d..696801cc5 100644 --- a/platforms/evm/protocols/portico/package.json +++ b/platforms/evm/protocols/portico/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,10 +52,10 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-evm": "0.12.0", - "@wormhole-foundation/sdk-evm-core": "0.12.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-evm": "0.14.0", + "@wormhole-foundation/sdk-evm-core": "0.14.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.14.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/tokenBridge/package.json b/platforms/evm/protocols/tokenBridge/package.json index 637fec9b4..a7c4b8749 100644 --- a/platforms/evm/protocols/tokenBridge/package.json +++ b/platforms/evm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,9 +52,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-evm": "0.12.0", - "@wormhole-foundation/sdk-evm-core": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-evm": "0.14.0", + "@wormhole-foundation/sdk-evm-core": "0.14.0", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/solana/package.json b/platforms/solana/package.json index 00d18ea56..e3c762968 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", "rpc-websockets": "^7.10.0" }, "type": "module", diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index 1d4154bc6..1ee3c91c9 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -48,8 +48,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-solana": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-solana": "0.14.0", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index 0c8b3c5a3..b96ada539 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-solana": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-solana": "0.14.0", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index 4e3fefcd2..fab894ccb 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-solana": "0.12.0", - "@wormhole-foundation/sdk-solana-core": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-solana": "0.14.0", + "@wormhole-foundation/sdk-solana-core": "0.14.0", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/sui/package.json b/platforms/sui/package.json index 9a193ef8b..e8435d336 100644 --- a/platforms/sui/package.json +++ b/platforms/sui/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", "@mysten/sui.js": "^0.50.1" }, "type": "module", diff --git a/platforms/sui/protocols/cctp/package.json b/platforms/sui/protocols/cctp/package.json index 9f3953151..a09df5aa2 100644 --- a/platforms/sui/protocols/cctp/package.json +++ b/platforms/sui/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-cctp", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/wormhole-sdk-ts.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-sui": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-sui": "0.14.0" }, "type": "module", "exports": { @@ -72,4 +72,4 @@ } } } -} +} \ No newline at end of file diff --git a/platforms/sui/protocols/core/package.json b/platforms/sui/protocols/core/package.json index b8789ed1f..82b1836c0 100644 --- a/platforms/sui/protocols/core/package.json +++ b/platforms/sui/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-sui": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-sui": "0.14.0" }, "type": "module", "exports": { diff --git a/platforms/sui/protocols/tokenBridge/package.json b/platforms/sui/protocols/tokenBridge/package.json index 1452f8621..791f130c6 100644 --- a/platforms/sui/protocols/tokenBridge/package.json +++ b/platforms/sui/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,9 +46,9 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-sui": "0.12.0", - "@wormhole-foundation/sdk-sui-core": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-sui": "0.14.0", + "@wormhole-foundation/sdk-sui-core": "0.14.0" }, "type": "module", "exports": { diff --git a/sdk/package.json b/sdk/package.json index 0c99c5212..4a9d15fcc 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk", - "version": "0.12.0", + "version": "0.14.0", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -384,31 +384,31 @@ } }, "dependencies": { - "@wormhole-foundation/sdk-base": "0.12.0", - "@wormhole-foundation/sdk-definitions": "0.12.0", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-evm": "0.12.0", - "@wormhole-foundation/sdk-evm-core": "0.12.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.12.0", - "@wormhole-foundation/sdk-evm-portico": "0.12.0", - "@wormhole-foundation/sdk-evm-cctp": "0.12.0", - "@wormhole-foundation/sdk-solana": "0.12.0", - "@wormhole-foundation/sdk-solana-core": "0.12.0", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.12.0", - "@wormhole-foundation/sdk-solana-cctp": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.12.0", - "@wormhole-foundation/sdk-sui": "0.12.0", - "@wormhole-foundation/sdk-sui-core": "0.12.0", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.12.0", - "@wormhole-foundation/sdk-aptos": "0.12.0", - "@wormhole-foundation/sdk-aptos-core": "0.12.0", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.12.0", - "@wormhole-foundation/sdk-algorand": "0.12.0", - "@wormhole-foundation/sdk-algorand-core": "0.12.0", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.12.0" + "@wormhole-foundation/sdk-base": "0.14.0", + "@wormhole-foundation/sdk-definitions": "0.14.0", + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-evm": "0.14.0", + "@wormhole-foundation/sdk-evm-core": "0.14.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.14.0", + "@wormhole-foundation/sdk-evm-portico": "0.14.0", + "@wormhole-foundation/sdk-evm-cctp": "0.14.0", + "@wormhole-foundation/sdk-solana": "0.14.0", + "@wormhole-foundation/sdk-solana-core": "0.14.0", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.14.0", + "@wormhole-foundation/sdk-solana-cctp": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.14.0", + "@wormhole-foundation/sdk-sui": "0.14.0", + "@wormhole-foundation/sdk-sui-core": "0.14.0", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.14.0", + "@wormhole-foundation/sdk-aptos": "0.14.0", + "@wormhole-foundation/sdk-aptos-core": "0.14.0", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.14.0", + "@wormhole-foundation/sdk-algorand": "0.14.0", + "@wormhole-foundation/sdk-algorand-core": "0.14.0", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.14.0" }, "type": "module" } \ No newline at end of file From cf07b6a7bca9cd59f2a94d7c3f1aeeca702c87ca Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Thu, 31 Oct 2024 13:05:03 -0400 Subject: [PATCH 53/69] Disable Sui CCTP (#729) * disable Sui CCTP * ignore sui cctp package for now * bump versions --- core/base/src/constants/circle.ts | 1 - core/base/src/constants/contracts/circle.ts | 4 +- package-lock.json | 228 +++++++++----------- package.json | 3 +- platforms/sui/protocols/cctp/src/index.ts | 3 + sdk/src/platforms/sui.ts | 3 +- 6 files changed, 113 insertions(+), 129 deletions(-) diff --git a/core/base/src/constants/circle.ts b/core/base/src/constants/circle.ts index ed6d6f85e..8c2896c97 100644 --- a/core/base/src/constants/circle.ts +++ b/core/base/src/constants/circle.ts @@ -19,7 +19,6 @@ const usdcContracts = [[ ["Solana", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"], ["Base", "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"], ["Polygon", "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359"], - ["Sui", "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC"], ]], [ "Testnet", [ ["Sepolia", "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"], diff --git a/core/base/src/constants/contracts/circle.ts b/core/base/src/constants/contracts/circle.ts index 83da6ba4c..92b61ffd9 100644 --- a/core/base/src/constants/contracts/circle.ts +++ b/core/base/src/constants/contracts/circle.ts @@ -55,8 +55,8 @@ export const circleContracts = [[ wormhole: "0x0FF28217dCc90372345954563486528aa865cDd6", }], [ "Sui", { - tokenMessenger: "0x410d70c8baad60f310f45c13b9656ecbfed46fdf970e051f0cac42891a848856", - messageTransmitter: "0x34c884874be4cb4b84e79fa280d7b041f186f4d1ef08be1dc74b20e94376951a", + tokenMessenger: "", + messageTransmitter: "", wormholeRelayer: "", wormhole: "", }], diff --git a/package-lock.json b/package-lock.json index 4f8ad19bc..1a36d212b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ts-sdk", - "version": "0.12.0", + "version": "0.14.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ts-sdk", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "workspaces": [ "core/base", @@ -32,7 +32,6 @@ "platforms/sui", "platforms/sui/protocols/core", "platforms/sui/protocols/tokenBridge", - "platforms/sui/protocols/cctp", "platforms/aptos", "platforms/aptos/protocols/core", "platforms/aptos/protocols/tokenBridge", @@ -60,11 +59,11 @@ }, "connect": { "name": "@wormhole-foundation/sdk-connect", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-base": "0.12.0", - "@wormhole-foundation/sdk-definitions": "0.12.0", + "@wormhole-foundation/sdk-base": "0.14.0", + "@wormhole-foundation/sdk-definitions": "0.14.0", "axios": "^1.4.0" }, "engines": { @@ -73,7 +72,7 @@ }, "core/base": { "name": "@wormhole-foundation/sdk-base", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { "@scure/base": "^1.1.3" @@ -81,11 +80,11 @@ }, "core/definitions": { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.12.0", + "version": "0.14.0", "dependencies": { "@noble/curves": "^1.4.0", "@noble/hashes": "^1.3.1", - "@wormhole-foundation/sdk-base": "0.12.0" + "@wormhole-foundation/sdk-base": "0.14.0" } }, "core/definitions/node_modules/@noble/curves": { @@ -110,10 +109,10 @@ }, "core/icons": { "name": "@wormhole-foundation/sdk-icons", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-base": "0.12.0" + "@wormhole-foundation/sdk-base": "0.14.0" }, "devDependencies": { "tsx": "^4.7.0" @@ -121,10 +120,10 @@ }, "examples": { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk": "0.12.0" + "@wormhole-foundation/sdk": "0.14.0" }, "devDependencies": { "dotenv": "^16.3.1", @@ -2932,10 +2931,6 @@ "resolved": "platforms/sui", "link": true }, - "node_modules/@wormhole-foundation/sdk-sui-cctp": { - "resolved": "platforms/sui/protocols/cctp", - "link": true - }, "node_modules/@wormhole-foundation/sdk-sui-core": { "resolved": "platforms/sui/protocols/core", "link": true @@ -8977,10 +8972,10 @@ }, "platforms/algorand": { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", "algosdk": "2.7.0" }, "engines": { @@ -8989,11 +8984,11 @@ }, "platforms/algorand/protocols/core": { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.12.0", - "@wormhole-foundation/sdk-connect": "0.12.0" + "@wormhole-foundation/sdk-algorand": "0.14.0", + "@wormhole-foundation/sdk-connect": "0.14.0" }, "engines": { "node": ">=16" @@ -9001,12 +8996,12 @@ }, "platforms/algorand/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.12.0", - "@wormhole-foundation/sdk-algorand-core": "0.12.0", - "@wormhole-foundation/sdk-connect": "0.12.0" + "@wormhole-foundation/sdk-algorand": "0.14.0", + "@wormhole-foundation/sdk-algorand-core": "0.14.0", + "@wormhole-foundation/sdk-connect": "0.14.0" }, "engines": { "node": ">=16" @@ -9014,10 +9009,10 @@ }, "platforms/aptos": { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", "aptos": "1.21.0" }, "engines": { @@ -9026,11 +9021,11 @@ }, "platforms/aptos/protocols/core": { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.12.0", - "@wormhole-foundation/sdk-connect": "0.12.0" + "@wormhole-foundation/sdk-aptos": "0.14.0", + "@wormhole-foundation/sdk-connect": "0.14.0" }, "engines": { "node": ">=16" @@ -9038,11 +9033,11 @@ }, "platforms/aptos/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.12.0", - "@wormhole-foundation/sdk-connect": "0.12.0" + "@wormhole-foundation/sdk-aptos": "0.14.0", + "@wormhole-foundation/sdk-connect": "0.14.0" }, "engines": { "node": ">=16" @@ -9050,14 +9045,14 @@ }, "platforms/cosmwasm": { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", "cosmjs-types": "^0.9.0" }, "engines": { @@ -9066,14 +9061,14 @@ }, "platforms/cosmwasm/protocols/core": { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm": "0.14.0" }, "engines": { "node": ">=16" @@ -9081,15 +9076,15 @@ }, "platforms/cosmwasm/protocols/ibc": { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.14.0", "cosmjs-types": "^0.9.0" }, "engines": { @@ -9098,13 +9093,13 @@ }, "platforms/cosmwasm/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm": "0.14.0" }, "engines": { "node": ">=16" @@ -9112,10 +9107,10 @@ }, "platforms/evm": { "name": "@wormhole-foundation/sdk-evm", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", "ethers": "^6.5.1" }, "devDependencies": { @@ -9127,11 +9122,11 @@ }, "platforms/evm/protocols/cctp": { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-evm": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-evm": "0.14.0", "ethers": "^6.5.1" }, "engines": { @@ -9140,11 +9135,11 @@ }, "platforms/evm/protocols/core": { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-evm": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-evm": "0.14.0", "ethers": "^6.5.1" }, "engines": { @@ -9153,13 +9148,13 @@ }, "platforms/evm/protocols/portico": { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-evm": "0.12.0", - "@wormhole-foundation/sdk-evm-core": "0.12.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-evm": "0.14.0", + "@wormhole-foundation/sdk-evm-core": "0.14.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.14.0", "ethers": "^6.5.1" }, "engines": { @@ -9168,12 +9163,12 @@ }, "platforms/evm/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-evm": "0.12.0", - "@wormhole-foundation/sdk-evm-core": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-evm": "0.14.0", + "@wormhole-foundation/sdk-evm-core": "0.14.0", "ethers": "^6.5.1" }, "engines": { @@ -9182,14 +9177,14 @@ }, "platforms/solana": { "name": "@wormhole-foundation/sdk-solana", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.12.0", + "@wormhole-foundation/sdk-connect": "0.14.0", "rpc-websockets": "^7.10.0" }, "devDependencies": { @@ -9201,14 +9196,14 @@ }, "platforms/solana/protocols/cctp": { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-solana": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-solana": "0.14.0" }, "engines": { "node": ">=16" @@ -9216,14 +9211,14 @@ }, "platforms/solana/protocols/core": { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-solana": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-solana": "0.14.0" }, "engines": { "node": ">=16" @@ -9231,15 +9226,15 @@ }, "platforms/solana/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-solana": "0.12.0", - "@wormhole-foundation/sdk-solana-core": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-solana": "0.14.0", + "@wormhole-foundation/sdk-solana-core": "0.14.0" }, "engines": { "node": ">=16" @@ -9247,24 +9242,11 @@ }, "platforms/sui": { "name": "@wormhole-foundation/sdk-sui", - "version": "0.12.0", - "license": "Apache-2.0", - "dependencies": { - "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.12.0" - }, - "engines": { - "node": ">=16" - } - }, - "platforms/sui/protocols/cctp": { - "name": "@wormhole-foundation/sdk-sui-cctp", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-sui": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0" }, "engines": { "node": ">=16" @@ -9272,12 +9254,12 @@ }, "platforms/sui/protocols/core": { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-sui": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-sui": "0.14.0" }, "engines": { "node": ">=16" @@ -9285,13 +9267,13 @@ }, "platforms/sui/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-sui": "0.12.0", - "@wormhole-foundation/sdk-sui-core": "0.12.0" + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-sui": "0.14.0", + "@wormhole-foundation/sdk-sui-core": "0.14.0" }, "engines": { "node": ">=16" @@ -9299,34 +9281,34 @@ }, "sdk": { "name": "@wormhole-foundation/sdk", - "version": "0.12.0", + "version": "0.14.0", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.12.0", - "@wormhole-foundation/sdk-algorand-core": "0.12.0", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.12.0", - "@wormhole-foundation/sdk-aptos": "0.12.0", - "@wormhole-foundation/sdk-aptos-core": "0.12.0", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.12.0", - "@wormhole-foundation/sdk-base": "0.12.0", - "@wormhole-foundation/sdk-connect": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.12.0", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.12.0", - "@wormhole-foundation/sdk-definitions": "0.12.0", - "@wormhole-foundation/sdk-evm": "0.12.0", - "@wormhole-foundation/sdk-evm-cctp": "0.12.0", - "@wormhole-foundation/sdk-evm-core": "0.12.0", - "@wormhole-foundation/sdk-evm-portico": "0.12.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.12.0", - "@wormhole-foundation/sdk-solana": "0.12.0", - "@wormhole-foundation/sdk-solana-cctp": "0.12.0", - "@wormhole-foundation/sdk-solana-core": "0.12.0", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.12.0", - "@wormhole-foundation/sdk-sui": "0.12.0", - "@wormhole-foundation/sdk-sui-core": "0.12.0", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.12.0" + "@wormhole-foundation/sdk-algorand": "0.14.0", + "@wormhole-foundation/sdk-algorand-core": "0.14.0", + "@wormhole-foundation/sdk-algorand-tokenbridge": "0.14.0", + "@wormhole-foundation/sdk-aptos": "0.14.0", + "@wormhole-foundation/sdk-aptos-core": "0.14.0", + "@wormhole-foundation/sdk-aptos-tokenbridge": "0.14.0", + "@wormhole-foundation/sdk-base": "0.14.0", + "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm-core": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm-ibc": "0.14.0", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.14.0", + "@wormhole-foundation/sdk-definitions": "0.14.0", + "@wormhole-foundation/sdk-evm": "0.14.0", + "@wormhole-foundation/sdk-evm-cctp": "0.14.0", + "@wormhole-foundation/sdk-evm-core": "0.14.0", + "@wormhole-foundation/sdk-evm-portico": "0.14.0", + "@wormhole-foundation/sdk-evm-tokenbridge": "0.14.0", + "@wormhole-foundation/sdk-solana": "0.14.0", + "@wormhole-foundation/sdk-solana-cctp": "0.14.0", + "@wormhole-foundation/sdk-solana-core": "0.14.0", + "@wormhole-foundation/sdk-solana-tokenbridge": "0.14.0", + "@wormhole-foundation/sdk-sui": "0.14.0", + "@wormhole-foundation/sdk-sui-core": "0.14.0", + "@wormhole-foundation/sdk-sui-tokenbridge": "0.14.0" }, "engines": { "node": ">=16" diff --git a/package.json b/package.json index 98d5d1180..34e913d8c 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,6 @@ "platforms/sui", "platforms/sui/protocols/core", "platforms/sui/protocols/tokenBridge", - "platforms/sui/protocols/cctp", "platforms/aptos", "platforms/aptos/protocols/core", "platforms/aptos/protocols/tokenBridge", @@ -68,4 +67,4 @@ "unreleased": [ "tokenRegistry" ] -} \ No newline at end of file +} diff --git a/platforms/sui/protocols/cctp/src/index.ts b/platforms/sui/protocols/cctp/src/index.ts index 25f4c581a..f49b2ed69 100644 --- a/platforms/sui/protocols/cctp/src/index.ts +++ b/platforms/sui/protocols/cctp/src/index.ts @@ -1,6 +1,9 @@ +// TODO uncomment when enabling Sui CCTP +/* import { registerProtocol } from '@wormhole-foundation/sdk-connect'; import { SuiCircleBridge } from "./circleBridge.js"; registerProtocol("Sui", "CircleBridge", SuiCircleBridge); export * from './circleBridge.js'; +*/ diff --git a/sdk/src/platforms/sui.ts b/sdk/src/platforms/sui.ts index 224a8fa9a..a6503b738 100644 --- a/sdk/src/platforms/sui.ts +++ b/sdk/src/platforms/sui.ts @@ -9,7 +9,8 @@ const sui: PlatformDefinition = { protocols: { WormholeCore: () => import("@wormhole-foundation/sdk-sui-core"), TokenBridge: () => import("@wormhole-foundation/sdk-sui-tokenbridge"), - CircleBridge: () => import("@wormhole-foundation/sdk-sui-cctp"), + // TODO uncomment when enabling Sui CCTP + //CircleBridge: () => import("@wormhole-foundation/sdk-sui-cctp"), }, getChain: (network, chain, overrides?) => new _sui.SuiChain( From 074b9aab5afa80669ca9d38e1d14c0c37627b8fe Mon Sep 17 00:00:00 2001 From: yuli-ferna <35125931+yuli-ferna@users.noreply.github.com> Date: Fri, 1 Nov 2024 10:03:14 -0400 Subject: [PATCH 54/69] Include Spl Token 2022 in getBalances (#728) * Include Spl Token 2022 in getBalances * Review change --- platforms/solana/src/platform.ts | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/platforms/solana/src/platform.ts b/platforms/solana/src/platform.ts index 43395cf97..5f133e71a 100644 --- a/platforms/solana/src/platform.ts +++ b/platforms/solana/src/platform.ts @@ -19,8 +19,9 @@ import { } from '@wormhole-foundation/sdk-connect'; import { SolanaChain } from './chain.js'; -import { TOKEN_PROGRAM_ID } from '@solana/spl-token'; +import { TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID } from '@solana/spl-token'; import type { + AccountInfo, Commitment, ConnectionConfig, ParsedAccountData, @@ -150,19 +151,24 @@ export class SolanaPlatform native = BigInt(await rpc.getBalance(new PublicKey(walletAddress))); } - const splParsedTokenAccounts = await rpc.getParsedTokenAccountsByOwner( - new PublicKey(walletAddress), - { - programId: new PublicKey(TOKEN_PROGRAM_ID), - }, - ); + const splParsedTokenAccounts = (await Promise.all( + [TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID] + .map(pid => new PublicKey(pid)) + .map(programId => rpc.getParsedTokenAccountsByOwner(new PublicKey(walletAddress), { programId }) + ))).reduce<{ + pubkey: PublicKey; + account: AccountInfo; + }[] + >((acc, val) => { + return acc.concat(val.value); + }, []); const balancesArr = tokens.map((token) => { if (isNative(token)) { return { ['native']: native }; } const addrString = new SolanaAddress(token).toString(); - const amount = splParsedTokenAccounts.value.find( + const amount = splParsedTokenAccounts.find( (v) => v?.account.data.parsed?.info?.mint === token, )?.account.data.parsed?.info?.tokenAmount?.amount; if (!amount) return { [addrString]: null }; From 870323f5417ca49f1eb3cd96e94cee1ba11b1759 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Tue, 5 Nov 2024 12:08:09 -0600 Subject: [PATCH 55/69] Add MonadDevnet blocktime (#732) --- core/base/src/constants/finality.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/core/base/src/constants/finality.ts b/core/base/src/constants/finality.ts index cff29db91..9a669fdd3 100644 --- a/core/base/src/constants/finality.ts +++ b/core/base/src/constants/finality.ts @@ -112,6 +112,7 @@ const blockTimeMilliseconds = [ ["Kujira", 3_000], ["Mantle", 2_000], ["Moonbeam", 12_000], + ["MonadDevnet", 1_000], ["Near", 1_500], ["Neon", 30_000], ["Oasis", 6_000], From 9396746da129eda1296fd43794e9e66c11ef39cb Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Thu, 7 Nov 2024 11:38:32 -0600 Subject: [PATCH 56/69] use 72 blocks for eth finality which should cover p75 (#733) * use 72 blocks for eth finality which should cover p75 finality is somewhere between 64 and 95 blocks * fix tests --- core/base/__tests__/finality.ts | 4 ++-- core/base/src/constants/finality.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/base/__tests__/finality.ts b/core/base/__tests__/finality.ts index c78923a09..7a6fcfbca 100644 --- a/core/base/__tests__/finality.ts +++ b/core/base/__tests__/finality.ts @@ -7,7 +7,7 @@ import { describe("Finality tests", function () { test("Receive expected number of rounds", () => { - expect(finalityThreshold("Ethereum")).toEqual(96); + expect(finalityThreshold("Ethereum")).toEqual(72); expect(finalityThreshold("Algorand")).toEqual(0); expect(finalityThreshold("Solana")).toEqual(32); }); @@ -41,7 +41,7 @@ describe("Finality tests", function () { test("Estimates rounds from finalized consistency level", () => { // 100 + (# final rounds) expect(consistencyLevelToBlock("Ethereum", ConsistencyLevels.Finalized, fromBlock)).toEqual( - fromBlock + 96n, + fromBlock + 72n, ); expect(consistencyLevelToBlock("Solana", ConsistencyLevels.Finalized, fromBlock)).toEqual( fromBlock + 32n, diff --git a/core/base/src/constants/finality.ts b/core/base/src/constants/finality.ts index 9a669fdd3..94e0360c1 100644 --- a/core/base/src/constants/finality.ts +++ b/core/base/src/constants/finality.ts @@ -26,7 +26,7 @@ export const safeThreshold = constMap(safeThresholds); // Number of blocks before a transaction is considered "final" const finalityThresholds = [ ["Solana", 32], - ["Ethereum", 96], + ["Ethereum", 72], // between 64 and 95 blocks; use 72 as a middle ground ["Bsc", 15], // Checkpointed to L1 after ~512 blocks ["Optimism", 512], From d847b4df3c59fbefba9685676efc31fa088951ff Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Fri, 8 Nov 2024 10:32:15 -0600 Subject: [PATCH 57/69] sui: getCoinType native token address fix (#734) * sui: getCoinType native token address fix Fixes #730 * change error msg --- platforms/sui/__tests__/unit/address.test.ts | 15 +++++++++++++++ platforms/sui/src/address.ts | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/platforms/sui/__tests__/unit/address.test.ts b/platforms/sui/__tests__/unit/address.test.ts index 9d2ba352a..91f747608 100644 --- a/platforms/sui/__tests__/unit/address.test.ts +++ b/platforms/sui/__tests__/unit/address.test.ts @@ -9,11 +9,26 @@ describe("Sui Address Tests", () => { expect(address.toString()).toEqual( "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI", ); + expect(address.getCoinType()).toEqual(SUI_COIN); const acctAddress = "0xc90949fd7ff3c13fd0b586a10547b5ca1212edc2c170e368d1dea00c01fea62b"; address = new SuiAddress(acctAddress); expect(address).toBeTruthy(); expect(address.toString()).toEqual(acctAddress); + + const wrappedTokenAddress = + "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN"; + address = new SuiAddress(wrappedTokenAddress); + expect(address).toBeTruthy(); + expect(address.toString()).toEqual(wrappedTokenAddress); + expect(address.getCoinType()).toEqual(wrappedTokenAddress); + + const nativeTokenAddress = + "0xfa7ac3951fdca92c5200d468d31a365eb03b2be9936fde615e69f0c1274ad3a0::BLUB::BLUB"; + address = new SuiAddress(nativeTokenAddress); + expect(address).toBeTruthy(); + expect(address.toString()).toEqual(nativeTokenAddress); + expect(address.getCoinType()).toEqual(nativeTokenAddress); }); test("An invalid address is rejected", () => { diff --git a/platforms/sui/src/address.ts b/platforms/sui/src/address.ts index 00ab2fb42..4ca20beeb 100644 --- a/platforms/sui/src/address.ts +++ b/platforms/sui/src/address.ts @@ -113,7 +113,12 @@ export class SuiAddress implements Address { if (this.module === "sui::SUI") { return SUI_COIN; } - return [this.getPackageId(), "coin", "COIN"].join(SUI_SEPARATOR); + + if (!this.module) { + throw new Error("No module present in Sui token address"); + } + + return this.unwrap(); } static instanceof(address: any): address is SuiAddress { From 4dd079504ba71ab7292653b25718fdfac752c1e6 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Mon, 11 Nov 2024 09:52:06 -0600 Subject: [PATCH 58/69] removed automatic route isAvailable method (#720) * removed comment * removed isAvailable method * removed imports --- connect/__tests__/mocks/routes/automatic.ts | 4 ---- connect/src/routes/cctp/automatic.ts | 4 ---- connect/src/routes/portico/automatic.ts | 4 ---- connect/src/routes/resolver.ts | 23 +----------------- connect/src/routes/route.ts | 4 +--- connect/src/routes/tokenBridge/automatic.ts | 26 ++++++++++----------- 6 files changed, 15 insertions(+), 50 deletions(-) diff --git a/connect/__tests__/mocks/routes/automatic.ts b/connect/__tests__/mocks/routes/automatic.ts index f13be9ced..f95d57713 100644 --- a/connect/__tests__/mocks/routes/automatic.ts +++ b/connect/__tests__/mocks/routes/automatic.ts @@ -64,10 +64,6 @@ export class AutomaticMockRoute return true; } - async isAvailable(): Promise { - return true; - } - async validate( request: RouteTransferRequest, params: TransferParams, diff --git a/connect/src/routes/cctp/automatic.ts b/connect/src/routes/cctp/automatic.ts index 5f600fafc..c3b4fd8c0 100644 --- a/connect/src/routes/cctp/automatic.ts +++ b/connect/src/routes/cctp/automatic.ts @@ -110,10 +110,6 @@ export class AutomaticCCTPRoute }; } - async isAvailable(): Promise { - return true; - } - async validate(request: RouteTransferRequest, params: Tp): Promise { try { const options = params.options ?? this.getDefaultOptions(); diff --git a/connect/src/routes/portico/automatic.ts b/connect/src/routes/portico/automatic.ts index b8bf35404..5803e66fa 100644 --- a/connect/src/routes/portico/automatic.ts +++ b/connect/src/routes/portico/automatic.ts @@ -144,10 +144,6 @@ export class AutomaticPorticoRoute return chain.supportsPorticoBridge(); } - async isAvailable(): Promise { - return true; - } - getDefaultOptions(): OP { return {}; } diff --git a/connect/src/routes/resolver.ts b/connect/src/routes/resolver.ts index 9e66a248e..043106c14 100644 --- a/connect/src/routes/resolver.ts +++ b/connect/src/routes/resolver.ts @@ -8,9 +8,7 @@ import { import type { Wormhole } from "../wormhole.js"; import type { RouteTransferRequest } from "./request.js"; import type { Route, RouteConstructor } from "./route.js"; -import { isAutomatic } from "./route.js"; import { uniqueTokens } from "./token.js"; -import type { Options, Receipt, ValidatedTransferParams } from "./types.js"; export class RouteResolver { wh: Wormhole; @@ -102,25 +100,6 @@ export class RouteResolver { this.routeConstructors.filter((_, index) => routesSupported[index]), ); - // Next, we make sure all supported routes are available. For relayed routes, this will ping - // the relayer to make sure it's online. - return await Promise.all( - supportedRoutes.map( - async ( - rc, - ): Promise<[Route, Receipt>, boolean]> => { - const route = new rc(this.wh); - try { - const available = isAutomatic(route) ? await route.isAvailable(request) : true; - return [route, available]; - } catch (e) { - console.error(`failed to check if route is available for ${rc.meta.name}: `, e); - return [route, false]; - } - }, - ), - ) - .then((availableRoutes) => availableRoutes.filter(([_, available]) => available)) - .then((availableRoutes) => availableRoutes.map(([route, _]) => route!)); + return supportedRoutes.map((rc) => new rc(this.wh)); } } diff --git a/connect/src/routes/route.ts b/connect/src/routes/route.ts index 04528f075..cb92f2ea4 100644 --- a/connect/src/routes/route.ts +++ b/connect/src/routes/route.ts @@ -113,12 +113,10 @@ export abstract class AutomaticRoute< R extends Receipt = Receipt, > extends Route { static IS_AUTOMATIC = true; - // TODO: search for usagees and update arg - public abstract isAvailable(request: RouteTransferRequest): Promise; } export function isAutomatic(route: Route): route is AutomaticRoute { - return (route as AutomaticRoute).isAvailable !== undefined && (route.constructor as RouteConstructor).IS_AUTOMATIC; + return !!(route.constructor as RouteConstructor).IS_AUTOMATIC; } /** diff --git a/connect/src/routes/tokenBridge/automatic.ts b/connect/src/routes/tokenBridge/automatic.ts index 0aeee76f2..48dcc79e7 100644 --- a/connect/src/routes/tokenBridge/automatic.ts +++ b/connect/src/routes/tokenBridge/automatic.ts @@ -14,9 +14,7 @@ import { TransferState } from "../../types.js"; import { Wormhole } from "../../wormhole.js"; import type { StaticRouteMethods } from "../route.js"; import { AutomaticRoute } from "../route.js"; -import { - MinAmountError, -} from '../types.js'; +import { MinAmountError } from "../types.js"; import type { Quote, QuoteResult, @@ -121,16 +119,6 @@ export class AutomaticTokenBridgeRoute return { nativeGas: 0.0 }; } - async isAvailable(request: RouteTransferRequest): Promise { - const atb = await request.fromChain.getAutomaticTokenBridge(); - - if (isTokenId(request.source.id)) { - return await atb.isRegisteredToken(request.source.id.address); - } - - return true; - } - async validate(request: RouteTransferRequest, params: Tp): Promise { try { const options = params.options ?? this.getDefaultOptions(); @@ -219,6 +207,18 @@ export class AutomaticTokenBridgeRoute } async quote(request: RouteTransferRequest, params: Vp): Promise { + const atb = await request.fromChain.getAutomaticTokenBridge(); + + if (isTokenId(request.source.id)) { + const isRegistered = await atb.isRegisteredToken(request.source.id.address); + if (!isRegistered) { + return { + success: false, + error: new Error("Source token is not registered"), + }; + } + } + try { let quote = await TokenTransfer.quoteTransfer(this.wh, request.fromChain, request.toChain, { automatic: true, From dd576e00b35cf0cace9c6a814192b69acf7233ce Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Tue, 12 Nov 2024 11:14:21 -0500 Subject: [PATCH 59/69] remove redundant method from Route interface (#736) --- connect/__tests__/mocks/routes/automatic.ts | 4 ---- connect/__tests__/mocks/routes/manual.ts | 4 ---- connect/src/routes/cctp/automatic.ts | 4 ---- connect/src/routes/cctp/manual.ts | 4 ---- connect/src/routes/portico/automatic.ts | 8 ++------ connect/src/routes/resolver.ts | 4 +--- connect/src/routes/route.ts | 2 -- connect/src/routes/tokenBridge/automatic.ts | 4 ---- connect/src/routes/tokenBridge/manual.ts | 4 ---- scripts/src/features.ts | 2 +- 10 files changed, 4 insertions(+), 36 deletions(-) diff --git a/connect/__tests__/mocks/routes/automatic.ts b/connect/__tests__/mocks/routes/automatic.ts index f95d57713..49b4b2b3b 100644 --- a/connect/__tests__/mocks/routes/automatic.ts +++ b/connect/__tests__/mocks/routes/automatic.ts @@ -60,10 +60,6 @@ export class AutomaticMockRoute return [nativeTokenId(toChain.chain)]; } - static isProtocolSupported(chain: ChainContext): boolean { - return true; - } - async validate( request: RouteTransferRequest, params: TransferParams, diff --git a/connect/__tests__/mocks/routes/manual.ts b/connect/__tests__/mocks/routes/manual.ts index b2aa13947..2893a4687 100644 --- a/connect/__tests__/mocks/routes/manual.ts +++ b/connect/__tests__/mocks/routes/manual.ts @@ -58,10 +58,6 @@ export class ManualMockRoute return [nativeTokenId(toChain.chain)]; } - static isProtocolSupported(chain: ChainContext): boolean { - return true; - } - async validate( request: RouteTransferRequest, params: TransferParams, diff --git a/connect/src/routes/cctp/automatic.ts b/connect/src/routes/cctp/automatic.ts index c3b4fd8c0..745d11fd4 100644 --- a/connect/src/routes/cctp/automatic.ts +++ b/connect/src/routes/cctp/automatic.ts @@ -100,10 +100,6 @@ export class AutomaticCCTPRoute return [Wormhole.chainAddress(chain, circle.usdcContract.get(network, chain)!)]; } - static isProtocolSupported(chain: ChainContext): boolean { - return chain.supportsAutomaticCircleBridge(); - } - getDefaultOptions(): Op { return { nativeGas: 0.0, diff --git a/connect/src/routes/cctp/manual.ts b/connect/src/routes/cctp/manual.ts index 28584066f..1ac1d53f7 100644 --- a/connect/src/routes/cctp/manual.ts +++ b/connect/src/routes/cctp/manual.ts @@ -93,10 +93,6 @@ export class CCTPRoute return [Wormhole.chainAddress(chain, circle.usdcContract.get(network, chain)!)]; } - static isProtocolSupported(chain: ChainContext): boolean { - return chain.supportsCircleBridge(); - } - getDefaultOptions(): Op { return { payload: undefined, diff --git a/connect/src/routes/portico/automatic.ts b/connect/src/routes/portico/automatic.ts index 5803e66fa..e86ff8457 100644 --- a/connect/src/routes/portico/automatic.ts +++ b/connect/src/routes/portico/automatic.ts @@ -140,10 +140,6 @@ export class AutomaticPorticoRoute .map((t) => t.token); } - static isProtocolSupported(chain: ChainContext): boolean { - return chain.supportsPorticoBridge(); - } - getDefaultOptions(): OP { return {}; } @@ -151,8 +147,8 @@ export class AutomaticPorticoRoute async validate(request: RouteTransferRequest, params: TP): Promise { try { if ( - !AutomaticPorticoRoute.isProtocolSupported(request.fromChain) || - !AutomaticPorticoRoute.isProtocolSupported(request.toChain) + !AutomaticPorticoRoute.supportedChains(request.fromChain.network).includes(request.fromChain.chain) || + !AutomaticPorticoRoute.supportedChains(request.toChain.network).includes(request.toChain.chain) ) { throw new Error("Protocol not supported"); } diff --git a/connect/src/routes/resolver.ts b/connect/src/routes/resolver.ts index 043106c14..a128ed3da 100644 --- a/connect/src/routes/resolver.ts +++ b/connect/src/routes/resolver.ts @@ -62,9 +62,7 @@ export class RouteResolver { const protocolSupported = rc.supportedNetworks().includes(this.wh.network) && rc.supportedChains(this.wh.network).includes(request.toChain.chain) && - rc.supportedChains(this.wh.network).includes(request.fromChain.chain) && - rc.isProtocolSupported(request.fromChain) && - rc.isProtocolSupported(request.toChain); + rc.supportedChains(this.wh.network).includes(request.fromChain.chain) const sourceTokenAddress = canonicalAddress( isNative(request.source.id.address) ? request.source.wrapped! : request.source.id, diff --git a/connect/src/routes/route.ts b/connect/src/routes/route.ts index cb92f2ea4..7479463a3 100644 --- a/connect/src/routes/route.ts +++ b/connect/src/routes/route.ts @@ -87,8 +87,6 @@ export interface RouteConstructor { supportedNetworks(): Network[]; /** get the list of chains this route supports */ supportedChains(network: Network): Chain[]; - /** check that the underlying protocols are supported */ - isProtocolSupported(chain: ChainContext): boolean; /** get the list of source tokens that are possible to send */ supportedSourceTokens(fromChain: ChainContext): Promise; /** get the list of destination tokens that may be received on the destination chain */ diff --git a/connect/src/routes/tokenBridge/automatic.ts b/connect/src/routes/tokenBridge/automatic.ts index 48dcc79e7..ea39c7488 100644 --- a/connect/src/routes/tokenBridge/automatic.ts +++ b/connect/src/routes/tokenBridge/automatic.ts @@ -111,10 +111,6 @@ export class AutomaticTokenBridgeRoute } } - static isProtocolSupported(chain: ChainContext): boolean { - return chain.supportsAutomaticTokenBridge(); - } - getDefaultOptions(): Op { return { nativeGas: 0.0 }; } diff --git a/connect/src/routes/tokenBridge/manual.ts b/connect/src/routes/tokenBridge/manual.ts index 672ad5280..c5e8ced79 100644 --- a/connect/src/routes/tokenBridge/manual.ts +++ b/connect/src/routes/tokenBridge/manual.ts @@ -89,10 +89,6 @@ export class TokenBridgeRoute } } - static isProtocolSupported(chain: ChainContext): boolean { - return chain.supportsTokenBridge(); - } - getDefaultOptions(): Op { return { payload: undefined }; } diff --git a/scripts/src/features.ts b/scripts/src/features.ts index ca86212a9..6a916c1f9 100644 --- a/scripts/src/features.ts +++ b/scripts/src/features.ts @@ -65,7 +65,7 @@ function getSupportmatrix(n: Network) { for (const chain of chains) { try { const ctx = wh.getChain(chain as Chain); - protoSupport[name]![chain] = rc.isProtocolSupported(ctx); + protoSupport[name]![chain] = rc.supportedChains(ctx.network).includes(ctx.chain); } catch (e) { console.log("error on: ", chain); } From 46ffba0ca5fe5ceac0f2a93385b6d893827fe757 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Tue, 12 Nov 2024 11:17:35 -0600 Subject: [PATCH 60/69] 1.0.3 version bump (#735) --- connect/package.json | 6 +-- core/base/package.json | 2 +- core/definitions/package.json | 4 +- core/icons/package.json | 4 +- examples/package.json | 4 +- package.json | 4 +- platforms/algorand/package.json | 4 +- .../algorand/protocols/core/package.json | 6 +-- .../protocols/tokenBridge/package.json | 8 +-- platforms/aptos/package.json | 4 +- platforms/aptos/protocols/core/package.json | 6 +-- .../aptos/protocols/tokenBridge/package.json | 6 +-- platforms/cosmwasm/package.json | 4 +- .../cosmwasm/protocols/core/package.json | 6 +-- platforms/cosmwasm/protocols/ibc/package.json | 8 +-- .../protocols/tokenBridge/package.json | 6 +-- platforms/evm/package.json | 4 +- platforms/evm/protocols/cctp/package.json | 6 +-- platforms/evm/protocols/core/package.json | 6 +-- platforms/evm/protocols/portico/package.json | 10 ++-- .../evm/protocols/tokenBridge/package.json | 8 +-- platforms/solana/package.json | 4 +- platforms/solana/protocols/cctp/package.json | 6 +-- platforms/solana/protocols/core/package.json | 6 +-- .../solana/protocols/tokenBridge/package.json | 8 +-- platforms/sui/package.json | 4 +- platforms/sui/protocols/core/package.json | 6 +-- .../sui/protocols/tokenBridge/package.json | 8 +-- sdk/package.json | 52 +++++++++---------- 29 files changed, 105 insertions(+), 105 deletions(-) diff --git a/connect/package.json b/connect/package.json index d0c0415f4..fdc9646da 100644 --- a/connect/package.json +++ b/connect/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-connect", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -98,8 +98,8 @@ }, "dependencies": { "axios": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.14.0", - "@wormhole-foundation/sdk-definitions": "0.14.0" + "@wormhole-foundation/sdk-base": "1.0.3", + "@wormhole-foundation/sdk-definitions": "1.0.3" }, "type": "module" } \ No newline at end of file diff --git a/core/base/package.json b/core/base/package.json index 13671a519..fe6dfce41 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-base", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" diff --git a/core/definitions/package.json b/core/definitions/package.json index 774664e45..f47c08b86 100644 --- a/core/definitions/package.json +++ b/core/definitions/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -86,7 +86,7 @@ "dependencies": { "@noble/hashes": "^1.3.1", "@noble/curves": "^1.4.0", - "@wormhole-foundation/sdk-base": "0.14.0" + "@wormhole-foundation/sdk-base": "1.0.3" }, "type": "module" } \ No newline at end of file diff --git a/core/icons/package.json b/core/icons/package.json index 98f6c522e..40ffcc352 100644 --- a/core/icons/package.json +++ b/core/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-icons", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -50,7 +50,7 @@ "dist/cjs" ], "dependencies": { - "@wormhole-foundation/sdk-base": "0.14.0" + "@wormhole-foundation/sdk-base": "1.0.3" }, "sideEffects": false, "scripts": { diff --git a/examples/package.json b/examples/package.json index 8e5d5192d..9d4af61b7 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -51,6 +51,6 @@ "tsx": "^4.7.0" }, "dependencies": { - "@wormhole-foundation/sdk": "0.14.0" + "@wormhole-foundation/sdk": "1.0.3" } } \ No newline at end of file diff --git a/package.json b/package.json index 34e913d8c..7e26c10ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sdk", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "directories": { "test": "__tests__" @@ -67,4 +67,4 @@ "unreleased": [ "tokenRegistry" ] -} +} \ No newline at end of file diff --git a/platforms/algorand/package.json b/platforms/algorand/package.json index a0f613f20..37a95deee 100644 --- a/platforms/algorand/package.json +++ b/platforms/algorand/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -96,7 +96,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", "algosdk": "2.7.0" }, "type": "module" diff --git a/platforms/algorand/protocols/core/package.json b/platforms/algorand/protocols/core/package.json index 2a3752159..b31eaf72a 100644 --- a/platforms/algorand/protocols/core/package.json +++ b/platforms/algorand/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-algorand": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-algorand": "1.0.3" }, "type": "module", "exports": { diff --git a/platforms/algorand/protocols/tokenBridge/package.json b/platforms/algorand/protocols/tokenBridge/package.json index e13e8a109..91b79f489 100644 --- a/platforms/algorand/protocols/tokenBridge/package.json +++ b/platforms/algorand/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-algorand": "0.14.0", - "@wormhole-foundation/sdk-algorand-core": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-algorand": "1.0.3", + "@wormhole-foundation/sdk-algorand-core": "1.0.3" }, "type": "module", "exports": { diff --git a/platforms/aptos/package.json b/platforms/aptos/package.json index a9f725564..719f6f064 100644 --- a/platforms/aptos/package.json +++ b/platforms/aptos/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", "aptos": "1.21.0" }, "type": "module", diff --git a/platforms/aptos/protocols/core/package.json b/platforms/aptos/protocols/core/package.json index 872745fe6..542b0a7d3 100644 --- a/platforms/aptos/protocols/core/package.json +++ b/platforms/aptos/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-aptos": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-aptos": "1.0.3" }, "type": "module", "exports": { diff --git a/platforms/aptos/protocols/tokenBridge/package.json b/platforms/aptos/protocols/tokenBridge/package.json index ff91a5a71..c31c42bd7 100644 --- a/platforms/aptos/protocols/tokenBridge/package.json +++ b/platforms/aptos/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-aptos": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-aptos": "1.0.3" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/package.json b/platforms/cosmwasm/package.json index 9fbf67fef..4de33271b 100644 --- a/platforms/cosmwasm/package.json +++ b/platforms/cosmwasm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", diff --git a/platforms/cosmwasm/protocols/core/package.json b/platforms/cosmwasm/protocols/core/package.json index 62b132522..c26548a35 100644 --- a/platforms/cosmwasm/protocols/core/package.json +++ b/platforms/cosmwasm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm": "1.0.3", "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2" diff --git a/platforms/cosmwasm/protocols/ibc/package.json b/platforms/cosmwasm/protocols/ibc/package.json index f22063932..7ea0fdf1b 100644 --- a/platforms/cosmwasm/protocols/ibc/package.json +++ b/platforms/cosmwasm/protocols/ibc/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,9 +57,9 @@ "@cosmjs/stargate": "^0.32.0", "cosmjs-types": "^0.9.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm-core": "1.0.3" }, "type": "module", "exports": { diff --git a/platforms/cosmwasm/protocols/tokenBridge/package.json b/platforms/cosmwasm/protocols/tokenBridge/package.json index bde3ad304..f6d69b200 100644 --- a/platforms/cosmwasm/protocols/tokenBridge/package.json +++ b/platforms/cosmwasm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -54,8 +54,8 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.14.13-beta.2", "@cosmjs/cosmwasm-stargate": "^0.32.0", - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm": "1.0.3" }, "type": "module", "exports": { diff --git a/platforms/evm/package.json b/platforms/evm/package.json index 22448b5fe..64a981a1e 100644 --- a/platforms/evm/package.json +++ b/platforms/evm/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -57,7 +57,7 @@ "nock": "13.3.8" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/cctp/package.json b/platforms/evm/protocols/cctp/package.json index df2c3f85f..06e76c352 100644 --- a/platforms/evm/protocols/cctp/package.json +++ b/platforms/evm/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,8 +53,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-evm": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-evm": "1.0.3", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/core/package.json b/platforms/evm/protocols/core/package.json index 5670e7f5f..af98e064a 100644 --- a/platforms/evm/protocols/core/package.json +++ b/platforms/evm/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,8 +52,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-evm": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-evm": "1.0.3", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/portico/package.json b/platforms/evm/protocols/portico/package.json index 696801cc5..c6c7e9126 100644 --- a/platforms/evm/protocols/portico/package.json +++ b/platforms/evm/protocols/portico/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,10 +52,10 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-evm": "0.14.0", - "@wormhole-foundation/sdk-evm-core": "0.14.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-evm": "1.0.3", + "@wormhole-foundation/sdk-evm-core": "1.0.3", + "@wormhole-foundation/sdk-evm-tokenbridge": "1.0.3", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/evm/protocols/tokenBridge/package.json b/platforms/evm/protocols/tokenBridge/package.json index a7c4b8749..b07fe30f3 100644 --- a/platforms/evm/protocols/tokenBridge/package.json +++ b/platforms/evm/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -52,9 +52,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-evm": "0.14.0", - "@wormhole-foundation/sdk-evm-core": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-evm": "1.0.3", + "@wormhole-foundation/sdk-evm-core": "1.0.3", "ethers": "^6.5.1" }, "type": "module", diff --git a/platforms/solana/package.json b/platforms/solana/package.json index e3c762968..3203f11ab 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -53,7 +53,7 @@ "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", "rpc-websockets": "^7.10.0" }, "type": "module", diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index 1ee3c91c9..f3dcf52f0 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -48,8 +48,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-solana": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-solana": "1.0.3", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index b96ada539..ffb1e7bf0 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,8 +45,8 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-solana": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-solana": "1.0.3", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", "@solana/web3.js": "^1.95.2" diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index fab894ccb..64bc8fb81 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -45,9 +45,9 @@ "prettier": "prettier --write ./src" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-solana": "0.14.0", - "@wormhole-foundation/sdk-solana-core": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-solana": "1.0.3", + "@wormhole-foundation/sdk-solana-core": "1.0.3", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2" diff --git a/platforms/sui/package.json b/platforms/sui/package.json index e8435d336..cd41b771c 100644 --- a/platforms/sui/package.json +++ b/platforms/sui/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,7 +46,7 @@ "test": "jest --config ./jest.config.ts" }, "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", "@mysten/sui.js": "^0.50.1" }, "type": "module", diff --git a/platforms/sui/protocols/core/package.json b/platforms/sui/protocols/core/package.json index 82b1836c0..123c9bfc5 100644 --- a/platforms/sui/protocols/core/package.json +++ b/platforms/sui/protocols/core/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,8 +46,8 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-sui": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-sui": "1.0.3" }, "type": "module", "exports": { diff --git a/platforms/sui/protocols/tokenBridge/package.json b/platforms/sui/protocols/tokenBridge/package.json index 791f130c6..d91a9c389 100644 --- a/platforms/sui/protocols/tokenBridge/package.json +++ b/platforms/sui/protocols/tokenBridge/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -46,9 +46,9 @@ }, "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-sui": "0.14.0", - "@wormhole-foundation/sdk-sui-core": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-sui": "1.0.3", + "@wormhole-foundation/sdk-sui-core": "1.0.3" }, "type": "module", "exports": { diff --git a/sdk/package.json b/sdk/package.json index 4a9d15fcc..acfff583b 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@wormhole-foundation/sdk", - "version": "0.14.0", + "version": "1.0.3", "repository": { "type": "git", "url": "git+https://github.com/wormhole-foundation/connect-sdk.git" @@ -384,31 +384,31 @@ } }, "dependencies": { - "@wormhole-foundation/sdk-base": "0.14.0", - "@wormhole-foundation/sdk-definitions": "0.14.0", - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-evm": "0.14.0", - "@wormhole-foundation/sdk-evm-core": "0.14.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.14.0", - "@wormhole-foundation/sdk-evm-portico": "0.14.0", - "@wormhole-foundation/sdk-evm-cctp": "0.14.0", - "@wormhole-foundation/sdk-solana": "0.14.0", - "@wormhole-foundation/sdk-solana-core": "0.14.0", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.14.0", - "@wormhole-foundation/sdk-solana-cctp": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.14.0", - "@wormhole-foundation/sdk-sui": "0.14.0", - "@wormhole-foundation/sdk-sui-core": "0.14.0", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.14.0", - "@wormhole-foundation/sdk-aptos": "0.14.0", - "@wormhole-foundation/sdk-aptos-core": "0.14.0", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.14.0", - "@wormhole-foundation/sdk-algorand": "0.14.0", - "@wormhole-foundation/sdk-algorand-core": "0.14.0", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.14.0" + "@wormhole-foundation/sdk-base": "1.0.3", + "@wormhole-foundation/sdk-definitions": "1.0.3", + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-evm": "1.0.3", + "@wormhole-foundation/sdk-evm-core": "1.0.3", + "@wormhole-foundation/sdk-evm-tokenbridge": "1.0.3", + "@wormhole-foundation/sdk-evm-portico": "1.0.3", + "@wormhole-foundation/sdk-evm-cctp": "1.0.3", + "@wormhole-foundation/sdk-solana": "1.0.3", + "@wormhole-foundation/sdk-solana-core": "1.0.3", + "@wormhole-foundation/sdk-solana-tokenbridge": "1.0.3", + "@wormhole-foundation/sdk-solana-cctp": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm-core": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm-ibc": "1.0.3", + "@wormhole-foundation/sdk-sui": "1.0.3", + "@wormhole-foundation/sdk-sui-core": "1.0.3", + "@wormhole-foundation/sdk-sui-tokenbridge": "1.0.3", + "@wormhole-foundation/sdk-aptos": "1.0.3", + "@wormhole-foundation/sdk-aptos-core": "1.0.3", + "@wormhole-foundation/sdk-aptos-tokenbridge": "1.0.3", + "@wormhole-foundation/sdk-algorand": "1.0.3", + "@wormhole-foundation/sdk-algorand-core": "1.0.3", + "@wormhole-foundation/sdk-algorand-tokenbridge": "1.0.3" }, "type": "module" } \ No newline at end of file From a2ec72479dad7018e9dea56fbd73b5c1d2c219ac Mon Sep 17 00:00:00 2001 From: bruce-riley <96066700+bruce-riley@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:54:21 -0600 Subject: [PATCH 61/69] Ink testnet and Worldchain mainnet support (#737) --- core/base/src/constants/chains.ts | 1 + core/base/src/constants/contracts/core.ts | 2 ++ core/base/src/constants/contracts/tokenBridge.ts | 2 ++ core/base/src/constants/finality.ts | 1 + core/base/src/constants/nativeChainIds.ts | 2 ++ core/base/src/constants/platforms.ts | 1 + core/base/src/constants/rpc.ts | 2 ++ core/icons/src/constants/chainIcons.ts | 5 +++++ core/icons/src/images/chains/Ink.svg | 3 +++ 9 files changed, 19 insertions(+) create mode 100644 core/icons/src/images/chains/Ink.svg diff --git a/core/base/src/constants/chains.ts b/core/base/src/constants/chains.ts index dffca0d0a..6cb8ce014 100644 --- a/core/base/src/constants/chains.ts +++ b/core/base/src/constants/chains.ts @@ -50,6 +50,7 @@ const chainIdAndChainEntries = [ [ 43, "Snaxchain" ], [ 44, "Unichain" ], [ 45, "Worldchain" ], + [ 46, "Ink" ], [ 3104, "Wormchain" ], [ 4000, "Cosmoshub" ], [ 4001, "Evmos" ], diff --git a/core/base/src/constants/contracts/core.ts b/core/base/src/constants/contracts/core.ts index fb0a120b6..aa8201681 100644 --- a/core/base/src/constants/contracts/core.ts +++ b/core/base/src/constants/contracts/core.ts @@ -40,6 +40,7 @@ export const coreBridgeContracts = [[ ["Scroll", "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"], ["Mantle", "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"], ["Snaxchain", "0xc1BA3CC4bFE724A08FbbFbF64F8db196738665f4"], + ["Worldchain","0xcbcEe4e081464A15d8Ad5f58BB493954421eB506"], ]], [ "Testnet", [ ["Solana", "3u8hJUVTA4jH1wYAyUur7FFZVQ8H635K3tSHHF4ssjQ5"], @@ -87,6 +88,7 @@ export const coreBridgeContracts = [[ ["Snaxchain", "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"], ["Unichain", "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"], ["Worldchain", "0xe5E02cD12B6FcA153b0d7fF4bF55730AE7B3C93A"], + ["Ink", "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"], ["Xlayer", "0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"], ["Linea", "0x79A1027a6A159502049F10906D333EC57E95F083"], ["MonadDevnet", "0x376428e7f26D5867e69201b275553C45B09EE090"], diff --git a/core/base/src/constants/contracts/tokenBridge.ts b/core/base/src/constants/contracts/tokenBridge.ts index a4ca4ffad..5f48ab2fb 100644 --- a/core/base/src/constants/contracts/tokenBridge.ts +++ b/core/base/src/constants/contracts/tokenBridge.ts @@ -36,6 +36,7 @@ export const tokenBridgeContracts = [[ ["Scroll", "0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"], ["Mantle", "0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"], ["Snaxchain", "0x8B94bfE456B48a6025b92E11Be393BAa86e68410"], + ["Worldchain","0xc309275443519adca74c9136b02A38eF96E3a1f6"], ]], [ "Testnet", [ ["Solana", "DZnkkTmCiFWfYTfT41X3Rd1kDgozqzxWaHqsw6W4x2oe"], @@ -79,6 +80,7 @@ export const tokenBridgeContracts = [[ ["Snaxchain", "0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"], ["Unichain", "0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"], ["Worldchain", "0x430855B4D43b8AEB9D2B9869B74d58dda79C0dB2"], + ["Ink", "0x376428e7f26D5867e69201b275553C45B09EE090"], ["Linea", "0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"], ]], [ "Devnet", [ diff --git a/core/base/src/constants/finality.ts b/core/base/src/constants/finality.ts index 94e0360c1..a1640aa9a 100644 --- a/core/base/src/constants/finality.ts +++ b/core/base/src/constants/finality.ts @@ -62,6 +62,7 @@ const finalityThresholds = [ ["Snaxchain", 512], ["Unichain", 512], ["Worldchain",512], + ["Ink", 512], ["Cosmoshub", 0], ["Evmos", 0], ["Kujira", 0], diff --git a/core/base/src/constants/nativeChainIds.ts b/core/base/src/constants/nativeChainIds.ts index 84d6b1a8a..dabb83b03 100644 --- a/core/base/src/constants/nativeChainIds.ts +++ b/core/base/src/constants/nativeChainIds.ts @@ -54,6 +54,7 @@ const chainNetworkNativeChainIdEntries = [ ["Blast", 81457n], ["Linea", 59144n], ["Snaxchain", 2192n], + ["Worldchain",480n], ], ], [ @@ -108,6 +109,7 @@ const chainNetworkNativeChainIdEntries = [ ["Snaxchain", 13001n], ["Unichain", 1301n], ["Worldchain", 4801n], + ["Ink", 763373n], ["Xlayer", 195n], ["Linea", 59141n], // Sepolia ["MonadDevnet", 41454n], diff --git a/core/base/src/constants/platforms.ts b/core/base/src/constants/platforms.ts index af5419e83..919b7598b 100644 --- a/core/base/src/constants/platforms.ts +++ b/core/base/src/constants/platforms.ts @@ -39,6 +39,7 @@ const platformAndChainsEntries = [[ "Snaxchain", "Unichain", "Worldchain", + "Ink", "MonadDevnet", ]], [ "Solana", [ diff --git a/core/base/src/constants/rpc.ts b/core/base/src/constants/rpc.ts index cff7a9bd9..30aa6bcc1 100644 --- a/core/base/src/constants/rpc.ts +++ b/core/base/src/constants/rpc.ts @@ -46,6 +46,7 @@ const rpcConfig = [[ ["Mantle", "https://rpc.mantle.xyz"], ["Klaytn", "https://rpc.ankr.com/klaytn"], ["Snaxchain", "https://mainnet.snaxchain.io"], + ["Worldchain","https://worldchain-mainnet.g.alchemy.com/public"], ]], [ "Testnet", [ ["Ethereum", "https://eth-goerli.public.blastapi.io"], @@ -91,6 +92,7 @@ const rpcConfig = [[ ["Snaxchain", "https://testnet.snaxchain.io"], ["Unichain", "https://sepolia.unichain.org"], ["Worldchain", "https://worldchain-sepolia.g.alchemy.com/public"], + ["Ink", "https://rpc-qnd-sepolia.inkonchain.com"], ["MonadDevnet", ""], // TODO: No public rpc is currently available, override with a custom rpc for now. ]], [ "Devnet", [ diff --git a/core/icons/src/constants/chainIcons.ts b/core/icons/src/constants/chainIcons.ts index 026fb98a6..fe7acbae6 100644 --- a/core/icons/src/constants/chainIcons.ts +++ b/core/icons/src/constants/chainIcons.ts @@ -205,6 +205,11 @@ export function chainToIcon(chain: Chain): string { PREFIX + "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4gIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiMwMDAiIHJ4PSIyNTYiIC8+ICA8ZyBjbGlwLXBhdGg9InVybCgjd29ybGQtY2hhaW4tYSkiPiAgICA8bWFzayAgICAgIGlkPSJ3b3JsZC1jaGFpbi1iIiAgICAgIHdpZHRoPSIzMjkiICAgICAgaGVpZ2h0PSIzMjkiICAgICAgeD0iOTIiICAgICAgeT0iOTEiICAgICAgbWFza1VuaXRzPSJ1c2VyU3BhY2VPblVzZSIgICAgPiAgICAgIDxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik05MiA5MWgzMjl2MzI5SDkyVjkxWiIgLz4gICAgPC9tYXNrPiAgICA8ZyBtYXNrPSJ1cmwoI3dvcmxkLWNoYWluLWIpIj4gICAgICA8cGF0aCAgICAgICAgZmlsbD0iI2ZmZiIgICAgICAgIGQ9Ik00MDguMDQ5IDE5MS40NzJjLTguMjk0LTE5LjYwMS0yMC4xNDktMzcuMTY4LTM1LjI1MS01Mi4yNy0xNS4xMDItMTUuMTAzLTMyLjcwOC0yNi45NTctNTIuMjctMzUuMjUyQzMwMC4yMjIgOTUuMzQzIDI3OC43MDMgOTEgMjU2LjQ4MSA5MWMtMjIuMTg0IDAtNDMuNzQyIDQuMzQzLTY0LjA0OCAxMi45NTEtMTkuNjAxIDguMjk0LTM3LjE2OSAyMC4xNDktNTIuMjcgMzUuMjUxLTE1LjEwMiAxNS4xMDItMjYuOTU3IDMyLjcwOC0zNS4yNTIgNTIuMjdDOTYuMzQzIDIxMS43MzkgOTIgMjMzLjI5NyA5MiAyNTUuNDgxYzAgMjIuMTgzIDQuMzQzIDQzLjc0MSAxMi45NTEgNjQuMDQ3IDguMjk0IDE5LjYwMSAyMC4xNDkgMzcuMTY4IDM1LjI1MSA1Mi4yNyAxNS4xMDIgMTUuMTAyIDMyLjcwOCAyNi45NTcgNTIuMjcgMzUuMjUxQzIxMi43NzggNDE1LjYxOCAyMzQuMjk3IDQyMCAyNTYuNTE5IDQyMGMyMi4xODQgMCA0My43NDItNC4zNDMgNjQuMDQ4LTEyLjk1MSAxOS42MDEtOC4yOTQgMzcuMTY4LTIwLjE0OSA1Mi4yNy0zNS4yNTEgMTUuMTAyLTE1LjEwMiAyNi45NTctMzIuNzA4IDM1LjI1Mi01Mi4yNyA4LjU2OC0yMC4zMDYgMTIuOTUtNDEuODI1IDEyLjk1LTY0LjA0Ny0uMDM5LTIyLjE4NC00LjQyMS00My43NDItMTIuOTktNjQuMDA5Wm0tMjA2LjE4NyA0OC41NTRjNi44NDctMjYuMjkyIDMwLjc5MS00NS43MzcgNTkuMjM1LTQ1LjczN2gxMTQuMjA1YzcuMzU2IDE0LjIwMyAxMi4wNTEgMjkuNjU3IDEzLjg5IDQ1LjczN2gtMTg3LjMzWm0xODcuMzMgMzAuOTA5YTEzMi42ODYgMTMyLjY4NiAwIDAgMS0xMy44OSA0NS43MzdIMjYxLjA5N2MtMjguNDA1IDAtNTIuMzQ5LTE5LjQ0Ni01OS4yMzUtNDUuNzM3aDE4Ny4zM1pNMTYyLjAzMyAxNjEuMDMzYzI1LjIzNi0yNS4yMzUgNTguNzY1LTM5LjEyNCA5NC40NDgtMzkuMTI0IDM1LjY4MSAwIDY5LjIxMSAxMy44ODkgOTQuNDQ2IDM5LjEyNC43NjcuNzczIDEuNTI0IDEuNTU1IDIuMjcgMi4zNDhoLTkyLjFjLTI0LjYwOSAwLTQ3LjczMiA5LjU4Ni02NS4xNDMgMjYuOTk2LTEzLjY5MyAxMy42OTQtMjIuNTM1IDMwLjk0Ny0yNS43MDUgNDkuNjg4aC00Ni40NDFjMy40MDQtMjkuODUyIDE2LjY2Ny01Ny40NzQgMzguMjI1LTc5LjAzMlptOTQuNDQ4IDIyOC4wNThjLTM1LjY4MyAwLTY5LjIxMi0xMy44ODktOTQuNDQ4LTM5LjEyNC0yMS41NTgtMjEuNTU4LTM0LjgyMS00OS4xOC0zOC4yMjUtNzguOTkzaDQ2LjQ0MWMzLjEzIDE4Ljc0MSAxMi4wMTIgMzUuOTk1IDI1LjcwNSA0OS42ODkgMTcuNDExIDE3LjQxIDQwLjUzNCAyNi45OTYgNjUuMTQzIDI2Ljk5Nmg5Mi4xMzljLS43NDMuNzgyLTEuNTI2IDEuNTY0LTIuMjY5IDIuMzQ3LTI1LjIzNiAyNS4xNTctNTguODA1IDM5LjA4NS05NC40ODYgMzkuMDg1WiIgICAgICAvPiAgICA8L2c+ICA8L2c+ICA8ZGVmcz4gICAgPGNsaXBQYXRoIGlkPSJ3b3JsZC1jaGFpbi1hIj4gICAgICA8cGF0aCBmaWxsPSIjZmZmIiBkPSJNOTIgOTFoMzI5djMyOUg5MnoiIC8+ICAgIDwvY2xpcFBhdGg+ICA8L2RlZnM+PC9zdmc+" ); + } else if (chain === "Ink") { + return ( + PREFIX + + "PHN2ZyB3aWR0aD0iMjc1IiBoZWlnaHQ9IjI3NSIgdmlld0JveD0iMCAwIDI3NSAyNzUiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGZpbGxSdWxlPSJldmVub2RkIiBjbGlwUnVsZT0iZXZlbm9kZCIgZD0iTTI3NSAxMzcuNUMyNzUgNjEuNTYwOCAyMTMuNDM5IC0zLjMxOTQxZS0wNiAxMzcuNSAwQzYxLjU2MDggMy4zMTk0MWUtMDYgLTMuMzE5NDFlLTA2IDYxLjU2MDggMCAxMzcuNUMzLjMxOTQxZS0wNiAyMTMuNDM5IDYxLjU2MDggMjc1IDEzNy41IDI3NUMyMTMuNDM5IDI3NSAyNzUgMjEzLjQzOSAyNzUgMTM3LjVaTTE1Ny4xMjUgMjQwLjQwN0MxNTcuMTI1IDI0OS43MzUgMTQ5LjQ2OSAyNTcuMzE3IDEzOC42MDIgMjU3LjUzNUMxMzguMzAxIDI1Ny41MzggMTM4IDI1Ny41MzkgMTM3LjY5OCAyNTcuNTRIMTM3LjMwMkM3MS4wOTY5IDI1Ny40MzMgMTcuNDYwMyAyMDMuNzMgMTcuNDYwMyAxMzcuNUMxNy40NjAzIDcxLjIwNDEgNzEuMjAzOSAxNy40NjA1IDEzNy41IDE3LjQ2MDVDMTM3Ljg1NyAxNy40NjA1IDEzOC4yMTUgMTcuNDYyMSAxMzguNTcxIDE3LjQ2NTJDMTUwLjgzNCAxNy42ODM2IDE1Ny4xMjUgMjUuMjY1NCAxNTcuMTI1IDM0LjU5MjlDMTU3LjEyNSA0NC4wODU5IDE0OC43MzMgNTEuMDcxNSAxMzkuODQzIDUxLjA3MTVDMTMwLjk1MiA1MS4wNzE1IDEzMC41MTYgNTEuMDcxNSAxMjIuMDA2IDUxLjc1MzRDMTEzLjQ5NSA1Mi40MzU0IDEwNC42OTUgNTkuNDIwOSAxMDQuNjk1IDY4Ljg4NTlDMTA0LjY5NSA3OC40MDcxIDExMi40MyA4Ni4wNzQ1IDEyMi4wMDYgODYuMDc0NUgxOTcuNDhDMjA3LjAyOCA4Ni4wNzQ1IDIxNC43NjIgOTMuNzQyIDIxNC43NjIgMTAzLjIwN0MyMTQuNzYyIDExMi42NzIgMjA3LjAyOCAxMjAuMzM5IDE5Ny40OCAxMjAuMzM5SDgxLjIyOThDNzEuNjUzOSAxMjAuMzM5IDYzLjkxOTUgMTI4LjAzNSA2My45MTk1IDEzNy41MjhDNjMuOTE5NSAxNDYuOTkzIDcxLjY1MzkgMTU0LjY2MSA4MS4yMjk4IDE1NC42NjFIMTM5Ljg0M0MxNDkuMzkxIDE1NC42NjEgMTU3LjEyNSAxNjIuMzI4IDE1Ny4xMjUgMTcxLjgyMUMxNTcuMTI1IDE4MS4yODYgMTQ5LjM5MSAxODguOTU0IDEzOS44NDMgMTg4Ljk1NEgxMjIuMDA2QzExMi40MyAxODguOTU0IDEwNC42OTUgMTk2LjYyMSAxMDQuNjk1IDIwNi4wODZDMTA0LjY5NSAyMTUuNTc5IDExMi42MjIgMjIyLjUwOSAxMjIuMDA2IDIyMy4yMTlDMTIyLjc0NSAyMjMuMjc1IDEyMy40MjIgMjIzLjMyNiAxMjQuMDQ1IDIyMy4zNzRDMTI3LjM0NyAyMjMuNjI1IDEyOS4xNTEgMjIzLjc2MyAxMzAuOTU4IDIyMy44MzhDMTMzLjEzNCAyMjMuOTI5IDEzNS4zMTQgMjIzLjkyOSAxNDAuMTE5IDIyMy45MjlDMTQ5LjY2NyAyMjMuOTI5IDE1Ny4xMjUgMjMwLjk0MiAxNTcuMTI1IDI0MC40MDdaIiBmaWxsPSIjNzEzMkY1Ii8+PC9zdmc+" + ); } else if (chain === "Wormchain") { return ( PREFIX + diff --git a/core/icons/src/images/chains/Ink.svg b/core/icons/src/images/chains/Ink.svg new file mode 100644 index 000000000..6859ec928 --- /dev/null +++ b/core/icons/src/images/chains/Ink.svg @@ -0,0 +1,3 @@ + + + From 76b20317b0f68e823d4e6c4a2e41bb2a7705c64f Mon Sep 17 00:00:00 2001 From: bruce-riley <96066700+bruce-riley@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:31:58 -0600 Subject: [PATCH 62/69] Update Monad devnet core address (#739) --- core/base/src/constants/contracts/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/base/src/constants/contracts/core.ts b/core/base/src/constants/contracts/core.ts index aa8201681..a0490918d 100644 --- a/core/base/src/constants/contracts/core.ts +++ b/core/base/src/constants/contracts/core.ts @@ -91,7 +91,7 @@ export const coreBridgeContracts = [[ ["Ink", "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"], ["Xlayer", "0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"], ["Linea", "0x79A1027a6A159502049F10906D333EC57E95F083"], - ["MonadDevnet", "0x376428e7f26D5867e69201b275553C45B09EE090"], + ["MonadDevnet", "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"], ]], [ "Devnet", [ ["Solana", "Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"], From 394b7fd9f5e7bd032c0025e0d69a4be54c261643 Mon Sep 17 00:00:00 2001 From: Andreas <41449730+nonergodic@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:53:29 -0800 Subject: [PATCH 63/69] fix, cleanup, and tighten type programming utils (#710) * add excludeIndexes function implementation to array utils * tighten up type programming parts * fix: remove readonly for array function return types * further type hardening and fixing comment --- core/base/src/constants/guardians.ts | 6 +- core/base/src/utils/array.ts | 206 ++++++++++++++++--------- core/base/src/utils/mapping.ts | 178 +++++++++++---------- core/base/src/utils/metaprogramming.ts | 55 +++++-- 4 files changed, 274 insertions(+), 171 deletions(-) diff --git a/core/base/src/constants/guardians.ts b/core/base/src/constants/guardians.ts index b408077f9..9ac5bd732 100644 --- a/core/base/src/constants/guardians.ts +++ b/core/base/src/constants/guardians.ts @@ -1,5 +1,5 @@ import type { MapLevels} from './../utils/index.js'; -import { constMap, column, cartesianRightRecursive } from './../utils/index.js'; +import { constMap, filterIndexes, zip, cartesianRightRecursive } from './../utils/index.js'; import type { Network } from './networks.js'; // prettier-ignore @@ -30,8 +30,8 @@ const guardianKeyAndNameEntries = [[ ]] ] as const satisfies MapLevels<[Network, string, string]>; -export const guardianKeys = column(cartesianRightRecursive(guardianKeyAndNameEntries), 1); -export const guardianNames = column(cartesianRightRecursive(guardianKeyAndNameEntries), 2); +export const [guardianKeys, guardianNames] = + filterIndexes(zip(cartesianRightRecursive(guardianKeyAndNameEntries)), [1, 2]); export const guardianNameToKey = constMap(guardianKeyAndNameEntries, [[0, 2], 1]); export const guardianKeyToName = constMap(guardianKeyAndNameEntries, [1, [0, 2]]); diff --git a/core/base/src/utils/array.ts b/core/base/src/utils/array.ts index ac69bae29..ddd9bf49d 100644 --- a/core/base/src/utils/array.ts +++ b/core/base/src/utils/array.ts @@ -1,63 +1,105 @@ -import type { RoArray, RoArray2D, IsUnion } from './metaprogramming.js'; +import type { RoPair, RoTuple, RoArray, Extends, Xor, Not } from './metaprogramming.js'; -export const range = (length: number) => [...Array(length).keys()]; +export type RoTuple2D = RoTuple>; +export type RoArray2D = RoArray>; -//TODO the intent here is that number represents a number literal, but strictly speaking -// the type allows for unions of number literals (and an array of such unions) -//The reason for not just sticking to unions is that unions lose order information which is -// relevant in some cases (and iterating over them is a pain). -export type IndexEs = number | RoArray; +type TupleRangeImpl = + A["length"] extends L + ? A + : TupleRangeImpl; -export type ElementIndexPairs = - [...{ [K in keyof T]: K extends `${infer N extends number}` ? [T[K], N] : never }]; +export type TupleRange = + number extends L + ? never + : L extends any + ? TupleRangeImpl + : never; -export const elementIndexPairs = (arr: T) => - range(arr.length).map(i => [arr[i], i]) as ElementIndexPairs; +export type Range = + L extends any + ? number extends L + ? number[] + : TupleRange + : never; -export type Entries = +export type TupleWithLength = + TupleRange extends infer R extends RoArray + ? [...{ [K in keyof R]: T }] + : never; + +export type RoTupleWithLength = Readonly>; + +export const range = (length: L) => + [...Array(length).keys()] as Range; + +//capitalization to highlight that this is intended to be a literal or a union of literals +export type IndexEs = number; + +//utility type to reduce boilerplate of iteration code by replacing: +// `T extends readonly [infer Head extends T[number], ...infer Tail extends RoTuple]` +//with just: +// `T extends HeadTail` +//this also avoids the somewhat common mistake of accidentally dropping the readonly modifier +export type HeadTail> = + readonly [Head, ...Tail]; + +export type TupleEntries = [...{ [K in keyof T]: K extends `${infer N extends number}` ? [N, T[K]] : never }]; -export const entries = (arr: T) => - range(arr.length).map(i => [i, arr[i]]) as Entries; +//const aware version of Array.entries +export type Entries = + T extends RoTuple + ? TupleEntries + : T extends RoArray + ? [number, U][] + : never; + +export function entries(arr: T): TupleEntries; +export function entries(arr: T): Entries; +export function entries(arr: readonly any[]): [number, any][] { + return [...arr.entries()]; +} -export type Flatten = - T extends readonly [infer Head, ...infer Tail extends RoArray] - ? Head extends RoArray - ? [...Head, ...Flatten] - : [Head, ...Flatten] +export type IsArray = T extends RoArray ? true : false; +export type IsFlat = true extends IsArray ? false : true; + +export type TupleFlatten = + T extends HeadTail + ? Head extends RoTuple + ? [...Head, ...TupleFlatten] + : [Head, ...TupleFlatten] : []; -export type InnerFlatten = - [...{ [K in keyof T]: +type StripArray = T extends RoArray ? E : T; + +export type Flatten = + A extends RoTuple + ? TupleFlatten + : StripArray[]; + +export const flatten = (arr: A) => + arr.flat() as Flatten; + +export type InnerFlatten = + [...{ [K in keyof A]: K extends `${number}` - ? T[K] extends RoArray - ? Flatten - : T[K] + ? A[K] extends RoArray + ? Flatten + : A[K] : never }]; -export type IsFlat = - T extends readonly [infer Head, ...infer Tail extends RoArray] - ? Head extends RoArray - ? false - : IsFlat - : true; - -export type Unflatten = - [...{ [K in keyof T]: K extends `${number}` ? [T[K]] : never }]; - -export type AllSameLength = - T extends readonly [infer Head extends RoArray, ...infer Tail extends RoArray2D] - ? L extends void - ? AllSameLength - : Head["length"] extends L - ? AllSameLength - : false - : true; - -export type IsRectangular = - //1d array is rectangular - T extends RoArray2D ? AllSameLength : IsFlat; +export type Unflatten = + [...{ [K in keyof A]: K extends `${number}` ? [A[K]] : never }]; + +export type IsRectangular = + T extends RoTuple2D + ? T extends HeadTail + ? Tail extends readonly [] + ? true //a column is rectangular + : Tail[number]["length"] extends Head["length"] ? true : false + : true //empty is rectangular + : true; //a row is rectangular export type Column = [...{ [K in keyof A]: K extends `${number}` ? A[K][I] : never }]; @@ -65,48 +107,66 @@ export type Column = export const column = (tupArr: A, index: I) => tupArr.map((tuple) => tuple[index]) as Column; -export type Zip = - //TODO remove, find max length, and return undefined for elements in shorter arrays - A["length"] extends 0 - ? [] - : IsRectangular extends true - ? A[0] extends infer Head extends RoArray +export type TupleZip = + IsRectangular extends true + ? T[0] extends infer Head extends RoTuple ? [...{ [K in keyof Head]: K extends `${number}` - ? [...{ [K2 in keyof A]: K extends keyof A[K2] ? A[K2][K] : never }] + ? [...{ [K2 in keyof T]: K extends keyof T[K2] ? T[K2][K] : never }] : never }] : [] - : never + : never; + +export type Zip = + A extends RoTuple2D + ? TupleZip + : Flatten[number][][]; export const zip = (arr: Args) => range(arr[0]!.length).map(col => range(arr.length).map(row => arr[row]![col]) - ) as unknown as ([Zip] extends [never] ? RoArray2D : Zip); + ) as Zip; //extracts elements with the given indexes in the specified order, explicitly forbid unions -export type OnlyIndexes = - IsUnion extends false - ? I extends number - ? OnlyIndexes - : I extends readonly [infer Head extends number, ...infer Tail extends RoArray] - ? E[Head] extends undefined - ? OnlyIndexes - : [E[Head], ...OnlyIndexes] - : [] - : never; +export type TuplePickWithOrder> = + I extends HeadTail + ? A[Head] extends undefined + ? TuplePickWithOrder + : [A[Head], ...TuplePickWithOrder] + : []; -type ExcludeIndexesImpl = - T extends readonly [infer Head, ...infer Tail] - ? Head extends readonly [infer I extends number, infer V] - ? I extends C - ? ExcludeIndexesImpl - : [V, ...ExcludeIndexesImpl] +export type PickWithOrder> = + [A, I] extends [infer T extends RoTuple, infer TI extends RoTuple] + ? TuplePickWithOrder + : A; + +export const pickWithOrder = + >(arr: A, indexes: I) => + indexes.map((i) => arr[i]) as PickWithOrder; + +type FilterIndexesImpl = + T extends HeadTail + ? Head extends RoPair + ? Not, Extends>> extends true + ? [V, ...FilterIndexesImpl] + : FilterIndexesImpl : never : []; -export type ExcludeIndexes = - ExcludeIndexesImpl, C extends RoArray ? C[number] : C>; +export type FilterIndexes = + A extends infer T extends RoTuple + ? FilterIndexesImpl, I, E> + : A; + +export const filterIndexes = < + const T extends RoArray, + const I extends RoArray, + const E extends boolean = false +>(arr: T, indexes: I, exclude?: E) => { + const indexSet = new Set(Array.isArray(indexes) ? indexes : [indexes]); + return arr.filter((_,i) => indexSet.has(i) !== exclude) as FilterIndexes; +}; export type Cartesian = L extends RoArray diff --git a/core/base/src/utils/mapping.ts b/core/base/src/utils/mapping.ts index 82b0617a6..e6fbaf9a0 100644 --- a/core/base/src/utils/mapping.ts +++ b/core/base/src/utils/mapping.ts @@ -63,22 +63,22 @@ //VR = value rows import type { - IndexEs, + RoTuple2D, + RoArray2D, + HeadTail, + Entries, Flatten, InnerFlatten, IsRectangular, - Zip, + TupleZip, Cartesian, - OnlyIndexes, - ExcludeIndexes, - ElementIndexPairs, + TuplePickWithOrder, } from './array.js'; import { range, zip } from './array.js'; -import type { Widen, RoArray, RoArray2D, RoPair } from './metaprogramming.js'; +import type { Widen, RoTuple, RoNeTuple, RoArray, RoPair } from './metaprogramming.js'; - -export type ShallowMapping> = - { readonly [E in M[number]as E[0]]: E[1] }; +export type ShallowMapping> = + { readonly [E in M[number] as E[0]]: E[1] }; //symbol probably shouldn't be part of the union (but then our type isn't a superset of PropertyKey // anymore which comes with its own set of headaches) @@ -87,11 +87,11 @@ function isMappableKey(key: unknown): key is MappableKey { return ["string", "number", "symbol", "bigint", "boolean"].includes(typeof key); } -export type MapLevel = RoArray>; +export type MapLevel = RoTuple>; -type MapLevelsTuple = readonly [MappableKey, ...RoArray, unknown]; +type MapLevelsTuple = readonly [MappableKey, ...RoTuple, unknown]; export type MapLevels = - T extends readonly [infer Head extends MappableKey, ...infer Tail extends RoArray] + T extends HeadTail ? Tail extends MapLevelsTuple ? MapLevel> : MapLevel @@ -114,7 +114,7 @@ type FromExtPropKey = : T; type MappingEntry = RoPair; -type MappingEntries = RoArray>; +type MappingEntries = RoTuple>; //Recursively sifts through T combining all row indexes that have key K. //Matching rows (i.e. those with key K) have their indexes placed in IA, non-matching (unfiltered) @@ -122,13 +122,10 @@ type MappingEntries = RoArray>; type CombineKeyRowIndexes< K extends MappableKey, T extends MappingEntries, - IA extends RoArray, //all values associated with K + IA extends RoTuple, //all values associated with K U extends MappingEntries = [], //rows that have been scanned and are not associated with K > = - T extends readonly [ - infer Head extends MappingEntry, - ...infer Tail extends MappingEntries - ] + T extends HeadTail ? Head[0] extends K ? CombineKeyRowIndexes : CombineKeyRowIndexes @@ -140,10 +137,10 @@ type CombineKeyRowIndexes< // [["Mainnet", 0], ["Mainnet", 1], ["Mainnet", 2], ["Testnet", 3], ["Testnet", 4]] //into [["Mainnet", [0,1,2]], ["Testnet", [3,4]]]. type ToMapEntries, M extends MappingEntries = []> = - KCI extends readonly [infer Head, ...infer Tail extends MappingEntries] + KCI extends HeadTail ? Head extends RoPair ? CombineKeyRowIndexes extends RoPair< - infer IA extends RoArray, + infer IA extends RoTuple, infer KCIU extends MappingEntries > ? ToMapEntries @@ -151,20 +148,39 @@ type ToMapEntries, M extends MappingEntries = : never : M; -type CartesianRightRecursive = - M extends MappingEntries - ? Flatten<[...{ [K in keyof M]: +type CartesianRightRecursive = + M extends infer IM extends MappingEntries + ? Flatten<[...{ [K in keyof IM]: K extends `${number}` - ? InnerFlatten>> + ? InnerFlatten>> : never }]> - : M extends MappingEntry - ? Cartesian + : M extends infer IM extends MappingEntry + ? Cartesian : M; -type Shape = RoPair; //key columns, value columns -type CartesianSet = RoArray2D; //CartesianSet is always rectangular -type Transpose = Zip; +type Shape = RoPair, RoTuple>; //key columns, value columns +type IndexLike = number | RoNeTuple; +type ShapeLike = RoPair; +type ShapeLikeToShape = + S extends RoPair + ? [KC extends number ? [KC] : KC, VC extends number ? [VC] : VC] + : never; + +type CartesianSet = RoTuple2D; //CartesianSet is always rectangular +type Transpose = + TupleZip extends infer R extends RoTuple2D + ? R + : never; + +type FlipInnerPair> = + [...{ [K in keyof T]: K extends `${number}` ? [T[K][1], T[K][0]] : never }]; + +type KeyRowIndexes = MappingEntries>; +type KeyColumnToKeyRowIndexes> = + FlipInnerPair> extends infer FIP extends MappingEntries + ? ToMapEntries + : never; //Takes the first of the reamining key columns and splits it into chunks that share the same key // value. Then invokes itself for each sub-chunk passing along only those value rows that belong @@ -172,23 +188,18 @@ type Transpose = Zip; //In our example for the default shape, it starts with the network column and splits it into // the "Mainnet" and "Testnet" chunk. The first chunk gets the first 3 rows, the second chunk // gets the last 2. Then the "Mainnet" chunk is recursively split into 3 chunks again, ... -type ProcessNextKeyColmn, VR extends RoArray> = - KC["length"] extends 0 - ? VR - : ExcludeIndexes extends infer KCR extends CartesianSet - //KRIA = key row indexes array - ? ToMapEntries> extends infer KRIA extends MappingEntries> - ? [...{ - [K in keyof KRIA]: [ - KRIA[K][0], +type ProcessNextKeyColmn, VR extends RoTuple> = + KC extends HeadTail + ? KeyColumnToKeyRowIndexes> extends infer KRI extends KeyRowIndexes + ? [...{ [K in keyof KRI]: [ + KRI[K][0], ProcessNextKeyColmn< - Transpose, KRIA[K][1]>>, - OnlyIndexes + Transpose, KRI[K][1]>, MappableKey>, + TuplePickWithOrder > - ] - }] + ]}] : never - : never; + : VR; //We encode leaf values as tuples of void (which does not constitute a value type and hence can't // come from the user) and the actual value. This allows us to later distinguish whether a value @@ -199,7 +210,7 @@ type LeafValue = RoPair; //Takes the value columns and combines them into leaf value rows. type CombineValueColumnsToLeafValues = //if we only have a single value column, we don't have to use tuples for values - (VC["length"] extends 1 ? VC[0] : Transpose) extends infer VCT extends RoArray + (VC["length"] extends 1 ? VC[0] : Transpose) extends infer VCT extends RoTuple ? [...{ [K in keyof VCT]: K extends `${number}` ? LeafValue : never }] : never; @@ -207,19 +218,19 @@ type CombineValueColumnsToLeafValues = // the specified shape. type SplitAndReorderKeyValueColumns = Transpose extends infer C extends CartesianSet - ? [OnlyIndexes, OnlyIndexes] + ? [TuplePickWithOrder, TuplePickWithOrder] : never; //returns the mapping with "unwrapped" values (i.e. turns the singleton arrays back into their one // constituent element) if all leaves are indeed singletons, otherwise returns void type UnwrapValuesIfAllAreSingletons = D extends 1 - ? M extends MappingEntries - ? [...{ [K in keyof M]: K extends `${number}` ? [M[K][0], M[K][1][0][1]] : never }] + ? M extends infer IM extends MappingEntries + ? [...{ [K in keyof IM]: K extends `${number}` ? [M[K][0], M[K][1][0][1]] : never }] : void - : M extends MappingEntries - ? [...{ [K in keyof M]: K extends `${number}` - ? [M[K][0], UnwrapValuesIfAllAreSingletons] + : M extends infer IM extends MappingEntries + ? [...{ [K in keyof IM]: K extends `${number}` + ? [IM[K][0], UnwrapValuesIfAllAreSingletons] : never }] extends infer U extends MappingEntries ? U @@ -232,28 +243,28 @@ type MaybeUnwrapValuesIfAllAreSingletons = //check that M has a valid structure for mapping entries - CartesianRightRecursive extends infer CRR extends RoArray2D + CartesianRightRecursive extends infer CRR extends RoTuple2D ? IsRectangular extends true //ensure CRR is not empty - ? CRR extends readonly [RoArray, ...RoArray2D] + ? CRR extends RoNeTuple ? S extends Shape ? SplitAndReorderKeyValueColumns extends [ infer KC extends CartesianSet, infer VC extends CartesianSet ] - ? KC["length"] extends Depth[number] - ? CombineValueColumnsToLeafValues extends infer VR extends RoArray + ? KC["length"] extends infer D extends Depth[number] + ? CombineValueColumnsToLeafValues extends infer VR extends RoTuple ? ProcessNextKeyColmn extends infer TM extends MappingEntries - ? [MaybeUnwrapValuesIfAllAreSingletons, KC["length"]] + ? [MaybeUnwrapValuesIfAllAreSingletons, D] : never : never : never : never //if we don't have an explicit shape, take the first row and subtract 1 (for the value // column) to determine the count of key columns - : CRR[0] extends readonly [...infer KC extends RoArray, unknown] - ? KC["length"] extends Depth[number] - ? [M, KC["length"]] + : CRR[0] extends readonly [...infer KC extends RoTuple, unknown] + ? KC["length"] extends infer D extends Depth[number] + ? [M, D] : never : never : never @@ -267,7 +278,7 @@ type ObjectFromMappingEntries ? D extends 1 ? V extends LeafValue ? T - : V extends RoArray + : V extends RoTuple ? [...{ [K2 in keyof V]: K2 extends `${number}` ? V[K2][1] : never }] : V : V extends MappingEntries @@ -279,9 +290,9 @@ type ObjectFromMappingEntries export type ToMappingAndDepth< M extends MappingEntries, - S extends Shape | void | undefined + S extends ShapeLike | undefined > = - TransformMapping extends [ + TransformMapping : void> extends [ infer TM extends MappingEntries, infer D extends Depth[number], ] @@ -290,13 +301,13 @@ export type ToMappingAndDepth< export type ToMapping< M extends MappingEntries, - S extends Shape | void | undefined = undefined + S extends ShapeLike | undefined = undefined > = ToMappingAndDepth[0]; type Mapped = { [key: PropertyKey]: unknown | Mapped }; -type RecursiveAccess> = - KA extends readonly [infer Head extends MappableKey, ...infer Tail extends RoArray] +type RecursiveAccess> = + KA extends HeadTail ? M extends Mapped ? RecursiveAccess], Tail> : never @@ -306,22 +317,22 @@ type RecursiveAccess> = // as to avoid having to hardcode arity...) type GenericMappingFunc = D extends 1 - ? >(...args: [K1]) => RecursiveAccess + ? >(...args: readonly [K1]) => RecursiveAccess : D extends 2 ? , const K2 extends FromExtPropKey>, - >(...args: [K1, K2]) => RecursiveAccess + >(...args: readonly [K1, K2]) => RecursiveAccess : D extends 3 ? , const K2 extends FromExtPropKey>, const K3 extends FromExtPropKey>, - >(...args: [K1, K2, K3]) => RecursiveAccess + >(...args: readonly [K1, K2, K3]) => RecursiveAccess : D extends 4 ? , const K2 extends FromExtPropKey>, const K3 extends FromExtPropKey>, const K4 extends FromExtPropKey>, - >(...args: [K1, K2, K3, K4]) => RecursiveAccess + >(...args: readonly [K1, K2, K3, K4]) => RecursiveAccess : never; type SubMap = @@ -350,7 +361,7 @@ type WidenedParamsAndRet = [Widen>>, ...WidenedParamsAndRetRec]; type HasGetFuncs = - WidenedParamsAndRet extends [...infer P extends RoArray, infer R] + WidenedParamsAndRet extends [...infer P extends RoTuple, infer R] ? { readonly has: (...args: P) => boolean, readonly get: (...args: P) => R | undefined } : never; @@ -359,7 +370,7 @@ type ConstMap = ? GenericMappingFunc & HasGetFuncs : GenericMappingFunc & HasGetFuncs & SubMapFunc; -type ToConstMap = +type ToConstMap = ToMappingAndDepth extends [infer TM extends Mapped, infer D extends Depth[number]] ? ConstMap : never; @@ -368,24 +379,24 @@ const isRecursiveTuple = (arr: RoArray) => arr.length === 2 && !Array.isArray(arr[0]) && Array.isArray(arr[1]); export const cartesianRightRecursive = - (arr: T): CartesianRightRecursive => ( + (arr: T): CartesianRightRecursive => ( arr.length === 0 ? [] : Array.isArray(arr[0]) ? (arr as MappingEntries).map(([key, val]) => Array.isArray(val) - ? (isRecursiveTuple(val) ? cartesianRightRecursive(val) : val) + ? (isRecursiveTuple(val) ? cartesianRightRecursive(val as unknown as RoTuple) : val) .map(ele => [key, ele].flat()) : [[key, val]] ).flat() : isRecursiveTuple(arr) - ? cartesianRightRecursive(arr[1] as RoArray).map((ele: any) => [arr[0], ele]) + ? cartesianRightRecursive(arr[1] as RoTuple).map((ele: any) => [arr[0], ele]) : arr ) as CartesianRightRecursive; const toMapping = < const M extends MappingEntries, - const S extends Shape | undefined = undefined + const S extends ShapeLike | undefined = undefined >(mapping: M, shape?: S): ToMapping => { const crr = cartesianRightRecursive(mapping); if (crr.length === 0) @@ -399,8 +410,8 @@ const toMapping = < let leafObjects = [] as any[]; let allSingletons = true; const buildMappingRecursively = ( - keyCartesianSet: CartesianSet, - values: RoArray + keyCartesianSet: MappableKey[][], + values: RoArray2D ): any => { const distinctKeys = Array.from(new Set(keyCartesianSet[0]).values()); const keyRows = new Map(distinctKeys.map(key => [key, []])); @@ -432,7 +443,7 @@ const toMapping = < const valuesSubset = rows.map(i => values[i]!); return [ key, - buildMappingRecursively(keyCartesianSubset as CartesianSet, valuesSubset) + buildMappingRecursively(keyCartesianSubset, valuesSubset) ]; })); }; @@ -460,10 +471,7 @@ const toMapping = < if (!isMappableKey(key)) throw new Error(`Invalid key: ${key} in ${keyCol}`); - const ret = buildMappingRecursively( - keyCartesianSet as CartesianSet, - zip(leafValues!) - ); + const ret = buildMappingRecursively(keyCartesianSet! as any, zip(leafValues!)); if (allSingletons) for (const leafObj of leafObjects) @@ -475,7 +483,7 @@ const toMapping = < export function constMap< const M extends MappingEntries, - const S extends Shape | undefined = undefined, + const S extends ShapeLike | undefined = undefined, >(mappingEntries: M, shape?: S): ToConstMap { const mapping = toMapping(mappingEntries, shape); const genericMappingFunc = ((...args: MappableKey[]) => @@ -484,10 +492,10 @@ export function constMap< mapping )); return Object.assign(genericMappingFunc, { - has: (...args: readonly MappableKey[]) => genericMappingFunc(...args) !== undefined, - get: (...args: readonly MappableKey[]) => genericMappingFunc(...args), + has: (...args: RoArray) => genericMappingFunc(...args) !== undefined, + get: (...args: RoArray) => genericMappingFunc(...args), subMap: (key: MappableKey) => (mapping as any)[key.toString()], - }) as ToConstMap; + }) as unknown as ToConstMap; } //--- find a bunch of "tests" below diff --git a/core/base/src/utils/metaprogramming.ts b/core/base/src/utils/metaprogramming.ts index d41eb2cab..7c3bf1a66 100644 --- a/core/base/src/utils/metaprogramming.ts +++ b/core/base/src/utils/metaprogramming.ts @@ -1,11 +1,19 @@ export type Extends = [T] extends [U] ? true : false; -//this is a generic overload of the built-in `Function` type, it should work as a more -// powerful drop-in replacement -export type Function

= (...args: P) => R; +export type NeTuple = [T, ...T[]]; +export type Tuple = NeTuple | []; +export type RoTuple = Readonly>; +export type RoNeTuple = Readonly>; export type RoArray = readonly T[]; -export type RoArray2D = RoArray>; export type RoPair = readonly [T, U]; +//Function is is a generic overload of the built-in type +// It should work as a more powerful drop-in replacement. +// Since the built-in type is not generic and permissive, we have to use RoArray as the +// default type of the parameters, otherwise `Test` would become false after our overload: +// type TestFunc = (...args: [string, number]) => boolean; +// type Test = TestFunc extends Function ? true : false; //true for built-in +export type Function

= RoArray, R = unknown> = + (...args: P) => R; export type Widen = T extends string ? string : @@ -22,15 +30,42 @@ export type IsAny = Extends<0, 1 & T>; export type IsNever = Extends; -//allow both And and And -export type And | boolean, R extends boolean = true> = +export type Not = B extends true ? false : true; + +//empty And is true (neutral element) +export type And | boolean, R extends boolean = true> = R extends true - ? T extends RoArray - ? Extends - : Extends + ? T extends RoTuple + ? false extends T[number] + ? false + : true + : T : false; -export type Not = B extends true ? false : true; +//empty And is false (neutral element) +export type Or | boolean, R extends boolean = false> = + R extends false + ? T extends RoTuple + ? true extends T[number] + ? true + : false + : T + : true; + +type XorImpl> = + T extends readonly [infer First, infer Second, ...infer Tail extends RoArray] + ? XorImpl<[boolean extends First | Second ? true : false, ...Tail]> + : T extends readonly [infer Final] + ? Final + : never; //Xor has no neutral element that we can return for the empty case + +//empty Xor is not supported (xor has no neutral element) +export type Xor | boolean, R extends boolean | undefined = undefined> = + T extends RoTuple + ? [...T, ...(undefined extends R ? [] : [Exclude])] extends infer V extends RoTuple + ? XorImpl + : never + : boolean extends Exclude | T ? true : false; export type ParseNumber = T extends `${infer N extends number}` ? N : never; From 0c57292368146c460abc9ce9e7f6a42be8e0b903 Mon Sep 17 00:00:00 2001 From: Andreas <41449730+nonergodic@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:53:49 -0800 Subject: [PATCH 64/69] extract layouting into standalone package and adjust for changes (#738) --- core/base/package.json | 5 +- core/base/src/utils/index.ts | 4 +- core/base/src/utils/layout.ts | 26 + core/base/src/utils/layout/deserialize.ts | 225 ------- core/base/src/utils/layout/discriminate.ts | 613 ------------------ core/base/src/utils/layout/fixedDynamic.ts | 221 ------- core/base/src/utils/layout/index.ts | 8 - core/base/src/utils/layout/items.ts | 123 ---- core/base/src/utils/layout/layout.ts | 251 ------- core/base/src/utils/layout/serialize.ts | 225 ------- core/base/src/utils/layout/size.ts | 165 ----- core/base/src/utils/layout/utils.ts | 140 ---- core/definitions/src/layout-items/amount.ts | 4 +- core/definitions/src/layout-items/boolean.ts | 4 +- core/definitions/src/layout-items/chain.ts | 6 +- core/definitions/src/layout-items/circle.ts | 4 +- .../src/layout-items/guardianSet.ts | 4 +- .../definitions/src/layout-items/payloadId.ts | 4 +- core/definitions/src/layout-items/sequence.ts | 4 +- .../definitions/src/layout-items/signature.ts | 3 +- core/definitions/src/layout-items/string.ts | 4 +- .../src/layout-items/universalAddress.ts | 4 +- .../automaticCircleBridgeLayout.ts | 4 +- .../src/protocols/relayer/relayerLayout.ts | 8 +- .../tokenBridge/tokenBridgeLayout.ts | 5 +- core/definitions/src/vaa/functions.ts | 28 +- package-lock.json | 219 ++++--- .../tokenBridge/src/foreignAddress.ts | 10 +- 28 files changed, 191 insertions(+), 2130 deletions(-) create mode 100644 core/base/src/utils/layout.ts delete mode 100644 core/base/src/utils/layout/deserialize.ts delete mode 100644 core/base/src/utils/layout/discriminate.ts delete mode 100644 core/base/src/utils/layout/fixedDynamic.ts delete mode 100644 core/base/src/utils/layout/index.ts delete mode 100644 core/base/src/utils/layout/items.ts delete mode 100644 core/base/src/utils/layout/layout.ts delete mode 100644 core/base/src/utils/layout/serialize.ts delete mode 100644 core/base/src/utils/layout/size.ts delete mode 100644 core/base/src/utils/layout/utils.ts diff --git a/core/base/package.json b/core/base/package.json index fe6dfce41..4922781d8 100644 --- a/core/base/package.json +++ b/core/base/package.json @@ -116,7 +116,8 @@ "dist/cjs" ], "dependencies": { - "@scure/base": "^1.1.3" + "@scure/base": "^1.1.3", + "binary-layout": "^1.0.3" }, "sideEffects": false, "scripts": { @@ -132,4 +133,4 @@ "prettier": "prettier --write ./src" }, "type": "module" -} \ No newline at end of file +} diff --git a/core/base/src/utils/index.ts b/core/base/src/utils/index.ts index 09d29638a..5f96d0f63 100644 --- a/core/base/src/utils/index.ts +++ b/core/base/src/utils/index.ts @@ -2,9 +2,7 @@ export * from "./array.js"; export * from "./mapping.js"; export * from "./metaprogramming.js"; export * from "./misc.js"; - -export * from "./layout/index.js"; +export * from "./layout.js"; export * as amount from "./amount.js"; -export * as layout from "./layout/index.js"; export * as encoding from "./encoding.js"; diff --git a/core/base/src/utils/layout.ts b/core/base/src/utils/layout.ts new file mode 100644 index 000000000..2d9527807 --- /dev/null +++ b/core/base/src/utils/layout.ts @@ -0,0 +1,26 @@ +export { + type Layout, + type DeriveType as LayoutToType, + type FixedConversion, + type CustomConversion, + type Endianness, + type CustomizableBytes, + type CustomizableBytesReturn, + type Discriminator, + type FixedItemsOf as FixedItemsOfLayout, + type DynamicItemsOf as DynamicItemsOfLayout, + type Bitset, + type BitsetItem, + serialize as serializeLayout, + deserialize as deserializeLayout, + buildDiscriminator as layoutDiscriminator, + calcSize as calcLayoutSize, + calcStaticSize as calcStaticLayoutSize, + customizableBytes, + addFixedValues, + fixedItemsOf as fixedItemsOfLayout, + dynamicItemsOf as dynamicItemsOfLayout, + enumItem, + optionItem, + bitsetItem +} from "binary-layout"; diff --git a/core/base/src/utils/layout/deserialize.ts b/core/base/src/utils/layout/deserialize.ts deleted file mode 100644 index 3abe40303..000000000 --- a/core/base/src/utils/layout/deserialize.ts +++ /dev/null @@ -1,225 +0,0 @@ -import type { - Endianness, - Layout, - LayoutItem, - LayoutToType, - CustomConversion, - NumSizeToPrimitive, - NumType, - BytesType, -} from './layout.js'; -import { defaultEndianness, numberMaxSize } from './layout.js'; - -import { - isNumType, - isBytesType, - isFixedBytesConversion, - checkBytesTypeEqual, - checkNumEquals, -} from './utils.js'; -import { getCachedSerializedFrom } from './serialize.js'; - -export function deserializeLayout( - layout: L, - bytes: BytesType, - opts?: { - offset?: number, - end?: number, - consumeAll?: B, - }, -) { - const encoded = { - bytes, - offset: opts?.offset ?? 0, - end: opts?.end ?? bytes.length, - }; - const decoded = internalDeserializeLayout(layout, encoded); - - if ((opts?.consumeAll ?? true) && encoded.offset !== encoded.end) - throw new Error(`encoded data is longer than expected: ${encoded.end} > ${encoded.offset}`); - - return ( - (opts?.consumeAll ?? true) ? decoded : [decoded, encoded.offset] - ) as B extends true ? LayoutToType : readonly [LayoutToType, number]; -} - -type BytesChunk = { - bytes: BytesType, - offset: number, - end: number, -}; - -function updateOffset(encoded: BytesChunk, size: number) { - const newOffset = encoded.offset + size; - if (newOffset > encoded.end) - throw new Error(`chunk is shorter than expected: ${encoded.end} < ${newOffset}`); - - encoded.offset = newOffset; -} - -function internalDeserializeLayout(layout: Layout, encoded: BytesChunk): any { - if (!Array.isArray(layout)) - return deserializeLayoutItem(layout as LayoutItem, encoded); - - let decoded = {} as any; - for (const item of layout) - try { - ((item as any).omit ? {} : decoded)[item.name] = deserializeLayoutItem(item, encoded); - } - catch (e) { - (e as Error).message = `when deserializing item '${item.name}': ${(e as Error).message}`; - throw e; - } - - return decoded; -} - -function deserializeNum( - encoded: BytesChunk, - size: S, - endianness: Endianness = defaultEndianness, - signed: boolean = false, -) { - let val = 0n; - for (let i = 0; i < size; ++i) - val |= BigInt(encoded.bytes[encoded.offset + i]!) - << BigInt(8 * (endianness === "big" ? size - i - 1 : i)); - - //check sign bit if value is indeed signed and adjust accordingly - if (signed && (encoded.bytes[encoded.offset + (endianness === "big" ? 0 : size - 1)]! & 0x80)) - val -= 1n << BigInt(8 * size); - - updateOffset(encoded, size); - - return ((size > numberMaxSize) ? val : Number(val)) as NumSizeToPrimitive; -} - -function deserializeLayoutItem(item: LayoutItem, encoded: BytesChunk): any { - switch (item.binary) { - case "int": - case "uint": { - const value = deserializeNum(encoded, item.size, item.endianness, item.binary === "int"); - - const { custom } = item; - if (isNumType(custom)) { - checkNumEquals(custom, value); - return custom; - } - if (isNumType(custom?.from)) { - checkNumEquals(custom!.from, value); - return custom!.to; - } - - //narrowing to CustomConversion is a bit hacky here, since the true type - // would be CustomConversion | CustomConversion, but then we'd - // have to further tease that apart still for no real gain... - return custom !== undefined ? (custom as CustomConversion).to(value) : value; - } - case "bytes": { - const expectedSize = ("lengthSize" in item && item.lengthSize !== undefined) - ? deserializeNum(encoded, item.lengthSize, item.lengthEndianness) - : (item as {size?: number})?.size; - - if ("layout" in item) { //handle layout conversions - const { custom } = item; - const offset = encoded.offset; - let layoutData; - if (expectedSize === undefined) - layoutData = internalDeserializeLayout(item.layout, encoded); - else { - const subChunk = {...encoded, end: encoded.offset + expectedSize}; - updateOffset(encoded, expectedSize); - layoutData = internalDeserializeLayout(item.layout, subChunk); - if (subChunk.offset !== subChunk.end) - throw new Error( - `read less data than expected: ${subChunk.offset - encoded.offset} < ${expectedSize}` - ); - } - - if (custom !== undefined) { - if (typeof custom.from !== "function") { - checkBytesTypeEqual( - getCachedSerializedFrom(item as any), - encoded.bytes, - {dataSlize: [offset, encoded.offset]} - ); - return custom.to; - } - return custom.to(layoutData); - } - - return layoutData; - } - - const { custom } = item; - { //handle fixed conversions - let fixedFrom; - let fixedTo; - if (isBytesType(custom)) - fixedFrom = custom; - else if (isFixedBytesConversion(custom)) { - fixedFrom = custom.from; - fixedTo = custom.to; - } - if (fixedFrom !== undefined) { - const size = expectedSize ?? fixedFrom.length; - const value = encoded.bytes.slice(encoded.offset, encoded.offset + size); - checkBytesTypeEqual(fixedFrom, value); - updateOffset(encoded, size); - return fixedTo ?? fixedFrom; - } - } - - //handle no or custom conversions - const start = encoded.offset; - const end = (expectedSize !== undefined) ? encoded.offset + expectedSize : encoded.end; - updateOffset(encoded, end - start); - - const value = encoded.bytes.slice(start, end); - return custom !== undefined ? (custom as CustomConversion).to(value) : value; - } - case "array": { - let ret = [] as any[]; - const { layout } = item; - const deserializeArrayItem = () => { - const deserializedItem = internalDeserializeLayout(layout, encoded); - ret.push(deserializedItem); - } - - let length = null; - if ("length" in item && item.length !== undefined) - length = item.length; - else if ("lengthSize" in item && item.lengthSize !== undefined) - length = deserializeNum(encoded, item.lengthSize, item.lengthEndianness); - - if (length !== null) - for (let i = 0; i < length; ++i) - deserializeArrayItem(); - else - while (encoded.offset < encoded.end) - deserializeArrayItem(); - - return ret; - } - case "switch": { - const id = deserializeNum(encoded, item.idSize, item.idEndianness); - const {layouts} = item; - if (layouts.length === 0) - throw new Error(`switch item has no layouts`); - - const hasPlainIds = typeof layouts[0]![0] === "number"; - const pair = (layouts as readonly any[]).find(([idOrConversionId]) => - hasPlainIds ? idOrConversionId === id : (idOrConversionId)[0] === id); - - if (pair === undefined) - throw new Error(`unknown id value: ${id}`); - - const [idOrConversionId, idLayout] = pair; - const decoded = internalDeserializeLayout(idLayout, encoded); - return { - [item.idTag ?? "id"]: hasPlainIds ? id : (idOrConversionId as any)[1], - ...decoded - }; - } - } -} diff --git a/core/base/src/utils/layout/discriminate.ts b/core/base/src/utils/layout/discriminate.ts deleted file mode 100644 index 004fd36a2..000000000 --- a/core/base/src/utils/layout/discriminate.ts +++ /dev/null @@ -1,613 +0,0 @@ -import type { Layout, LayoutItem, LengthPrefixed, BytesType } from './layout.js'; -import { serializeNum, getCachedSerializedFrom } from './serialize.js'; -import { isNumType, isBytesType, isFixedBytesConversion } from './utils.js'; -import { calcStaticLayoutSize } from './size.js'; - -//defining a bunch of types for readability -type Uint = number; -type Bitset = bigint; -type Size = Uint; -type BytePos = Uint; -type ByteVal = Uint; //actually a uint8 -type LayoutIndex = Uint; -type Candidates = Bitset; -type FixedBytes = (readonly [BytePos, BytesType])[]; -//using a Bounds type (even though currently the upper bound can only either be equal to the lower -// bound or Infinity) in anticipation of a future switch layout item that might contain multiple -// sublayouts which, unlike arrays currently, could all be bounded but potentially with -// different sizes -type Bounds = [Size, Size]; - -function arrayToBitset(arr: readonly number[]): Bitset { - return arr.reduce((bit, i) => bit | BigInt(1) << BigInt(i), BigInt(0)); -} - -function bitsetToArray(bitset: Bitset): number[] { - const ret = []; - for (let i = 0n; bitset > 0n; bitset >>= 1n, ++i) - if (bitset & 1n) - ret.push(Number(i)); - - return ret; -} - -function count(candidates: Candidates) { - let count = 0; - for (; candidates > 0n; candidates >>= 1n) - count += Number(candidates & 1n); - return count; -} - -const lengthSizeMax = (lengthSize: number) => - lengthSize > 0 ? 2**(8 * lengthSize) - 1 : Infinity; - -function layoutItemMeta( - item: LayoutItem, - offset: BytePos | null, - fixedBytes: FixedBytes, -): Bounds { - switch (item.binary) { - case "int": - case "uint": { - const fixedVal = - isNumType(item.custom) - ? item.custom - : isNumType(item?.custom?.from) - ? item!.custom!.from - : null; - - if (fixedVal !== null && offset !== null) { - const cursor = {bytes: new Uint8Array(item.size), offset: 0}; - serializeNum(fixedVal, item.size, cursor, item.endianness, item.binary === "int"); - fixedBytes.push([offset, cursor.bytes]); - } - - return [item.size, item.size]; - } - case "bytes": { - const lengthSize = ("lengthSize" in item) ? item.lengthSize | 0 : 0; - - let fixed; - let fixedSize; - if ("layout" in item) { - const { custom } = item; - if (custom !== undefined && typeof custom.from !== "function") { - fixed = getCachedSerializedFrom(item as any); - fixedSize = fixed.length; - } - else { - const layoutSize = calcStaticLayoutSize(item.layout); - if (layoutSize !== null) - fixedSize = layoutSize; - } - } - else { - const { custom } = item; - if (isBytesType(custom)) { - fixed = custom; - fixedSize = custom.length; - } - else if (isFixedBytesConversion(custom)) { - fixed = custom.from; - fixedSize = custom.from.length; - } - } - - if (lengthSize > 0 && offset !== null) { - if (fixedSize !== undefined) { - const cursor = {bytes: new Uint8Array(lengthSize), offset: 0}; - const endianess = (item as LengthPrefixed).lengthEndianness; - serializeNum(fixedSize, lengthSize, cursor, endianess, false); - fixedBytes.push([offset, cursor.bytes]); - } - offset += lengthSize; - } - - if (fixed !== undefined) { - if (offset !== null) - fixedBytes.push([offset, fixed]); - - return [lengthSize + fixed.length, lengthSize + fixed.length]; - } - - //lengthSize must be 0 if size is defined - const ret = ("size" in item && item.size !== undefined) - ? [item.size, item.size] as Bounds - : undefined; - - if ("layout" in item) { - const lm = createLayoutMeta(item.layout, offset, fixedBytes) - return ret ?? [lengthSize + lm[0], lengthSize + lm[1]]; - } - - return ret ?? [lengthSize, lengthSizeMax(lengthSize)]; - } - case "array": { - if ("length" in item) { - let localFixedBytes = [] as FixedBytes; - const itemSize = createLayoutMeta(item.layout, 0, localFixedBytes); - if (offset !== null) { - if (itemSize[0] !== itemSize[1]) { - //if the size of an array item is not fixed we can only add the fixed bytes of the - // first item - if (item.length > 0) - for (const [o, s] of localFixedBytes) - fixedBytes.push([offset + o, s]); - } - else { - //otherwise we can add fixed know bytes for each array item - for (let i = 0; i < item.length; ++i) - for (const [o, s] of localFixedBytes) - fixedBytes.push([offset + o + i * itemSize[0], s]); - } - } - - return [item.length * itemSize[0], item.length * itemSize[1]]; - } - const lengthSize = (item as LengthPrefixed).lengthSize | 0; - return [lengthSize, lengthSizeMax(lengthSize)]; - } - case "switch": { - const caseFixedBytes = item.layouts.map(_ => []) as FixedBytes[]; - const {idSize, idEndianness} = item; - const caseBounds = item.layouts.map(([idOrConversionId, layout], caseIndex) => { - const idVal = Array.isArray(idOrConversionId) ? idOrConversionId[0] : idOrConversionId; - if (offset !== null) { - const cursor = {bytes: new Uint8Array(idSize), offset: 0}; - serializeNum(idVal, idSize, cursor, idEndianness); - caseFixedBytes[caseIndex]!.push([0, cursor.bytes]); - } - const ret = createLayoutMeta(layout, offset !== null ? idSize : null, caseFixedBytes[caseIndex]!); - return [ret[0] + idSize, ret[1] + idSize] as Bounds; - }); - - if (offset !== null && caseFixedBytes.every(fbs => fbs.length > 0)) - //find bytes that have the same value across all cases - // (it's a lambda to enable early return from inner loops) - (() => { - //constrain search to the minimum length of all cases - const minLen = Math.min( - ...caseFixedBytes.map(fbs => fbs.at(-1)![0] + fbs.at(-1)![1].length) - ); - //keep track of the current index in each case's fixed bytes array - const itIndexes = caseFixedBytes.map(_ => 0); - - for (let bytePos = 0; bytePos < minLen;) { - let byteVal = null; - let caseIndex = 0; - while (caseIndex < caseFixedBytes.length) { - let curItIndex = itIndexes[caseIndex]!; - const curFixedBytes = caseFixedBytes[caseIndex]!; - const [curOffset, curSerialized] = curFixedBytes[curItIndex]!; - if (curOffset + curSerialized.length <= bytePos) { - //no fixed byte at this position in this case - ++curItIndex; - - if (curItIndex === curFixedBytes.length) - return; //we have exhausted all fixed bytes in at least one case - - itIndexes[caseIndex] = curItIndex; - //jump to the next possible bytePos given the fixed bytes of the current case index - bytePos = curFixedBytes[curItIndex]![0]; - break; - } - - const curByteVal = curSerialized[bytePos - curOffset]; - if (byteVal === null) - byteVal = curByteVal; - - if (curByteVal !== byteVal) { - ++bytePos; - break; - } - - ++caseIndex; - } - - //only if we made it through all cases without breaking do we have a fixed byte - // and hence add it to the list of fixed bytes - if (caseIndex === caseFixedBytes.length) { - fixedBytes.push([offset + bytePos, new Uint8Array([byteVal!])]); - ++bytePos; - } - } - })(); - - return [ - Math.min(...caseBounds.map(([lower]) => lower)), - Math.max(...caseBounds.map(([_, upper]) => upper)) - ] as Bounds; - } - } -} - -function createLayoutMeta( - layout: Layout, - offset: BytePos | null, - fixedBytes: FixedBytes -): Bounds { - if (!Array.isArray(layout)) - return layoutItemMeta(layout as LayoutItem, offset, fixedBytes); - - let bounds = [0, 0] as Bounds; - for (const item of layout) { - const itemSize = layoutItemMeta(item, offset, fixedBytes); - bounds[0] += itemSize[0]; - bounds[1] += itemSize[1]; - //if the bounds don't agree then we can't reliably predict the offset of subsequent items - if (offset !== null) - offset = itemSize[0] === itemSize[1] ? offset + itemSize[0] : null; - } - return bounds; -} - -function buildAscendingBounds(sortedBounds: readonly (readonly [Bounds, LayoutIndex])[]) { - const ascendingBounds = new Map(); - //sortedCandidates tracks all layouts that have a size bound that contains the size that's - // currently under consideration, sorted in ascending order of their respective upper bounds - let sortedCandidates = [] as (readonly [Size, LayoutIndex])[]; - const closeCandidatesBefore = (before: number) => { - while (sortedCandidates.length > 0 && sortedCandidates[0]![0] < before) { - const end = sortedCandidates[0]![0] + 1; - //remove all candidates that end at the same position - const removeIndex = sortedCandidates.findIndex(([upper]) => end <= upper); - if (removeIndex === -1) - sortedCandidates = []; - else - sortedCandidates.splice(0, removeIndex); - //introduce a new bound that captures all candidates that can have a size of at least `end` - ascendingBounds.set(end, arrayToBitset(sortedCandidates.map(([, j]) => j))); - } - }; - - for (const [[lower, upper], i] of sortedBounds) { - closeCandidatesBefore(lower); - const insertIndex = sortedCandidates.findIndex(([u]) => u > upper); - if (insertIndex === -1) - sortedCandidates.push([upper, i]); - else - sortedCandidates.splice(insertIndex, 0, [upper, i]); - - ascendingBounds.set(lower, arrayToBitset(sortedCandidates.map(([, j]) => j))); - } - closeCandidatesBefore(Infinity); - - return ascendingBounds; -} - -//Generates a greedy divide-and-conquer strategy to determine the layout (or set of layouts) that -// a given serialized byte array might conform to. -//It leverages size bounds and known fixed bytes of layouts to quickly eliminate candidates, by -// (greedily) choosing the discriminator (byte or size) that eliminates the most candidates at -// each step. -//Power is a relative measure of the strength of a discriminator given a set of layout candidates. -// It's in [0, candidate.length - 1] and states how many layouts of that set can _at least_ be -// eliminated when applying that discriminator. -//Layout sizes are only tracked in terms of lower and upper bounds. This means that while a layout -// like an array of e.g. 2 byte uints can actually never have an odd size, the algorithm will -// simply treat it as having a size bound of [0, Infinity]. This means that the algorithm is -// "lossy" in the sense that it does not use all the information that it actually has available -// and will e.g. wrongly conclude that the aforementioned layout cannot be distinguished from a -// second layout that starts off with a one byte uint followed by an array of 2 byte uints (and -// would thus always have odd size). I.e. it would wrongly conclude that the power of the size -// discriminator is 0 when it should be 1. -//The alternative to accepting this limitation is tracking all possible combinations of offsets, -// multiples, and their arbitrary composition which would be massively more complicated and -// also pointless in the general case because we'd have to figure out whether a given size can be -// expressed as some combination of offsets and array size multiples in which case it's almost -// certainly computaionally cheaper to simply attempt to deserialize the given given data for the -// respective layout. -function generateLayoutDiscriminator( - layouts: readonly Layout[] -): [boolean, (encoded: BytesType) => readonly LayoutIndex[]] { - //for debug output: - // const candStr = (candidate: Bitset) => candidate.toString(2).padStart(layouts.length, '0'); - - if (layouts.length === 0) - throw new Error("Cannot discriminate empty set of layouts"); - - const emptySet = 0n; - const allLayouts = (1n << BigInt(layouts.length)) - 1n; - - const fixedKnown = layouts.map(() => [] as FixedBytes); - const sizeBounds = layouts.map((l, i) => createLayoutMeta(l, 0, fixedKnown[i]!)); - const sortedBounds = sizeBounds.map((b, i) => [b, i] as const).sort(([[l1]], [[l2]]) => l1 - l2); - - const mustHaveByteAt = (() => { - let remaining = allLayouts; - const ret = new Map(); - for (const [[lower], i] of sortedBounds) { - remaining ^= 1n << BigInt(i); //delete the i-th bit - ret.set(lower, remaining); - } - return ret; - })(); - const ascendingBounds = buildAscendingBounds(sortedBounds); - const sizePower = layouts.length - Math.max( - ...[...ascendingBounds.values()].map(candidates => count(candidates)) - ); - //we don't check sizePower here and bail early if it is perfect because we prefer perfect byte - // discriminators over perfect size discriminators due to their faster lookup times (hash map - // vs binary search (and actually currently everything is even implement using linear search)) - // and more predictable / lower complexity branching behavior. - const layoutsWithByteAt = (bytePos: BytePos) => { - let ret = allLayouts; - for (const [lower, candidates] of mustHaveByteAt) { - if (bytePos < lower) - break; - - ret = candidates; - } - return ret; - }; - - const layoutsWithSize = (size: Size) => { - let ret = emptySet; - for (const [lower, candidates] of ascendingBounds) { - if (size < lower) - break; - - ret = candidates; - } - return ret; - }; - - const fixedKnownBytes: readonly ((readonly [ByteVal, LayoutIndex])[])[] = Array.from({length: - Math.max(...fixedKnown.map(fkb => fkb.length > 0 ? fkb.at(-1)![0] + fkb.at(-1)![1].length : 0)) - }).map(() => []); - - for (let i = 0; i < fixedKnown.length; ++i) - for (const [offset, serialized] of fixedKnown[i]!) - for (let j = 0; j < serialized.length; ++j) - fixedKnownBytes[offset + j]!.push([serialized[j]!, i]); - - //debug output: - // console.log("fixedKnownBytes:", - // fixedKnownBytes.map((v, i) => v.length > 0 ? [i, v] : undefined).filter(v => v !== undefined) - // ); - - let bestBytes = []; - for (const [bytePos, fixedKnownByte] of fixedKnownBytes.entries()) { - //the number of layouts with a given size is an upper bound on the discriminatory power of - // a byte at a given position: If the encoded data is too short we can automatically - // exclude all layouts whose minimum size is larger than it, nevermind those who expect - // a known, fixed value at this position. - const lwba = layoutsWithByteAt(bytePos); - const anyValueLayouts = lwba ^ arrayToBitset(fixedKnownByte.map(([, layoutIdx]) => layoutIdx)); - const outOfBoundsLayouts = allLayouts ^ lwba; - const distinctValues = new Map(); - //the following equation holds (after applying .length to each component): - //layouts = outOfBoundsLayouts + anyValueLayouts + fixedKnownByte - for (const [byteVal, candidate] of fixedKnownByte) { - if (!distinctValues.has(byteVal)) - distinctValues.set(byteVal, emptySet); - - distinctValues.set(byteVal, distinctValues.get(byteVal)! | 1n << BigInt(candidate)); - } - - let power = layouts.length - Math.max(count(anyValueLayouts), count(outOfBoundsLayouts)); - for (const layoutsWithValue of distinctValues.values()) { - //if we find the byte value associated with this set of layouts, we can eliminate - // all other layouts that don't have this value at this position and all layouts - // that are too short to have a value in this position regardless - const curPower = fixedKnownByte.length - count(layoutsWithValue) + count(outOfBoundsLayouts); - power = Math.min(power, curPower); - } - - //debug output: - // console.log( - // "bytePos:", bytePos, - // "\npower:", power, - // "\nfixedKnownByte:", fixedKnownByte, - // "\nlwba:", candStr(lwba), - // "\nanyValueLayouts:", candStr(anyValueLayouts), - // "\noutOfBoundsLayouts:", candStr(outOfBoundsLayouts), - // "\ndistinctValues:", new Map([...distinctValues].map(([k, v]) => [k, candStr(v)])) - // ); - - if (power === 0) - continue; - - if (power === layouts.length - 1) - //we have a perfect byte discriminator -> bail early - return [ - true, - (encoded: BytesType) => - bitsetToArray( - encoded.length <= bytePos - ? outOfBoundsLayouts - : distinctValues.get(encoded[bytePos]!) ?? emptySet - ) - ]; - - bestBytes.push([power, bytePos, outOfBoundsLayouts, distinctValues, anyValueLayouts] as const); - } - - //if we get here, we know we don't have a perfect byte discriminator so we now check wether we - // we have a perfect size discriminator and bail early if so - if (sizePower === layouts.length - 1) - return [true, (encoded: BytesType) => bitsetToArray(layoutsWithSize(encoded.length))]; - - //sort in descending order of power - bestBytes.sort(([lhsPower], [rhsPower]) => rhsPower - lhsPower); - type BestBytes = typeof bestBytes; - type Strategy = [BytePos, Candidates, Map] | "size" | "indistinguishable"; - - let distinguishable = true; - const strategies = new Map(); - const candidatesBySize = new Map(); - const addStrategy = (candidates: Candidates, strategy: Strategy) => { - strategies.set(candidates, strategy); - if (!candidatesBySize.has(count(candidates))) - candidatesBySize.set(count(candidates), []); - candidatesBySize.get(count(candidates))!.push(candidates); - }; - - const recursivelyBuildStrategy = ( - candidates: Candidates, - bestBytes: BestBytes, - ) => { - if (count(candidates) <= 1 || strategies.has(candidates)) - return; - - let sizePower = 0; - const narrowedBounds = new Map(); - for (const candidate of bitsetToArray(candidates)) { - const lower = sizeBounds[candidate]![0]; - const overlap = ascendingBounds.get(lower)! & candidates; - narrowedBounds.set(lower, overlap) - sizePower = Math.max(sizePower, count(overlap)); - } - sizePower = count(candidates) - sizePower; - - const narrowedBestBytes = [] as BestBytes; - for (const [power, bytePos, outOfBoundsLayouts, distinctValues, anyValueLayouts] of bestBytes) { - const narrowedDistinctValues = new Map(); - let fixedKnownCount = 0; - for (const [byteVal, layoutsWithValue] of distinctValues) { - const lwv = layoutsWithValue & candidates; - if (count(lwv) > 0) { - narrowedDistinctValues.set(byteVal, lwv); - fixedKnownCount += count(lwv); - } - } - const narrowedOutOfBoundsLayouts = outOfBoundsLayouts & candidates; - - let narrowedPower = narrowedDistinctValues.size > 0 ? power : 0; - for (const layoutsWithValue of narrowedDistinctValues.values()) { - const curPower = - fixedKnownCount - count(layoutsWithValue) + count(narrowedOutOfBoundsLayouts); - narrowedPower = Math.min(narrowedPower, curPower); - } - - if (narrowedPower === 0) - continue; - - if (narrowedPower === count(candidates) - 1) { - //if we have a perfect byte discriminator, we can bail early - addStrategy(candidates, [bytePos, narrowedOutOfBoundsLayouts, narrowedDistinctValues]); - return; - } - - narrowedBestBytes.push([ - narrowedPower, - bytePos, - narrowedOutOfBoundsLayouts, - narrowedDistinctValues, - anyValueLayouts & candidates - ] as const); - } - - if (sizePower === count(candidates) - 1) { - //if we have a perfect size discriminator, we can bail early - addStrategy(candidates, "size"); - return; - } - - narrowedBestBytes.sort(([lhsPower], [rhsPower]) => rhsPower - lhsPower); - - //prefer byte discriminators over size discriminators - if (narrowedBestBytes.length > 0 && narrowedBestBytes[0]![0] >= sizePower) { - const [, bytePos, narrowedOutOfBoundsLayouts, narrowedDistinctValues, anyValueLayouts] = - narrowedBestBytes[0]!; - addStrategy(candidates, [bytePos, narrowedOutOfBoundsLayouts, narrowedDistinctValues]); - recursivelyBuildStrategy(narrowedOutOfBoundsLayouts, narrowedBestBytes); - for (const cand of narrowedDistinctValues.values()) - recursivelyBuildStrategy(cand | anyValueLayouts, narrowedBestBytes.slice(1)); - - return; - } - - if (sizePower > 0) { - addStrategy(candidates, "size"); - for (const cands of narrowedBounds.values()) - recursivelyBuildStrategy(cands, narrowedBestBytes); - - return; - } - - addStrategy(candidates, "indistinguishable"); - distinguishable = false; - } - - recursivelyBuildStrategy(allLayouts, bestBytes); - - const findSmallestSuperSetStrategy = (candidates: Candidates) => { - for (let size = count(candidates) + 1; size < layouts.length - 2; ++size) - for (const larger of candidatesBySize.get(size) ?? []) - if ((candidates & larger) == candidates) //is subset? - return strategies.get(larger)!; - - throw new Error("Implementation error in layout discrimination algorithm"); - }; - - //debug output: - // console.log("strategies:", JSON.stringify( - // new Map([...strategies].map(([cands, strat]) => [ - // candStr(cands), - // typeof strat === "string" - // ? strat - // : [ - // strat[0], //bytePos - // candStr(strat[1]), //outOfBoundsLayouts - // new Map([...strat[2]].map(([value, cands]) => [value, candStr(cands)])) - // ] - // ] - // )) - // )); - - return [distinguishable, (encoded: BytesType) => { - let candidates = allLayouts; - - let strategy = strategies.get(candidates)!; - while (strategy !== "indistinguishable") { - //debug output: - // console.log( - // "applying strategy", strategy, - // "\nfor remaining candidates:", candStr(candidates) - // ); - if (strategy === "size") - candidates &= layoutsWithSize(encoded.length); - else { - const [bytePos, outOfBoundsLayouts, distinctValues] = strategy; - if (encoded.length <= bytePos) - candidates &= outOfBoundsLayouts; - else { - const byteVal = encoded[bytePos]; - for (const [val, cands] of distinctValues) - if (val !== byteVal) - candidates ^= candidates & cands; //= candidates - cands (set minus) - - candidates ^= candidates & outOfBoundsLayouts; - } - } - - if (count(candidates) <= 1) - break; - - strategy = strategies.get(candidates) ?? findSmallestSuperSetStrategy(candidates) - } - - //debug output: - // console.log("final candidates", candStr(candidates)); - return bitsetToArray(candidates); - }]; -} - -export function layoutDiscriminator( - layouts: readonly Layout[], - allowAmbiguous?: B -) { - const [distinguishable, discriminator] = generateLayoutDiscriminator(layouts); - if (!distinguishable && !allowAmbiguous) - throw new Error("Cannot uniquely distinguished the given layouts"); - - return ( - !allowAmbiguous - ? (encoded: BytesType) => { - const layout = discriminator(encoded); - return layout.length === 0 ? null : layout[0]; - } - : discriminator - ) as (encoded: BytesType) => B extends false ? LayoutIndex | null : readonly LayoutIndex[]; -} diff --git a/core/base/src/utils/layout/fixedDynamic.ts b/core/base/src/utils/layout/fixedDynamic.ts deleted file mode 100644 index b59936656..000000000 --- a/core/base/src/utils/layout/fixedDynamic.ts +++ /dev/null @@ -1,221 +0,0 @@ -import type { - Layout, - ProperLayout, - LayoutItem, - NumLayoutItem, - BytesLayoutItem, - ArrayLayoutItem, - SwitchLayoutItem, - LayoutToType, - NumType, - BytesType, - LayoutObject, - FixedConversion, - CustomConversion, -} from './layout.js'; - -import { isPrimitiveType, isLayoutItem, isFixedPrimitiveConversion } from './utils.js'; - -type NonEmpty = readonly [unknown, ...unknown[]]; - -type IPLPair = readonly [any, ProperLayout]; - -type FilterItemsOfIPLPairs = - ILA extends infer V extends readonly IPLPair[] - ? V extends readonly [infer H extends IPLPair, ...infer T extends readonly IPLPair[]] - ? FilterItemsOfLayout extends infer P extends ProperLayout | void - ? P extends NonEmpty - ? [[H[0], P], ...FilterItemsOfIPLPairs] - : FilterItemsOfIPLPairs - : never - : [] - : never; - -type FilterLayoutOfItem = - FilterItemsOfLayout extends infer L extends LayoutItem | NonEmpty - ? { readonly [K in keyof Item]: K extends "layout" ? L : Item[K] } - : void; - -type FilterItem = - Item extends infer I extends LayoutItem - ? I extends NumLayoutItem - ? I["custom"] extends NumType | FixedConversion - ? Fixed extends true ? I : void - : Fixed extends true ? void : I - : I extends ArrayLayoutItem - ? FilterLayoutOfItem - : I extends BytesLayoutItem & { layout: Layout } - ? I["custom"] extends { custom: FixedConversion} - ? Fixed extends true ? I : void - : I extends { custom: CustomConversion} - ? Fixed extends true ? void : I - : FilterLayoutOfItem - : I extends BytesLayoutItem - ? I["custom"] extends BytesType | FixedConversion - ? Fixed extends true ? I : void - : Fixed extends true ? void : I - : I extends SwitchLayoutItem - ? { readonly [K in keyof I]: - K extends "layouts" ? FilterItemsOfIPLPairs : I[K] - } - : never - : never; - -type FilterItemsOfLayout = - L extends infer LI extends LayoutItem - ? FilterItem - : L extends infer P extends ProperLayout - ? P extends readonly [infer H extends LayoutItem, ...infer T extends ProperLayout] - ? FilterItem extends infer NI - ? NI extends LayoutItem - // @ts-ignore - ? [NI, ...FilterItemsOfLayout] - : FilterItemsOfLayout - : never - : [] - : never; - -type StartFilterItemsOfLayout = - FilterItemsOfLayout extends infer V extends Layout - ? V - : never; - -function filterItem(item: LayoutItem, fixed: boolean): LayoutItem | null { - switch (item.binary) { - // @ts-ignore - fallthrough is intentional - case "bytes": { - if ("layout" in item) { - const { custom } = item; - if (custom === undefined) { - const { layout } = item; - if (isLayoutItem(layout)) - return filterItem(layout, fixed); - - const filteredItems = internalFilterItemsOfProperLayout(layout, fixed); - return (filteredItems.length > 0) ? { ...item, layout: filteredItems } : null; - } - const isFixedItem = typeof custom.from !== "function"; - return (fixed && isFixedItem || !fixed && !isFixedItem) ? item : null; - } - } - case "int": - case "uint": { - const { custom } = item; - const isFixedItem = isPrimitiveType(custom) || isFixedPrimitiveConversion(custom); - return (fixed && isFixedItem || !fixed && !isFixedItem) ? item : null; - } - case "array": { - const filtered = internalFilterItemsOfLayout(item.layout, fixed); - return (filtered !== null) ? { ...item, layout: filtered } : null; - } - case "switch": { - const filteredIdLayoutPairs = (item.layouts as readonly any[]).reduce( - (acc: any, [idOrConversionId, idLayout]: any) => { - const filteredItems = internalFilterItemsOfProperLayout(idLayout, fixed); - return filteredItems.length > 0 - ? [...acc, [idOrConversionId, filteredItems]] - : acc; - }, - [] as any[] - ); - return { ...item, layouts: filteredIdLayoutPairs }; - } - } -} - -function internalFilterItemsOfProperLayout(proper: ProperLayout, fixed: boolean): ProperLayout { - return proper.reduce( - (acc, item) => { - const filtered = filterItem(item, fixed) as ProperLayout[number] | null; - return filtered !== null ? [...acc, filtered] : acc; - }, - [] as ProperLayout - ); -} - -function internalFilterItemsOfLayout(layout: Layout, fixed: boolean): any { - return (Array.isArray(layout) - ? internalFilterItemsOfProperLayout(layout, fixed) - : filterItem(layout as LayoutItem, fixed) - ); -} - -function filterItemsOfLayout( - layout: L, - fixed: Fixed -): FilterItemsOfLayout { - return internalFilterItemsOfLayout(layout, fixed); -} - -export type FixedItemsOfLayout = StartFilterItemsOfLayout; -export type DynamicItemsOfLayout = StartFilterItemsOfLayout; - -export const fixedItemsOfLayout = (layout: L) => - filterItemsOfLayout(layout, true); - -export const dynamicItemsOfLayout = (layout: L) => - filterItemsOfLayout(layout, false); - -function internalAddFixedValuesItem(item: LayoutItem, dynamicValue: any): any { - switch (item.binary) { - // @ts-ignore - fallthrough is intentional - case "bytes": { - if ("layout" in item) { - const { custom } = item; - if (custom === undefined || typeof custom.from !== "function") - return internalAddFixedValues(item.layout, custom ? custom.from : dynamicValue); - - return dynamicValue; - } - } - case "int": - case "uint": { - const { custom } = item; - return (item as {omit?: boolean})?.omit - ? undefined - : isPrimitiveType(custom) - ? custom - : isFixedPrimitiveConversion(custom) - ? custom.to - : dynamicValue; - } - case "array": - return Array.isArray(dynamicValue) - ? dynamicValue.map(element => internalAddFixedValues(item.layout, element)) - : undefined; - case "switch": { - const id = dynamicValue[item.idTag ?? "id"]; - const [_, idLayout] = (item.layouts as readonly IPLPair[]).find(([idOrConversionId]) => - (Array.isArray(idOrConversionId) ? idOrConversionId[1] : idOrConversionId) == id - )!; - return { - [item.idTag ?? "id"]: id, - ...internalAddFixedValues(idLayout, dynamicValue) - }; - } - } -} - -function internalAddFixedValues(layout: Layout, dynamicValues: any): any { - dynamicValues = dynamicValues ?? {}; - if (isLayoutItem(layout)) - return internalAddFixedValuesItem(layout as LayoutItem, dynamicValues); - - const ret = {} as any; - for (const item of layout) { - const fixedVals = internalAddFixedValuesItem( - item, - dynamicValues[item.name as keyof typeof dynamicValues] ?? {} - ); - if (fixedVals !== undefined) - ret[item.name] = fixedVals; - } - return ret; -} - -export function addFixedValues( - layout: L, - dynamicValues: LayoutToType>, -): LayoutToType { - return internalAddFixedValues(layout, dynamicValues) as LayoutToType; -} diff --git a/core/base/src/utils/layout/index.ts b/core/base/src/utils/layout/index.ts deleted file mode 100644 index 7e76269d7..000000000 --- a/core/base/src/utils/layout/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * from "./layout.js"; -export * from "./serialize.js"; -export * from "./deserialize.js"; -export * from "./fixedDynamic.js"; -export * from "./discriminate.js"; -export * from "./utils.js"; -export * from "./size.js"; -export * from "./items.js"; diff --git a/core/base/src/utils/layout/items.ts b/core/base/src/utils/layout/items.ts deleted file mode 100644 index 95f201d10..000000000 --- a/core/base/src/utils/layout/items.ts +++ /dev/null @@ -1,123 +0,0 @@ -import type { - Endianness, - NumberSize, - NumSizeToPrimitive, - LayoutToType, - CustomConversion -} from './layout.js'; -import { numberMaxSize } from './layout.js'; -import type { CustomizableBytes, CustomizableBytesReturn } from './utils.js'; -import { customizableBytes } from './utils.js'; - -export function enumItem< - const E extends readonly (readonly [string, number])[] ->(entries: E, opts?: {size?: NumberSize, endianness?: Endianness}) { - const valueToName = Object.fromEntries(entries.map(([name, value]) => [value, name])); - const nameToValue = Object.fromEntries(entries); - return { - binary: "uint", - size: opts?.size ?? 1, - endianness: opts?.endianness ?? "big", - custom: { - to: (encoded: number): E[number][0] => { - const name = valueToName[encoded]; - if (name === undefined) - throw new Error(`Invalid enum value: ${encoded}`); - - return name; - }, - from: (name: E[number][0]) => nameToValue[name]!, - } - } as const; -} - -const baseOptionItem = (someType: T) => ({ - binary: "switch", - idSize: 1, - idTag: "isSome", - layouts: [ - [[0, false], []], - [[1, true ], [customizableBytes({ name: "value"}, someType)]], - ] -} as const); - -type BaseOptionItem = - LayoutToType>>; - -type BaseOptionValue = - LayoutToType> | undefined; - -export function optionItem(optVal: T) { - return { - binary: "bytes", - layout: baseOptionItem(optVal), - custom: { - to: (obj: BaseOptionItem): BaseOptionValue => - obj.isSome === true - //TODO I'm really not sure why we need to manually narrow the type here - ? (obj as Exclude)["value"] - : undefined, - from: (value: BaseOptionValue): BaseOptionItem => - value === undefined - ? { isSome: false } - //TODO and this is even more sketch - : ({ isSome: true, value } as unknown as Exclude, { isSome: false }>), - } satisfies CustomConversion, BaseOptionValue> - } as const -}; - -export type Bitset = - {[K in B[number] as K extends "" | undefined ? never : K]: boolean}; - -type ByteSize = [ - never, - 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, -]; - -type BitsizeToBytesize = N extends keyof ByteSize ? ByteSize[N] : number; - -export type BitsetItem< - B extends readonly (string | undefined)[], - S extends number = BitsizeToBytesize, -> = { - binary: "uint"; - size: S; - custom: { - to: (encoded: NumSizeToPrimitive) => Bitset; - from: (obj: Bitset) => NumSizeToPrimitive; - }; -}; - -export function bitsetItem< - const B extends readonly (string | undefined)[], - const S extends number = BitsizeToBytesize, ->(bitnames: B, size?: S): BitsetItem { - return { - binary: "uint", - size: (size ?? Math.ceil(bitnames.length / 8)) as S, - custom: { - to: (encoded: NumSizeToPrimitive): Bitset => { - const ret: Bitset = {} as Bitset; - for (let i = 0; i < bitnames.length; ++i) - if (bitnames[i]) //skip undefined and empty string - //always use bigint for simplicity - ret[bitnames[i] as keyof Bitset] = (BigInt(encoded) & (1n << BigInt(i))) !== 0n; - - return ret; - }, - from: (obj: Bitset): NumSizeToPrimitive => { - let val = 0n; - for (let i = 0; i < bitnames.length; ++i) - if (bitnames[i] && obj[bitnames[i] as keyof Bitset]) - val |= 1n << BigInt(i); - - return (bitnames.length > numberMaxSize ? val : Number(val)) as NumSizeToPrimitive; - }, - }, - } as const -} diff --git a/core/base/src/utils/layout/layout.ts b/core/base/src/utils/layout/layout.ts deleted file mode 100644 index 48783e053..000000000 --- a/core/base/src/utils/layout/layout.ts +++ /dev/null @@ -1,251 +0,0 @@ -export type NumType = number | bigint; -export type BytesType = Uint8Array; -export type PrimitiveType = NumType | BytesType; - -//used wherever an object is expected that sprung from the LayoutToType type defined below -export type LayoutObject = { readonly [key: string]: any }; - -export const binaryLiterals = ["int", "uint", "bytes", "array", "switch"] as const; -export type BinaryLiterals = typeof binaryLiterals[number]; -export type Endianness = "little" | "big"; -export const defaultEndianness = "big"; - -export const numberMaxSize = 6; //Math.log2(Number.MAX_SAFE_INTEGER) / 8 = 6.625; -export type NumberSize = 1 | 2 | 3 | 4 | 5 | 6; - -export type NumSizeToPrimitive = - Size extends NumberSize - ? number - : Size & NumberSize extends never - ? bigint - : number | bigint; - -//TODO introduce an optional size property that specifies the number of required bytes to -// allow for more efficient size calculation before serialization -export type FixedConversion = { - //TODO readonly size?: number, - readonly to: ToType, - readonly from: FromType, -}; - -export type CustomConversion = { - //TODO readonly size?: (val: ToType) => number, - readonly to: (val: FromType) => ToType, - readonly from: (val: ToType) => FromType, -}; - -export interface LayoutItemBase { - readonly binary: BL, -}; - -interface FixedOmittableCustom { - custom: T, - omit?: boolean -}; - -//length size: number of bytes used to encode the preceeding length field which in turn -// holds either the number of bytes (for bytes) or elements (for array) -export interface LengthPrefixed { - readonly lengthSize: NumberSize, - readonly lengthEndianness?: Endianness, //see defaultEndianness - // //restricts the datarange of lengthSize to a maximum value to prevent out of memory - // // attacks/issues - // readonly maxLength?: number, -} - -//size: number of bytes used to encode the item -interface NumLayoutItemBase - extends LayoutItemBase { - size: T extends bigint ? number : NumberSize, - endianness?: Endianness, //see defaultEndianness -}; - -export interface FixedPrimitiveNum< - T extends NumType, - Signed extends Boolean -> extends NumLayoutItemBase, FixedOmittableCustom {}; - -export interface OptionalToFromNum< - T extends NumType, - Signed extends Boolean -> extends NumLayoutItemBase { - custom?: FixedConversion | CustomConversion -}; - -export interface FixedPrimitiveBytes - extends LayoutItemBase<"bytes">, FixedOmittableCustom {}; - -//A word on the somewhat confusing size, lengthSize, and custom properties of BytesLayouts: -// It is a common pattern that layouts define a certain structure, while also wanting to allow -// customization of certain portions of that structure. E.g. a layout might define a known, -// fixed header, followed by a body, which might be the rest of the data, or have some prefixed -// or even known, fixed size. -// A natural way to enable this sort of functionality is to specify a layout that contains a body -// LayoutItem with the given length/size fields, but with an overrideable custom field, where -// the generic version simply leaves custom unspecified resulting in an raw Uint8Array. -// Allowing such overriding can give somewhat confusing results thought: -// For example, if layouts are only ever defined by a single party, it would never make sense to -// specify both a size and a FixedConversion, since the former could be derived from the latter. -// But if multiple parties are involved, one party might want to nail down the size of the data -// itself, or the size and endianess of the length field, while another then specifies what the -// actual content is (and this might even be done recursively, where one protocol builds on -// top of another). -// So to facilitate this usecase, BytesLayouts allow for this sort of redundant specification. -// -// One annoying downside of this approach is that it allows for inconsistent specifications. -// Following C++'s philosophy, we'll simple define the behavior as undefined in such cases. -// We could remedy the problem by providing a consistency check function, but this too is awkward -// because it would then perform what is effectively a verification of the code itself during -// every startup... -// Such are the perils of an interpreted language. -// -//Number of bytes written/read by a BytesLayout: -// If a size is specified manually, it must be consistent with the conversion or layout. -// If a lengthSize is specified, it will encode the size of the data on serialization, and -// must match the size of the conversion / layout on deserialization. -// If neither a size, nor a lengthSize is specified, and the size is not derivable from the custom -// property (i.e. it's undefined, or a CustomConversion, or a Layout whose size can't be -// statically determined), it will consume the rest of the data on deserialization. -export interface FlexPureBytes extends LayoutItemBase<"bytes"> { - readonly custom?: BytesType | FixedConversion | CustomConversion, -}; - -export interface FlexLayoutBytes extends LayoutItemBase<"bytes"> { - readonly custom?: FixedConversion | CustomConversion, - readonly layout: Layout, -} - -export interface ManualSizePureBytes extends FlexPureBytes { - readonly size: number, -}; - -export interface LengthPrefixedPureBytes extends FlexPureBytes, LengthPrefixed {}; - -export interface ManualSizeLayoutBytes extends FlexLayoutBytes { - readonly size: number, -}; - -export interface LengthPrefixedLayoutBytes extends FlexLayoutBytes, LengthPrefixed {}; - -interface ArrayLayoutItemBase extends LayoutItemBase<"array"> { - readonly layout: Layout, -}; - -export interface FixedLengthArray extends ArrayLayoutItemBase { - readonly length: number, -}; - -export interface LengthPrefixedArray extends ArrayLayoutItemBase, LengthPrefixed {}; - -//consumes the rest of the data on deserialization -export interface RemainderArray extends ArrayLayoutItemBase {}; - -type PlainId = number; -type ConversionId = readonly [number, unknown]; -type IdProperLayoutPair< - Id extends PlainId | ConversionId, - P extends ProperLayout = ProperLayout -> = readonly [Id, P]; -type IdProperLayoutPairs = - readonly IdProperLayoutPair[] | - readonly IdProperLayoutPair[]; -type DistributiveAtLeast1 = T extends any ? readonly [T, ...T[]] : never; -export interface SwitchLayoutItem extends LayoutItemBase<"switch"> { - readonly idSize: NumberSize, - readonly idEndianness?: Endianness, //see defaultEndianness - readonly idTag?: string, - readonly layouts: - DistributiveAtLeast1 | IdProperLayoutPair>, -} - -export type NumLayoutItem = - //force distribution over union - Signed extends infer S extends boolean - ? FixedPrimitiveNum | - OptionalToFromNum | - FixedPrimitiveNum | - OptionalToFromNum - : never; - -export type UintLayoutItem = NumLayoutItem; -export type IntLayoutItem = NumLayoutItem; -export type BytesLayoutItem = - FixedPrimitiveBytes | - FlexPureBytes | - ManualSizePureBytes | - LengthPrefixedPureBytes | - FlexLayoutBytes | - ManualSizeLayoutBytes | - LengthPrefixedLayoutBytes; -export type ArrayLayoutItem = FixedLengthArray | LengthPrefixedArray | RemainderArray; -export type LayoutItem = NumLayoutItem | BytesLayoutItem | ArrayLayoutItem | SwitchLayoutItem; -export type NamedLayoutItem = LayoutItem & { readonly name: string }; -export type ProperLayout = readonly NamedLayoutItem[]; -export type Layout = LayoutItem | ProperLayout; - -type NameOrOmitted = T extends {omit: true} ? never : T["name"]; - -export type LayoutToType = - Layout extends L - ? any - : L extends infer LI extends LayoutItem - ? LayoutItemToType

  • - : L extends infer P extends ProperLayout - ? { readonly [I in P[number] as NameOrOmitted]: LayoutItemToType } - : never; - -type MaybeConvert = - Id extends readonly [number, infer Converted] ? Converted : Id; - -type IdLayoutPairsToTypeUnion = - A extends infer V extends IdProperLayoutPairs - ? V extends readonly [infer Head,...infer Tail extends IdProperLayoutPairs] - ? Head extends IdProperLayoutPair - ? MaybeConvert extends infer Id - ? LayoutToType

    extends infer LT extends LayoutObject - ? { readonly [K in IdTag | keyof LT]: K extends keyof LT ? LT[K] : Id } - | IdLayoutPairsToTypeUnion - : never - : never - : never - : never - : never; - -type LayoutItemToType = - Item extends infer I extends LayoutItem - ? I extends NumLayoutItem - //we must infer FromType here to make sure we "hit" the correct type of the conversion - ? I["custom"] extends CustomConversion - ? To - : I["custom"] extends FixedConversion - ? To - : I["custom"] extends undefined - ? NumSizeToPrimitive - : I["custom"] extends NumType - ? I["custom"] - : NumSizeToPrimitive - : I extends BytesLayoutItem - ? I extends { layout: Layout } - ? I["custom"] extends CustomConversion - ? To - : I["custom"] extends FixedConversion - ? To - : LayoutToType - : I["custom"] extends CustomConversion - ? To - : I["custom"] extends FixedConversion - ? To - : BytesType - : I extends ArrayLayoutItem - ? readonly LayoutToType[] - : I extends SwitchLayoutItem - ? IdLayoutPairsToTypeUnion< - I["layouts"], - I["idTag"] extends undefined - ? "id" - : I["idTag"] extends string - ? I["idTag"] - : "id" - > - : never - : never; diff --git a/core/base/src/utils/layout/serialize.ts b/core/base/src/utils/layout/serialize.ts deleted file mode 100644 index 103b278d0..000000000 --- a/core/base/src/utils/layout/serialize.ts +++ /dev/null @@ -1,225 +0,0 @@ -import type { - Endianness, - Layout, - LayoutItem, - LayoutToType, - CustomConversion, - NumType, - BytesType, - FixedConversion, - LayoutObject, - LayoutItemBase -} from './layout.js'; -import { - defaultEndianness, - numberMaxSize, -} from './layout.js'; -import { calcLayoutSize } from './size.js'; -import { - checkItemSize, - checkBytesTypeEqual, - checkNumEquals, - findIdLayoutPair, - isFixedBytesConversion, - isLayoutItem, - isNumType, - isBytesType, -} from './utils.js'; - -type Cursor = { - bytes: BytesType; - offset: number; -}; - -const cursorWrite = (cursor: Cursor, bytes: BytesType) => { - cursor.bytes.set(bytes, cursor.offset); - cursor.offset += bytes.length; -} - -export function serializeLayout< - const L extends Layout, - E extends BytesType | undefined = undefined ->( - layout: L, - data: LayoutToType, - encoded?: E, - offset = 0, -) { - const cursor = {bytes: encoded ?? new Uint8Array(calcLayoutSize(layout, data)), offset}; - internalSerializeLayout(layout, data, cursor); - if (!encoded && cursor.offset !== cursor.bytes.length) - throw new Error( - `encoded data is shorter than expected: ${cursor.bytes.length} > ${cursor.offset}` - ); - - return (encoded ? cursor.offset : cursor.bytes) as E extends undefined ? Uint8Array : number; -} - -//see numberMaxSize comment in layout.ts -const maxAllowedNumberVal = 2 ** (numberMaxSize * 8); - -export function serializeNum( - val: NumType, - size: number, - cursor: Cursor, - endianness: Endianness = defaultEndianness, - signed: boolean = false, -) { - if (!signed && val < 0) - throw new Error(`Value ${val} is negative but unsigned`); - - if (typeof val === "number") { - if (!Number.isInteger(val)) - throw new Error(`Value ${val} is not an integer`); - - if (size > numberMaxSize) { - if (val >= maxAllowedNumberVal) - throw new Error(`Value ${val} is too large to be safely converted into an integer`); - - if (signed && val <= -maxAllowedNumberVal) - throw new Error(`Value ${val} is too small to be safely converted into an integer`); - } - } - - const bound = 2n ** BigInt(size * 8) - if (val >= bound) - throw new Error(`Value ${val} is too large for ${size} bytes`); - - if (signed && val < -bound) - throw new Error(`Value ${val} is too small for ${size} bytes`); - - //correctly handles both signed and unsigned values - for (let i = 0; i < size; ++i) - cursor.bytes[cursor.offset + i] = - Number((BigInt(val) >> BigInt(8 * (endianness === "big" ? size - i - 1 : i)) & 0xffn)); - - cursor.offset += size; -} - -function internalSerializeLayout( - layout: Layout, - data: any, - cursor: Cursor, -) { - if (isLayoutItem(layout)) - serializeLayoutItem(layout as LayoutItem, data, cursor); - else - for (const item of layout) - try { - serializeLayoutItem(item, data[item.name], cursor); - } - catch (e: any) { - e.message = `when serializing item '${item.name}': ${e.message}`; - throw e; - } -} - -function serializeLayoutItem(item: LayoutItem, data: any, cursor: Cursor) { - switch (item.binary) { - case "int": - case "uint": { - const value = (() => { - if (isNumType(item.custom)) { - if (!("omit" in item && item.omit)) - checkNumEquals(item.custom, data); - return item.custom; - } - - if (isNumType(item?.custom?.from)) - //no proper way to deeply check equality of item.custom.to and data in JS - return item!.custom!.from; - - type narrowedCustom = CustomConversion | CustomConversion; - return item.custom !== undefined ? (item.custom as narrowedCustom).from(data) : data; - })(); - - serializeNum(value, item.size, cursor, item.endianness, item.binary === "int"); - break; - } - case "bytes": { - const offset = cursor.offset; - if ("lengthSize" in item && item.lengthSize !== undefined) - cursor.offset += item.lengthSize; - - if ("layout" in item) { - const { custom } = item; - let layoutData; - if (custom === undefined) - layoutData = data; - else if (typeof custom.from !== "function") - layoutData = custom.from; - else - layoutData = custom.from(data); - - internalSerializeLayout(item.layout, layoutData, cursor); - } - else { - const { custom } = item; - if (isBytesType(custom)) { - if (!("omit" in item && item.omit)) - checkBytesTypeEqual(custom, data); - - cursorWrite(cursor, custom); - } - else if (isFixedBytesConversion(custom)) - //no proper way to deeply check equality of custom.to and data - cursorWrite(cursor, custom.from); - else - cursorWrite(cursor, custom !== undefined ? custom.from(data) : data); - } - - if ("lengthSize" in item && item.lengthSize !== undefined) { - const itemSize = cursor.offset - offset - item.lengthSize; - const curOffset = cursor.offset; - cursor.offset = offset; - serializeNum(itemSize, item.lengthSize, cursor, item.lengthEndianness); - cursor.offset = curOffset; - } - else - checkItemSize(item, cursor.offset - offset); - - break; - } - case "array": { - if ("length" in item && item.length !== data.length) - throw new Error( - `array length mismatch: layout length: ${item.length}, data length: ${data.length}` - ); - - if ("lengthSize" in item && item.lengthSize !== undefined) - serializeNum(data.length, item.lengthSize, cursor, item.lengthEndianness); - - for (let i = 0; i < data.length; ++i) - internalSerializeLayout(item.layout, data[i], cursor); - - break; - } - case "switch": { - const [idOrConversionId, layout] = findIdLayoutPair(item, data); - const idNum = (Array.isArray(idOrConversionId) ? idOrConversionId[0] : idOrConversionId); - serializeNum(idNum, item.idSize, cursor, item.idEndianness); - internalSerializeLayout(layout, data, cursor); - break; - } - } -}; - -//slightly hacky, but the only way to ensure that we are actually deserializing the -// right data without having to re-serialize the layout every time -export function getCachedSerializedFrom( - item: LayoutItemBase<"bytes"> & {layout: Layout; custom: FixedConversion} -) { - const custom = - item.custom as FixedConversion & {cachedSerializedFrom?: BytesType}; - if (!("cachedSerializedFrom" in custom)) { - custom.cachedSerializedFrom = serializeLayout(item.layout, custom.from); - if ("size" in item && - item.size !== undefined && - item.size !== custom.cachedSerializedFrom.length - ) - throw new Error( - `Layout specification error: custom.from does not serialize to specified size` - ); - } - return custom.cachedSerializedFrom!; -} diff --git a/core/base/src/utils/layout/size.ts b/core/base/src/utils/layout/size.ts deleted file mode 100644 index 5a499b149..000000000 --- a/core/base/src/utils/layout/size.ts +++ /dev/null @@ -1,165 +0,0 @@ -import type { - Layout, - LayoutItem, - LayoutToType, -} from './layout.js'; -import { - findIdLayoutPair, - isBytesType, - isLayoutItem, - isFixedBytesConversion, - checkItemSize, -} from './utils.js'; - -function calcItemSize(item: LayoutItem, data: any): number | null { - switch (item.binary) { - case "int": - case "uint": - return item.size; - case "bytes": { - //items only have a size or a lengthSize, never both - const lengthSize = ("lengthSize" in item) ? item.lengthSize | 0 : 0; - - if ("layout" in item) { - const { custom } = item; - const layoutSize = internalCalcLayoutSize( - item.layout, - custom === undefined - ? data - : typeof custom.from === "function" - ? custom.from(data) - : custom.from - ); - if (layoutSize === null) - return ("size" in item ) ? item.size ?? null : null; - - return lengthSize + checkItemSize(item, layoutSize); - } - - const { custom } = item; - if (isBytesType(custom)) - return lengthSize + custom.length; //assumed to equal item.size if it exists - - if (isFixedBytesConversion(custom)) - return lengthSize + custom.from.length; //assumed to equal item.size if it exists - - if (custom === undefined) - return data ? lengthSize + checkItemSize(item, data.length) : null; - - return data !== undefined ? lengthSize + checkItemSize(item, custom.from(data).length) : null; - } - case "array": { - const length = "length" in item ? item.length : undefined; - if (data === undefined) { - if (length !== undefined) { - const layoutSize = internalCalcLayoutSize(item.layout); - if (layoutSize === null) - return null; - - return length * layoutSize; - } - return null; - } - - let size = 0; - if (length !== undefined && length !== data.length) - throw new Error( - `array length mismatch: layout length: ${length}, data length: ${data.length}` - ); - else if ("lengthSize" in item && item.lengthSize !== undefined) - size += item.lengthSize; - - for (let i = 0; i < data.length; ++i) { - const entrySize = internalCalcLayoutSize(item.layout, data[i]); - if (entrySize === null) - return null; - - size += entrySize; - } - - return size; - } - case "switch": { - if (data !== undefined) { - const [_, layout] = findIdLayoutPair(item, data); - const layoutSize = internalCalcLayoutSize(layout, data); - return layoutSize !== null ? item.idSize + layoutSize : null; - } - - let size = null; - for (const [_, layout] of item.layouts) { - const layoutSize = internalCalcLayoutSize(layout); - if (size === null) - size = layoutSize; - else if (layoutSize !== size) - return null; - } - return item.idSize + size!; - } - } -} - -function internalCalcLayoutSize(layout: Layout, data?: any): number | null { - if (isLayoutItem(layout)) - return calcItemSize(layout as LayoutItem, data); - - let size = 0; - for (const item of layout) { - let itemData; - if (data) - if (!("omit" in item) || !item.omit) { - if (!(item.name in data)) - throw new Error(`missing data for layout item: ${item.name}`); - - itemData = data[item.name]; - } - - const itemSize = calcItemSize(item, itemData); - if (itemSize === null) { - if (data !== undefined) - throw new Error(`coding error: couldn't calculate size for layout item: ${item.name}`); - - return null; - } - size += itemSize; - } - return size; -} - -//no way to use overloading here: -// export function calcLayoutSize(layout: L): number | null; -// export function calcLayoutSize(layout: L, data: LayoutToType): number; -// export function calcLayoutSize( -// layout: L, -// data?: LayoutToType -// ): number | null; //impl -//results in "instantiation too deep" error. -// -//Trying to pack everything into a single function definition means we either can't narrow the -// return type correctly: -// export function calcLayoutSize( -// layout: L, -// data: LayoutToType, -// ): number | null; -//or we have to make data overly permissive via: -// export function calcLayoutSize< -// L extends Layout, -// const D extends LayoutToType | undefined, -// >( -// layout: L, -// data?: D, //data can now contain additional properties -// ): undefined extends D ? number | null : number; -//so we're stuck with having to use to separate names -export function calcStaticLayoutSize(layout: Layout): number | null { - return internalCalcLayoutSize(layout); -} - -export function calcLayoutSize(layout: L, data: LayoutToType): number { - const size = internalCalcLayoutSize(layout, data); - if (size === null) - throw new Error( - `coding error: couldn't calculate layout size for layout ${layout} with data ${data}` - ); - - return size; -} diff --git a/core/base/src/utils/layout/utils.ts b/core/base/src/utils/layout/utils.ts deleted file mode 100644 index 9c242a074..000000000 --- a/core/base/src/utils/layout/utils.ts +++ /dev/null @@ -1,140 +0,0 @@ -import type { - Layout, - LayoutItem, - BytesLayoutItem, - SwitchLayoutItem, - FixedConversion, - CustomConversion, - NumType, - BytesType, - PrimitiveType -} from "./layout.js"; -import { binaryLiterals } from "./layout.js"; - -export const isNumType = (x: any): x is NumType => - typeof x === "number" || typeof x === "bigint"; - -export const isBytesType = (x: any): x is BytesType => x instanceof Uint8Array; - -export const isPrimitiveType = (x: any): x is PrimitiveType => - isNumType(x) || isBytesType(x); - -export const isLayoutItem = (x: any): x is LayoutItem => binaryLiterals.includes(x?.binary); - -export const isLayout = (x: any): x is Layout => - isLayoutItem(x) || Array.isArray(x) && x.every(isLayoutItem); - -const isFixedNumberConversion = (custom: any): custom is FixedConversion => - typeof custom?.from === "number"; - -const isFixedBigintConversion = (custom: any): custom is FixedConversion => - typeof custom?.from === "bigint"; - -export const isFixedUintConversion = (custom: any): custom is - FixedConversion | FixedConversion => - isFixedNumberConversion(custom) || isFixedBigintConversion(custom); - -export const isFixedBytesConversion = (custom: any): custom is FixedConversion => - isBytesType(custom?.from); - -export const isFixedPrimitiveConversion = (custom: any): custom is - FixedConversion | FixedConversion | FixedConversion => - isFixedUintConversion(custom) || isFixedBytesConversion(custom); - -export type CustomizableBytes = - undefined | - Layout | - Uint8Array | - FixedConversion | - CustomConversion | - readonly [Layout, FixedConversion | CustomConversion]; - -type CombineObjects = { - [K in keyof T | keyof U]: K extends keyof T ? T[K] : K extends keyof U ? U[K] : never; -}; - -export type BytesBase = - ( {} | { readonly name: string } ) & Omit; - - -export type CustomizableBytesReturn = - CombineObjects< - B, - P extends undefined - ? { readonly binary: "bytes" } - : P extends Layout - ? { readonly binary: "bytes", readonly layout: P } - : P extends Uint8Array | FixedConversion | CustomConversion - ? { readonly binary: "bytes", readonly custom: P } - : P extends readonly [Layout, FixedConversion | CustomConversion] - ? { readonly binary: "bytes", readonly layout: P[0], readonly custom: P[1] } - : never - >; - -export const customizableBytes = < - const B extends BytesBase, - const C extends CustomizableBytes ->(base: B, spec?: C) => ({ - ...base, - binary: "bytes", - ...(() => { - if (spec === undefined) - return {}; - - if (isLayout(spec)) - return { layout: spec }; - - if (spec instanceof Uint8Array || isFixedBytesConversion(spec) || !Array.isArray(spec)) - return { custom: spec }; - - return { layout: spec[0], custom: spec[1] }; - })() -} as CustomizableBytesReturn); - -export const checkSize = (layoutSize: number, dataSize: number): number => { - if (layoutSize !== dataSize) - throw new Error(`size mismatch: layout size: ${layoutSize}, data size: ${dataSize}`); - - return dataSize; -} - -export const checkItemSize = (item: any, dataSize: number): number => - ("size" in item && item.size !== undefined) ? checkSize(item.size, dataSize) : dataSize; - -export const checkNumEquals = (custom: number | bigint, data: number | bigint): void => { - if (custom != data) - throw new Error(`value mismatch: (constant) layout value: ${custom}, data value: ${data}`); -} - -export const checkBytesTypeEqual = ( - custom: BytesType, - data: BytesType, - opts?: { - customSlice?: number | readonly [number, number]; - dataSlize?: number | readonly [number, number]; - }): void => { - const toSlice = (bytes: BytesType, slice?: number | readonly [number, number]) => - slice === undefined - ? [0, bytes.length] as const - : Array.isArray(slice) - ? slice - : [slice, bytes.length] as const; - - const [customStart, customEnd] = toSlice(custom, opts?.customSlice); - const [dataStart, dataEnd] = toSlice(data, opts?.dataSlize); - const length = customEnd - customStart; - checkSize(length, dataEnd - dataStart); - - for (let i = 0; i < custom.length; ++i) - if (custom[i + customStart] !== data[i + dataStart]) - throw new Error(`binary data mismatch: ` + - `layout value: ${custom}, offset: ${customStart}, data value: ${data}, offset: ${dataStart}` - ); -} - -export function findIdLayoutPair(item: SwitchLayoutItem, data: any) { - const id = data[item.idTag ?? "id"]; - return (item.layouts as readonly any[]).find(([idOrConversionId]) => - (Array.isArray(idOrConversionId) ? idOrConversionId[1] : idOrConversionId) == id - )!; -} diff --git a/core/definitions/src/layout-items/amount.ts b/core/definitions/src/layout-items/amount.ts index 42eeab7b5..d82fb48c7 100644 --- a/core/definitions/src/layout-items/amount.ts +++ b/core/definitions/src/layout-items/amount.ts @@ -1,6 +1,6 @@ -import type { UintLayoutItem } from "@wormhole-foundation/sdk-base"; +import type { Layout } from "@wormhole-foundation/sdk-base"; export const amountItem = { binary: "uint", size: 32, -} as const satisfies UintLayoutItem; +} as const satisfies Layout; diff --git a/core/definitions/src/layout-items/boolean.ts b/core/definitions/src/layout-items/boolean.ts index 8fa5a43c8..c359041a5 100644 --- a/core/definitions/src/layout-items/boolean.ts +++ b/core/definitions/src/layout-items/boolean.ts @@ -1,4 +1,4 @@ -import type { CustomConversion, UintLayoutItem } from "@wormhole-foundation/sdk-base"; +import type { Layout, CustomConversion } from "@wormhole-foundation/sdk-base"; export const boolItem = { binary: "uint", @@ -7,4 +7,4 @@ export const boolItem = { to: (encoded: number): boolean => encoded > 0, from: (val: boolean): number => (val ? 1 : 0), } satisfies CustomConversion, -} as const satisfies UintLayoutItem; +} as const satisfies Layout; diff --git a/core/definitions/src/layout-items/chain.ts b/core/definitions/src/layout-items/chain.ts index e1d6a474d..14044951a 100644 --- a/core/definitions/src/layout-items/chain.ts +++ b/core/definitions/src/layout-items/chain.ts @@ -2,7 +2,7 @@ import type { Chain, CustomConversion, FixedConversion, - UintLayoutItem, + Layout, } from "@wormhole-foundation/sdk-base"; import { chainToChainId, chains, toChain } from "@wormhole-foundation/sdk-base"; @@ -37,7 +37,7 @@ export const chainItem = < }, from: (val: AllowNull): number => (val == null ? 0 : chainToChainId(val)), } satisfies CustomConversion>, - }) as const satisfies UintLayoutItem; + }) as const satisfies Layout; export const fixedChainItem = (chain: C) => ({ @@ -46,4 +46,4 @@ export const fixedChainItem = (chain: C) => to: chain, from: chainToChainId(chain), } satisfies FixedConversion, - }) as const satisfies UintLayoutItem; + }) as const satisfies Layout; diff --git a/core/definitions/src/layout-items/circle.ts b/core/definitions/src/layout-items/circle.ts index 2f94a9084..f213bb50f 100644 --- a/core/definitions/src/layout-items/circle.ts +++ b/core/definitions/src/layout-items/circle.ts @@ -1,9 +1,9 @@ -import type { UintLayoutItem } from "@wormhole-foundation/sdk-base"; +import type { Layout } from "@wormhole-foundation/sdk-base"; export const circleDomainItem = { binary: "uint", size: 4, -} as const satisfies UintLayoutItem; +} as const satisfies Layout; export const circleNonceItem = { binary: "uint", diff --git a/core/definitions/src/layout-items/guardianSet.ts b/core/definitions/src/layout-items/guardianSet.ts index 4f0b7426d..328204be9 100644 --- a/core/definitions/src/layout-items/guardianSet.ts +++ b/core/definitions/src/layout-items/guardianSet.ts @@ -1,6 +1,6 @@ -import type { UintLayoutItem } from "@wormhole-foundation/sdk-base"; +import type { Layout } from "@wormhole-foundation/sdk-base"; export const guardianSetItem = { binary: "uint", size: 4, -} as const satisfies UintLayoutItem; +} as const satisfies Layout; diff --git a/core/definitions/src/layout-items/payloadId.ts b/core/definitions/src/layout-items/payloadId.ts index 24813b517..ecc0812e7 100644 --- a/core/definitions/src/layout-items/payloadId.ts +++ b/core/definitions/src/layout-items/payloadId.ts @@ -1,4 +1,4 @@ -import type { UintLayoutItem } from "@wormhole-foundation/sdk-base"; +import type { Layout } from "@wormhole-foundation/sdk-base"; export const payloadIdItem = (id: ID) => ({ @@ -7,4 +7,4 @@ export const payloadIdItem = (id: ID) => size: 1, custom: id, omit: true, - } as const satisfies UintLayoutItem & { readonly name: string }); + } as const satisfies Layout & { readonly name: string }); diff --git a/core/definitions/src/layout-items/sequence.ts b/core/definitions/src/layout-items/sequence.ts index 96f322fa7..104677ebd 100644 --- a/core/definitions/src/layout-items/sequence.ts +++ b/core/definitions/src/layout-items/sequence.ts @@ -1,6 +1,6 @@ -import type { UintLayoutItem } from "@wormhole-foundation/sdk-base"; +import type { Layout } from "@wormhole-foundation/sdk-base"; export const sequenceItem = { binary: "uint", size: 8, -} as const satisfies UintLayoutItem; +} as const satisfies Layout; diff --git a/core/definitions/src/layout-items/signature.ts b/core/definitions/src/layout-items/signature.ts index f2e7680c5..9366340e3 100644 --- a/core/definitions/src/layout-items/signature.ts +++ b/core/definitions/src/layout-items/signature.ts @@ -1,6 +1,5 @@ import type { Layout, - BytesLayoutItem, LayoutToType, CustomConversion, } from "@wormhole-foundation/sdk-base"; @@ -19,4 +18,4 @@ export const signatureItem = { to: (val: LayoutToType) => new Signature(val.r, val.s, val.v), from: (val: Signature) => ({ r: val.r, s: val.s, v: val.v }), } as const satisfies CustomConversion, Signature>, -} as const satisfies BytesLayoutItem; +} as const satisfies Layout; diff --git a/core/definitions/src/layout-items/string.ts b/core/definitions/src/layout-items/string.ts index 1768585f6..76d04876d 100644 --- a/core/definitions/src/layout-items/string.ts +++ b/core/definitions/src/layout-items/string.ts @@ -1,6 +1,6 @@ import type { + Layout, CustomConversion, - LayoutItem, } from "@wormhole-foundation/sdk-base"; import { encoding } from "@wormhole-foundation/sdk-base"; @@ -21,4 +21,4 @@ export const fixedLengthStringItem = (size: number) => ({ to: (val: Uint8Array): string => encoding.bytes.decode(trimZeros(val)), from: (val: string): Uint8Array => encoding.bytes.zpad(encoding.bytes.encode(val), size), } satisfies CustomConversion, -} as const satisfies LayoutItem); +} as const satisfies Layout); diff --git a/core/definitions/src/layout-items/universalAddress.ts b/core/definitions/src/layout-items/universalAddress.ts index 4499a762a..281082641 100644 --- a/core/definitions/src/layout-items/universalAddress.ts +++ b/core/definitions/src/layout-items/universalAddress.ts @@ -1,5 +1,5 @@ import type { - LayoutItem, + Layout, CustomConversion, } from "@wormhole-foundation/sdk-base"; import { UniversalAddress } from '../universalAddress.js'; @@ -11,4 +11,4 @@ export const universalAddressItem = { to: (val: Uint8Array): UniversalAddress => new UniversalAddress(val), from: (val: UniversalAddress): Uint8Array => val.toUint8Array(), } satisfies CustomConversion, -} as const satisfies LayoutItem; +} as const satisfies Layout; diff --git a/core/definitions/src/protocols/circleBridge/automaticCircleBridgeLayout.ts b/core/definitions/src/protocols/circleBridge/automaticCircleBridgeLayout.ts index ae4510bd1..30b29a2d2 100644 --- a/core/definitions/src/protocols/circleBridge/automaticCircleBridgeLayout.ts +++ b/core/definitions/src/protocols/circleBridge/automaticCircleBridgeLayout.ts @@ -1,5 +1,5 @@ import type { Layout, CustomizableBytes } from "@wormhole-foundation/sdk-base"; -import { layout } from "@wormhole-foundation/sdk-base"; +import { customizableBytes } from "@wormhole-foundation/sdk-base"; import { payloadIdItem, universalAddressItem, @@ -29,7 +29,7 @@ export const depositWithPayloadLayout = ( customPayload?: P, diff --git a/core/definitions/src/protocols/tokenBridge/tokenBridgeLayout.ts b/core/definitions/src/protocols/tokenBridge/tokenBridgeLayout.ts index 887cd6ebd..c138dfc36 100644 --- a/core/definitions/src/protocols/tokenBridge/tokenBridgeLayout.ts +++ b/core/definitions/src/protocols/tokenBridge/tokenBridgeLayout.ts @@ -1,8 +1,7 @@ import type { + Layout, CustomConversion, CustomizableBytes, - Layout, - LayoutItem, } from "@wormhole-foundation/sdk-base"; import { customizableBytes, range } from "@wormhole-foundation/sdk-base"; import { @@ -24,7 +23,7 @@ const fixedLengthStringItem = { .join(""), from: (str: string) => new Uint8Array(str.split("").map((c) => c.charCodeAt(0))), } satisfies CustomConversion, -} as const satisfies LayoutItem; +} as const satisfies Layout; const transferCommonLayout = [ { diff --git a/core/definitions/src/vaa/functions.ts b/core/definitions/src/vaa/functions.ts index 5ee48f7dd..c148971b1 100644 --- a/core/definitions/src/vaa/functions.ts +++ b/core/definitions/src/vaa/functions.ts @@ -165,7 +165,7 @@ export function deserialize( ): DistributiveVAA> { if (typeof data === "string") data = encoding.hex.decode(data); - const [header, envelopeOffset] = deserializeLayout(headerLayout, data, { consumeAll: false }); + const [header, headerSize] = deserializeLayout(headerLayout, data, false); //ensure that guardian signature indicies are unique and in ascending order - see: //https://github.com/wormhole-foundation/wormhole/blob/8e0cf4c31f39b5ba06b0f6cdb6e690d3adf3d6a3/ethereum/contracts/Messages.sol#L121 @@ -173,18 +173,18 @@ export function deserialize( if (header.signatures[i]!.guardianIndex <= header.signatures[i - 1]!.guardianIndex) throw new Error("Guardian signatures must be in ascending order of guardian set index"); - const [envelope, payloadOffset] = deserializeLayout(envelopeLayout, data, { - offset: envelopeOffset, - consumeAll: false, - }); + const envelopeOffset = headerSize; + const [envelope, envelopeSize] = + deserializeLayout(envelopeLayout, data.subarray(envelopeOffset), false); + const payloadOffset = envelopeOffset + envelopeSize; const [payloadLiteral, payload] = typeof payloadDet === "string" ? [ payloadDet as PayloadLiteral, - deserializePayload(payloadDet as PayloadLiteral, data, payloadOffset), + deserializePayload(payloadDet as PayloadLiteral, data.subarray(payloadOffset)), ] - : deserializePayload(payloadDet as PayloadDiscriminator, data, payloadOffset); + : deserializePayload(payloadDet as PayloadDiscriminator, data.subarray(payloadOffset)); const [protocolName, payloadName] = decomposeLiteral(payloadLiteral); const hash = keccak256(data.slice(envelopeOffset)); @@ -231,7 +231,7 @@ export function deserializePayload; } @@ -322,11 +325,8 @@ export const deserializeUnknownVaa = (data: Uint8Array) => { { name: "consistencyLevel", binary: "uint", size: 1 }, ] as const satisfies Layout; - const [header, offset] = deserializeLayout(headerLayout, data, { consumeAll: false }); - const [envelope, offset2] = deserializeLayout(envelopeLayout, data, { - offset: offset, - consumeAll: false, - }); + const [header, offset] = deserializeLayout(headerLayout, data, false); + const [envelope, offset2] = deserializeLayout(envelopeLayout, data.subarray(offset), false); return { ...header, diff --git a/package-lock.json b/package-lock.json index 1a36d212b..df80d41ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ts-sdk", - "version": "0.14.0", + "version": "1.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ts-sdk", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "workspaces": [ "core/base", @@ -59,11 +59,11 @@ }, "connect": { "name": "@wormhole-foundation/sdk-connect", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-base": "0.14.0", - "@wormhole-foundation/sdk-definitions": "0.14.0", + "@wormhole-foundation/sdk-base": "1.0.3", + "@wormhole-foundation/sdk-definitions": "1.0.3", "axios": "^1.4.0" }, "engines": { @@ -72,19 +72,20 @@ }, "core/base": { "name": "@wormhole-foundation/sdk-base", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@scure/base": "^1.1.3" + "@scure/base": "^1.1.3", + "binary-layout": "^1.0.3" } }, "core/definitions": { "name": "@wormhole-foundation/sdk-definitions", - "version": "0.14.0", + "version": "1.0.3", "dependencies": { "@noble/curves": "^1.4.0", "@noble/hashes": "^1.3.1", - "@wormhole-foundation/sdk-base": "0.14.0" + "@wormhole-foundation/sdk-base": "1.0.3" } }, "core/definitions/node_modules/@noble/curves": { @@ -109,10 +110,10 @@ }, "core/icons": { "name": "@wormhole-foundation/sdk-icons", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-base": "0.14.0" + "@wormhole-foundation/sdk-base": "1.0.3" }, "devDependencies": { "tsx": "^4.7.0" @@ -120,10 +121,10 @@ }, "examples": { "name": "@wormhole-foundation/connect-sdk-examples", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk": "0.14.0" + "@wormhole-foundation/sdk": "1.0.3" }, "devDependencies": { "dotenv": "^16.3.1", @@ -3390,6 +3391,12 @@ "node": ">=8" } }, + "node_modules/binary-layout": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/binary-layout/-/binary-layout-1.0.3.tgz", + "integrity": "sha512-kpXCSOko4wbQaQswZk4IPcjVZwN77TKZgjMacdoX54EvUHAn/CzJclCt25SUmpXfzFrGovoq3LkPJkMy10bZxQ==", + "license": "Apache-2.0" + }, "node_modules/bindings": { "version": "1.5.0", "license": "MIT", @@ -8972,10 +8979,10 @@ }, "platforms/algorand": { "name": "@wormhole-foundation/sdk-algorand", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", "algosdk": "2.7.0" }, "engines": { @@ -8984,11 +8991,11 @@ }, "platforms/algorand/protocols/core": { "name": "@wormhole-foundation/sdk-algorand-core", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.14.0", - "@wormhole-foundation/sdk-connect": "0.14.0" + "@wormhole-foundation/sdk-algorand": "1.0.3", + "@wormhole-foundation/sdk-connect": "1.0.3" }, "engines": { "node": ">=16" @@ -8996,12 +9003,12 @@ }, "platforms/algorand/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-algorand-tokenbridge", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.14.0", - "@wormhole-foundation/sdk-algorand-core": "0.14.0", - "@wormhole-foundation/sdk-connect": "0.14.0" + "@wormhole-foundation/sdk-algorand": "1.0.3", + "@wormhole-foundation/sdk-algorand-core": "1.0.3", + "@wormhole-foundation/sdk-connect": "1.0.3" }, "engines": { "node": ">=16" @@ -9009,10 +9016,10 @@ }, "platforms/aptos": { "name": "@wormhole-foundation/sdk-aptos", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", "aptos": "1.21.0" }, "engines": { @@ -9021,11 +9028,11 @@ }, "platforms/aptos/protocols/core": { "name": "@wormhole-foundation/sdk-aptos-core", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.14.0", - "@wormhole-foundation/sdk-connect": "0.14.0" + "@wormhole-foundation/sdk-aptos": "1.0.3", + "@wormhole-foundation/sdk-connect": "1.0.3" }, "engines": { "node": ">=16" @@ -9033,11 +9040,11 @@ }, "platforms/aptos/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-aptos-tokenbridge", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-aptos": "0.14.0", - "@wormhole-foundation/sdk-connect": "0.14.0" + "@wormhole-foundation/sdk-aptos": "1.0.3", + "@wormhole-foundation/sdk-connect": "1.0.3" }, "engines": { "node": ">=16" @@ -9045,14 +9052,14 @@ }, "platforms/cosmwasm": { "name": "@wormhole-foundation/sdk-cosmwasm", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/proto-signing": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", "cosmjs-types": "^0.9.0" }, "engines": { @@ -9061,14 +9068,14 @@ }, "platforms/cosmwasm/protocols/core": { "name": "@wormhole-foundation/sdk-cosmwasm-core", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm": "1.0.3" }, "engines": { "node": ">=16" @@ -9076,15 +9083,15 @@ }, "platforms/cosmwasm/protocols/ibc": { "name": "@wormhole-foundation/sdk-cosmwasm-ibc", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@cosmjs/stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm-core": "1.0.3", "cosmjs-types": "^0.9.0" }, "engines": { @@ -9093,13 +9100,13 @@ }, "platforms/cosmwasm/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-cosmwasm-tokenbridge", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.0", "@injectivelabs/sdk-ts": "^1.14.13-beta.2", - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm": "1.0.3" }, "engines": { "node": ">=16" @@ -9107,10 +9114,10 @@ }, "platforms/evm": { "name": "@wormhole-foundation/sdk-evm", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", "ethers": "^6.5.1" }, "devDependencies": { @@ -9122,11 +9129,11 @@ }, "platforms/evm/protocols/cctp": { "name": "@wormhole-foundation/sdk-evm-cctp", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-evm": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-evm": "1.0.3", "ethers": "^6.5.1" }, "engines": { @@ -9135,11 +9142,11 @@ }, "platforms/evm/protocols/core": { "name": "@wormhole-foundation/sdk-evm-core", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-evm": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-evm": "1.0.3", "ethers": "^6.5.1" }, "engines": { @@ -9148,13 +9155,13 @@ }, "platforms/evm/protocols/portico": { "name": "@wormhole-foundation/sdk-evm-portico", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-evm": "0.14.0", - "@wormhole-foundation/sdk-evm-core": "0.14.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-evm": "1.0.3", + "@wormhole-foundation/sdk-evm-core": "1.0.3", + "@wormhole-foundation/sdk-evm-tokenbridge": "1.0.3", "ethers": "^6.5.1" }, "engines": { @@ -9163,12 +9170,12 @@ }, "platforms/evm/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-evm-tokenbridge", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-evm": "0.14.0", - "@wormhole-foundation/sdk-evm-core": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-evm": "1.0.3", + "@wormhole-foundation/sdk-evm-core": "1.0.3", "ethers": "^6.5.1" }, "engines": { @@ -9177,14 +9184,14 @@ }, "platforms/solana": { "name": "@wormhole-foundation/sdk-solana", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.14.0", + "@wormhole-foundation/sdk-connect": "1.0.3", "rpc-websockets": "^7.10.0" }, "devDependencies": { @@ -9196,14 +9203,14 @@ }, "platforms/solana/protocols/cctp": { "name": "@wormhole-foundation/sdk-solana-cctp", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-solana": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-solana": "1.0.3" }, "engines": { "node": ">=16" @@ -9211,14 +9218,14 @@ }, "platforms/solana/protocols/core": { "name": "@wormhole-foundation/sdk-solana-core", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-solana": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-solana": "1.0.3" }, "engines": { "node": ">=16" @@ -9226,15 +9233,15 @@ }, "platforms/solana/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-solana-tokenbridge", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", "@solana/web3.js": "^1.95.2", - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-solana": "0.14.0", - "@wormhole-foundation/sdk-solana-core": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-solana": "1.0.3", + "@wormhole-foundation/sdk-solana-core": "1.0.3" }, "engines": { "node": ">=16" @@ -9242,11 +9249,11 @@ }, "platforms/sui": { "name": "@wormhole-foundation/sdk-sui", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3" }, "engines": { "node": ">=16" @@ -9254,12 +9261,12 @@ }, "platforms/sui/protocols/core": { "name": "@wormhole-foundation/sdk-sui-core", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-sui": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-sui": "1.0.3" }, "engines": { "node": ">=16" @@ -9267,13 +9274,13 @@ }, "platforms/sui/protocols/tokenBridge": { "name": "@wormhole-foundation/sdk-sui-tokenbridge", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.50.1", - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-sui": "0.14.0", - "@wormhole-foundation/sdk-sui-core": "0.14.0" + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-sui": "1.0.3", + "@wormhole-foundation/sdk-sui-core": "1.0.3" }, "engines": { "node": ">=16" @@ -9281,34 +9288,34 @@ }, "sdk": { "name": "@wormhole-foundation/sdk", - "version": "0.14.0", + "version": "1.0.3", "license": "Apache-2.0", "dependencies": { - "@wormhole-foundation/sdk-algorand": "0.14.0", - "@wormhole-foundation/sdk-algorand-core": "0.14.0", - "@wormhole-foundation/sdk-algorand-tokenbridge": "0.14.0", - "@wormhole-foundation/sdk-aptos": "0.14.0", - "@wormhole-foundation/sdk-aptos-core": "0.14.0", - "@wormhole-foundation/sdk-aptos-tokenbridge": "0.14.0", - "@wormhole-foundation/sdk-base": "0.14.0", - "@wormhole-foundation/sdk-connect": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm-core": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm-ibc": "0.14.0", - "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "0.14.0", - "@wormhole-foundation/sdk-definitions": "0.14.0", - "@wormhole-foundation/sdk-evm": "0.14.0", - "@wormhole-foundation/sdk-evm-cctp": "0.14.0", - "@wormhole-foundation/sdk-evm-core": "0.14.0", - "@wormhole-foundation/sdk-evm-portico": "0.14.0", - "@wormhole-foundation/sdk-evm-tokenbridge": "0.14.0", - "@wormhole-foundation/sdk-solana": "0.14.0", - "@wormhole-foundation/sdk-solana-cctp": "0.14.0", - "@wormhole-foundation/sdk-solana-core": "0.14.0", - "@wormhole-foundation/sdk-solana-tokenbridge": "0.14.0", - "@wormhole-foundation/sdk-sui": "0.14.0", - "@wormhole-foundation/sdk-sui-core": "0.14.0", - "@wormhole-foundation/sdk-sui-tokenbridge": "0.14.0" + "@wormhole-foundation/sdk-algorand": "1.0.3", + "@wormhole-foundation/sdk-algorand-core": "1.0.3", + "@wormhole-foundation/sdk-algorand-tokenbridge": "1.0.3", + "@wormhole-foundation/sdk-aptos": "1.0.3", + "@wormhole-foundation/sdk-aptos-core": "1.0.3", + "@wormhole-foundation/sdk-aptos-tokenbridge": "1.0.3", + "@wormhole-foundation/sdk-base": "1.0.3", + "@wormhole-foundation/sdk-connect": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm-core": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm-ibc": "1.0.3", + "@wormhole-foundation/sdk-cosmwasm-tokenbridge": "1.0.3", + "@wormhole-foundation/sdk-definitions": "1.0.3", + "@wormhole-foundation/sdk-evm": "1.0.3", + "@wormhole-foundation/sdk-evm-cctp": "1.0.3", + "@wormhole-foundation/sdk-evm-core": "1.0.3", + "@wormhole-foundation/sdk-evm-portico": "1.0.3", + "@wormhole-foundation/sdk-evm-tokenbridge": "1.0.3", + "@wormhole-foundation/sdk-solana": "1.0.3", + "@wormhole-foundation/sdk-solana-cctp": "1.0.3", + "@wormhole-foundation/sdk-solana-core": "1.0.3", + "@wormhole-foundation/sdk-solana-tokenbridge": "1.0.3", + "@wormhole-foundation/sdk-sui": "1.0.3", + "@wormhole-foundation/sdk-sui-core": "1.0.3", + "@wormhole-foundation/sdk-sui-tokenbridge": "1.0.3" }, "engines": { "node": ">=16" diff --git a/platforms/aptos/protocols/tokenBridge/src/foreignAddress.ts b/platforms/aptos/protocols/tokenBridge/src/foreignAddress.ts index d1fde0019..fac168d6b 100644 --- a/platforms/aptos/protocols/tokenBridge/src/foreignAddress.ts +++ b/platforms/aptos/protocols/tokenBridge/src/foreignAddress.ts @@ -1,4 +1,6 @@ -import { encoding, layout, layoutItems } from "@wormhole-foundation/sdk-connect"; +import type { Layout, LayoutToType } from "@wormhole-foundation/sdk-base"; +import { encoding, serializeLayout } from "@wormhole-foundation/sdk-base"; +import { layoutItems } from "@wormhole-foundation/sdk-definitions"; import { APTOS_SEPARATOR } from "@wormhole-foundation/sdk-aptos"; const foreignAddressSeedLayout = [ @@ -13,8 +15,8 @@ const foreignAddressSeedLayout = [ { name: "tokenId", ...layoutItems.universalAddressItem }, // from https://github.com/aptos-labs/aptos-core/blob/25696fd266498d81d346fe86e01c330705a71465/aptos-move/framework/aptos-framework/sources/account.move#L90-L95 { name: "domainSeparator", binary: "bytes", custom: new Uint8Array([0xff]), omit: true }, -] as const satisfies layout.Layout; +] as const satisfies Layout; export const serializeForeignAddressSeeds = ( - data: layout.LayoutToType, -): Uint8Array => layout.serializeLayout(foreignAddressSeedLayout, data); + data: LayoutToType, +): Uint8Array => serializeLayout(foreignAddressSeedLayout, data); From cff7ce237f5185bb7b0fb6da45f9417473019751 Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Mon, 25 Nov 2024 14:13:05 -0500 Subject: [PATCH 65/69] Make sure both chains are supported (#744) * make sure both chains are supported (this is useful in case supportedDestinationTokens doesn't verify this) * verify network too --- connect/src/routes/resolver.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/connect/src/routes/resolver.ts b/connect/src/routes/resolver.ts index a128ed3da..21765da6e 100644 --- a/connect/src/routes/resolver.ts +++ b/connect/src/routes/resolver.ts @@ -44,6 +44,16 @@ export class RouteResolver { const [, inputTokenId] = resolveWrappedToken(fromChain.network, fromChain.chain, inputToken); const tokens = await Promise.all( this.routeConstructors.map(async (rc) => { + const supportedNetworks = rc.supportedNetworks(); + if (!supportedNetworks.includes(fromChain.network)) { + return []; + } + + const supportedChains = rc.supportedChains(fromChain.network); + if (!supportedChains.includes(fromChain.chain) || !supportedChains.includes(toChain.chain)) { + return []; + } + try { return await rc.supportedDestinationTokens(inputTokenId, fromChain, toChain); } catch (e) { From 9105de290c91babbf8ad031bd89cc75ee38739c8 Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:11:42 -0600 Subject: [PATCH 66/69] sepolia finality should be 72 (#745) --- core/base/src/constants/finality.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/base/src/constants/finality.ts b/core/base/src/constants/finality.ts index a1640aa9a..63fc9f97e 100644 --- a/core/base/src/constants/finality.ts +++ b/core/base/src/constants/finality.ts @@ -72,7 +72,7 @@ const finalityThresholds = [ ["Dymension", 0], ["Provenance",0], // Testnets - ["Sepolia", 96], + ["Sepolia", 72], ["ArbitrumSepolia", 4096], ["BaseSepolia", 512], ["OptimismSepolia", 512], From d4b2fea48fdcae9b8fd4028606ec58dc6bf7f38d Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Tue, 3 Dec 2024 13:21:39 -0500 Subject: [PATCH 67/69] Fix infinite loop in address parsing (#746) * fix potential inifinite loop * simple example file showing how to parse addresses * toNative can handle a UniversalAddress value * add unit tests to document and test this behavior * handle Uint8Array too * check it starts with 0x * test --- core/definitions/__tests__/address.ts | 2 +- core/definitions/src/address.ts | 17 ++++++++++--- core/definitions/src/universalAddress.ts | 2 +- examples/package.json | 3 ++- examples/src/parseAddress.ts | 20 ++++++++++++++++ platforms/evm/__tests__/unit/platform.test.ts | 24 +++++++++++++++++++ 6 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 examples/src/parseAddress.ts diff --git a/core/definitions/__tests__/address.ts b/core/definitions/__tests__/address.ts index 651ea11b8..475fa0a5a 100644 --- a/core/definitions/__tests__/address.ts +++ b/core/definitions/__tests__/address.ts @@ -35,4 +35,4 @@ describe("UniversalAddress tests", function () { const ua = new UniversalAddress(appId, "algorandAppId"); expect(ua.toString()).toEqual(appAddress) }); -}); \ No newline at end of file +}); diff --git a/core/definitions/src/address.ts b/core/definitions/src/address.ts index 0af2f7a52..145099bae 100644 --- a/core/definitions/src/address.ts +++ b/core/definitions/src/address.ts @@ -102,9 +102,20 @@ export function toNative( } return nativeAddress; - } catch (_) { - // try to parse it as a universal address - return (UniversalAddress.instanceof(ua) ? ua : new UniversalAddress(ua)).toNative(chain); + } catch (e: any) { + const err = `Error parsing address as a native ${chain} address: ${e.message}`; + + if (UniversalAddress.instanceof(ua)) { + throw err; + } else { + // If we were given a string or Uint8Array value, which is ambiguously either a + // NativeAddress or UniversalAddress, and it failed to parse directly + // as a NativeAddress, we try one more time to parse it as a UniversalAddress + // first and then convert that to a NativeAddress. + console.error(err); + console.error('Attempting to parse as UniversalAddress'); + return (new UniversalAddress(ua)).toNative(chain); + } } } diff --git a/core/definitions/src/universalAddress.ts b/core/definitions/src/universalAddress.ts index caa9a41a4..ff14a3bb5 100644 --- a/core/definitions/src/universalAddress.ts +++ b/core/definitions/src/universalAddress.ts @@ -26,7 +26,7 @@ export class UniversalAddress implements Address { } toNative[0]>(chainOrPlatform: T): NativeAddress { - return toNative(chainOrPlatform, this.toUint8Array()); + return toNative(chainOrPlatform, this); } unwrap(): Uint8Array { diff --git a/examples/package.json b/examples/package.json index 9d4af61b7..2dc9d970f 100644 --- a/examples/package.json +++ b/examples/package.json @@ -37,6 +37,7 @@ "wrapped": "tsx src/createWrapped.ts", "tb": "tsx src/tokenBridge.ts", "cctp": "tsx src/cctp.ts", + "parseAddress": "tsx src/parseAddress.ts", "demo": "tsx src/index.ts", "cosmos": "tsx src/cosmos.ts", "msg": "tsx src/messaging.ts", @@ -53,4 +54,4 @@ "dependencies": { "@wormhole-foundation/sdk": "1.0.3" } -} \ No newline at end of file +} diff --git a/examples/src/parseAddress.ts b/examples/src/parseAddress.ts new file mode 100644 index 000000000..79d08d4ce --- /dev/null +++ b/examples/src/parseAddress.ts @@ -0,0 +1,20 @@ +import { toNative, toUniversal } from "@wormhole-foundation/sdk"; + +const ETHEREUM_ADDRESS = '0xaaee1a9723aadb7afa2810263653a34ba2c21c7a'; +const ETHEREUM_ADDRESS_UNIVERSAL = toUniversal('Ethereum', ETHEREUM_ADDRESS).toString(); + +(async function () { + // We can parse an Ethereum address from its native or universal format + const parsedEthereumAddr1 = toNative('Ethereum', ETHEREUM_ADDRESS); + const parsedEthereumAddr2 = toNative('Ethereum', ETHEREUM_ADDRESS_UNIVERSAL); + console.log(parsedEthereumAddr1); + console.log(parsedEthereumAddr2); + + // Parsing a Sui address as Ethereum will throw: + try { + toNative('Ethereum', '0xabd62c91e3bd89243c592b93b9f45cf9f584be3df4574e05ae31d02fcfef67fc'); + } catch (e) { + console.error(e); + } +})(); + diff --git a/platforms/evm/__tests__/unit/platform.test.ts b/platforms/evm/__tests__/unit/platform.test.ts index 196a82321..a4947ad9e 100644 --- a/platforms/evm/__tests__/unit/platform.test.ts +++ b/platforms/evm/__tests__/unit/platform.test.ts @@ -20,6 +20,10 @@ import { chains, } from '@wormhole-foundation/sdk-connect'; +import { + toNative, +} from '@wormhole-foundation/sdk-definitions'; + import '@wormhole-foundation/sdk-evm-core'; import '@wormhole-foundation/sdk-evm-tokenbridge'; import { EvmPlatform } from '../../src/platform.js'; @@ -38,6 +42,26 @@ const configs = CONFIG[network].chains; // const satisfiesInterface: PlatformUtils = EvmPlatform; describe('EVM Platform Tests', () => { + describe("Parse Ethereum address", function () { + test("should correctly parse Ethereum addresses", () => { + expect(() => + toNative('Ethereum', '0xaaee1a9723aadb7afa2810263653a34ba2c21c7a') + ).toBeTruthy(); + }); + + test("should correctly handle zero-padded Ethereum addresses (in universal address format)", () => { + expect(() => + toNative('Ethereum', '0x000000000000000000000000aaee1a9723aadb7afa2810263653a34ba2c21c7a') + ).toBeTruthy(); + }); + + test("should throw when parsing an invalid Ethereum addresses", () => { + expect(() => + toNative('Ethereum', '0xabd62c91e3bd89243c592b93b9f45cf9f584be3df4574e05ae31d02fcfef67fc') + ).toThrow(); + }); + }); + describe('Get Token Bridge', () => { test('No RPC', async () => { const p = new EvmPlatform(network, {}); From bfedcc626f25e252340e55411c1d0a7ecade2acb Mon Sep 17 00:00:00 2001 From: kev1n-peters <96065607+kev1n-peters@users.noreply.github.com> Date: Wed, 4 Dec 2024 08:28:11 -0600 Subject: [PATCH 68/69] bump @solana/web3.js to ^1.95.8 (#747) --- package-lock.json | 17 +++++++++-------- platforms/solana/package.json | 4 ++-- platforms/solana/protocols/cctp/package.json | 2 +- platforms/solana/protocols/core/package.json | 2 +- .../solana/protocols/tokenBridge/package.json | 2 +- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index df80d41ca..4f15a043c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2260,11 +2260,12 @@ } }, "node_modules/@solana/web3.js": { - "version": "1.95.2", - "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.95.2.tgz", - "integrity": "sha512-SjlHp0G4qhuhkQQc+YXdGkI8EerCqwxvgytMgBpzMUQTafrkNant3e7pgilBGgjy/iM40ICvWBLgASTPMrQU7w==", + "version": "1.95.8", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.95.8.tgz", + "integrity": "sha512-sBHzNh7dHMrmNS5xPD1d0Xa2QffW/RXaxu/OysRXBfwTp+LYqGGmMtCYYwrHPrN5rjAmJCsQRNAwv4FM0t3B6g==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.24.8", + "@babel/runtime": "^7.25.0", "@noble/curves": "^1.4.2", "@noble/hashes": "^1.4.0", "@solana/buffer-layout": "^4.0.1", @@ -9190,7 +9191,7 @@ "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", - "@solana/web3.js": "^1.95.2", + "@solana/web3.js": "^1.95.8", "@wormhole-foundation/sdk-connect": "1.0.3", "rpc-websockets": "^7.10.0" }, @@ -9208,7 +9209,7 @@ "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", - "@solana/web3.js": "^1.95.2", + "@solana/web3.js": "^1.95.8", "@wormhole-foundation/sdk-connect": "1.0.3", "@wormhole-foundation/sdk-solana": "1.0.3" }, @@ -9223,7 +9224,7 @@ "dependencies": { "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", - "@solana/web3.js": "^1.95.2", + "@solana/web3.js": "^1.95.8", "@wormhole-foundation/sdk-connect": "1.0.3", "@wormhole-foundation/sdk-solana": "1.0.3" }, @@ -9238,7 +9239,7 @@ "dependencies": { "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", - "@solana/web3.js": "^1.95.2", + "@solana/web3.js": "^1.95.8", "@wormhole-foundation/sdk-connect": "1.0.3", "@wormhole-foundation/sdk-solana": "1.0.3", "@wormhole-foundation/sdk-solana-core": "1.0.3" diff --git a/platforms/solana/package.json b/platforms/solana/package.json index 3203f11ab..c7584fed9 100644 --- a/platforms/solana/package.json +++ b/platforms/solana/package.json @@ -52,7 +52,7 @@ "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.29.0", "@solana/spl-token": "0.3.9", - "@solana/web3.js": "^1.95.2", + "@solana/web3.js": "^1.95.8", "@wormhole-foundation/sdk-connect": "1.0.3", "rpc-websockets": "^7.10.0" }, @@ -106,4 +106,4 @@ } } } -} \ No newline at end of file +} diff --git a/platforms/solana/protocols/cctp/package.json b/platforms/solana/protocols/cctp/package.json index f3dcf52f0..4ca320a1f 100644 --- a/platforms/solana/protocols/cctp/package.json +++ b/platforms/solana/protocols/cctp/package.json @@ -52,7 +52,7 @@ "@wormhole-foundation/sdk-solana": "1.0.3", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", - "@solana/web3.js": "^1.95.2" + "@solana/web3.js": "^1.95.8" }, "type": "module", "exports": { diff --git a/platforms/solana/protocols/core/package.json b/platforms/solana/protocols/core/package.json index ffb1e7bf0..2af98b20a 100644 --- a/platforms/solana/protocols/core/package.json +++ b/platforms/solana/protocols/core/package.json @@ -49,7 +49,7 @@ "@wormhole-foundation/sdk-solana": "1.0.3", "@coral-xyz/borsh": "0.29.0", "@coral-xyz/anchor": "0.29.0", - "@solana/web3.js": "^1.95.2" + "@solana/web3.js": "^1.95.8" }, "type": "module", "exports": { diff --git a/platforms/solana/protocols/tokenBridge/package.json b/platforms/solana/protocols/tokenBridge/package.json index 64bc8fb81..c4c9a61d8 100644 --- a/platforms/solana/protocols/tokenBridge/package.json +++ b/platforms/solana/protocols/tokenBridge/package.json @@ -50,7 +50,7 @@ "@wormhole-foundation/sdk-solana-core": "1.0.3", "@coral-xyz/anchor": "0.29.0", "@solana/spl-token": "0.3.9", - "@solana/web3.js": "^1.95.2" + "@solana/web3.js": "^1.95.8" }, "type": "module", "exports": { From a4f49e39bf0609593359a050891e0c15abe4f86f Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Wed, 11 Dec 2024 10:41:11 -0500 Subject: [PATCH 69/69] ensure token address is a string --- platforms/solana/src/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/solana/src/platform.ts b/platforms/solana/src/platform.ts index 5f133e71a..72c6847db 100644 --- a/platforms/solana/src/platform.ts +++ b/platforms/solana/src/platform.ts @@ -169,7 +169,7 @@ export class SolanaPlatform } const addrString = new SolanaAddress(token).toString(); const amount = splParsedTokenAccounts.find( - (v) => v?.account.data.parsed?.info?.mint === token, + (v) => v?.account.data.parsed?.info?.mint === token.toString(), )?.account.data.parsed?.info?.tokenAmount?.amount; if (!amount) return { [addrString]: null }; return { [addrString]: BigInt(amount) };