@alephium/web3 1.12.0-beta.0 → 1.12.0-danube.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.
- package/dist/alephium-web3.min.js +1 -1
- package/dist/alephium-web3.min.js.map +1 -1
- package/dist/src/address/address.d.ts +1 -0
- package/dist/src/address/address.js +45 -22
- package/dist/src/api/api-alephium.d.ts +78 -124
- package/dist/src/api/api-alephium.js +0 -50
- package/dist/src/api/node-provider.d.ts +0 -2
- package/dist/src/api/node-provider.js +0 -1
- package/dist/src/codec/instr-codec.d.ts +26 -10
- package/dist/src/codec/instr-codec.js +38 -18
- package/dist/src/contract/contract.d.ts +11 -6
- package/dist/src/contract/contract.js +35 -21
- package/dist/src/contract/deployment.d.ts +2 -0
- package/dist/src/signer/signer.d.ts +13 -13
- package/dist/src/signer/signer.js +84 -9
- package/dist/src/signer/tx-builder.d.ts +4 -10
- package/dist/src/signer/tx-builder.js +41 -67
- package/dist/src/signer/types.d.ts +14 -27
- package/dist/src/signer/types.js +0 -3
- package/dist/src/utils/sign.js +2 -2
- package/package.json +1 -1
- package/src/address/address.ts +50 -19
- package/src/api/api-alephium.ts +92 -172
- package/src/api/node-provider.ts +0 -3
- package/src/codec/instr-codec.ts +45 -21
- package/src/contract/contract.ts +45 -29
- package/src/contract/deployment.ts +2 -0
- package/src/signer/signer.ts +118 -24
- package/src/signer/tx-builder.ts +60 -99
- package/src/signer/types.ts +31 -39
- package/src/utils/sign.ts +2 -2
|
@@ -31,4 +31,5 @@ export declare function groupOfLockupScript(lockupScript: LockupScript): number;
|
|
|
31
31
|
export declare function groupFromBytes(bytes: Uint8Array): number;
|
|
32
32
|
export declare function groupFromHint(hint: number): number;
|
|
33
33
|
export declare function hasExplicitGroupIndex(address: string): boolean;
|
|
34
|
+
export declare function addressWithoutExplicitGroupIndex(address: string): string;
|
|
34
35
|
export declare function addressFromLockupScript(lockupScript: LockupScript): string;
|
|
@@ -43,7 +43,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
43
43
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.addressFromLockupScript = exports.hasExplicitGroupIndex = exports.groupFromHint = exports.groupFromBytes = exports.groupOfLockupScript = exports.subContractId = exports.contractIdFromTx = exports.addressFromTokenId = exports.addressFromContractId = exports.addressFromScript = exports.addressFromPublicKey = exports.publicKeyFromPrivateKey = exports.groupOfPrivateKey = exports.tokenIdFromAddress = exports.contractIdFromAddress = exports.groupOfAddress = exports.isContractAddress = exports.defaultGroupOfGrouplessAddress = exports.isGrouplessAddressWithGroupIndex = exports.isGrouplessAddressWithoutGroupIndex = exports.isGrouplessAddress = exports.isAssetAddress = exports.addressToBytes = exports.isValidAddress = exports.validateAddress = exports.AddressType = void 0;
|
|
46
|
+
exports.addressFromLockupScript = exports.addressWithoutExplicitGroupIndex = exports.hasExplicitGroupIndex = exports.groupFromHint = exports.groupFromBytes = exports.groupOfLockupScript = exports.subContractId = exports.contractIdFromTx = exports.addressFromTokenId = exports.addressFromContractId = exports.addressFromScript = exports.addressFromPublicKey = exports.publicKeyFromPrivateKey = exports.groupOfPrivateKey = exports.tokenIdFromAddress = exports.contractIdFromAddress = exports.groupOfAddress = exports.isContractAddress = exports.defaultGroupOfGrouplessAddress = exports.isGrouplessAddressWithGroupIndex = exports.isGrouplessAddressWithoutGroupIndex = exports.isGrouplessAddress = exports.isAssetAddress = exports.addressToBytes = exports.isValidAddress = exports.validateAddress = exports.AddressType = void 0;
|
|
47
47
|
const elliptic_1 = require("elliptic");
|
|
48
48
|
const bn_js_1 = __importDefault(require("bn.js"));
|
|
49
49
|
const constants_1 = require("../constants");
|
|
@@ -55,7 +55,9 @@ const codec_1 = require("../codec");
|
|
|
55
55
|
const djb2_1 = __importDefault(require("../utils/djb2"));
|
|
56
56
|
const error_1 = require("../error");
|
|
57
57
|
const codec_2 = require("../codec/codec");
|
|
58
|
-
const
|
|
58
|
+
const secp256k1 = new elliptic_1.ec('secp256k1');
|
|
59
|
+
const secp256r1 = new elliptic_1.ec('p256');
|
|
60
|
+
const ed25519 = new elliptic_1.eddsa('ed25519');
|
|
59
61
|
const PublicKeyHashSize = 32;
|
|
60
62
|
var AddressType;
|
|
61
63
|
(function (AddressType) {
|
|
@@ -124,9 +126,13 @@ function decodeAndValidateAddress(address) {
|
|
|
124
126
|
throw new Error(`Invalid address: ${address}`);
|
|
125
127
|
}
|
|
126
128
|
function isGrouplessAddressWithoutGroup(decoded) {
|
|
129
|
+
// An ED25519 public key is 32 bytes; other public keys are 33 bytes.
|
|
130
|
+
// Format: AddressType(1 byte) + KeyType(1 byte) + PublicKey(32/33 bytes) + Checksum(4 bytes)
|
|
127
131
|
return decoded[0] === AddressType.P2PK && (decoded.length === 38 || decoded.length === 39);
|
|
128
132
|
}
|
|
129
133
|
function isGrouplessAddressWithGroup(decoded) {
|
|
134
|
+
// An ED25519 public key is 32 bytes; other public keys are 33 bytes.
|
|
135
|
+
// Format: AddressType(1 byte) + KeyType(1 byte) + PublicKey(32/33 bytes) + Checksum(4 bytes) + GroupIndex(1 byte)
|
|
130
136
|
return decoded[0] === AddressType.P2PK && (decoded.length === 39 || decoded.length === 40);
|
|
131
137
|
}
|
|
132
138
|
function addressToBytes(address) {
|
|
@@ -245,31 +251,41 @@ function groupOfPrivateKey(privateKey, keyType) {
|
|
|
245
251
|
exports.groupOfPrivateKey = groupOfPrivateKey;
|
|
246
252
|
function publicKeyFromPrivateKey(privateKey, _keyType) {
|
|
247
253
|
const keyType = _keyType ?? 'default';
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
+
switch (keyType) {
|
|
255
|
+
case 'default':
|
|
256
|
+
case 'gl-secp256k1':
|
|
257
|
+
return secp256k1.keyFromPrivate(privateKey).getPublic(true, 'hex');
|
|
258
|
+
case 'gl-secp256r1':
|
|
259
|
+
case 'gl-webauthn':
|
|
260
|
+
return secp256r1.keyFromPrivate(privateKey).getPublic(true, 'hex');
|
|
261
|
+
case 'gl-ed25519':
|
|
262
|
+
return ed25519.keyFromSecret(privateKey).getPublic('hex');
|
|
263
|
+
case 'bip340-schnorr':
|
|
264
|
+
return secp256k1.g.mul(new bn_js_1.default(privateKey, 16)).encode('hex', true).slice(2);
|
|
254
265
|
}
|
|
255
266
|
}
|
|
256
267
|
exports.publicKeyFromPrivateKey = publicKeyFromPrivateKey;
|
|
268
|
+
function p2pkAddressFromPublicKey(publicKey, keyType) {
|
|
269
|
+
const keyTypeByte = keyType === 'gl-secp256k1' ? 0x00 : keyType === 'gl-secp256r1' ? 0x01 : keyType === 'gl-ed25519' ? 0x02 : 0x03;
|
|
270
|
+
const publicKeyBytes = new Uint8Array([keyTypeByte, ...(0, utils_1.hexToBinUnsafe)(publicKey)]);
|
|
271
|
+
const checksum = codec_1.intAs4BytesCodec.encode((0, djb2_1.default)(publicKeyBytes));
|
|
272
|
+
const bytes = new Uint8Array([AddressType.P2PK, ...publicKeyBytes, ...checksum]);
|
|
273
|
+
return bs58_1.default.encode(bytes);
|
|
274
|
+
}
|
|
257
275
|
function addressFromPublicKey(publicKey, _keyType) {
|
|
258
276
|
const keyType = _keyType ?? 'default';
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
const lockupScript = (0, utils_1.hexToBinUnsafe)(`0101000000000458144020${publicKey}8685`);
|
|
272
|
-
return addressFromScript(lockupScript);
|
|
277
|
+
switch (keyType) {
|
|
278
|
+
case 'default': {
|
|
279
|
+
const hash = blakejs_1.default.blake2b((0, utils_1.hexToBinUnsafe)(publicKey), undefined, 32);
|
|
280
|
+
const bytes = new Uint8Array([AddressType.P2PKH, ...hash]);
|
|
281
|
+
return bs58_1.default.encode(bytes);
|
|
282
|
+
}
|
|
283
|
+
case 'bip340-schnorr': {
|
|
284
|
+
const lockupScript = (0, utils_1.hexToBinUnsafe)(`0101000000000458144020${publicKey}8685`);
|
|
285
|
+
return addressFromScript(lockupScript);
|
|
286
|
+
}
|
|
287
|
+
default:
|
|
288
|
+
return p2pkAddressFromPublicKey(publicKey, keyType);
|
|
273
289
|
}
|
|
274
290
|
}
|
|
275
291
|
exports.addressFromPublicKey = addressFromPublicKey;
|
|
@@ -348,6 +364,13 @@ function hasExplicitGroupIndex(address) {
|
|
|
348
364
|
return address.length > 2 && address[address.length - 2] === ':';
|
|
349
365
|
}
|
|
350
366
|
exports.hasExplicitGroupIndex = hasExplicitGroupIndex;
|
|
367
|
+
function addressWithoutExplicitGroupIndex(address) {
|
|
368
|
+
if (hasExplicitGroupIndex(address)) {
|
|
369
|
+
return address.slice(0, address.length - 2);
|
|
370
|
+
}
|
|
371
|
+
return address;
|
|
372
|
+
}
|
|
373
|
+
exports.addressWithoutExplicitGroupIndex = addressWithoutExplicitGroupIndex;
|
|
351
374
|
function addressFromLockupScript(lockupScript) {
|
|
352
375
|
if (lockupScript.kind === 'P2PK') {
|
|
353
376
|
const groupByte = lockup_script_codec_1.lockupScriptCodec.encode(lockupScript).slice(-1);
|
|
@@ -176,7 +176,7 @@ export interface BuildChainedDeployContractTx {
|
|
|
176
176
|
}
|
|
177
177
|
/** BuildChainedDeployContractTxResult */
|
|
178
178
|
export interface BuildChainedDeployContractTxResult {
|
|
179
|
-
value:
|
|
179
|
+
value: BuildSimpleDeployContractTxResult;
|
|
180
180
|
type: string;
|
|
181
181
|
}
|
|
182
182
|
/** BuildChainedExecuteScriptTx */
|
|
@@ -186,7 +186,7 @@ export interface BuildChainedExecuteScriptTx {
|
|
|
186
186
|
}
|
|
187
187
|
/** BuildChainedExecuteScriptTxResult */
|
|
188
188
|
export interface BuildChainedExecuteScriptTxResult {
|
|
189
|
-
value:
|
|
189
|
+
value: BuildSimpleExecuteScriptTxResult;
|
|
190
190
|
type: string;
|
|
191
191
|
}
|
|
192
192
|
/** BuildChainedTransferTx */
|
|
@@ -196,7 +196,7 @@ export interface BuildChainedTransferTx {
|
|
|
196
196
|
}
|
|
197
197
|
/** BuildChainedTransferTxResult */
|
|
198
198
|
export interface BuildChainedTransferTxResult {
|
|
199
|
-
value:
|
|
199
|
+
value: BuildSimpleTransferTxResult;
|
|
200
200
|
type: string;
|
|
201
201
|
}
|
|
202
202
|
/** BuildChainedTx */
|
|
@@ -222,25 +222,13 @@ export interface BuildDeployContractTx {
|
|
|
222
222
|
gasAmount?: number;
|
|
223
223
|
/** @format uint256 */
|
|
224
224
|
gasPrice?: string;
|
|
225
|
+
/** @format group-index */
|
|
226
|
+
group?: number;
|
|
225
227
|
/** @format block-hash */
|
|
226
228
|
targetBlockHash?: string;
|
|
227
229
|
}
|
|
228
230
|
/** BuildDeployContractTxResult */
|
|
229
|
-
export
|
|
230
|
-
/** @format int32 */
|
|
231
|
-
fromGroup: number;
|
|
232
|
-
/** @format int32 */
|
|
233
|
-
toGroup: number;
|
|
234
|
-
unsignedTx: string;
|
|
235
|
-
/** @format gas */
|
|
236
|
-
gasAmount: number;
|
|
237
|
-
/** @format uint256 */
|
|
238
|
-
gasPrice: string;
|
|
239
|
-
/** @format 32-byte-hash */
|
|
240
|
-
txId: string;
|
|
241
|
-
/** @format address */
|
|
242
|
-
contractAddress: string;
|
|
243
|
-
}
|
|
231
|
+
export type BuildDeployContractTxResult = BuildGrouplessDeployContractTxResult | BuildSimpleDeployContractTxResult;
|
|
244
232
|
/** BuildExecuteScriptTx */
|
|
245
233
|
export interface BuildExecuteScriptTx {
|
|
246
234
|
/** @format hex-string */
|
|
@@ -258,74 +246,30 @@ export interface BuildExecuteScriptTx {
|
|
|
258
246
|
gasPrice?: string;
|
|
259
247
|
/** @format block-hash */
|
|
260
248
|
targetBlockHash?: string;
|
|
249
|
+
/** @format group-index */
|
|
250
|
+
group?: number;
|
|
261
251
|
/** @format double */
|
|
262
252
|
gasEstimationMultiplier?: number;
|
|
263
253
|
}
|
|
264
254
|
/** BuildExecuteScriptTxResult */
|
|
265
|
-
export
|
|
266
|
-
/** @format int32 */
|
|
267
|
-
fromGroup: number;
|
|
268
|
-
/** @format int32 */
|
|
269
|
-
toGroup: number;
|
|
270
|
-
unsignedTx: string;
|
|
271
|
-
/** @format gas */
|
|
272
|
-
gasAmount: number;
|
|
273
|
-
/** @format uint256 */
|
|
274
|
-
gasPrice: string;
|
|
275
|
-
/** @format 32-byte-hash */
|
|
276
|
-
txId: string;
|
|
277
|
-
simulationResult: SimulationResult;
|
|
278
|
-
}
|
|
279
|
-
/** BuildGrouplessDeployContractTx */
|
|
280
|
-
export interface BuildGrouplessDeployContractTx {
|
|
281
|
-
fromAddress: string;
|
|
282
|
-
/** @format hex-string */
|
|
283
|
-
bytecode: string;
|
|
284
|
-
/** @format uint256 */
|
|
285
|
-
initialAttoAlphAmount?: string;
|
|
286
|
-
initialTokenAmounts?: Token[];
|
|
287
|
-
/** @format uint256 */
|
|
288
|
-
issueTokenAmount?: string;
|
|
289
|
-
/** @format address */
|
|
290
|
-
issueTokenTo?: string;
|
|
291
|
-
/** @format uint256 */
|
|
292
|
-
gasPrice?: string;
|
|
293
|
-
/** @format block-hash */
|
|
294
|
-
targetBlockHash?: string;
|
|
295
|
-
}
|
|
255
|
+
export type BuildExecuteScriptTxResult = BuildGrouplessExecuteScriptTxResult | BuildSimpleExecuteScriptTxResult;
|
|
296
256
|
/** BuildGrouplessDeployContractTxResult */
|
|
297
257
|
export interface BuildGrouplessDeployContractTxResult {
|
|
298
|
-
transferTxs:
|
|
299
|
-
deployContractTx:
|
|
300
|
-
|
|
301
|
-
/** BuildGrouplessExecuteScriptTx */
|
|
302
|
-
export interface BuildGrouplessExecuteScriptTx {
|
|
303
|
-
fromAddress: string;
|
|
304
|
-
/** @format hex-string */
|
|
305
|
-
bytecode: string;
|
|
306
|
-
/** @format uint256 */
|
|
307
|
-
attoAlphAmount?: string;
|
|
308
|
-
tokens?: Token[];
|
|
309
|
-
/** @format uint256 */
|
|
310
|
-
gasPrice?: string;
|
|
311
|
-
/** @format block-hash */
|
|
312
|
-
targetBlockHash?: string;
|
|
313
|
-
/** @format double */
|
|
314
|
-
gasEstimationMultiplier?: number;
|
|
258
|
+
transferTxs: BuildSimpleTransferTxResult[];
|
|
259
|
+
deployContractTx: BuildSimpleDeployContractTxResult;
|
|
260
|
+
type: string;
|
|
315
261
|
}
|
|
316
262
|
/** BuildGrouplessExecuteScriptTxResult */
|
|
317
263
|
export interface BuildGrouplessExecuteScriptTxResult {
|
|
318
|
-
transferTxs:
|
|
319
|
-
executeScriptTx:
|
|
264
|
+
transferTxs: BuildSimpleTransferTxResult[];
|
|
265
|
+
executeScriptTx: BuildSimpleExecuteScriptTxResult;
|
|
266
|
+
type: string;
|
|
320
267
|
}
|
|
321
|
-
/**
|
|
322
|
-
export interface
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
gasPrice?: string;
|
|
327
|
-
/** @format block-hash */
|
|
328
|
-
targetBlockHash?: string;
|
|
268
|
+
/** BuildGrouplessTransferTxResult */
|
|
269
|
+
export interface BuildGrouplessTransferTxResult {
|
|
270
|
+
transferTxs: BuildSimpleTransferTxResult[];
|
|
271
|
+
transferTx: BuildSimpleTransferTxResult;
|
|
272
|
+
type: string;
|
|
329
273
|
}
|
|
330
274
|
/** BuildInfo */
|
|
331
275
|
export interface BuildInfo {
|
|
@@ -362,6 +306,54 @@ export interface BuildMultisigAddressResult {
|
|
|
362
306
|
/** @format address */
|
|
363
307
|
address: string;
|
|
364
308
|
}
|
|
309
|
+
/** BuildSimpleDeployContractTxResult */
|
|
310
|
+
export interface BuildSimpleDeployContractTxResult {
|
|
311
|
+
/** @format int32 */
|
|
312
|
+
fromGroup: number;
|
|
313
|
+
/** @format int32 */
|
|
314
|
+
toGroup: number;
|
|
315
|
+
unsignedTx: string;
|
|
316
|
+
/** @format gas */
|
|
317
|
+
gasAmount: number;
|
|
318
|
+
/** @format uint256 */
|
|
319
|
+
gasPrice: string;
|
|
320
|
+
/** @format 32-byte-hash */
|
|
321
|
+
txId: string;
|
|
322
|
+
/** @format address */
|
|
323
|
+
contractAddress: string;
|
|
324
|
+
type: string;
|
|
325
|
+
}
|
|
326
|
+
/** BuildSimpleExecuteScriptTxResult */
|
|
327
|
+
export interface BuildSimpleExecuteScriptTxResult {
|
|
328
|
+
/** @format int32 */
|
|
329
|
+
fromGroup: number;
|
|
330
|
+
/** @format int32 */
|
|
331
|
+
toGroup: number;
|
|
332
|
+
unsignedTx: string;
|
|
333
|
+
/** @format gas */
|
|
334
|
+
gasAmount: number;
|
|
335
|
+
/** @format uint256 */
|
|
336
|
+
gasPrice: string;
|
|
337
|
+
/** @format 32-byte-hash */
|
|
338
|
+
txId: string;
|
|
339
|
+
simulationResult: SimulationResult;
|
|
340
|
+
type: string;
|
|
341
|
+
}
|
|
342
|
+
/** BuildSimpleTransferTxResult */
|
|
343
|
+
export interface BuildSimpleTransferTxResult {
|
|
344
|
+
unsignedTx: string;
|
|
345
|
+
/** @format gas */
|
|
346
|
+
gasAmount: number;
|
|
347
|
+
/** @format uint256 */
|
|
348
|
+
gasPrice: string;
|
|
349
|
+
/** @format 32-byte-hash */
|
|
350
|
+
txId: string;
|
|
351
|
+
/** @format int32 */
|
|
352
|
+
fromGroup: number;
|
|
353
|
+
/** @format int32 */
|
|
354
|
+
toGroup: number;
|
|
355
|
+
type: string;
|
|
356
|
+
}
|
|
365
357
|
/** BuildSweepAddressTransactions */
|
|
366
358
|
export interface BuildSweepAddressTransactions {
|
|
367
359
|
/** @format public-key */
|
|
@@ -421,23 +413,13 @@ export interface BuildTransferTx {
|
|
|
421
413
|
gasAmount?: number;
|
|
422
414
|
/** @format uint256 */
|
|
423
415
|
gasPrice?: string;
|
|
416
|
+
/** @format group-index */
|
|
417
|
+
group?: number;
|
|
424
418
|
/** @format block-hash */
|
|
425
419
|
targetBlockHash?: string;
|
|
426
420
|
}
|
|
427
421
|
/** BuildTransferTxResult */
|
|
428
|
-
export
|
|
429
|
-
unsignedTx: string;
|
|
430
|
-
/** @format gas */
|
|
431
|
-
gasAmount: number;
|
|
432
|
-
/** @format uint256 */
|
|
433
|
-
gasPrice: string;
|
|
434
|
-
/** @format 32-byte-hash */
|
|
435
|
-
txId: string;
|
|
436
|
-
/** @format int32 */
|
|
437
|
-
fromGroup: number;
|
|
438
|
-
/** @format int32 */
|
|
439
|
-
toGroup: number;
|
|
440
|
-
}
|
|
422
|
+
export type BuildTransferTxResult = BuildGrouplessTransferTxResult | BuildSimpleTransferTxResult;
|
|
441
423
|
/** CallContract */
|
|
442
424
|
export interface CallContract {
|
|
443
425
|
/** @format int32 */
|
|
@@ -1133,6 +1115,7 @@ export interface TestContract {
|
|
|
1133
1115
|
args?: Val[];
|
|
1134
1116
|
existingContracts?: ContractState[];
|
|
1135
1117
|
inputAssets?: TestInputAsset[];
|
|
1118
|
+
dustAmount?: string;
|
|
1136
1119
|
}
|
|
1137
1120
|
/** TestContractResult */
|
|
1138
1121
|
export interface TestContractResult {
|
|
@@ -1909,7 +1892,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1909
1892
|
* @summary Build an unsigned transfer transaction to a number of recipients
|
|
1910
1893
|
* @request POST:/transactions/build
|
|
1911
1894
|
*/
|
|
1912
|
-
postTransactionsBuild: (data: BuildTransferTx, params?: RequestParams) => Promise<
|
|
1895
|
+
postTransactionsBuild: (data: BuildTransferTx, params?: RequestParams) => Promise<BuildSimpleTransferTxResult | BuildGrouplessTransferTxResult>;
|
|
1913
1896
|
/**
|
|
1914
1897
|
* No description
|
|
1915
1898
|
*
|
|
@@ -1918,7 +1901,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1918
1901
|
* @summary Build unsigned transfer transactions from an address of one group to addresses of many groups. Each target group requires a dedicated transaction or more in case large number of outputs needed to be split.
|
|
1919
1902
|
* @request POST:/transactions/build-transfer-from-one-to-many-groups
|
|
1920
1903
|
*/
|
|
1921
|
-
postTransactionsBuildTransferFromOneToManyGroups: (data: BuildTransferTx, params?: RequestParams) => Promise<
|
|
1904
|
+
postTransactionsBuildTransferFromOneToManyGroups: (data: BuildTransferTx, params?: RequestParams) => Promise<BuildSimpleTransferTxResult[]>;
|
|
1922
1905
|
/**
|
|
1923
1906
|
* No description
|
|
1924
1907
|
*
|
|
@@ -1927,7 +1910,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1927
1910
|
* @summary Build an unsigned transaction with multiple addresses to a number of recipients
|
|
1928
1911
|
* @request POST:/transactions/build-multi-addresses
|
|
1929
1912
|
*/
|
|
1930
|
-
postTransactionsBuildMultiAddresses: (data: BuildMultiAddressesTransaction, params?: RequestParams) => Promise<
|
|
1913
|
+
postTransactionsBuildMultiAddresses: (data: BuildMultiAddressesTransaction, params?: RequestParams) => Promise<BuildSimpleTransferTxResult>;
|
|
1931
1914
|
/**
|
|
1932
1915
|
* No description
|
|
1933
1916
|
*
|
|
@@ -2096,7 +2079,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
2096
2079
|
* @summary Build an unsigned script
|
|
2097
2080
|
* @request POST:/contracts/unsigned-tx/execute-script
|
|
2098
2081
|
*/
|
|
2099
|
-
postContractsUnsignedTxExecuteScript: (data: BuildExecuteScriptTx, params?: RequestParams) => Promise<
|
|
2082
|
+
postContractsUnsignedTxExecuteScript: (data: BuildExecuteScriptTx, params?: RequestParams) => Promise<BuildSimpleExecuteScriptTxResult | BuildGrouplessExecuteScriptTxResult>;
|
|
2100
2083
|
/**
|
|
2101
2084
|
* No description
|
|
2102
2085
|
*
|
|
@@ -2123,7 +2106,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
2123
2106
|
* @summary Build an unsigned contract
|
|
2124
2107
|
* @request POST:/contracts/unsigned-tx/deploy-contract
|
|
2125
2108
|
*/
|
|
2126
|
-
postContractsUnsignedTxDeployContract: (data: BuildDeployContractTx, params?: RequestParams) => Promise<
|
|
2109
|
+
postContractsUnsignedTxDeployContract: (data: BuildDeployContractTx, params?: RequestParams) => Promise<BuildSimpleDeployContractTxResult | BuildGrouplessDeployContractTxResult>;
|
|
2127
2110
|
/**
|
|
2128
2111
|
* No description
|
|
2129
2112
|
*
|
|
@@ -2229,7 +2212,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
2229
2212
|
* @summary Build a multisig unsigned transaction
|
|
2230
2213
|
* @request POST:/multisig/build
|
|
2231
2214
|
*/
|
|
2232
|
-
postMultisigBuild: (data: BuildMultisig, params?: RequestParams) => Promise<
|
|
2215
|
+
postMultisigBuild: (data: BuildMultisig, params?: RequestParams) => Promise<BuildSimpleTransferTxResult>;
|
|
2233
2216
|
/**
|
|
2234
2217
|
* No description
|
|
2235
2218
|
*
|
|
@@ -2374,34 +2357,5 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
2374
2357
|
*/
|
|
2375
2358
|
putUtilsCheckHashIndexing: (params?: RequestParams) => Promise<void>;
|
|
2376
2359
|
};
|
|
2377
|
-
groupless: {
|
|
2378
|
-
/**
|
|
2379
|
-
* No description
|
|
2380
|
-
*
|
|
2381
|
-
* @tags Groupless
|
|
2382
|
-
* @name PostGrouplessTransfer
|
|
2383
|
-
* @summary Build unsigned transfer transactions from a groupless address
|
|
2384
|
-
* @request POST:/groupless/transfer
|
|
2385
|
-
*/
|
|
2386
|
-
postGrouplessTransfer: (data: BuildGrouplessTransferTx, params?: RequestParams) => Promise<BuildTransferTxResult[]>;
|
|
2387
|
-
/**
|
|
2388
|
-
* No description
|
|
2389
|
-
*
|
|
2390
|
-
* @tags Groupless
|
|
2391
|
-
* @name PostGrouplessExecuteScript
|
|
2392
|
-
* @summary Build an unsigned execute script transaction from a groupless address
|
|
2393
|
-
* @request POST:/groupless/execute-script
|
|
2394
|
-
*/
|
|
2395
|
-
postGrouplessExecuteScript: (data: BuildGrouplessExecuteScriptTx, params?: RequestParams) => Promise<BuildGrouplessExecuteScriptTxResult>;
|
|
2396
|
-
/**
|
|
2397
|
-
* No description
|
|
2398
|
-
*
|
|
2399
|
-
* @tags Groupless
|
|
2400
|
-
* @name PostGrouplessDeployContract
|
|
2401
|
-
* @summary Build an unsigned deploy contract transaction from a groupless address
|
|
2402
|
-
* @request POST:/groupless/deploy-contract
|
|
2403
|
-
*/
|
|
2404
|
-
postGrouplessDeployContract: (data: BuildGrouplessDeployContractTx, params?: RequestParams) => Promise<BuildGrouplessDeployContractTxResult>;
|
|
2405
|
-
};
|
|
2406
2360
|
}
|
|
2407
2361
|
export {};
|
|
@@ -1547,56 +1547,6 @@ class Api extends HttpClient {
|
|
|
1547
1547
|
...params
|
|
1548
1548
|
}).then(utils_1.convertHttpResponse)
|
|
1549
1549
|
};
|
|
1550
|
-
this.groupless = {
|
|
1551
|
-
/**
|
|
1552
|
-
* No description
|
|
1553
|
-
*
|
|
1554
|
-
* @tags Groupless
|
|
1555
|
-
* @name PostGrouplessTransfer
|
|
1556
|
-
* @summary Build unsigned transfer transactions from a groupless address
|
|
1557
|
-
* @request POST:/groupless/transfer
|
|
1558
|
-
*/
|
|
1559
|
-
postGrouplessTransfer: (data, params = {}) => this.request({
|
|
1560
|
-
path: `/groupless/transfer`,
|
|
1561
|
-
method: 'POST',
|
|
1562
|
-
body: data,
|
|
1563
|
-
type: ContentType.Json,
|
|
1564
|
-
format: 'json',
|
|
1565
|
-
...params
|
|
1566
|
-
}).then(utils_1.convertHttpResponse),
|
|
1567
|
-
/**
|
|
1568
|
-
* No description
|
|
1569
|
-
*
|
|
1570
|
-
* @tags Groupless
|
|
1571
|
-
* @name PostGrouplessExecuteScript
|
|
1572
|
-
* @summary Build an unsigned execute script transaction from a groupless address
|
|
1573
|
-
* @request POST:/groupless/execute-script
|
|
1574
|
-
*/
|
|
1575
|
-
postGrouplessExecuteScript: (data, params = {}) => this.request({
|
|
1576
|
-
path: `/groupless/execute-script`,
|
|
1577
|
-
method: 'POST',
|
|
1578
|
-
body: data,
|
|
1579
|
-
type: ContentType.Json,
|
|
1580
|
-
format: 'json',
|
|
1581
|
-
...params
|
|
1582
|
-
}).then(utils_1.convertHttpResponse),
|
|
1583
|
-
/**
|
|
1584
|
-
* No description
|
|
1585
|
-
*
|
|
1586
|
-
* @tags Groupless
|
|
1587
|
-
* @name PostGrouplessDeployContract
|
|
1588
|
-
* @summary Build an unsigned deploy contract transaction from a groupless address
|
|
1589
|
-
* @request POST:/groupless/deploy-contract
|
|
1590
|
-
*/
|
|
1591
|
-
postGrouplessDeployContract: (data, params = {}) => this.request({
|
|
1592
|
-
path: `/groupless/deploy-contract`,
|
|
1593
|
-
method: 'POST',
|
|
1594
|
-
body: data,
|
|
1595
|
-
type: ContentType.Json,
|
|
1596
|
-
format: 'json',
|
|
1597
|
-
...params
|
|
1598
|
-
}).then(utils_1.convertHttpResponse)
|
|
1599
|
-
};
|
|
1600
1550
|
}
|
|
1601
1551
|
}
|
|
1602
1552
|
exports.Api = Api;
|
|
@@ -14,7 +14,6 @@ interface NodeProviderApis {
|
|
|
14
14
|
utils: NodeApi<string>['utils'];
|
|
15
15
|
miners: NodeApi<string>['miners'];
|
|
16
16
|
events: NodeApi<string>['events'];
|
|
17
|
-
groupless: NodeApi<string>['groupless'];
|
|
18
17
|
}
|
|
19
18
|
export declare class NodeProvider implements NodeProviderApis {
|
|
20
19
|
readonly wallets: NodeApi<string>['wallets'];
|
|
@@ -28,7 +27,6 @@ export declare class NodeProvider implements NodeProviderApis {
|
|
|
28
27
|
readonly utils: NodeApi<string>['utils'];
|
|
29
28
|
readonly miners: NodeApi<string>['miners'];
|
|
30
29
|
readonly events: NodeApi<string>['events'];
|
|
31
|
-
readonly groupless: NodeApi<string>['groupless'];
|
|
32
30
|
constructor(baseUrl: string, apiKey?: string, customFetch?: typeof fetch);
|
|
33
31
|
constructor(provider: NodeProvider);
|
|
34
32
|
constructor(handler: ApiRequestHandler);
|
|
@@ -185,7 +185,6 @@ class NodeProvider {
|
|
|
185
185
|
this.utils = { ...nodeApi.utils };
|
|
186
186
|
this.miners = { ...nodeApi.miners };
|
|
187
187
|
this.events = { ...nodeApi.events };
|
|
188
|
-
this.groupless = { ...nodeApi.groupless };
|
|
189
188
|
(0, types_1.requestWithLog)(this);
|
|
190
189
|
}
|
|
191
190
|
// This can prevent the proxied node provider from being modified
|
|
@@ -180,19 +180,19 @@ export type Instr = {
|
|
|
180
180
|
name: 'U256ModMul';
|
|
181
181
|
code: 0x37;
|
|
182
182
|
} | {
|
|
183
|
-
name: '
|
|
183
|
+
name: 'NumericBitAnd';
|
|
184
184
|
code: 0x38;
|
|
185
185
|
} | {
|
|
186
|
-
name: '
|
|
186
|
+
name: 'NumericBitOr';
|
|
187
187
|
code: 0x39;
|
|
188
188
|
} | {
|
|
189
|
-
name: '
|
|
189
|
+
name: 'NumericXor';
|
|
190
190
|
code: 0x3a;
|
|
191
191
|
} | {
|
|
192
|
-
name: '
|
|
192
|
+
name: 'NumericSHL';
|
|
193
193
|
code: 0x3b;
|
|
194
194
|
} | {
|
|
195
|
-
name: '
|
|
195
|
+
name: 'NumericSHR';
|
|
196
196
|
code: 0x3c;
|
|
197
197
|
} | {
|
|
198
198
|
name: 'I256ToU256';
|
|
@@ -438,6 +438,12 @@ export type Instr = {
|
|
|
438
438
|
} | {
|
|
439
439
|
name: 'GroupOfAddress';
|
|
440
440
|
code: 0x8c;
|
|
441
|
+
} | {
|
|
442
|
+
name: 'VerifySignature';
|
|
443
|
+
code: 0x8d;
|
|
444
|
+
} | {
|
|
445
|
+
name: 'GetSegregatedWebAuthnSignature';
|
|
446
|
+
code: 0x8e;
|
|
441
447
|
} | {
|
|
442
448
|
name: 'LoadMutField';
|
|
443
449
|
code: 0xa0;
|
|
@@ -604,6 +610,12 @@ export type Instr = {
|
|
|
604
610
|
name: 'CallExternalBySelector';
|
|
605
611
|
code: 0xd4;
|
|
606
612
|
selector: number;
|
|
613
|
+
} | {
|
|
614
|
+
name: 'ExternalCallerContractId';
|
|
615
|
+
code: 0xd5;
|
|
616
|
+
} | {
|
|
617
|
+
name: 'ExternalCallerAddress';
|
|
618
|
+
code: 0xd6;
|
|
607
619
|
};
|
|
608
620
|
export declare const CallLocalCode = 0;
|
|
609
621
|
export declare const CallExternalCode = 1;
|
|
@@ -679,11 +691,11 @@ export declare const U256Ge: Instr;
|
|
|
679
691
|
export declare const U256ModAdd: Instr;
|
|
680
692
|
export declare const U256ModSub: Instr;
|
|
681
693
|
export declare const U256ModMul: Instr;
|
|
682
|
-
export declare const
|
|
683
|
-
export declare const
|
|
684
|
-
export declare const
|
|
685
|
-
export declare const
|
|
686
|
-
export declare const
|
|
694
|
+
export declare const NumericBitAnd: Instr;
|
|
695
|
+
export declare const NumericBitOr: Instr;
|
|
696
|
+
export declare const NumericXor: Instr;
|
|
697
|
+
export declare const NumericSHL: Instr;
|
|
698
|
+
export declare const NumericSHR: Instr;
|
|
687
699
|
export declare const I256ToU256: Instr;
|
|
688
700
|
export declare const I256ToByteVec: Instr;
|
|
689
701
|
export declare const U256ToI256: Instr;
|
|
@@ -764,6 +776,8 @@ export declare const U256ToString: Instr;
|
|
|
764
776
|
export declare const I256ToString: Instr;
|
|
765
777
|
export declare const BoolToString: Instr;
|
|
766
778
|
export declare const GroupOfAddress: Instr;
|
|
779
|
+
export declare const VerifySignature: Instr;
|
|
780
|
+
export declare const GetSegregatedWebAuthnSignature: Instr;
|
|
767
781
|
export declare const LoadMutField: (index: number) => Instr;
|
|
768
782
|
export declare const StoreMutField: (index: number) => Instr;
|
|
769
783
|
export declare const ApproveAlph: Instr;
|
|
@@ -817,6 +831,8 @@ export declare const MinimalContractDeposit: Instr;
|
|
|
817
831
|
export declare const CreateMapEntry: (immFieldsNum: number, mutFieldsNum: number) => Instr;
|
|
818
832
|
export declare const MethodSelector: (selector: number) => Instr;
|
|
819
833
|
export declare const CallExternalBySelector: (selector: number) => Instr;
|
|
834
|
+
export declare const ExternalCallerContractId: Instr;
|
|
835
|
+
export declare const ExternalCallerAddress: Instr;
|
|
820
836
|
export declare class InstrCodec extends Codec<Instr> {
|
|
821
837
|
encode(instr: Instr): Uint8Array;
|
|
822
838
|
_decode(input: Reader): Instr;
|