@acala-network/chopsticks-utils 1.5.2 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -176,11 +176,11 @@ export declare const testingPairs: (keyringType?: "ed25519" | "sr25519", ss58For
176
176
  * @returns Object containing various test signers, and a `polkadotSignerBuilder` function to create more.
177
177
  */
178
178
  export declare const testingSigners: (keyringType?: "Ed25519" | "Sr25519") => {
179
- alice: import("@polkadot-api/polkadot-signer").PolkadotSigner;
180
- bob: import("@polkadot-api/polkadot-signer").PolkadotSigner;
181
- charlie: import("@polkadot-api/polkadot-signer").PolkadotSigner;
182
- dave: import("@polkadot-api/polkadot-signer").PolkadotSigner;
183
- eve: import("@polkadot-api/polkadot-signer").PolkadotSigner;
184
- ferdie: import("@polkadot-api/polkadot-signer").PolkadotSigner;
185
- polkadotSignerBuilder: (path: string, keyringType?: "Ed25519" | "Sr25519") => import("@polkadot-api/polkadot-signer").PolkadotSigner;
179
+ alice: import("@polkadot-api/signers-common").CommonSignerTxCreator;
180
+ bob: import("@polkadot-api/signers-common").CommonSignerTxCreator;
181
+ charlie: import("@polkadot-api/signers-common").CommonSignerTxCreator;
182
+ dave: import("@polkadot-api/signers-common").CommonSignerTxCreator;
183
+ eve: import("@polkadot-api/signers-common").CommonSignerTxCreator;
184
+ ferdie: import("@polkadot-api/signers-common").CommonSignerTxCreator;
185
+ polkadotSignerBuilder: (path: string, keyringType?: "Ed25519" | "Sr25519") => import("@polkadot-api/signers-common").CommonSignerTxCreator;
186
186
  };
package/dist/cjs/index.js CHANGED
@@ -42,7 +42,7 @@ const _api = require("@polkadot/api");
42
42
  const _keyring = require("@polkadot/keyring");
43
43
  const _hdkd = require("@polkadot-labs/hdkd");
44
44
  const _hdkdhelpers = require("@polkadot-labs/hdkd-helpers");
45
- const _signer = require("polkadot-api/signer");
45
+ const _txcreator = require("polkadot-api/tx-creator");
46
46
  _export_star(require("./signFake.js"), exports);
47
47
  function _export_star(from, to) {
48
48
  Object.keys(from).forEach(function(k) {
@@ -234,7 +234,7 @@ const testingSigners = (keyringType = 'Ed25519')=>{
234
234
  // Create a PAPI polkadot signer given a derivation path e.g. "//Alice" or "//Bob".
235
235
  const polkadotSignerBuilder = (path, keyringType = 'Ed25519')=>{
236
236
  const hdkdKeyPair = derive(path);
237
- return (0, _signer.getPolkadotSigner)(hdkdKeyPair.publicKey, keyringType, hdkdKeyPair.sign);
237
+ return (0, _txcreator.getTxCreator)(hdkdKeyPair.publicKey, keyringType, hdkdKeyPair.sign);
238
238
  };
239
239
  return {
240
240
  alice: polkadotSignerBuilder('//Alice', keyringType),
@@ -17,7 +17,8 @@ _export(exports, {
17
17
  }
18
18
  });
19
19
  const signFakeWithApi = async (api, tx, addr, options = {})=>{
20
- const nonce = options.nonce ?? (await api.query.system.account(addr)).nonce;
20
+ const account = await api.query.system.account(addr);
21
+ const nonce = options.nonce ?? account.nonce;
21
22
  signFake(tx, addr, {
22
23
  nonce,
23
24
  genesisHash: api.genesisHash,
@@ -176,11 +176,11 @@ export declare const testingPairs: (keyringType?: "ed25519" | "sr25519", ss58For
176
176
  * @returns Object containing various test signers, and a `polkadotSignerBuilder` function to create more.
177
177
  */
178
178
  export declare const testingSigners: (keyringType?: "Ed25519" | "Sr25519") => {
179
- alice: import("@polkadot-api/polkadot-signer").PolkadotSigner;
180
- bob: import("@polkadot-api/polkadot-signer").PolkadotSigner;
181
- charlie: import("@polkadot-api/polkadot-signer").PolkadotSigner;
182
- dave: import("@polkadot-api/polkadot-signer").PolkadotSigner;
183
- eve: import("@polkadot-api/polkadot-signer").PolkadotSigner;
184
- ferdie: import("@polkadot-api/polkadot-signer").PolkadotSigner;
185
- polkadotSignerBuilder: (path: string, keyringType?: "Ed25519" | "Sr25519") => import("@polkadot-api/polkadot-signer").PolkadotSigner;
179
+ alice: import("@polkadot-api/signers-common").CommonSignerTxCreator;
180
+ bob: import("@polkadot-api/signers-common").CommonSignerTxCreator;
181
+ charlie: import("@polkadot-api/signers-common").CommonSignerTxCreator;
182
+ dave: import("@polkadot-api/signers-common").CommonSignerTxCreator;
183
+ eve: import("@polkadot-api/signers-common").CommonSignerTxCreator;
184
+ ferdie: import("@polkadot-api/signers-common").CommonSignerTxCreator;
185
+ polkadotSignerBuilder: (path: string, keyringType?: "Ed25519" | "Sr25519") => import("@polkadot-api/signers-common").CommonSignerTxCreator;
186
186
  };
package/dist/esm/index.js CHANGED
@@ -3,7 +3,7 @@ import { ApiPromise, WsProvider } from '@polkadot/api';
3
3
  import { createTestKeyring, Keyring } from '@polkadot/keyring';
4
4
  import { ed25519CreateDerive, sr25519CreateDerive } from '@polkadot-labs/hdkd';
5
5
  import { DEV_PHRASE, entropyToMiniSecret, mnemonicToEntropy } from '@polkadot-labs/hdkd-helpers';
6
- import { getPolkadotSigner } from 'polkadot-api/signer';
6
+ import { getTxCreator } from 'polkadot-api/tx-creator';
7
7
  const logger = defaultLogger.child({
8
8
  name: 'utils'
9
9
  });
@@ -216,7 +216,7 @@ export * from './signFake.js';
216
216
  // Create a PAPI polkadot signer given a derivation path e.g. "//Alice" or "//Bob".
217
217
  const polkadotSignerBuilder = (path, keyringType = 'Ed25519')=>{
218
218
  const hdkdKeyPair = derive(path);
219
- return getPolkadotSigner(hdkdKeyPair.publicKey, keyringType, hdkdKeyPair.sign);
219
+ return getTxCreator(hdkdKeyPair.publicKey, keyringType, hdkdKeyPair.sign);
220
220
  };
221
221
  return {
222
222
  alice: polkadotSignerBuilder('//Alice', keyringType),
@@ -1,5 +1,6 @@
1
1
  export const signFakeWithApi = async (api, tx, addr, options = {})=>{
2
- const nonce = options.nonce ?? (await api.query.system.account(addr)).nonce;
2
+ const account = await api.query.system.account(addr);
3
+ const nonce = options.nonce ?? account.nonce;
3
4
  signFake(tx, addr, {
4
5
  nonce,
5
6
  genesisHash: api.genesisHash,
package/package.json CHANGED
@@ -1,50 +1,54 @@
1
1
  {
2
- "name": "@acala-network/chopsticks-utils",
3
- "version": "1.5.2",
4
- "author": "Acala Developers <hello@acala.network>",
5
- "license": "Apache-2.0",
6
- "type": "module",
7
- "engines": {
8
- "node": ">=v22"
9
- },
10
- "scripts": {
11
- "clean": "rm -rf dist tsconfig.tsbuildinfo",
12
- "build": "yarn clean && ../../package-build.sh",
13
- "depcheck": "npx depcheck"
14
- },
15
- "dependencies": {
16
- "@acala-network/chopsticks": "1.5.2",
17
- "@acala-network/chopsticks-core": "1.5.2",
18
- "@polkadot-labs/hdkd": "^0.0.19",
19
- "@polkadot-labs/hdkd-helpers": "^0.0.19",
20
- "@polkadot/api": "^16.4.1",
21
- "@polkadot/api-base": "^16.4.1",
22
- "@polkadot/keyring": "^14.0.1",
23
- "@polkadot/types": "^16.4.1",
24
- "@polkadot/util": "^14.0.1",
25
- "polkadot-api": "^1.14.1"
26
- },
27
- "devDependencies": {
28
- "@swc/cli": "0.7.10",
29
- "@swc/core": "^1.12.14",
30
- "typescript": "^5.8.3"
31
- },
32
- "files": [
33
- "dist/esm/**",
34
- "dist/cjs/**"
35
- ],
36
- "main": "./dist/cjs/index.js",
37
- "module": "./dist/esm/index.js",
38
- "exports": {
39
- ".": {
40
- "require": "./dist/cjs/index.js",
41
- "import": "./dist/esm/index.js",
42
- "default": "./dist/esm/index.js"
43
- },
44
- "./*": {
45
- "require": "./dist/cjs/*.js",
46
- "import": "./dist/esm/*.js",
47
- "default": "./dist/esm/*.js"
48
- }
49
- }
50
- }
2
+ "name": "@acala-network/chopsticks-utils",
3
+ "version": "1.6.1",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/AcalaNetwork/chopsticks"
7
+ },
8
+ "author": "Acala Developers <hello@acala.network>",
9
+ "license": "Apache-2.0",
10
+ "type": "module",
11
+ "engines": {
12
+ "node": ">=v24"
13
+ },
14
+ "scripts": {
15
+ "clean": "rm -rf dist tsconfig.tsbuildinfo",
16
+ "build": "bun run clean && ../../package-build.sh",
17
+ "depcheck": "bunx depcheck"
18
+ },
19
+ "dependencies": {
20
+ "@acala-network/chopsticks": "1.6.1",
21
+ "@acala-network/chopsticks-core": "1.6.1",
22
+ "@polkadot-labs/hdkd": "^0.0.32",
23
+ "@polkadot-labs/hdkd-helpers": "^0.0.34",
24
+ "@polkadot/api": "^17.0.2",
25
+ "@polkadot/api-base": "^17.0.2",
26
+ "@polkadot/keyring": "^14.0.3",
27
+ "@polkadot/types": "^17.0.2",
28
+ "@polkadot/util": "^14.0.3",
29
+ "polkadot-api": "^3.3.0"
30
+ },
31
+ "devDependencies": {
32
+ "@swc/cli": "0.8.2",
33
+ "@swc/core": "^1.16.22",
34
+ "typescript": "^6.0.3"
35
+ },
36
+ "files": [
37
+ "dist/esm/**",
38
+ "dist/cjs/**"
39
+ ],
40
+ "main": "./dist/cjs/index.js",
41
+ "module": "./dist/esm/index.js",
42
+ "exports": {
43
+ ".": {
44
+ "require": "./dist/cjs/index.js",
45
+ "import": "./dist/esm/index.js",
46
+ "default": "./dist/esm/index.js"
47
+ },
48
+ "./*": {
49
+ "require": "./dist/cjs/*.js",
50
+ "import": "./dist/esm/*.js",
51
+ "default": "./dist/esm/*.js"
52
+ }
53
+ }
54
+ }