diff --git a/.github/workflows/typescript-sdk-publish.yml b/.github/workflows/typescript-sdk-publish.yml index 468f802e67..9283d992c3 100644 --- a/.github/workflows/typescript-sdk-publish.yml +++ b/.github/workflows/typescript-sdk-publish.yml @@ -17,16 +17,48 @@ concurrency: defaults: run: shell: bash + working-directory: './typescript-sdk' env: - NODE_OPTIONS: '--no-warnings' ACTIONS_RUNNER_DEBUG: true + NODE_OPTIONS: '--no-warnings' jobs: + publish-npm: + name: 'Publish to NPM' + runs-on: ['ubuntu-latest'] + permissions: + contents: read + # The OIDC ID token is used for authentication with JSR. + id-token: write + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + + - name: 'Setup bun' + uses: oven-sh/setup-bun@v2 + with: + bun-version: 'latest' + registry-url: 'https://registry.npmjs.org' + + - name: 'Install Dependencies' + run: bun install + + - name: 'Prechecks' + run: | + bun run build + bun run typecheck + bun run check-package + + - name: 'Publish to npm' + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + bun publih --access='public' + publish-jsr: - # manually temporarily disabled - if: false - name: 'Publish JSR' + name: 'Publish to JSR' runs-on: ['ubuntu-latest'] permissions: contents: read @@ -42,7 +74,6 @@ jobs: bun-version: 'latest' - name: 'Publish to JSR' - working-directory: './typescript-sdk' run: | bun install bun scripts/publish.ts --period patch diff --git a/typescript-sdk/bun.lockb b/typescript-sdk/bun.lockb index db7cb3488a..a3cbaebe43 100755 Binary files a/typescript-sdk/bun.lockb and b/typescript-sdk/bun.lockb differ diff --git a/typescript-sdk/package.json b/typescript-sdk/package.json index 85a1bc21f5..099aa79959 100644 --- a/typescript-sdk/package.json +++ b/typescript-sdk/package.json @@ -39,7 +39,7 @@ "@cosmjs/proto-signing": "^0.33.0", "@cosmjs/stargate": "0.33.0", "@cosmjs/tendermint-rpc": "^0.33.0", - "viem": "^2.22.9" + "viem": "^2.22.10" }, "devDependencies": { "@total-typescript/ts-reset": "^0.6.1", diff --git a/typescript-sdk/src/abi/index.ts b/typescript-sdk/src/abi/index.ts deleted file mode 100644 index 3d87a6379b..0000000000 --- a/typescript-sdk/src/abi/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./ucs-01.ts" -export * from "./ucs-02.ts" -export * from "./ucs-03.ts" diff --git a/typescript-sdk/src/abi/ucs-02.ts b/typescript-sdk/src/abi/ucs-02.ts deleted file mode 100644 index 781e2073ed..0000000000 --- a/typescript-sdk/src/abi/ucs-02.ts +++ /dev/null @@ -1,1065 +0,0 @@ -export const ucs02NftAbi = [ - { - type: "constructor", - inputs: [], - stateMutability: "nonpayable" - }, - { - type: "function", - name: "UPGRADE_INTERFACE_VERSION", - inputs: [], - outputs: [ - { - name: "", - type: "string", - internalType: "string" - } - ], - stateMutability: "view" - }, - { - type: "function", - name: "getOutstanding", - inputs: [ - { - name: "sourceChannel", - type: "string", - internalType: "string" - }, - { - name: "token", - type: "address", - internalType: "address" - } - ], - outputs: [ - { - name: "", - type: "uint256", - internalType: "uint256" - } - ], - stateMutability: "view" - }, - { - type: "function", - name: "ibcAddress", - inputs: [], - outputs: [ - { - name: "", - type: "address", - internalType: "address" - } - ], - stateMutability: "view" - }, - { - type: "function", - name: "initialize", - inputs: [ - { - name: "_ibcHandler", - type: "address", - internalType: "contract IIBCPacket" - }, - { - name: "admin", - type: "address", - internalType: "address" - } - ], - outputs: [], - stateMutability: "nonpayable" - }, - { - type: "function", - name: "onAcknowledgementPacket", - inputs: [ - { - name: "ibcPacket", - type: "tuple", - internalType: "struct IbcCoreChannelV1Packet.Data", - components: [ - { - name: "sequence", - type: "uint64", - internalType: "uint64" - }, - { - name: "source_port", - type: "string", - internalType: "string" - }, - { - name: "source_channel", - type: "string", - internalType: "string" - }, - { - name: "destination_port", - type: "string", - internalType: "string" - }, - { - name: "destination_channel", - type: "string", - internalType: "string" - }, - { - name: "data", - type: "bytes", - internalType: "bytes" - }, - { - name: "timeout_height", - type: "tuple", - internalType: "struct IbcCoreClientV1Height.Data", - components: [ - { - name: "revision_number", - type: "uint64", - internalType: "uint64" - }, - { - name: "revision_height", - type: "uint64", - internalType: "uint64" - } - ] - }, - { - name: "timeout_timestamp", - type: "uint64", - internalType: "uint64" - } - ] - }, - { - name: "acknowledgement", - type: "bytes", - internalType: "bytes" - }, - { - name: "", - type: "address", - internalType: "address" - } - ], - outputs: [], - stateMutability: "nonpayable" - }, - { - type: "function", - name: "onChanCloseConfirm", - inputs: [ - { - name: "", - type: "string", - internalType: "string" - }, - { - name: "", - type: "string", - internalType: "string" - } - ], - outputs: [], - stateMutability: "view" - }, - { - type: "function", - name: "onChanCloseInit", - inputs: [ - { - name: "", - type: "string", - internalType: "string" - }, - { - name: "", - type: "string", - internalType: "string" - } - ], - outputs: [], - stateMutability: "view" - }, - { - type: "function", - name: "onChanOpenAck", - inputs: [ - { - name: "", - type: "string", - internalType: "string" - }, - { - name: "", - type: "string", - internalType: "string" - }, - { - name: "", - type: "string", - internalType: "string" - }, - { - name: "counterpartyVersion", - type: "string", - internalType: "string" - } - ], - outputs: [], - stateMutability: "view" - }, - { - type: "function", - name: "onChanOpenConfirm", - inputs: [ - { - name: "", - type: "string", - internalType: "string" - }, - { - name: "", - type: "string", - internalType: "string" - } - ], - outputs: [], - stateMutability: "nonpayable" - }, - { - type: "function", - name: "onChanOpenInit", - inputs: [ - { - name: "order", - type: "uint8", - internalType: "enum IbcCoreChannelV1GlobalEnums.Order" - }, - { - name: "", - type: "string[]", - internalType: "string[]" - }, - { - name: "", - type: "string", - internalType: "string" - }, - { - name: "", - type: "string", - internalType: "string" - }, - { - name: "", - type: "tuple", - internalType: "struct IbcCoreChannelV1Counterparty.Data", - components: [ - { - name: "port_id", - type: "string", - internalType: "string" - }, - { - name: "channel_id", - type: "string", - internalType: "string" - } - ] - }, - { - name: "version", - type: "string", - internalType: "string" - } - ], - outputs: [], - stateMutability: "view" - }, - { - type: "function", - name: "onChanOpenTry", - inputs: [ - { - name: "order", - type: "uint8", - internalType: "enum IbcCoreChannelV1GlobalEnums.Order" - }, - { - name: "", - type: "string[]", - internalType: "string[]" - }, - { - name: "", - type: "string", - internalType: "string" - }, - { - name: "", - type: "string", - internalType: "string" - }, - { - name: "", - type: "tuple", - internalType: "struct IbcCoreChannelV1Counterparty.Data", - components: [ - { - name: "port_id", - type: "string", - internalType: "string" - }, - { - name: "channel_id", - type: "string", - internalType: "string" - } - ] - }, - { - name: "version", - type: "string", - internalType: "string" - }, - { - name: "counterpartyVersion", - type: "string", - internalType: "string" - } - ], - outputs: [], - stateMutability: "view" - }, - { - type: "function", - name: "onERC721Received", - inputs: [ - { - name: "", - type: "address", - internalType: "address" - }, - { - name: "", - type: "address", - internalType: "address" - }, - { - name: "", - type: "uint256", - internalType: "uint256" - }, - { - name: "", - type: "bytes", - internalType: "bytes" - } - ], - outputs: [ - { - name: "", - type: "bytes4", - internalType: "bytes4" - } - ], - stateMutability: "pure" - }, - { - type: "function", - name: "onRecvPacket", - inputs: [ - { - name: "ibcPacket", - type: "tuple", - internalType: "struct IbcCoreChannelV1Packet.Data", - components: [ - { - name: "sequence", - type: "uint64", - internalType: "uint64" - }, - { - name: "source_port", - type: "string", - internalType: "string" - }, - { - name: "source_channel", - type: "string", - internalType: "string" - }, - { - name: "destination_port", - type: "string", - internalType: "string" - }, - { - name: "destination_channel", - type: "string", - internalType: "string" - }, - { - name: "data", - type: "bytes", - internalType: "bytes" - }, - { - name: "timeout_height", - type: "tuple", - internalType: "struct IbcCoreClientV1Height.Data", - components: [ - { - name: "revision_number", - type: "uint64", - internalType: "uint64" - }, - { - name: "revision_height", - type: "uint64", - internalType: "uint64" - } - ] - }, - { - name: "timeout_timestamp", - type: "uint64", - internalType: "uint64" - } - ] - }, - { - name: "relayer", - type: "address", - internalType: "address" - } - ], - outputs: [ - { - name: "", - type: "bytes", - internalType: "bytes" - } - ], - stateMutability: "nonpayable" - }, - { - type: "function", - name: "onRecvPacketProcessing", - inputs: [ - { - name: "ibcPacket", - type: "tuple", - internalType: "struct IbcCoreChannelV1Packet.Data", - components: [ - { - name: "sequence", - type: "uint64", - internalType: "uint64" - }, - { - name: "source_port", - type: "string", - internalType: "string" - }, - { - name: "source_channel", - type: "string", - internalType: "string" - }, - { - name: "destination_port", - type: "string", - internalType: "string" - }, - { - name: "destination_channel", - type: "string", - internalType: "string" - }, - { - name: "data", - type: "bytes", - internalType: "bytes" - }, - { - name: "timeout_height", - type: "tuple", - internalType: "struct IbcCoreClientV1Height.Data", - components: [ - { - name: "revision_number", - type: "uint64", - internalType: "uint64" - }, - { - name: "revision_height", - type: "uint64", - internalType: "uint64" - } - ] - }, - { - name: "timeout_timestamp", - type: "uint64", - internalType: "uint64" - } - ] - }, - { - name: "", - type: "address", - internalType: "address" - } - ], - outputs: [], - stateMutability: "nonpayable" - }, - { - type: "function", - name: "onTimeoutPacket", - inputs: [ - { - name: "ibcPacket", - type: "tuple", - internalType: "struct IbcCoreChannelV1Packet.Data", - components: [ - { - name: "sequence", - type: "uint64", - internalType: "uint64" - }, - { - name: "source_port", - type: "string", - internalType: "string" - }, - { - name: "source_channel", - type: "string", - internalType: "string" - }, - { - name: "destination_port", - type: "string", - internalType: "string" - }, - { - name: "destination_channel", - type: "string", - internalType: "string" - }, - { - name: "data", - type: "bytes", - internalType: "bytes" - }, - { - name: "timeout_height", - type: "tuple", - internalType: "struct IbcCoreClientV1Height.Data", - components: [ - { - name: "revision_number", - type: "uint64", - internalType: "uint64" - }, - { - name: "revision_height", - type: "uint64", - internalType: "uint64" - } - ] - }, - { - name: "timeout_timestamp", - type: "uint64", - internalType: "uint64" - } - ] - }, - { - name: "", - type: "address", - internalType: "address" - } - ], - outputs: [], - stateMutability: "nonpayable" - }, - { - type: "function", - name: "owner", - inputs: [], - outputs: [ - { - name: "", - type: "address", - internalType: "address" - } - ], - stateMutability: "view" - }, - { - type: "function", - name: "paused", - inputs: [], - outputs: [ - { - name: "", - type: "bool", - internalType: "bool" - } - ], - stateMutability: "view" - }, - { - type: "function", - name: "proxiableUUID", - inputs: [], - outputs: [ - { - name: "", - type: "bytes32", - internalType: "bytes32" - } - ], - stateMutability: "view" - }, - { - type: "function", - name: "renounceOwnership", - inputs: [], - outputs: [], - stateMutability: "nonpayable" - }, - { - type: "function", - name: "send", - inputs: [ - { - name: "sourceChannel", - type: "string", - internalType: "string" - }, - { - name: "receiver", - type: "string", - internalType: "string" - }, - { - name: "nftClass", - type: "address", - internalType: "address" - }, - { - name: "tokens", - type: "uint256[]", - internalType: "uint256[]" - }, - { - name: "timeoutTimestamp", - type: "uint64", - internalType: "uint64" - } - ], - outputs: [], - stateMutability: "nonpayable" - }, - { - type: "function", - name: "transferOwnership", - inputs: [ - { - name: "newOwner", - type: "address", - internalType: "address" - } - ], - outputs: [], - stateMutability: "nonpayable" - }, - { - type: "function", - name: "upgradeToAndCall", - inputs: [ - { - name: "newImplementation", - type: "address", - internalType: "address" - }, - { - name: "data", - type: "bytes", - internalType: "bytes" - } - ], - outputs: [], - stateMutability: "payable" - }, - { - type: "event", - name: "ClassCreated", - inputs: [ - { - name: "packetSequence", - type: "uint64", - indexed: false, - internalType: "uint64" - }, - { - name: "channelId", - type: "string", - indexed: false, - internalType: "string" - }, - { - name: "nftClass", - type: "address", - indexed: true, - internalType: "address" - } - ], - anonymous: false - }, - { - type: "event", - name: "Initialized", - inputs: [ - { - name: "version", - type: "uint64", - indexed: false, - internalType: "uint64" - } - ], - anonymous: false - }, - { - type: "event", - name: "OwnershipTransferred", - inputs: [ - { - name: "previousOwner", - type: "address", - indexed: true, - internalType: "address" - }, - { - name: "newOwner", - type: "address", - indexed: true, - internalType: "address" - } - ], - anonymous: false - }, - { - type: "event", - name: "Paused", - inputs: [ - { - name: "account", - type: "address", - indexed: false, - internalType: "address" - } - ], - anonymous: false - }, - { - type: "event", - name: "Received", - inputs: [ - { - name: "packetSequence", - type: "uint64", - indexed: false, - internalType: "uint64" - }, - { - name: "channelId", - type: "string", - indexed: false, - internalType: "string" - }, - { - name: "sender", - type: "string", - indexed: false, - internalType: "string" - }, - { - name: "receiver", - type: "address", - indexed: false, - internalType: "address" - }, - { - name: "nftClass", - type: "address", - indexed: true, - internalType: "address" - }, - { - name: "tokenIds", - type: "uint256[]", - indexed: false, - internalType: "uint256[]" - } - ], - anonymous: false - }, - { - type: "event", - name: "Refunded", - inputs: [ - { - name: "packetSequence", - type: "uint64", - indexed: false, - internalType: "uint64" - }, - { - name: "channelId", - type: "string", - indexed: false, - internalType: "string" - }, - { - name: "sender", - type: "address", - indexed: false, - internalType: "address" - }, - { - name: "receiver", - type: "string", - indexed: false, - internalType: "string" - }, - { - name: "nftClass", - type: "address", - indexed: true, - internalType: "address" - }, - { - name: "tokenIds", - type: "uint256[]", - indexed: false, - internalType: "uint256[]" - } - ], - anonymous: false - }, - { - type: "event", - name: "Sent", - inputs: [ - { - name: "packetSequence", - type: "uint64", - indexed: false, - internalType: "uint64" - }, - { - name: "channelId", - type: "string", - indexed: false, - internalType: "string" - }, - { - name: "sender", - type: "address", - indexed: false, - internalType: "address" - }, - { - name: "receiver", - type: "string", - indexed: false, - internalType: "string" - }, - { - name: "nftClass", - type: "address", - indexed: true, - internalType: "address" - }, - { - name: "tokenIds", - type: "uint256[]", - indexed: false, - internalType: "uint256[]" - } - ], - anonymous: false - }, - { - type: "event", - name: "Unpaused", - inputs: [ - { - name: "account", - type: "address", - indexed: false, - internalType: "address" - } - ], - anonymous: false - }, - { - type: "event", - name: "Upgraded", - inputs: [ - { - name: "implementation", - type: "address", - indexed: true, - internalType: "address" - } - ], - anonymous: false - }, - { - type: "error", - name: "AddressEmptyCode", - inputs: [ - { - name: "target", - type: "address", - internalType: "address" - } - ] - }, - { - type: "error", - name: "ERC1967InvalidImplementation", - inputs: [ - { - name: "implementation", - type: "address", - internalType: "address" - } - ] - }, - { - type: "error", - name: "ERC1967NonPayable", - inputs: [] - }, - { - type: "error", - name: "EnforcedPause", - inputs: [] - }, - { - type: "error", - name: "ErrInvalidAcknowledgement", - inputs: [] - }, - { - type: "error", - name: "ErrInvalidCounterpartyProtocolVersion", - inputs: [] - }, - { - type: "error", - name: "ErrInvalidHexAddress", - inputs: [] - }, - { - type: "error", - name: "ErrInvalidProtocolOrdering", - inputs: [] - }, - { - type: "error", - name: "ErrInvalidProtocolVersion", - inputs: [] - }, - { - type: "error", - name: "ErrNotIBC", - inputs: [] - }, - { - type: "error", - name: "ErrUnauthorized", - inputs: [] - }, - { - type: "error", - name: "ErrUnstoppable", - inputs: [] - }, - { - type: "error", - name: "ExpectedPause", - inputs: [] - }, - { - type: "error", - name: "FailedInnerCall", - inputs: [] - }, - { - type: "error", - name: "InvalidInitialization", - inputs: [] - }, - { - type: "error", - name: "MustTransferAtLeastOneToken", - inputs: [] - }, - { - type: "error", - name: "NotInitializing", - inputs: [] - }, - { - type: "error", - name: "OwnableInvalidOwner", - inputs: [ - { - name: "owner", - type: "address", - internalType: "address" - } - ] - }, - { - type: "error", - name: "OwnableUnauthorizedAccount", - inputs: [ - { - name: "account", - type: "address", - internalType: "address" - } - ] - }, - { - type: "error", - name: "UUPSUnauthorizedCallContext", - inputs: [] - }, - { - type: "error", - name: "UUPSUnsupportedProxiableUUID", - inputs: [ - { - name: "slot", - type: "bytes32", - internalType: "bytes32" - } - ] - } -] as const diff --git a/typescript-sdk/src/utilities/functions.ts b/typescript-sdk/src/utilities/functions.ts deleted file mode 100644 index 75e0906bd6..0000000000 --- a/typescript-sdk/src/utilities/functions.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Creates a new composite function that invokes the functions from right to left - */ - -export default function compose(...functions: Array<(...args: Array) => T>) { - return functions.reduce( - (acc, currentFn) => - (...args: Array) => - acc(currentFn(...args)) - ) -} diff --git a/typescript-sdk/src/utilities/index.ts b/typescript-sdk/src/utilities/index.ts index ed648d89ad..4bb320a216 100644 --- a/typescript-sdk/src/utilities/index.ts +++ b/typescript-sdk/src/utilities/index.ts @@ -1,13 +1,3 @@ -/** - * sleep for the specified number of milliseconds - * @example - * ```ts - * await sleep(1000) - * ``` - */ -export const sleep = async (ms: number): Promise => - new Promise(resolve => setTimeout(resolve, ms)) - /** * get the current timestamp in the format `YYYY-MM-DD--HH-MM-SS` * @example