@acala-network/chopsticks-utils 0.9.4-1 → 0.9.4-3
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.
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { ApiPromise, WsProvider } from '@polkadot/api';
|
|
2
|
+
import { StorageValues } from '@acala-network/chopsticks';
|
|
3
|
+
import { Codec } from '@polkadot/types/types';
|
|
4
|
+
import { Config } from '@acala-network/chopsticks/schema/index.js';
|
|
5
|
+
import { HexString } from '@polkadot/util/types';
|
|
6
|
+
import { Keyring } from '@polkadot/keyring';
|
|
7
|
+
import { SubmittableExtrinsic } from '@polkadot/api-base/types';
|
|
8
|
+
export * from './signFake.js';
|
|
9
|
+
export type SetupOption = {
|
|
10
|
+
endpoint: string | string[];
|
|
11
|
+
blockNumber?: number;
|
|
12
|
+
blockHash?: HexString;
|
|
13
|
+
wasmOverride?: string;
|
|
14
|
+
db?: string;
|
|
15
|
+
timeout?: number;
|
|
16
|
+
port?: number;
|
|
17
|
+
maxMemoryBlockCount?: number;
|
|
18
|
+
resume?: boolean | HexString | number;
|
|
19
|
+
runtimeLogLevel?: number;
|
|
20
|
+
};
|
|
21
|
+
export type SetupConfig = Config & {
|
|
22
|
+
timeout?: number;
|
|
23
|
+
};
|
|
24
|
+
export declare const createConfig: ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, port, maxMemoryBlockCount, resume, runtimeLogLevel, }: SetupOption) => SetupConfig;
|
|
25
|
+
export declare const setupContext: (option: SetupOption) => Promise<{
|
|
26
|
+
url: string;
|
|
27
|
+
chain: import("@acala-network/chopsticks").Blockchain;
|
|
28
|
+
ws: WsProvider;
|
|
29
|
+
api: ApiPromise;
|
|
30
|
+
dev: {
|
|
31
|
+
newBlock: (param?: {
|
|
32
|
+
count?: number;
|
|
33
|
+
to?: number;
|
|
34
|
+
unsafeBlockHeight?: number;
|
|
35
|
+
}) => Promise<string>;
|
|
36
|
+
setStorage: (values: StorageValues, blockHash?: string) => Promise<any>;
|
|
37
|
+
timeTravel: (date: string | number) => Promise<number>;
|
|
38
|
+
setHead: (hashOrNumber: string | number) => Promise<any>;
|
|
39
|
+
};
|
|
40
|
+
teardown(): Promise<void>;
|
|
41
|
+
pause(): Promise<unknown>;
|
|
42
|
+
}>;
|
|
43
|
+
export declare const setupContextWithConfig: ({ timeout, ...config }: SetupConfig) => Promise<{
|
|
44
|
+
url: string;
|
|
45
|
+
chain: import("@acala-network/chopsticks").Blockchain;
|
|
46
|
+
ws: WsProvider;
|
|
47
|
+
api: ApiPromise;
|
|
48
|
+
dev: {
|
|
49
|
+
newBlock: (param?: {
|
|
50
|
+
count?: number;
|
|
51
|
+
to?: number;
|
|
52
|
+
unsafeBlockHeight?: number;
|
|
53
|
+
}) => Promise<string>;
|
|
54
|
+
setStorage: (values: StorageValues, blockHash?: string) => Promise<any>;
|
|
55
|
+
timeTravel: (date: string | number) => Promise<number>;
|
|
56
|
+
setHead: (hashOrNumber: string | number) => Promise<any>;
|
|
57
|
+
};
|
|
58
|
+
teardown(): Promise<void>;
|
|
59
|
+
pause(): Promise<unknown>;
|
|
60
|
+
}>;
|
|
61
|
+
export type NetworkContext = Awaited<ReturnType<typeof setupContext>>;
|
|
62
|
+
export declare const setupNetworks: (networkOptions: Partial<Record<string, Config | string | undefined>>) => Promise<Record<string, {
|
|
63
|
+
url: string;
|
|
64
|
+
chain: import("@acala-network/chopsticks").Blockchain;
|
|
65
|
+
ws: WsProvider;
|
|
66
|
+
api: ApiPromise;
|
|
67
|
+
dev: {
|
|
68
|
+
newBlock: (param?: {
|
|
69
|
+
count?: number;
|
|
70
|
+
to?: number;
|
|
71
|
+
unsafeBlockHeight?: number;
|
|
72
|
+
}) => Promise<string>;
|
|
73
|
+
setStorage: (values: StorageValues, blockHash?: string) => Promise<any>;
|
|
74
|
+
timeTravel: (date: string | number) => Promise<number>;
|
|
75
|
+
setHead: (hashOrNumber: string | number) => Promise<any>;
|
|
76
|
+
};
|
|
77
|
+
teardown(): Promise<void>;
|
|
78
|
+
pause(): Promise<unknown>;
|
|
79
|
+
}>>;
|
|
80
|
+
export declare function defer<T>(): {
|
|
81
|
+
resolve: (value: any) => void;
|
|
82
|
+
reject: (reason: any) => void;
|
|
83
|
+
promise: Promise<T>;
|
|
84
|
+
};
|
|
85
|
+
export declare const sendTransaction: (tx: Promise<SubmittableExtrinsic<'promise'>>) => Promise<{
|
|
86
|
+
events: Promise<Codec[]>;
|
|
87
|
+
}>;
|
|
88
|
+
export declare const testingPairs: (keyringType?: 'ed25519' | 'sr25519', ss58Format?: number) => {
|
|
89
|
+
alice: import("@polkadot/keyring/types").KeyringPair;
|
|
90
|
+
bob: import("@polkadot/keyring/types").KeyringPair;
|
|
91
|
+
charlie: import("@polkadot/keyring/types").KeyringPair;
|
|
92
|
+
dave: import("@polkadot/keyring/types").KeyringPair;
|
|
93
|
+
eve: import("@polkadot/keyring/types").KeyringPair;
|
|
94
|
+
alith: import("@polkadot/keyring/types").KeyringPair;
|
|
95
|
+
baltathar: import("@polkadot/keyring/types").KeyringPair;
|
|
96
|
+
charleth: import("@polkadot/keyring/types").KeyringPair;
|
|
97
|
+
dorothy: import("@polkadot/keyring/types").KeyringPair;
|
|
98
|
+
ethan: import("@polkadot/keyring/types").KeyringPair;
|
|
99
|
+
keyring: Keyring;
|
|
100
|
+
keyringEth: import("@polkadot/keyring/types").KeyringInstance;
|
|
101
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ApiPromise } from '@polkadot/api';
|
|
2
|
+
import { GenericExtrinsic } from '@polkadot/types';
|
|
3
|
+
import { SignatureOptions } from '@polkadot/types/types';
|
|
4
|
+
export type SignFakeOptions = Partial<SignatureOptions>;
|
|
5
|
+
export declare const signFakeWithApi: (api: ApiPromise, tx: GenericExtrinsic, addr: string, options?: SignFakeOptions) => Promise<void>;
|
|
6
|
+
export declare const signFake: (tx: GenericExtrinsic, addr: string, options: SignatureOptions) => void;
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acala-network/chopsticks-utils",
|
|
3
|
-
"version": "0.9.4-
|
|
3
|
+
"version": "0.9.4-3",
|
|
4
4
|
"author": "Acala Developers <hello@acala.network>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"clean": "rm -rf dist",
|
|
9
|
-
"build": "yarn clean && yarn build:cjs && yarn build:esm
|
|
10
|
-
"build:cjs": "swc ./src --config-file ../../.cjsswcrc -d dist/cjs && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json",
|
|
11
|
-
"build:esm": "swc ./src --config-file ../../.esmswcrc -d dist/esm"
|
|
12
|
-
"build:types": "tsc -p tsconfig.json --emitDeclarationOnly --outDir dist/types"
|
|
8
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
9
|
+
"build": "yarn clean && yarn build:cjs && yarn build:esm",
|
|
10
|
+
"build:cjs": "swc ./src --config-file ../../.cjsswcrc -d dist/cjs && tsc -p tsconfig.json --declarationDir dist/cjs && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json",
|
|
11
|
+
"build:esm": "swc ./src --config-file ../../.esmswcrc -d dist/esm && tsc -p tsconfig.json --declarationDir dist/esm"
|
|
13
12
|
},
|
|
14
13
|
"dependencies": {
|
|
15
|
-
"@acala-network/chopsticks": "0.9.4-
|
|
14
|
+
"@acala-network/chopsticks": "0.9.4-3",
|
|
16
15
|
"@polkadot/api": "^10.10.1",
|
|
17
16
|
"@polkadot/types": "^10.10.1"
|
|
18
17
|
},
|
|
@@ -23,26 +22,20 @@
|
|
|
23
22
|
},
|
|
24
23
|
"files": [
|
|
25
24
|
"dist/esm/**",
|
|
26
|
-
"dist/cjs/**"
|
|
27
|
-
"dist/types/**"
|
|
25
|
+
"dist/cjs/**"
|
|
28
26
|
],
|
|
29
27
|
"main": "./dist/cjs/index.js",
|
|
30
28
|
"module": "./dist/esm/index.js",
|
|
31
|
-
"types": "./dist/types/index.d.ts",
|
|
32
29
|
"exports": {
|
|
33
30
|
".": {
|
|
34
|
-
"types": "./dist/types/index.d.ts",
|
|
35
31
|
"require": "./dist/cjs/index.js",
|
|
36
32
|
"import": "./dist/esm/index.js",
|
|
37
33
|
"default": "./dist/esm/index.js"
|
|
38
34
|
},
|
|
39
35
|
"./*": {
|
|
40
|
-
"types": "./dist/types/*.d.ts",
|
|
41
36
|
"require": "./dist/cjs/*.js",
|
|
42
37
|
"import": "./dist/esm/*.js",
|
|
43
38
|
"default": "./dist/esm/*.js"
|
|
44
|
-
}
|
|
45
|
-
"./package.json": "./package.json",
|
|
46
|
-
"./package.cjs.json": "./dist/cjs/package.json"
|
|
39
|
+
}
|
|
47
40
|
}
|
|
48
41
|
}
|
|
File without changes
|
|
File without changes
|