From 4745c1fc5f27f3cbc32a6e185cc00f68687ceb61 Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Fri, 11 Oct 2024 09:39:26 -0400 Subject: [PATCH] more replacements --- README.md | 8 ++++---- Tiltfile | 8 ++++---- __tests__/Dockerfile | 10 +++++----- __tests__/tests.yaml | 6 +++--- __tests__/wait-run.sh | 2 +- docs/index.html | 6 +++--- docs/modules/_wormhole_foundation_sdk.html | 6 +++--- docs/modules/_wormhole_foundation_sdk_connect.html | 6 +++--- sdk/README.md | 6 +++--- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 3abc32007..e51ee43ff 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The Wormhole Typescript SDK is useful for interacting with the chains Wormhole s ## Warning -: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: +: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/wormhole-sdk-ts/issues) any issues you find. :warning: ## Installation @@ -108,7 +108,7 @@ Understanding several higher level concepts of the SDK will help in using it eff Every chain is its own special snowflake but many of them share similar functionality. The `Platform` modules provide a consistent interface for interacting with the chains that share a platform. Each platform can be installed separately so that dependencies can stay as slim as possible. -See all supported platforms [here](https://github.com/wormhole-foundation/connect-sdk/tree/main/platforms) +See all supported platforms [here](https://github.com/wormhole-foundation/wormhole-sdk-ts/tree/main/platforms) ### Chain Context @@ -207,7 +207,7 @@ export interface SignAndSendSigner { } ``` -See the testing signers ([Evm](https://github.com/wormhole-foundation/connect-sdk/blob/main/platforms/evm/src/signer.ts), [Solana](https://github.com/wormhole-foundation/connect-sdk/blob/main/platforms/solana/src/signer.ts), ...) for an example of how to implement a signer for a specific chain or platform. +See the testing signers ([Evm](https://github.com/wormhole-foundation/wormhole-sdk-ts/blob/main/platforms/evm/src/signer.ts), [Solana](https://github.com/wormhole-foundation/wormhole-sdk-ts/blob/main/platforms/solana/src/signer.ts), ...) for an example of how to implement a signer for a specific chain or platform. ### VAAs @@ -402,7 +402,7 @@ const txGenerator = tb.createAttestation(token); // => AsyncGenerator TxHash[] ``` -Supported protocols are defined in the [definitions module](https://github.com/wormhole-foundation/connect-sdk/tree/main/core/definitions/src/protocols). +Supported protocols are defined in the [definitions module](https://github.com/wormhole-foundation/wormhole-sdk-ts/tree/main/core/definitions/src/protocols). ## Transfers diff --git a/Tiltfile b/Tiltfile index 5784d3b32..c9ce2f92a 100644 --- a/Tiltfile +++ b/Tiltfile @@ -6,14 +6,14 @@ load("__tests__/staging/wormhole/Tiltfile", "namespace", "k8s_yaml_with_ns", "se config.clear_enabled_resources() config.set_enabled_resources([ "guardian", # Also adds in all the chains we need - "connect-sdk-ci-tests" + "wormhole-sdk-ts-ci-tests" ]) # Without this, some resources cant find the namespace? namespace_create(namespace, allow_duplicates=True) docker_build( - ref = "connect-sdk-test", + ref = "wormhole-sdk-ts-test", context = ".", dockerfile = "__tests__/Dockerfile", only = [], @@ -22,8 +22,8 @@ docker_build( k8s_yaml_with_ns(encode_yaml_stream(set_env_in_jobs(read_yaml_stream("__tests__/tests.yaml"), "NUM_GUARDIANS", str(num_guardians)))) k8s_resource( - "connect-sdk-ci-tests", - labels = ["connect-sdk-ci"], + "wormhole-sdk-ts-ci-tests", + labels = ["wormhole-sdk-ts-ci"], trigger_mode = TRIGGER_MODE_AUTO, resource_deps = [], # wait-run.sh, specified in the tests.yaml file, handles waiting. Not having deps gets the build earlier. ) \ No newline at end of file diff --git a/__tests__/Dockerfile b/__tests__/Dockerfile index 76bd24f1b..8223b0fa8 100644 --- a/__tests__/Dockerfile +++ b/__tests__/Dockerfile @@ -9,12 +9,12 @@ RUN npm i typescript -g RUN mkdir -p /app WORKDIR /app -COPY package.json package-lock.json ./connect-sdk/ +COPY package.json package-lock.json ./wormhole-sdk-ts/ RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \ - npm ci --prefix connect-sdk -COPY . ./connect-sdk -RUN npm run rebuild --prefix connect-sdk + npm ci --prefix wormhole-sdk-ts +COPY . ./wormhole-sdk-ts +RUN npm run rebuild --prefix wormhole-sdk-ts RUN mkdir -p testing COPY __tests__/wait-run.sh ./testing -WORKDIR /app/testing \ No newline at end of file +WORKDIR /app/testing diff --git a/__tests__/tests.yaml b/__tests__/tests.yaml index 3e975ca91..629236b08 100644 --- a/__tests__/tests.yaml +++ b/__tests__/tests.yaml @@ -1,15 +1,15 @@ kind: Job apiVersion: batch/v1 metadata: - name: connect-sdk-ci-tests + name: wormhole-sdk-ts-ci-tests spec: backoffLimit: 0 template: spec: restartPolicy: Never containers: - - name: connect-sdk-ci-tests - image: connect-sdk-test + - name: wormhole-sdk-ts-ci-tests + image: wormhole-sdk-ts-test command: - /bin/sh - -c diff --git a/__tests__/wait-run.sh b/__tests__/wait-run.sh index 96c5b4df0..64c957358 100644 --- a/__tests__/wait-run.sh +++ b/__tests__/wait-run.sh @@ -4,4 +4,4 @@ num=${NUM_GUARDIANS:-1} # default value for NUM_GUARDIANS = 1 for ((i=0; iWormhole TS SDK - v0.7.0

