@xyo-network/account
Advanced tools
Comparing version 3.6.9 to 3.6.10
@@ -5,2 +5,3 @@ export * from './Account.ts'; | ||
export * from './Key/index.ts'; | ||
export * from './lib/index.ts'; | ||
export * from '@xyo-network/account-model'; | ||
@@ -7,0 +8,0 @@ export * from '@xyo-network/key-model'; |
{ | ||
"name": "@xyo-network/account", | ||
"version": "3.6.9", | ||
"version": "3.6.10", | ||
"description": "Primary SDK for using XYO Protocol 2.0", | ||
@@ -33,17 +33,17 @@ "homepage": "https://xyo.network", | ||
"@bitauth/libauth": "^3.0.0", | ||
"@scure/bip39": "^1.5.0", | ||
"@xylabs/arraybuffer": "^4.4.34", | ||
"@xylabs/assert": "^4.4.34", | ||
"@xylabs/hex": "^4.4.34", | ||
"@xylabs/object": "^4.4.34", | ||
"@xylabs/static-implements": "^4.4.34", | ||
"@xyo-network/account-model": "^3.6.9", | ||
"@xyo-network/data": "^3.6.9", | ||
"@xyo-network/key-model": "^3.6.9", | ||
"@xyo-network/previous-hash-store": "^3.6.9", | ||
"@xyo-network/previous-hash-store-model": "^3.6.9", | ||
"@xyo-network/wallet-model": "^3.6.9", | ||
"@xyo-network/wasm": "^3.6.9", | ||
"@scure/bip39": "^1.5.4", | ||
"@xylabs/arraybuffer": "^4.5.1", | ||
"@xylabs/assert": "^4.5.1", | ||
"@xylabs/hex": "^4.5.1", | ||
"@xylabs/object": "^4.5.1", | ||
"@xylabs/static-implements": "^4.5.1", | ||
"@xyo-network/account-model": "^3.6.10", | ||
"@xyo-network/data": "^3.6.10", | ||
"@xyo-network/key-model": "^3.6.10", | ||
"@xyo-network/previous-hash-store": "^3.6.10", | ||
"@xyo-network/previous-hash-store-model": "^3.6.10", | ||
"@xyo-network/wallet-model": "^3.6.10", | ||
"@xyo-network/wasm": "^3.6.10", | ||
"async-mutex": "^0.5.0", | ||
"ethers": "6.13.4" | ||
"ethers": "6.13.5" | ||
}, | ||
@@ -53,6 +53,6 @@ "devDependencies": { | ||
"@xylabs/tsconfig": "^4.2.6", | ||
"@xylabs/vitest-extended": "^4.4.34", | ||
"@xylabs/vitest-matchers": "^4.4.34", | ||
"typescript": "^5.7.2", | ||
"vitest": "^2.1.8" | ||
"@xylabs/vitest-extended": "^4.5.1", | ||
"@xylabs/vitest-matchers": "^4.5.1", | ||
"typescript": "^5.7.3", | ||
"vitest": "^3.0.4" | ||
}, | ||
@@ -59,0 +59,0 @@ "publishConfig": { |
import { toArrayBuffer, toUint8Array } from '@xylabs/arraybuffer' | ||
import { assertEx } from '@xylabs/assert' | ||
import { | ||
Address, Hash, hexFromArrayBuffer, | ||
Address, | ||
Hash, | ||
toHex, | ||
} from '@xylabs/hex' | ||
@@ -68,3 +70,3 @@ import { globallyUnique } from '@xylabs/object' | ||
get previousHash() { | ||
return this.previousHashBytes ? (hexFromArrayBuffer(this.previousHashBytes, { prefix: false }).toLowerCase() as Hash) : undefined | ||
return this.previousHashBytes ? (toHex(this.previousHashBytes, { prefix: false }).toLowerCase() as Hash) : undefined | ||
} | ||
@@ -148,3 +150,3 @@ | ||
? this.previousHash | ||
: hexFromArrayBuffer(previousHash, { prefix: false }) | ||
: toHex(previousHash, { prefix: false }) | ||
assertEx( | ||
@@ -159,3 +161,3 @@ currentPreviousHash === passedCurrentHash, | ||
if (Account.previousHashStore) { | ||
await Account.previousHashStore.setItem(this.address, hexFromArrayBuffer(newPreviousHash, { prefix: false })) | ||
await Account.previousHashStore.setItem(this.address, toHex(newPreviousHash, { prefix: false })) | ||
} | ||
@@ -162,0 +164,0 @@ return [signature, currentPreviousHash] |
@@ -5,2 +5,3 @@ import type { Secp256k1 } from '@bitauth/libauth' | ||
import { assertEx } from '@xylabs/assert' | ||
import { toHex } from '@xylabs/hex' | ||
import { Data } from '@xyo-network/data' | ||
@@ -45,2 +46,5 @@ import { WasmSupport } from '@xyo-network/wasm' | ||
const { derivePublicKeyUncompressed } = await this.secp256k1() | ||
if (BigInt(toHex(privateKey, { prefix: true })) === 0n) { | ||
throw new Error(`Invalid private key [${toHex(privateKey)}]`) | ||
} | ||
const derivedPublicKey = derivePublicKeyUncompressed(new Uint8Array(privateKey)) | ||
@@ -47,0 +51,0 @@ const fullPublicKey = typeof derivedPublicKey === 'string' ? toUint8Array(derivedPublicKey) : derivedPublicKey |
@@ -5,2 +5,3 @@ export * from './Account.ts' | ||
export * from './Key/index.ts' | ||
export * from './lib/index.ts' | ||
export * from '@xyo-network/account-model' | ||
@@ -7,0 +8,0 @@ export * from '@xyo-network/key-model' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
101529
1191
+ Added@xyo-network/account-model@3.8.0(transitive)
+ Added@xyo-network/data@3.8.0(transitive)
+ Added@xyo-network/key-model@3.8.0(transitive)
+ Added@xyo-network/previous-hash-store@3.8.0(transitive)
+ Added@xyo-network/previous-hash-store-indexeddb@3.8.0(transitive)
+ Added@xyo-network/previous-hash-store-model@3.8.0(transitive)
+ Added@xyo-network/previous-hash-store-storage@3.8.0(transitive)
+ Added@xyo-network/wallet-model@3.8.0(transitive)
+ Added@xyo-network/wasm@3.8.0(transitive)
+ Addedtslib@2.8.1(transitive)
- Removed@xyo-network/account-model@3.9.0(transitive)
- Removed@xyo-network/data@3.9.0(transitive)
- Removed@xyo-network/key-model@3.9.0(transitive)
- Removed@xyo-network/previous-hash-store@3.9.0(transitive)
- Removed@xyo-network/previous-hash-store-indexeddb@3.9.0(transitive)
- Removed@xyo-network/previous-hash-store-model@3.9.0(transitive)
- Removed@xyo-network/previous-hash-store-storage@3.9.0(transitive)
- Removed@xyo-network/wallet-model@3.9.0(transitive)
- Removed@xyo-network/wasm@3.9.0(transitive)
- Removedethers@6.13.4(transitive)
Updated@scure/bip39@^1.5.4
Updated@xylabs/arraybuffer@^4.5.1
Updated@xylabs/assert@^4.5.1
Updated@xylabs/hex@^4.5.1
Updated@xylabs/object@^4.5.1
Updated@xyo-network/data@^3.6.10
Updated@xyo-network/wasm@^3.6.10
Updatedethers@6.13.5