diff --git a/apps/auth/package.json b/apps/auth/package.json index e9b6bfd6..aa0c656b 100644 --- a/apps/auth/package.json +++ b/apps/auth/package.json @@ -24,7 +24,7 @@ "@hive/transaction": "*", "@hive/tsconfig": "*", "@hive/ui": "*", - "@hive/wax": "^0.3.8-240222134308", + "@hive/wax": "^0.3.8-240228091712", "@hiveio/dhive": "^1.2.8", "@hookform/resolvers": "^3.3.1", "@tanstack/react-query": "^4.36.1", diff --git a/apps/auth/pages/profile.tsx b/apps/auth/pages/profile.tsx index d3184669..2881b73e 100644 --- a/apps/auth/pages/profile.tsx +++ b/apps/auth/pages/profile.tsx @@ -12,6 +12,7 @@ import { verifySignature } from '@smart-signer/lib/utils'; import { vote, createHiveChain, BroadcastTransactionRequest } from '@hive/wax/web'; import { waxToKeychainOperation } from '@smart-signer/lib/signer/signer-keychain'; import { KeyTypes } from '@smart-signer/types/common'; +import { fetchJson } from '@smart-signer/lib/fetch-json'; import { getLogger } from '@ui/lib/logging'; const logger = getLogger('app'); @@ -33,8 +34,8 @@ export default function Profile() { voter: user.username, author: 'gtg', - // permlink: 'power-to-the-hive-but-just-a-little', - permlink: 'non-existing-permlink-q523-73867', + permlink: 'power-to-the-hive-but-just-a-little', + // permlink: 'non-existing-permlink-q523-73867', weight: 10000 }; @@ -63,10 +64,34 @@ export default function Profile() { }); logger.info('broadcast signature: %s', signature); txBuilder.build(signature); - const request = new BroadcastTransactionRequest(txBuilder); + logger.info('broadcast txBuilder: %o', txBuilder); + + const trx = { + trx: JSON.parse(txBuilder.toApi()), + max_block_age: -1, + }; + + logger.info('broadcast transaction: %o', trx); + const data = { + jsonrpc: "2.0", + method: "network_broadcast_api.broadcast_transaction", + params: trx, + id: 1 + }; + logger.info('broadcast data: %o', data); + + const fetchResult = await fetchJson('https://api.hive.blog', { + method: 'POST', + body: JSON.stringify(data, null, 0) + }); + logger.info('broadcast fetchResult: %o', fetchResult); + + const broadcastReq = new BroadcastTransactionRequest(txBuilder); + logger.info('broadcast broadcastReq: %o', broadcastReq); + logger.info('broadcast JSON.stringify(broadcastReq): %o', JSON.stringify(broadcastReq)); // Transmit - const result = await hiveChain.api.network_broadcast_api.broadcast_transaction(request); + const result = await hiveChain.api.network_broadcast_api.broadcast_transaction(broadcastReq); logger.info('broadcast result: %o', result); } catch (error) { logger.error(error); diff --git a/apps/blog/package.json b/apps/blog/package.json index dd7cfcb5..242a71de 100644 --- a/apps/blog/package.json +++ b/apps/blog/package.json @@ -27,7 +27,7 @@ "@hive/transaction": "*", "@hive/tsconfig": "*", "@hive/ui": "*", - "@hive/wax": "^0.3.8-240222134308", + "@hive/wax": "^0.3.8-240228091712", "@hiveio/content-renderer": "^2.0.0", "@hiveio/dhive": "^1.2.8", "@hookform/resolvers": "^3.1.1", diff --git a/apps/wallet/package.json b/apps/wallet/package.json index d6b5d1b3..48ec46ce 100644 --- a/apps/wallet/package.json +++ b/apps/wallet/package.json @@ -26,7 +26,7 @@ "@hive/transaction": "*", "@hive/tsconfig": "*", "@hive/ui": "*", - "@hive/wax": "^0.3.8-240222134308", + "@hive/wax": "^0.3.8-240228091712", "@hiveio/dhive": "^1.2.8", "@hookform/resolvers": "^3.3.2", "@next/bundle-analyzer": "^14.0.4", diff --git a/package-lock.json b/package-lock.json index 01f9dd81..e7d4293d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "@hive/transaction": "*", "@hive/tsconfig": "*", "@hive/ui": "*", - "@hive/wax": "^0.3.8-240222134308", + "@hive/wax": "^0.3.8-240228091712", "@hiveio/dhive": "^1.2.8", "@hookform/resolvers": "^3.3.1", "@tanstack/react-query": "^4.36.1", @@ -80,7 +80,7 @@ "@hive/transaction": "*", "@hive/tsconfig": "*", "@hive/ui": "*", - "@hive/wax": "^0.3.8-240222134308", + "@hive/wax": "^0.3.8-240228091712", "@hiveio/content-renderer": "^2.0.0", "@hiveio/dhive": "^1.2.8", "@hookform/resolvers": "^3.1.1", @@ -127,7 +127,7 @@ "zustand": "^4.4.7" }, "devDependencies": { - "@playwright/test": "^1.40.1", + "@playwright/test": "^1.41.1", "@types/cors": "^2.8.17", "@types/http-errors": "^2.0.4", "@types/qrcode": "^1.5.5", @@ -155,7 +155,7 @@ "@hive/transaction": "*", "@hive/tsconfig": "*", "@hive/ui": "*", - "@hive/wax": "^0.3.8-240222134308", + "@hive/wax": "^0.3.8-240228091712", "@hiveio/dhive": "^1.2.8", "@hookform/resolvers": "^3.3.2", "@next/bundle-analyzer": "^14.0.4", @@ -177,7 +177,7 @@ "zod": "^3.22.4" }, "devDependencies": { - "@playwright/test": "^1.40.1", + "@playwright/test": "^1.41.1", "typescript": "5.3.3" } }, @@ -988,12 +988,12 @@ "link": true }, "node_modules/@hive/hb-auth": { - "version": "0.0.1-stable.240223093642", - "resolved": "https://gitlab.syncad.com/api/v4/projects/429/packages/npm/@hive/hb-auth/-/@hive/hb-auth-0.0.1-stable.240223093642.tgz", - "integrity": "sha1-O6xdBV9gVuPuJzBkv0NnWdDhUlI=", + "version": "0.0.1-stable.240228104557", + "resolved": "https://gitlab.syncad.com/api/v4/projects/429/packages/npm/@hive/hb-auth/-/@hive/hb-auth-0.0.1-stable.240228104557.tgz", + "integrity": "sha1-8TjXdNUjBXw4IQUMZ5psKUrc2O8=", "dependencies": { "@hive/beekeeper": "1.27.2-240208135851", - "@hive/wax": "0.3.8-240222134308", + "@hive/wax": "0.3.8-240228091712", "comlink": "^4.4.1", "idb": "^7.1.1" } @@ -1035,9 +1035,9 @@ "link": true }, "node_modules/@hive/wax": { - "version": "0.3.8-240222134308", - "resolved": "https://gitlab.syncad.com/api/v4/projects/419/packages/npm/@hive/wax/-/@hive/wax-0.3.8-240222134308.tgz", - "integrity": "sha1-H/WlbVZose9ZcImPcECVFixv4xc=", + "version": "0.3.8-240228091712", + "resolved": "https://gitlab.syncad.com/api/v4/projects/419/packages/npm/@hive/wax/-/@hive/wax-0.3.8-240228091712.tgz", + "integrity": "sha1-/TUEa8AtnmW4JSrd3X+T8ZuN0ks=", "dependencies": { "@hive/beekeeper": "1.27.2-240110132748", "class-transformer": "^0.5.1", @@ -21995,9 +21995,9 @@ "name": "@hive/smart-signer", "version": "0.1.0", "dependencies": { - "@hive/hb-auth": "^0.0.1-stable.240223093642", + "@hive/hb-auth": "^0.0.1-stable.240228104557", "@hive/ui": "*", - "@hive/wax": "^0.3.8-240222134308", + "@hive/wax": "^0.3.8-240228091712", "@hiveio/dhive": "^1.2.8", "@hiveio/hive-js": "^2.0.7", "@tanstack/react-query": "^4.36.1", @@ -22068,7 +22068,7 @@ "version": "0.1.0", "dependencies": { "@hive/smart-signer": "*", - "@hive/wax": "^0.3.8-240222134308", + "@hive/wax": "^0.3.8-240228091712", "@hiveio/dhive": "^1.2.8", "@hiveio/hive-js": "^2.0.7", "secure-random": "^1.1.2", @@ -22093,7 +22093,7 @@ "@hive/prettier-config-custom": "*", "@hive/tailwindcss-config": "*", "@hive/tsconfig": "*", - "@hive/wax": "^0.3.8-240222134308", + "@hive/wax": "^0.3.8-240228091712", "@radix-ui/react-accordion": "^1.1.2", "@radix-ui/react-alert-dialog": "^1.0.4", "@radix-ui/react-avatar": "^1.0.3", diff --git a/packages/smart-signer/package.json b/packages/smart-signer/package.json index 6a5ffda6..5dac8293 100644 --- a/packages/smart-signer/package.json +++ b/packages/smart-signer/package.json @@ -7,9 +7,9 @@ "lint": "eslint ." }, "dependencies": { - "@hive/hb-auth": "^0.0.1-stable.240223093642", + "@hive/hb-auth": "^0.0.1-stable.240228104557", "@hive/ui": "*", - "@hive/wax": "^0.3.8-240222134308", + "@hive/wax": "^0.3.8-240228091712", "@hiveio/dhive": "^1.2.8", "@hiveio/hive-js": "^2.0.7", "@tanstack/react-query": "^4.36.1", diff --git a/packages/transaction/package.json b/packages/transaction/package.json index 3c41f4a9..79174568 100644 --- a/packages/transaction/package.json +++ b/packages/transaction/package.json @@ -8,7 +8,7 @@ }, "dependencies": { "@hive/smart-signer": "*", - "@hive/wax": "^0.3.8-240222134308", + "@hive/wax": "^0.3.8-240228091712", "@hiveio/dhive": "^1.2.8", "@hiveio/hive-js": "^2.0.7", "secure-random": "^1.1.2", diff --git a/packages/ui/package.json b/packages/ui/package.json index cd1cee75..5822754c 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -11,7 +11,7 @@ "@hive/prettier-config-custom": "*", "@hive/tailwindcss-config": "*", "@hive/tsconfig": "*", - "@hive/wax": "^0.3.8-240222134308", + "@hive/wax": "^0.3.8-240228091712", "@radix-ui/react-accordion": "^1.1.2", "@radix-ui/react-alert-dialog": "^1.0.4", "@radix-ui/react-avatar": "^1.0.3", diff --git a/scripts/update-wax.sh b/scripts/update-wax.sh new file mode 100755 index 00000000..b7f50bed --- /dev/null +++ b/scripts/update-wax.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +set -euo pipefail + +WAX_VERSION=${1} # prefixed with @ +HBAUTH_VERSION=${2} # prefixed with @ + +uninstall_packages() { + echo "Uninstalling packages" + + npm uninstall --save @hive/hb-auth --workspace=packages/smart-signer + + npm uninstall --save @hive/wax --workspace=packages/smart-signer + npm uninstall --save @hive/wax --workspace=packages/transaction + npm uninstall --save @hive/wax --workspace=packages/ui + + npm uninstall --save @hive/wax --workspace=apps/auth + npm uninstall --save @hive/wax --workspace=apps/blog + npm uninstall --save @hive/wax --workspace=apps/wallet +} + +install_packages() { + echo "Installing packages" + + npm install --save "@hive/wax${WAX_VERSION}" --workspace=apps/auth + npm install --save "@hive/wax${WAX_VERSION}" --workspace=apps/blog + npm install --save "@hive/wax${WAX_VERSION}" --workspace=apps/wallet + + npm install --save "@hive/wax${WAX_VERSION}" --workspace=packages/smart-signer + npm install --save "@hive/wax${WAX_VERSION}" --workspace=packages/transaction + npm install --save "@hive/wax${WAX_VERSION}" --workspace=packages/ui + + npm install --save "@hive/hb-auth${HBAUTH_VERSION}" --workspace=packages/smart-signer +} + +uninstall_packages +install_packages