Wormhole TS SDK - v0.7.0

Wormhole TS SDK

The Wormhole Typescript SDK is useful for interacting with the chains Wormhole supports and the protocols built on top of Wormhole.

-

Warning

:warning: This package is a Work in Progress so the interface may change and there are likely bugs. Please report any issues you find. :warning:

+

Warning

:warning: This package is a Work in Progress so the interface may change and there are likely bugs. Please report any issues you find. :warning:

Installation

Basic

Install the (meta) package

npm install @wormhole-foundation/sdk
 
@@ -59,7 +59,7 @@

Signers

In order to sign transactions, an object that fulfils the Signer interface is required. This is a simple interface that can be implemented by wrapping a web wallet or other signing mechanism.

// A Signer is an interface that must be provided to certain methods
// in the SDK to sign transactions. It can be either a SignOnlySigner
// or a SignAndSendSigner depending on circumstances.
// A Signer can be implemented by wrapping an existing offline wallet
// or a web wallet
export type Signer = SignOnlySigner | SignAndSendSigner;

// A SignOnlySender is for situations where the signer is not
// connected to the network or does not wish to broadcast the
// transactions themselves
export interface SignOnlySigner {
chain(): ChainName;
address(): string;
// Accept an array of unsigned transactions and return
// an array of signed and serialized transactions.
// The transactions may be inspected or altered before
// signing.
// Note: The serialization is chain specific, if in doubt,
// see the example implementations linked below
sign(tx: UnsignedTransaction[]): Promise<SignedTx[]>;
}

// A SignAndSendSigner is for situations where the signer is
// connected to the network and wishes to broadcast the
// transactions themselves
export interface SignAndSendSigner {
chain(): ChainName;
address(): string;
// Accept an array of unsigned transactions and return
// an array of transaction ids in the same order as the
// UnsignedTransactions array.
signAndSend(tx: UnsignedTransaction[]): Promise<TxHash[]>;
}
-

See the testing signers (Evm, Solana, ...) for an example of how to implement a signer for a specific chain or platform.

+

See the testing signers (Evm, Solana, ...) for an example of how to implement a signer for a specific chain or platform.

Protocols

While Wormhole itself is a Generic Message Passing protocol, a number of protocols have been built on top of it to provide specific functionality.

Each Protocol, if available, will have a Platform specific implementation. These implementations provide methods to generate transactions or read state from the contract on-chain.

Wormhole Core

The protocol that underlies all Wormhole activity is the Core protocol. This protocol is responsible for emitting the message containing the information necessary to perform bridging including Emitter address, the Sequence number for the message and the Payload of the message itself.

@@ -75,7 +75,7 @@

Using the WormholeTransfer abstractions is the recommended way to interact with these protocols but it is possible to use them directly

import { signSendWait } from "@wormhole-foundation/sdk";

// ...

const tb = await srcChain.getTokenBridge(); // => TokenBridge<'Evm'>

const token = "0xdeadbeef...";
const txGenerator = tb.createAttestation(token); // => AsyncGenerator<UnsignedTransaction, ...>
const txids = await signSendWait(srcChain, txGenerator, src.signer); // => TxHash[]
-

Supported protocols are defined in the definitions module.

+

Supported protocols are defined in the definitions module.

Transfers

While using the ChainContext and Protocol clients directly is possible, to do things like transfer tokens, the SDK provides some helpful abstractions.

The WormholeTransfer interface provides a convenient abstraction to encapsulate the steps involved in a cross-chain transfer.

Token Transfers

Performing a Token Transfer is trivial for any source and destination chains.

