Skip to content

Commit

Permalink
Update to latest libs.
Browse files Browse the repository at this point in the history
  • Loading branch information
nyusternie committed Sep 25, 2024
1 parent c174c0a commit b446f70
Show file tree
Hide file tree
Showing 16 changed files with 87 additions and 88 deletions.
12 changes: 6 additions & 6 deletions lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nexajs",
"version": "24.9.23",
"version": "24.9.24",
"license": "MIT",
"description": "A comprehensive JavaScript Library + SDK for building Nexa applications on Node.js (back-end) and web browsers (front-end).",
"author": "Ava's DAO",
Expand All @@ -16,19 +16,19 @@
"@nexajs/crypto": "24.9.5",
"@nexajs/hdnode": "24.9.22",
"@nexajs/id": "23.5.15",
"@nexajs/market": "24.9.23",
"@nexajs/market": "24.9.24",
"@nexajs/message": "24.9.22",
"@nexajs/privacy": "24.9.22",
"@nexajs/provider": "24.9.23",
"@nexajs/purse": "24.9.23",
"@nexajs/provider": "24.9.24",
"@nexajs/purse": "24.9.24",
"@nexajs/request": "24.9.22",
"@nexajs/rostrum": "24.6.23",
"@nexajs/rpc": "24.9.22",
"@nexajs/script": "24.7.15",
"@nexajs/token": "24.9.23",
"@nexajs/token": "24.9.24",
"@nexajs/transaction": "24.9.22",
"@nexajs/utils": "24.7.15",
"@nexajs/wallet": "24.9.23",
"@nexajs/wallet": "24.9.24",
"@nexajs/zk": "24.9.5",
"events": "3.3.0"
},
Expand Down
23 changes: 8 additions & 15 deletions lib/test/e2e/purse.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { Purse } from '../../index.js'
/* Import library modules. */
import {
getCoins,
sendCoin,
sendCoins,
} from '../../index.js'

