bulk-keychain-wasm 0.1.0 → 0.1.2
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.
- package/bulk_keychain_wasm.d.ts +144 -129
- package/bulk_keychain_wasm.js +637 -611
- package/bulk_keychain_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/bulk_keychain_wasm.d.ts
CHANGED
|
@@ -1,92 +1,106 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* WASM wrapper for Keypair
|
|
6
|
+
*/
|
|
4
7
|
export class WasmKeypair {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
8
|
+
free(): void;
|
|
9
|
+
[Symbol.dispose](): void;
|
|
10
|
+
/**
|
|
11
|
+
* Create from base58-encoded secret key or full keypair
|
|
12
|
+
*/
|
|
13
|
+
static fromBase58(s: string): WasmKeypair;
|
|
14
|
+
/**
|
|
15
|
+
* Create from raw bytes (32-byte secret or 64-byte full keypair)
|
|
16
|
+
*/
|
|
17
|
+
static fromBytes(bytes: Uint8Array): WasmKeypair;
|
|
18
|
+
/**
|
|
19
|
+
* Generate a new random keypair
|
|
20
|
+
*/
|
|
21
|
+
constructor();
|
|
22
|
+
/**
|
|
23
|
+
* Get the secret key as bytes (32 bytes)
|
|
24
|
+
*/
|
|
25
|
+
secretKey(): Uint8Array;
|
|
26
|
+
/**
|
|
27
|
+
* Get the full keypair as base58 (64 bytes)
|
|
28
|
+
*/
|
|
29
|
+
toBase58(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Get the full keypair as bytes (64 bytes)
|
|
32
|
+
*/
|
|
33
|
+
toBytes(): Uint8Array;
|
|
34
|
+
/**
|
|
35
|
+
* Get the public key as base58 string
|
|
36
|
+
*/
|
|
37
|
+
readonly pubkey: string;
|
|
35
38
|
}
|
|
36
39
|
|
|
40
|
+
/**
|
|
41
|
+
* WASM wrapper for Signer
|
|
42
|
+
*/
|
|
37
43
|
export class WasmSigner {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
44
|
+
free(): void;
|
|
45
|
+
[Symbol.dispose](): void;
|
|
46
|
+
/**
|
|
47
|
+
* Create a signer from base58-encoded secret key
|
|
48
|
+
*/
|
|
49
|
+
static fromBase58(s: string): WasmSigner;
|
|
50
|
+
/**
|
|
51
|
+
* Create a new signer from a keypair
|
|
52
|
+
*/
|
|
53
|
+
constructor(keypair: WasmKeypair);
|
|
54
|
+
/**
|
|
55
|
+
* Sign a single order/cancel/cancelAll
|
|
56
|
+
*/
|
|
57
|
+
sign(order: any, nonce?: number | null): any;
|
|
58
|
+
/**
|
|
59
|
+
* Sign agent wallet creation/deletion
|
|
60
|
+
*/
|
|
61
|
+
signAgentWallet(agent_pubkey: string, _delete: boolean, nonce?: number | null): any;
|
|
62
|
+
/**
|
|
63
|
+
* Sign multiple orders - each becomes its own transaction (parallel)
|
|
64
|
+
*/
|
|
65
|
+
signAll(orders: any, base_nonce?: number | null): any;
|
|
66
|
+
/**
|
|
67
|
+
* Sign a faucet request (testnet only)
|
|
68
|
+
*/
|
|
69
|
+
signFaucet(nonce?: number | null): any;
|
|
70
|
+
/**
|
|
71
|
+
* Sign multiple orders atomically in ONE transaction
|
|
72
|
+
*/
|
|
73
|
+
signGroup(orders: any, nonce?: number | null): any;
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated Use sign(), signAll(), or signGroup() instead
|
|
76
|
+
*/
|
|
77
|
+
signOrder(orders: any, nonce?: number | null): any;
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated Use signAll() instead
|
|
80
|
+
*/
|
|
81
|
+
signOrdersBatch(batches: any, base_nonce?: number | null): any;
|
|
82
|
+
/**
|
|
83
|
+
* Sign user settings update
|
|
84
|
+
*/
|
|
85
|
+
signUserSettings(settings: any, nonce?: number | null): any;
|
|
86
|
+
/**
|
|
87
|
+
* Create a signer with nonce management
|
|
88
|
+
*/
|
|
89
|
+
static withNonceManager(keypair: WasmKeypair, strategy: string): WasmSigner;
|
|
90
|
+
/**
|
|
91
|
+
* Get the signer's public key
|
|
92
|
+
*/
|
|
93
|
+
readonly pubkey: string;
|
|
88
94
|
}
|
|
89
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Compute order ID from wincode bytes
|
|
98
|
+
*
|
|
99
|
+
* This computes SHA256(wincode_bytes), which matches BULK's server-side
|
|
100
|
+
* order ID generation. Useful if you're serializing transactions yourself.
|
|
101
|
+
*/
|
|
102
|
+
export function computeOrderId(wincode_bytes: Uint8Array): string;
|
|
103
|
+
|
|
90
104
|
/**
|
|
91
105
|
* Get current timestamp in milliseconds
|
|
92
106
|
*/
|
|
@@ -115,61 +129,62 @@ export function validatePubkey(s: string): boolean;
|
|
|
115
129
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
116
130
|
|
|
117
131
|
export interface InitOutput {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
132
|
+
readonly memory: WebAssembly.Memory;
|
|
133
|
+
readonly __wbg_wasmkeypair_free: (a: number, b: number) => void;
|
|
134
|
+
readonly __wbg_wasmsigner_free: (a: number, b: number) => void;
|
|
135
|
+
readonly computeOrderId: (a: number, b: number) => [number, number];
|
|
136
|
+
readonly currentTimestamp: () => number;
|
|
137
|
+
readonly randomHash: () => [number, number];
|
|
138
|
+
readonly validateHash: (a: number, b: number) => number;
|
|
139
|
+
readonly validatePubkey: (a: number, b: number) => number;
|
|
140
|
+
readonly wasmkeypair_fromBase58: (a: number, b: number) => [number, number, number];
|
|
141
|
+
readonly wasmkeypair_fromBytes: (a: number, b: number) => [number, number, number];
|
|
142
|
+
readonly wasmkeypair_new: () => number;
|
|
143
|
+
readonly wasmkeypair_pubkey: (a: number) => [number, number];
|
|
144
|
+
readonly wasmkeypair_secretKey: (a: number) => [number, number];
|
|
145
|
+
readonly wasmkeypair_toBase58: (a: number) => [number, number];
|
|
146
|
+
readonly wasmkeypair_toBytes: (a: number) => [number, number];
|
|
147
|
+
readonly wasmsigner_fromBase58: (a: number, b: number) => [number, number, number];
|
|
148
|
+
readonly wasmsigner_new: (a: number) => number;
|
|
149
|
+
readonly wasmsigner_pubkey: (a: number) => [number, number];
|
|
150
|
+
readonly wasmsigner_sign: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
151
|
+
readonly wasmsigner_signAgentWallet: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
152
|
+
readonly wasmsigner_signAll: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
153
|
+
readonly wasmsigner_signFaucet: (a: number, b: number, c: number) => [number, number, number];
|
|
154
|
+
readonly wasmsigner_signGroup: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
155
|
+
readonly wasmsigner_signOrdersBatch: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
156
|
+
readonly wasmsigner_signUserSettings: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
157
|
+
readonly wasmsigner_withNonceManager: (a: number, b: number, c: number) => [number, number, number];
|
|
158
|
+
readonly init: () => void;
|
|
159
|
+
readonly wasmsigner_signOrder: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
160
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
161
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
162
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
163
|
+
readonly __externref_table_alloc: () => number;
|
|
164
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
165
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
166
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
167
|
+
readonly __wbindgen_start: () => void;
|
|
153
168
|
}
|
|
154
169
|
|
|
155
170
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
156
171
|
|
|
157
172
|
/**
|
|
158
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
159
|
-
* a precompiled `WebAssembly.Module`.
|
|
160
|
-
*
|
|
161
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
162
|
-
*
|
|
163
|
-
* @returns {InitOutput}
|
|
164
|
-
*/
|
|
173
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
174
|
+
* a precompiled `WebAssembly.Module`.
|
|
175
|
+
*
|
|
176
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
177
|
+
*
|
|
178
|
+
* @returns {InitOutput}
|
|
179
|
+
*/
|
|
165
180
|
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
166
181
|
|
|
167
182
|
/**
|
|
168
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
169
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
170
|
-
*
|
|
171
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
172
|
-
*
|
|
173
|
-
* @returns {Promise<InitOutput>}
|
|
174
|
-
*/
|
|
183
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
184
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
185
|
+
*
|
|
186
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
187
|
+
*
|
|
188
|
+
* @returns {Promise<InitOutput>}
|
|
189
|
+
*/
|
|
175
190
|
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|