diff --git a/docs/modules/_wormhole_foundation_sdk.html b/docs/modules/_wormhole_foundation_sdk.html index 4a242125b..7ffe20957 100644 --- a/docs/modules/_wormhole_foundation_sdk.html +++ b/docs/modules/_wormhole_foundation_sdk.html @@ -1,5 +1,5 @@ @wormhole-foundation/sdk - v0.7.0 | Wormhole TS SDK - v0.7.0

Module @wormhole-foundation/sdk - v0.7.0

Wormhole TS SDK

The Wormhole Typescript SDK is useful for interacting with the chains Wormhole supports and the protocols built on top of Wormhole.

-

Warning

:warning: This package is a Work in Progress so the interface may change and there are likely bugs. Please report any issues you find. :warning:

+

Warning

:warning: This package is a Work in Progress so the interface may change and there are likely bugs. Please report any issues you find. :warning:

Installation

Basic

Install the (meta) package

npm install @wormhole-foundation/sdk
 
@@ -59,7 +59,7 @@

Signers

In order to sign transactions, an object that fulfils the Signer interface is required. This is a simple interface that can be implemented by wrapping a web wallet or other signing mechanism.

// A Signer is an interface that must be provided to certain methods
// in the SDK to sign transactions. It can be either a SignOnlySigner
// or a SignAndSendSigner depending on circumstances.
// A Signer can be implemented by wrapping an existing offline wallet
// or a web wallet
export type Signer = SignOnlySigner | SignAndSendSigner;

// A SignOnlySender is for situations where the signer is not
// connected to the network or does not wish to broadcast the
// transactions themselves
export interface SignOnlySigner {
chain(): ChainName;
address(): string;
// Accept an array of unsigned transactions and return
// an array of signed and serialized transactions.
// The transactions may be inspected or altered before
// signing.
// Note: The serialization is chain specific, if in doubt,
// see the example implementations linked below
sign(tx: UnsignedTransaction[]): Promise<SignedTx[]>;
}

// A SignAndSendSigner is for situations where the signer is
// connected to the network and wishes to broadcast the
// transactions themselves
export interface SignAndSendSigner {
chain(): ChainName;
address(): string;
// Accept an array of unsigned transactions and return
// an array of transaction ids in the same order as the
// UnsignedTransactions array.
signAndSend(tx: UnsignedTransaction[]): Promise<TxHash[]>;
}
-

See the testing signers (Evm, Solana, ...) for an example of how to implement a signer for a specific chain or platform.

+

See the testing signers (Evm, Solana, ...) for an example of how to implement a signer for a specific chain or platform.

Protocols

While Wormhole itself is a Generic Message Passing protocol, a number of protocols have been built on top of it to provide specific functionality.

Each Protocol, if available, will have a Platform specific implementation. These implementations provide methods to generate transactions or read state from the contract on-chain.

Wormhole Core

The protocol that underlies all Wormhole activity is the Core protocol. This protocol is responsible for emitting the message containing the information necessary to perform bridging including Emitter address, the Sequence number for the message and the Payload of the message itself.

@@ -75,7 +75,7 @@

Using the WormholeTransfer abstractions is the recommended way to interact with these protocols but it is possible to use them directly

import { signSendWait } from "@wormhole-foundation/sdk";

// ...

const tb = await srcChain.getTokenBridge(); // => TokenBridge<'Evm'>

const token = "0xdeadbeef...";
const txGenerator = tb.createAttestation(token); // => AsyncGenerator<UnsignedTransaction, ...>
const txids = await signSendWait(srcChain, txGenerator, src.signer); // => TxHash[]
-

Supported protocols are defined in the definitions module.

+

Supported protocols are defined in the definitions module.

Transfers

While using the ChainContext and Protocol clients directly is possible, to do things like transfer tokens, the SDK provides some helpful abstractions.

The WormholeTransfer interface provides a convenient abstraction to encapsulate the steps involved in a cross-chain transfer.

Token Transfers

Performing a Token Transfer is trivial for any source and destination chains.

diff --git a/docs/modules/_wormhole_foundation_sdk_connect.html b/docs/modules/_wormhole_foundation_sdk_connect.html index b2f4ddf61..1e9079a28 100644 --- a/docs/modules/_wormhole_foundation_sdk_connect.html +++ b/docs/modules/_wormhole_foundation_sdk_connect.html @@ -1,5 +1,5 @@ @wormhole-foundation/sdk-connect - v0.7.0 | Wormhole TS SDK - v0.7.0

Module @wormhole-foundation/sdk-connect - v0.7.0

Wormhole TS SDK

The Wormhole Typescript SDK is useful for interacting with the chains Wormhole supports and the protocols built on top of Wormhole.

-

Warning

:warning: This package is a Work in Progress so the interface may change and there are likely bugs. Please report any issues you find. :warning:

+

Warning

:warning: This package is a Work in Progress so the interface may change and there are likely bugs. Please report any issues you find. :warning:

Installation

Basic

Install the (meta) package

npm install @wormhole-foundation/sdk
 
@@ -59,7 +59,7 @@

Signers

In order to sign transactions, an object that fulfils the Signer interface is required. This is a simple interface that can be implemented by wrapping a web wallet or other signing mechanism.

// A Signer is an interface that must be provided to certain methods
// in the SDK to sign transactions. It can be either a SignOnlySigner
// or a SignAndSendSigner depending on circumstances.
// A Signer can be implemented by wrapping an existing offline wallet
// or a web wallet
export type Signer = SignOnlySigner | SignAndSendSigner;

// A SignOnlySender is for situations where the signer is not
// connected to the network or does not wish to broadcast the
// transactions themselves
export interface SignOnlySigner {
chain(): ChainName;
address(): string;
// Accept an array of unsigned transactions and return
// an array of signed and serialized transactions.
// The transactions may be inspected or altered before
// signing.
// Note: The serialization is chain specific, if in doubt,
// see the example implementations linked below
sign(tx: UnsignedTransaction[]): Promise<SignedTx[]>;
}

// A SignAndSendSigner is for situations where the signer is
// connected to the network and wishes to broadcast the
// transactions themselves
export interface SignAndSendSigner {
chain(): ChainName;
address(): string;
// Accept an array of unsigned transactions and return
// an array of transaction ids in the same order as the
// UnsignedTransactions array.
signAndSend(tx: UnsignedTransaction[]): Promise<TxHash[]>;
}
-

See the testing signers (Evm, Solana, ...) for an example of how to implement a signer for a specific chain or platform.

+

See the testing signers (Evm, Solana, ...) for an example of how to implement a signer for a specific chain or platform.

Protocols

While Wormhole itself is a Generic Message Passing protocol, a number of protocols have been built on top of it to provide specific functionality.

Each Protocol, if available, will have a Platform specific implementation. These implementations provide methods to generate transactions or read state from the contract on-chain.

Wormhole Core

The protocol that underlies all Wormhole activity is the Core protocol. This protocol is responsible for emitting the message containing the information necessary to perform bridging including Emitter address, the Sequence number for the message and the Payload of the message itself.

@@ -75,7 +75,7 @@

Using the WormholeTransfer abstractions is the recommended way to interact with these protocols but it is possible to use them directly

import { signSendWait } from "@wormhole-foundation/sdk";

// ...

const tb = await srcChain.getTokenBridge(); // => TokenBridge<'Evm'>

const token = "0xdeadbeef...";
const txGenerator = tb.createAttestation(token); // => AsyncGenerator<UnsignedTransaction, ...>
const txids = await signSendWait(srcChain, txGenerator, src.signer); // => TxHash[]
-

Supported protocols are defined in the definitions module.

+

Supported protocols are defined in the definitions module.

Transfers

While using the ChainContext and Protocol clients directly is possible, to do things like transfer tokens, the SDK provides some helpful abstractions.

The WormholeTransfer interface provides a convenient abstraction to encapsulate the steps involved in a cross-chain transfer.

Token Transfers

Performing a Token Transfer is trivial for any source and destination chains.

diff --git a/sdk/README.md b/sdk/README.md index 4e5271cab..74cb7c932 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -4,7 +4,7 @@ The Wormhole Typescript SDK is useful for interacting with the chains Wormhole s ## Warning -: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: +: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/wormhole-sdk-ts/issues) any issues you find. :warning: ## Installation @@ -211,7 +211,7 @@ export interface SignAndSendSigner { } ``` -See the testing signers ([Evm](https://github.com/wormhole-foundation/connect-sdk/blob/main/platforms/evm/src/signer.ts), [Solana](https://github.com/wormhole-foundation/connect-sdk/blob/main/platforms/solana/src/signer.ts), ...) for an example of how to implement a signer for a specific chain or platform. +See the testing signers ([Evm](https://github.com/wormhole-foundation/wormhole-sdk-ts/blob/main/platforms/evm/src/signer.ts), [Solana](https://github.com/wormhole-foundation/wormhole-sdk-ts/blob/main/platforms/solana/src/signer.ts), ...) for an example of how to implement a signer for a specific chain or platform. ### Protocols @@ -293,7 +293,7 @@ const txGenerator = tb.createAttestation(token); // => AsyncGenerator TxHash[] ``` -Supported protocols are defined in the [definitions module](https://github.com/wormhole-foundation/connect-sdk/tree/main/core/definitions/src/protocols). +Supported protocols are defined in the [definitions module](https://github.com/wormhole-foundation/wormhole-sdk-ts/tree/main/core/definitions/src/protocols). ## Transfers