/* Import test(-ing) vectors. */
Expand Down Expand Up @@ -90,7 +90,7 @@ describe( 'Purse Test Suite', () => {

describe( 'Purse -> UTXO -> Send Coin', async () => {
it( 'should prepare and sign an UTXO for broadcast to the network', async () => {
return
// return
/* Encode Private Key WIF. */
wif = encodePrivateKeyWif(hexToBin(PRIVATE_KEY), 'mainnet')

Expand Down Expand Up @@ -158,21 +158,14 @@ return
console.log('\n Receivers:', receivers)

/* Send UTXO request. */
response = await sendCoin(coins, receivers)
console.log('Send UTXO (response):', response)
txResult = await sendCoins(coins, receivers)
console.log('Send Coins (txResult):', txResult)

try {
txResult = JSON.parse(response)
console.log('TX RESULT', txResult)

if (txResult.error) {
return console.error(txResult.message)
}

expect(txResult.result).to.have.length(64)
} catch (err) {
console.error(err)
if (txResult.error) {
return console.error(txResult.error)
}

expect(txResult.result).to.have.length(64)
} )
} )

Expand Down
50 changes: 25 additions & 25 deletions lib/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -522,12 +522,12 @@
uuid "9.0.0"
zxcvbn "4.4.2"

"@nexajs/market@24.9.23":
version "24.9.23"
resolved "https://registry.yarnpkg.com/@nexajs/market/-/market-24.9.23.tgz#69132d79c19942b08cf20ec1b625571f0165f71e"
integrity sha512-dnVo0fOaEqVQFdOZWe4qdXKvXVwdVKLzy+RzmMNY/i3076jsMBRPu371S+MUevRkOVpqYJ+0xQ5bq6FlIUzjjg==
"@nexajs/market@24.9.24":
version "24.9.24"
resolved "https://registry.yarnpkg.com/@nexajs/market/-/market-24.9.24.tgz#8f9a31cb7026b792161e4da7543a5629248be0b3"
integrity sha512-qc1Ij4lRZHEYxaj4HhvL/vU8ormNpCuJBdPrJZFXe0IvPWdeRqLc1vLbbpfSjDeINLG66WHnWad2UNyL3wX7GA==
dependencies:
"@nexajs/provider" "24.9.23"
"@nexajs/provider" "24.9.24"
"@nexajs/transaction" "24.9.22"
events "3.3.0"
moment "2.29.4"
Expand All @@ -551,22 +551,22 @@
dependencies:
events "3.3.0"

"@nexajs/provider@24.9.23":
version "24.9.23"
resolved "https://registry.yarnpkg.com/@nexajs/provider/-/provider-24.9.23.tgz#f1379a3e3d1509dc62a1d7adeee4a916938f9c76"
integrity sha512-GzVxkKmU7iCFMxbet69xc8cy3K0Ev6wQL/VmPMn6+xt6io/7SGGs/D7wCy0wM9zmvZhZTrp8FF9mQ/gHpQjydQ==
"@nexajs/provider@24.9.24":
version "24.9.24"
resolved "https://registry.yarnpkg.com/@nexajs/provider/-/provider-24.9.24.tgz#0611b2314f50bbf8a83923f7733b331f39b52988"
integrity sha512-oFdX3mlixA32CO+UVBM+TcWaqY4cUFakFw4UIQFOEBwZYO+NLFujHNe6VrSqGiiv2ntVBrPyP9EJNkvjbdGB0g==
dependencies:
"@nexajs/utils" "24.7.15"
events "3.3.0"

"@nexajs/purse@24.9.23":
version "24.9.23"
resolved "https://registry.yarnpkg.com/@nexajs/purse/-/purse-24.9.23.tgz#f45b48b7bd685f50b95cee667f1b81380e3995be"
integrity sha512-XqDWCf7xLIrr0dl3nV7MO2LsSt/C6WDRw0tIzoj53qfUsvMjZQmadmFj1T5p7njvGe9oplKRsX4EDYmFQEzIzQ==
"@nexajs/purse@24.9.24":
version "24.9.24"
resolved "https://registry.yarnpkg.com/@nexajs/purse/-/purse-24.9.24.tgz#185ec447b9a65125022b582a29b46c15be5ac894"
integrity sha512-/ZZwrThmJIYK3HFXgxg3Y/4SoBWBkpc76x32IuOTn1d/g3r3jwUxUfzWhzRu0jUe1k/Ys6w9Q7t45otqU4X7lw==
dependencies:
"@nexajs/address" "24.9.22"
"@nexajs/hdnode" "24.9.22"
"@nexajs/provider" "24.9.23"
"@nexajs/provider" "24.9.24"
"@nexajs/transaction" "24.9.22"
events "3.3.0"

Expand Down Expand Up @@ -601,15 +601,15 @@
dependencies:
"@nexajs/utils" "24.7.15"

"@nexajs/token@24.9.23":
version "24.9.23"
resolved "https://registry.yarnpkg.com/@nexajs/token/-/token-24.9.23.tgz#14e10fccfec7601e27ba53c8244f5534a0c33915"
integrity sha512-BxDE3MkA+WYTaYy9MVsPAD/0WEQwwtCW5qKYftCszmw6UKkeoxSi+EVZC0qvT73ci1QkIXaJU5qGj1tKqz8GZg==
"@nexajs/token@24.9.24":
version "24.9.24"
resolved "https://registry.yarnpkg.com/@nexajs/token/-/token-24.9.24.tgz#f8ea114908e83ff59f08b6369f8813efa5a171e3"
integrity sha512-mLfwx5UKepB9NVd8PLkHfIJqXSjGvrzOtORQQoAVznv/ZbVA28E01vjggLqQc4YtWVy84PNLKNBYP9MBTNMg8w==
dependencies:
"@nexajs/address" "24.9.22"
"@nexajs/crypto" "24.9.5"
"@nexajs/hdnode" "24.9.22"
"@nexajs/provider" "24.9.23"
"@nexajs/provider" "24.9.24"
"@nexajs/script" "24.7.15"
"@nexajs/transaction" "24.9.22"
events "3.3.0"
Expand All @@ -630,17 +630,17 @@
resolved "https://registry.yarnpkg.com/@nexajs/utils/-/utils-24.7.15.tgz#499bf20e1643e7c7bad91529a3f30c80512b6c5a"
integrity sha512-kI2GSorfBmylBjmnuwqeIeJWqlaIONX2MLPZ1FyGSviXFfd9H91Yr5KrHyDTh+BIV2dIfhPDqu/Lk5caG6XiiA==

"@nexajs/wallet@24.9.23":
version "24.9.23"
resolved "https://registry.yarnpkg.com/@nexajs/wallet/-/wallet-24.9.23.tgz#c380a83deb4a9ce38dee7f6498f8ba0beb813cef"
integrity sha512-A0vvLcIizf8gRIdRcvRXHw0z5bbutp1tv8mFYbmVBRbeLQKDcGvqK7iXBJK5zo5ftl+bU0SvfzajLHWqVj3oCw==
"@nexajs/wallet@24.9.24":
version "24.9.24"
resolved "https://registry.yarnpkg.com/@nexajs/wallet/-/wallet-24.9.24.tgz#f598fb268aba51e43befddd0c0b7a9438dbf6177"
integrity sha512-8wZ+nDdAXOlT44bapIUkGXg0knFCHPgGddJpdD2TjrZB+CxDtokBIzFoQOJyRd7RNUr6jXpl9/IMansRjwFaWw==
dependencies:
"@nexajs/address" "24.9.22"
"@nexajs/crypto" "24.9.5"
"@nexajs/hdnode" "24.9.22"
"@nexajs/purse" "24.9.23"
"@nexajs/purse" "24.9.24"
"@nexajs/script" "24.7.15"
"@nexajs/token" "24.9.23"
"@nexajs/token" "24.9.24"
events "3.3.0"
numeral "2.0.6"

Expand Down
4 changes: 2 additions & 2 deletions packages/Market/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@nexajs/market",
"version": "24.9.23",
"version": "24.9.24",
"description": "Access and trade with Nexa's exchange partners all from one place.",
"main": "index.js",
"repository": "https://github.com/avasdao/nexajs",
"author": "NEXA.js developers",
"license": "MIT",
"type": "module",
"dependencies": {
"@nexajs/provider": "24.9.23",
"@nexajs/provider": "24.9.24",
"@nexajs/transaction": "24.9.22",
"events": "3.3.0",
"moment": "2.29.4",
Expand Down
8 changes: 4 additions & 4 deletions packages/Market/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,10 @@
"@nexajs/script" "24.7.15"
"@nexajs/utils" "24.7.15"

"@nexajs/provider@24.9.23":
version "24.9.23"
resolved "https://registry.yarnpkg.com/@nexajs/provider/-/provider-24.9.23.tgz#f1379a3e3d1509dc62a1d7adeee4a916938f9c76"
integrity sha512-GzVxkKmU7iCFMxbet69xc8cy3K0Ev6wQL/VmPMn6+xt6io/7SGGs/D7wCy0wM9zmvZhZTrp8FF9mQ/gHpQjydQ==
"@nexajs/provider@24.9.24":
version "24.9.24"
resolved "https://registry.yarnpkg.com/@nexajs/provider/-/provider-24.9.24.tgz#0611b2314f50bbf8a83923f7733b331f39b52988"
integrity sha512-oFdX3mlixA32CO+UVBM+TcWaqY4cUFakFw4UIQFOEBwZYO+NLFujHNe6VrSqGiiv2ntVBrPyP9EJNkvjbdGB0g==
dependencies:
"@nexajs/utils" "24.7.15"
events "3.3.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/Provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nexajs/provider",
"version": "24.9.23",
"version": "24.9.24",
"description": "Manages individual (on-chain) service providers.",
"main": "index.js",
"repository": "https://github.com/avasdao/nexajs",
Expand Down
12 changes: 9 additions & 3 deletions packages/Provider/src/broadcast.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,26 @@ const broadcastNexa = async (_rawTx) => {

/* Validate response. */
if (response?.data?.broadcast) {
/* Set response. */
response = response.data.broadcast

/* Validate (txidem) response. */
if (isHex(response) && response.length === 64) {
response = {
// NOTE: This should be a transaction idem.
result: response.data.broadcast
result: response
}
} else {
response = {
error: typeof response.data.broadcast === 'string' ? response.data.broadcast : JSON.stringify(response.data.broadcast)
error: typeof response === 'string' ? response : JSON.stringify(response)
}
}
} else if (response?.data) {
/* Set response. */
response = response.data

response = {
error: typeof response.data === 'string' ? response?.data : JSON.stringify(response?.data)
error: typeof response === 'string' ? response : JSON.stringify(response)
}
} else {
response = {
Expand Down
4 changes: 2 additions & 2 deletions packages/Purse/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nexajs/purse",
"version": "24.9.23",
"version": "24.9.24",
"description": "Manages individual unspent transaction outputs (UTXOs).",
"main": "index.js",
"repository": "https://github.com/avasdao/nexajs",
Expand All @@ -10,7 +10,7 @@
"dependencies": {
"@nexajs/address": "24.9.22",
"@nexajs/hdnode": "24.9.22",
"@nexajs/provider": "24.9.23",
"@nexajs/provider": "24.9.24",
"@nexajs/transaction": "24.9.22",
"events": "3.3.0"
}
Expand Down
8 changes: 4 additions & 4 deletions packages/Purse/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,10 @@
"@nexajs/script" "24.7.15"
"@nexajs/utils" "24.7.15"

"@nexajs/provider@24.9.23":
version "24.9.23"
resolved "https://registry.yarnpkg.com/@nexajs/provider/-/provider-24.9.23.tgz#f1379a3e3d1509dc62a1d7adeee4a916938f9c76"
integrity sha512-GzVxkKmU7iCFMxbet69xc8cy3K0Ev6wQL/VmPMn6+xt6io/7SGGs/D7wCy0wM9zmvZhZTrp8FF9mQ/gHpQjydQ==
"@nexajs/provider@24.9.24":
version "24.9.24"
resolved "https://registry.yarnpkg.com/@nexajs/provider/-/provider-24.9.24.tgz#0611b2314f50bbf8a83923f7733b331f39b52988"
integrity sha512-oFdX3mlixA32CO+UVBM+TcWaqY4cUFakFw4UIQFOEBwZYO+NLFujHNe6VrSqGiiv2ntVBrPyP9EJNkvjbdGB0g==
dependencies:
"@nexajs/utils" "24.7.15"
events "3.3.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/Token/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nexajs/token",
"version": "24.9.23",
"version": "24.9.24",
"description": "Manage group token assets.",
"main": "index.js",
"repository": "https://github.com/avasdao/nexajs",
Expand All @@ -11,7 +11,7 @@
"@nexajs/address": "24.9.22",
"@nexajs/crypto": "24.9.5",
"@nexajs/hdnode": "24.9.22",
"@nexajs/provider": "24.9.23",
"@nexajs/provider": "24.9.24",
"@nexajs/script": "24.7.15",
"@nexajs/transaction": "24.9.22",
"events": "3.3.0"
Expand Down
8 changes: 4 additions & 4 deletions packages/Token/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,10 @@
"@nexajs/script" "24.7.15"
"@nexajs/utils" "24.7.15"

"@nexajs/provider@24.9.23":
version "24.9.23"
resolved "https://registry.yarnpkg.com/@nexajs/provider/-/provider-24.9.23.tgz#f1379a3e3d1509dc62a1d7adeee4a916938f9c76"
integrity sha512-GzVxkKmU7iCFMxbet69xc8cy3K0Ev6wQL/VmPMn6+xt6io/7SGGs/D7wCy0wM9zmvZhZTrp8FF9mQ/gHpQjydQ==
"@nexajs/provider@24.9.24":
version "24.9.24"
resolved "https://registry.yarnpkg.com/@nexajs/provider/-/provider-24.9.24.tgz#0611b2314f50bbf8a83923f7733b331f39b52988"
integrity sha512-oFdX3mlixA32CO+UVBM+TcWaqY4cUFakFw4UIQFOEBwZYO+NLFujHNe6VrSqGiiv2ntVBrPyP9EJNkvjbdGB0g==
dependencies:
"@nexajs/utils" "24.7.15"
events "3.3.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/Wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nexajs/wallet",
"version": "24.9.23",
"version": "24.9.24",
"description": "Manage a collection of assets spread across multiple blockchains.",
"main": "index.js",
"repository": "https://github.com/avasdao/nexajs",
Expand All @@ -11,9 +11,9 @@
"@nexajs/address": "24.9.22",
"@nexajs/crypto": "24.9.5",
"@nexajs/hdnode": "24.9.22",
"@nexajs/purse": "24.9.23",
"@nexajs/purse": "24.9.24",
"@nexajs/script": "24.7.15",
"@nexajs/token": "24.9.23",
"@nexajs/token": "24.9.24",
"events": "3.3.0",
"numeral": "2.0.6"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/Wallet/src/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export default async function (_tokenid, _receiver, _amount) {

/* Validate transaction result. */
if (txResult.result) {
console.log(txResult.result)
// console.log(txResult.result)

/* Set transaction idem. */
txidem = txResult.result
Expand Down
28 changes: 14 additions & 14 deletions packages/Wallet/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -266,22 +266,22 @@
"@nexajs/script" "24.7.15"
"@nexajs/utils" "24.7.15"

"@nexajs/provider@24.9.23":
version "24.9.23"
resolved "https://registry.yarnpkg.com/@nexajs/provider/-/provider-24.9.23.tgz#f1379a3e3d1509dc62a1d7adeee4a916938f9c76"
integrity sha512-GzVxkKmU7iCFMxbet69xc8cy3K0Ev6wQL/VmPMn6+xt6io/7SGGs/D7wCy0wM9zmvZhZTrp8FF9mQ/gHpQjydQ==
"@nexajs/provider@24.9.24":
version "24.9.24"
resolved "https://registry.yarnpkg.com/@nexajs/provider/-/provider-24.9.24.tgz#0611b2314f50bbf8a83923f7733b331f39b52988"
integrity sha512-oFdX3mlixA32CO+UVBM+TcWaqY4cUFakFw4UIQFOEBwZYO+NLFujHNe6VrSqGiiv2ntVBrPyP9EJNkvjbdGB0g==
dependencies:
"@nexajs/utils" "24.7.15"
events "3.3.0"

"@nexajs/purse@24.9.23":
version "24.9.23"
resolved "https://registry.yarnpkg.com/@nexajs/purse/-/purse-24.9.23.tgz#f45b48b7bd685f50b95cee667f1b81380e3995be"
integrity sha512-XqDWCf7xLIrr0dl3nV7MO2LsSt/C6WDRw0tIzoj53qfUsvMjZQmadmFj1T5p7njvGe9oplKRsX4EDYmFQEzIzQ==
"@nexajs/purse@24.9.24":
version "24.9.24"
resolved "https://registry.yarnpkg.com/@nexajs/purse/-/purse-24.9.24.tgz#185ec447b9a65125022b582a29b46c15be5ac894"
integrity sha512-/ZZwrThmJIYK3HFXgxg3Y/4SoBWBkpc76x32IuOTn1d/g3r3jwUxUfzWhzRu0jUe1k/Ys6w9Q7t45otqU4X7lw==
dependencies:
"@nexajs/address" "24.9.22"
"@nexajs/hdnode" "24.9.22"
"@nexajs/provider" "24.9.23"
"@nexajs/provider" "24.9.24"
"@nexajs/transaction" "24.9.22"
events "3.3.0"

Expand All @@ -292,15 +292,15 @@
dependencies:
"@nexajs/utils" "24.7.15"

"@nexajs/token@24.9.23":
version "24.9.23"
resolved "https://registry.yarnpkg.com/@nexajs/token/-/token-24.9.23.tgz#14e10fccfec7601e27ba53c8244f5534a0c33915"
integrity sha512-BxDE3MkA+WYTaYy9MVsPAD/0WEQwwtCW5qKYftCszmw6UKkeoxSi+EVZC0qvT73ci1QkIXaJU5qGj1tKqz8GZg==
"@nexajs/token@24.9.24":
version "24.9.24"
resolved "https://registry.yarnpkg.com/@nexajs/token/-/token-24.9.24.tgz#f8ea114908e83ff59f08b6369f8813efa5a171e3"
integrity sha512-mLfwx5UKepB9NVd8PLkHfIJqXSjGvrzOtORQQoAVznv/ZbVA28E01vjggLqQc4YtWVy84PNLKNBYP9MBTNMg8w==
dependencies:
"@nexajs/address" "24.9.22"
"@nexajs/crypto" "24.9.5"
"@nexajs/hdnode" "24.9.22"
"@nexajs/provider" "24.9.23"
"@nexajs/provider" "24.9.24"
"@nexajs/script" "24.7.15"
"@nexajs/transaction" "24.9.22"
events "3.3.0"
Expand Down
2 changes: 1 addition & 1 deletion studio-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@pinia/nuxt": "0.5.4",
"@trezor/connect-web": "9.1.4",
"moment": "2.30.1",
"nexajs": "24.9.23",
"nexajs": "24.9.24",
"numeral": "2.0.6",
"nuxt": "3.12.4",
"pinia": "2.2.2",
Expand Down
Loading

0 comments on commit b446f70

Please sign in to comment.