diff --git a/lerna.json b/lerna.json index 9b1db0a2..a7e0b4ff 100644 --- a/lerna.json +++ b/lerna.json @@ -7,5 +7,5 @@ "publishConfig": { "directory": "build" }, - "version": "0.12.0-alpha.6" + "version": "0.12.0-alpha.7" } diff --git a/packages/node-api/package.json b/packages/node-api/package.json index ffc07131..e0f8e3f5 100644 --- a/packages/node-api/package.json +++ b/packages/node-api/package.json @@ -18,10 +18,10 @@ }, "sideEffects": false, "type": "module", - "version": "0.12.0-alpha.6", + "version": "0.12.0-alpha.7", "main": "index.js", "dependencies": { - "@encointer/types": "^0.12.0-alpha.6", + "@encointer/types": "^0.12.0-alpha.7", "@polkadot/api": "^10.9.1", "tslib": "^2.5.3" }, diff --git a/packages/types/package.json b/packages/types/package.json index 31ba0d72..00668475 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -18,7 +18,7 @@ }, "sideEffects": false, "type": "module", - "version": "0.12.0-alpha.6", + "version": "0.12.0-alpha.7", "main": "index.js", "scripts": { "generate:defs": "node --experimental-specifier-resolution=node --loader ts-node/esm ../../node_modules/.bin/polkadot-types-from-defs --package @encointer/types/interfaces --input ./src/interfaces", diff --git a/packages/util/package.json b/packages/util/package.json index fba87d52..baf855b7 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -20,7 +20,7 @@ "sideEffects": false, "type": "module", "types": "./index.d.ts", - "version": "0.12.0-alpha.6", + "version": "0.12.0-alpha.7", "main": "index.js", "dependencies": { "@babel/runtime": "^7.18.9", diff --git a/packages/worker-api/package.json b/packages/worker-api/package.json index 874a1dd6..fef5bc50 100644 --- a/packages/worker-api/package.json +++ b/packages/worker-api/package.json @@ -19,12 +19,12 @@ "sideEffects": false, "type": "module", "types": "./index.d.ts", - "version": "0.12.0-alpha.6", + "version": "0.12.0-alpha.7", "main": "index.js", "dependencies": { - "@encointer/node-api": "^0.12.0-alpha.6", - "@encointer/types": "^0.12.0-alpha.6", - "@encointer/util": "^0.12.0-alpha.6", + "@encointer/node-api": "^0.12.0-alpha.7", + "@encointer/types": "^0.12.0-alpha.7", + "@encointer/util": "^0.12.0-alpha.7", "@polkadot/api": "^10.9.1", "@polkadot/keyring": "^12.3.2", "@polkadot/types": "^10.9.1", diff --git a/packages/worker-api/src/parsers.ts b/packages/worker-api/src/parsers.ts index b6b90ca5..3cd6a72c 100644 --- a/packages/worker-api/src/parsers.ts +++ b/packages/worker-api/src/parsers.ts @@ -6,6 +6,7 @@ import NodeRSA from 'node-rsa'; import type { IWorker } from './interface.js'; import type { BalanceEntry } from "@encointer/types"; +import BN from "bn.js"; export function parseBalance(self: IWorker, data: any): BalanceEntry { const balanceEntry = self.createType('BalanceEntry', data); @@ -25,12 +26,12 @@ export function parseBalanceType(data: any): number { export function parseNodeRSA(data: any): NodeRSA { const keyJson = JSON.parse(data); keyJson.n = u8aToBuffer(keyJson.n).reverse(); - keyJson.e = u8aToBuffer(keyJson.e).reverse(); + keyJson.e = new BN(keyJson.e); const key = new NodeRSA(); setKeyOpts(key); key.importKey({ n: keyJson.n, - e: keyJson.e + e: keyJson.e.toNumber() }, 'components-public'); return key; } diff --git a/packages/worker-api/src/requests.ts b/packages/worker-api/src/requests.ts index 38c5efa6..d452ea4f 100644 --- a/packages/worker-api/src/requests.ts +++ b/packages/worker-api/src/requests.ts @@ -80,7 +80,7 @@ export const createTrustedCall = ( const payload = Uint8Array.from([...call.toU8a(), ...nonce.toU8a(), ...hash.toU8a(), ...shard.toU8a()]); - return self.createType('IntegriteeIntegriteeTrustedCallSigned', { + return self.createType('IntegriteeTrustedCallSigned', { call: call, nonce: nonce, signature: { Sr25519: toAccount(accountOrPubKey, self.keyring()).sign(payload) }, diff --git a/yarn.lock b/yarn.lock index 97e9b946..72df5e2a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -755,18 +755,18 @@ __metadata: languageName: node linkType: hard -"@encointer/node-api@^0.12.0-alpha.6, @encointer/node-api@workspace:packages/node-api": +"@encointer/node-api@^0.12.0-alpha.7, @encointer/node-api@workspace:packages/node-api": version: 0.0.0-use.local resolution: "@encointer/node-api@workspace:packages/node-api" dependencies: - "@encointer/types": ^0.12.0-alpha.6 + "@encointer/types": ^0.12.0-alpha.7 "@polkadot/api": ^10.9.1 "@polkadot/util-crypto": ^12.3.2 tslib: ^2.5.3 languageName: unknown linkType: soft -"@encointer/types@^0.12.0-alpha.6, @encointer/types@workspace:packages/types": +"@encointer/types@^0.12.0-alpha.7, @encointer/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@encointer/types@workspace:packages/types" dependencies: @@ -781,7 +781,7 @@ __metadata: languageName: unknown linkType: soft -"@encointer/util@^0.12.0-alpha.6, @encointer/util@workspace:packages/util": +"@encointer/util@^0.12.0-alpha.7, @encointer/util@workspace:packages/util": version: 0.0.0-use.local resolution: "@encointer/util@workspace:packages/util" dependencies: @@ -798,9 +798,9 @@ __metadata: version: 0.0.0-use.local resolution: "@encointer/worker-api@workspace:packages/worker-api" dependencies: - "@encointer/node-api": ^0.12.0-alpha.6 - "@encointer/types": ^0.12.0-alpha.6 - "@encointer/util": ^0.12.0-alpha.6 + "@encointer/node-api": ^0.12.0-alpha.7 + "@encointer/types": ^0.12.0-alpha.7 + "@encointer/util": ^0.12.0-alpha.7 "@polkadot/api": ^10.9.1 "@polkadot/keyring": ^12.3.2 "@polkadot/types": ^10.9.1