Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sdk): update cosmjs patches #3581

Merged
merged 5 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions .github/workflows/typescript-sdk-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ concurrency:
defaults:
run:
shell: bash
working-directory: './typescript-sdk'

env:
NODE_OPTIONS: '--no-warnings'
ACTIONS_RUNNER_DEBUG: true
NODE_OPTIONS: '--no-warnings'

jobs:
publish-jsr:
# manually temporarily disabled
if: false
name: 'Publish JSR'
publish-sdk:
name: 'Publish to Registries'
runs-on: ['ubuntu-latest']
permissions:
contents: read
Expand All @@ -40,9 +39,22 @@ jobs:
uses: oven-sh/setup-bun@v2
with:
bun-version: 'latest'
registry-url: 'https://registry.npmjs.org'

- name: 'Publish to JSR'
working-directory: './typescript-sdk'
- name: 'Install Dependencies'
run: bun install

- name: 'Prechecks'
run: |
bun install
bun scripts/publish.ts --period patch
bun run build
bun run typecheck
bun run check-package

- name: 'Publish to JSR'
run: bun scripts/publish.ts --period patch

- name: 'Publish to NPM'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access='public' --no-git-tags
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 11 additions & 13 deletions networks/mkCosmosDevnet.nix
Original file line number Diff line number Diff line change
Expand Up @@ -603,19 +603,17 @@ let
mkdir -p $out/checksums
echo -n $(cat "${checksum}") > "$out/checksums/$(basename $wasm .wasm)"
mkdir -p $out/addresses
${
builtins.concatStringsSep "\n" (
pkgs.lib.imap0 (
idx:
{ salt, ... }:
''
echo -n "$(cat ${
getContractAddress creator checksum salt
})" > "$out/addresses/$(basename $wasm .wasm)_${builtins.toString idx}"
''
) instances
)
}
${builtins.concatStringsSep "\n" (
pkgs.lib.imap0 (
idx:
{ salt, ... }:
''
echo -n "$(cat ${
getContractAddress creator checksum salt
})" > "$out/addresses/$(basename $wasm .wasm)_${builtins.toString idx}"
''
) instances
)}
done
'';

Expand Down
Binary file modified typescript-sdk/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion typescript-sdk/jsr.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://jsr.io/schema/config-file.v1.json",
"name": "@union/client",
"version": "0.0.39",
"version": "0.0.48",
"license": "MIT",
"exports": {
".": "./src/mod.ts"
Expand Down
31 changes: 15 additions & 16 deletions typescript-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unionlabs/client",
"version": "0.0.45",
"version": "0.0.48",
"homepage": "https://union.build",
"description": "Union Labs cross-chain transfers client",
"type": "module",
Expand Down Expand Up @@ -29,32 +29,31 @@
"check-package": "deno run --allow-all npm:publint --strict && deno run --allow-all npm:@arethetypeswrong/cli@latest --pack --ignore-rules 'cjs-resolves-to-esm'"
},
"dependencies": {
"@aptos-labs/ts-sdk": "^1.33.1",
"@cosmjs/amino": "^0.32.4",
"@cosmjs/cosmwasm-stargate": "0.32.4",
"@cosmjs/proto-signing": "^0.32.4",
"@cosmjs/stargate": "0.32.4",
"@cosmjs/tendermint-rpc": "^0.32.4",
"@scure/base": "^1.2.1",
"@scure/base": "^1.2.4",
"neverthrow": "^8.1.1",
"ofetch": "^1.4.1",
"ox": "^0.6.0",
"patch-package": "^8.0.0",
"viem": "^2.22.3"
"@aptos-labs/ts-sdk": "^1.33.1",
"@cosmjs/amino": "^0.33.0",
"@cosmjs/cosmwasm-stargate": "0.33.0",
"@cosmjs/proto-signing": "^0.33.0",
"@cosmjs/stargate": "0.33.0",
"@cosmjs/tendermint-rpc": "^0.33.0",
"viem": "^2.22.10"
},
"devDependencies": {
"@total-typescript/ts-reset": "^0.6.1",
"@types/bun": "^1.1.15",
"@types/node": "^22.10.5",
"consola": "^3.3.3",
"@types/bun": "^1.1.17",
"@types/node": "^22.10.7",
"consola": "^3.4.0",
"cosmjs-types": "^0.9.0",
"jsr": "^0.13.2",
"knip": "^5.41.1",
"knip": "^5.42.2",
"tsup": "^8.3.5",
"tsx": "^4.19.2",
"typescript": "^5.7.2",
"typescript": "^5.7.3",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^2.1.8"
"vitest": "^3.0.2"
},
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/node_modules/@cosmjs/tendermint-rpc/build/comet38/adaptor/responses.js b/node_modules/@cosmjs/tendermint-rpc/build/comet38/adaptor/responses.js
index e8b2dc3..b5c540a 100644
index 29ec063..28a5c02 100644
--- a/node_modules/@cosmjs/tendermint-rpc/build/comet38/adaptor/responses.js
+++ b/node_modules/@cosmjs/tendermint-rpc/build/comet38/adaptor/responses.js
@@ -72,7 +72,7 @@ function decodePubkey(data) {
Expand All @@ -11,20 +11,25 @@ index e8b2dc3..b5c540a 100644
return {
algorithm,
data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(value)),
@@ -91,6 +91,11 @@ function decodePubkey(data) {
@@ -91,6 +91,16 @@ function decodePubkey(data) {
algorithm: "secp256k1",
data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)),
};
+ case "tendermint/PubKeyBn254":
+ return {
+ algorithm: "bn254",
+ data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)),
+ };
+ case "cometbft/PubKeyBn254":
+ return {
+ algorithm: "bn254",
+ data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)),
+ };
default:
throw new Error(`unknown pubkey type: ${data.type}`);
}
diff --git a/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/adaptor/responses.js b/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/adaptor/responses.js
index 5c9a406..0083a25 100644
index 19df9de..c73c4ca 100644
--- a/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/adaptor/responses.js
+++ b/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/adaptor/responses.js
@@ -72,7 +72,7 @@ function decodePubkey(data) {
Expand All @@ -36,14 +41,19 @@ index 5c9a406..0083a25 100644
return {
algorithm,
data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(value)),
@@ -91,6 +91,11 @@ function decodePubkey(data) {
@@ -91,6 +91,16 @@ function decodePubkey(data) {
algorithm: "secp256k1",
data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)),
};
+ case "tendermint/PubKeyBn254":
+ return {
+ algorithm: "bn254",
+ data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)),
+ };
+ case "cometbft/PubKeyBn254":
+ return {
+ algorithm: "bn254",
+ data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)),
+ };
default:
throw new Error(`unknown pubkey type: ${data.type}`);
Expand Down
2 changes: 1 addition & 1 deletion typescript-sdk/playground/union-to-holesky.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import "scripts/patch.ts"
import { http } from "viem"
import { holesky } from "viem/chains"
import { parseArgs } from "node:util"
import { hexToBytes } from "#convert.ts"
import { raise } from "#utilities/index.ts"
import { consola } from "../scripts/logger.ts"
import { hexToBytes } from "#convert.ts"
import { privateKeyToAccount } from "viem/accounts"
import { DirectSecp256k1Wallet } from "@cosmjs/proto-signing"
import { createUnionClient, type TransferAssetsParameters } from "#mod.ts"
Expand Down
3 changes: 0 additions & 3 deletions typescript-sdk/src/abi/index.ts

This file was deleted.

Loading
Loading