@argonprotocol/mainchain 1.4.12-dev.8cae3588 → 1.4.12-dev.d1c83d27
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/browser/index.d.ts +341 -448
- package/browser/index.js +10 -10
- package/browser/index.js.map +1 -1
- package/lib/index.cjs +32 -32
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +341 -448
- package/lib/index.d.ts +341 -448
- package/lib/index.js +10 -10
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
- package/src/interfaces/augment-api-consts.ts +6 -20
- package/src/interfaces/augment-api-errors.ts +5 -13
- package/src/interfaces/augment-api-events.ts +6 -27
- package/src/interfaces/augment-api-query.ts +46 -47
- package/src/interfaces/augment-api-tx.ts +0 -31
- package/src/interfaces/lookup.ts +289 -320
- package/src/interfaces/registry.ts +2 -4
- package/src/interfaces/types-lookup.ts +294 -347
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argonprotocol/mainchain",
|
|
3
|
-
"version": "1.4.12-dev.
|
|
3
|
+
"version": "1.4.12-dev.d1c83d27",
|
|
4
4
|
"description": "A client for accessing the Argon mainchain apis.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@argonprotocol/ethereum-contracts": "workspace:*",
|
|
71
|
-
"@argonprotocol/testing": "1.4.12-dev.
|
|
71
|
+
"@argonprotocol/testing": "1.4.12-dev.d1c83d27",
|
|
72
72
|
"@polkadot/typegen": "^16.5.6",
|
|
73
73
|
"@substrate/ss58-registry": "^1.51.0",
|
|
74
74
|
"@types/node": "^20",
|
|
@@ -82,6 +82,10 @@ declare module '@polkadot/api-base/types/consts' {
|
|
|
82
82
|
* Maximum releasing utxos at a time
|
|
83
83
|
**/
|
|
84
84
|
maxConcurrentlyReleasingLocks: u32 & AugmentedConst<ApiType>;
|
|
85
|
+
/**
|
|
86
|
+
* Max bitcoin blocks up to which the first observed output may fund the Lock.
|
|
87
|
+
**/
|
|
88
|
+
maxPendingConfirmationBlocks: u64 & AugmentedConst<ApiType>;
|
|
85
89
|
/**
|
|
86
90
|
* Number of frames orphaned UTXO release entries are retained after a lock lifecycle
|
|
87
91
|
* transition before being cleaned up.
|
|
@@ -94,27 +98,9 @@ declare module '@polkadot/api-base/types/consts' {
|
|
|
94
98
|
};
|
|
95
99
|
bitcoinUtxos: {
|
|
96
100
|
/**
|
|
97
|
-
* Maximum number of
|
|
98
|
-
**/
|
|
99
|
-
maxCandidateUtxosPerLock: u32 & AugmentedConst<ApiType>;
|
|
100
|
-
/**
|
|
101
|
-
* Maximum number of satoshi difference allowed from expected to consider a UTXO as
|
|
102
|
-
* "confirmed"
|
|
103
|
-
**/
|
|
104
|
-
maximumSatoshiThresholdFromExpected: u64 & AugmentedConst<ApiType>;
|
|
105
|
-
/**
|
|
106
|
-
* Maximum bitcoin blocks to accept a UTXO for confirmation. Expired locks remain watched
|
|
107
|
-
* for this many additional blocks so late funding can be detected as orphaned.
|
|
108
|
-
**/
|
|
109
|
-
maxPendingConfirmationBlocks: u64 & AugmentedConst<ApiType>;
|
|
110
|
-
/**
|
|
111
|
-
* The maximum number of UTXOs that can be watched in a block and/or expiring at same block
|
|
112
|
-
**/
|
|
113
|
-
maxPendingConfirmationUtxos: u32 & AugmentedConst<ApiType>;
|
|
114
|
-
/**
|
|
115
|
-
* The maximum number of expired pending funding entries cleaned up in a block
|
|
101
|
+
* Maximum number of outputs tracked for a single Lock address.
|
|
116
102
|
**/
|
|
117
|
-
|
|
103
|
+
maxUtxosPerLock: u32 & AugmentedConst<ApiType>;
|
|
118
104
|
};
|
|
119
105
|
blockRewards: {
|
|
120
106
|
/**
|
|
@@ -234,18 +234,14 @@ declare module '@polkadot/api-base/types/errors' {
|
|
|
234
234
|
* Invalid bitcoin sync height attempted
|
|
235
235
|
**/
|
|
236
236
|
InvalidBitcoinSyncHeight: AugmentedError<ApiType>;
|
|
237
|
-
/**
|
|
238
|
-
* This Lock already has an attached funding UTXO
|
|
239
|
-
**/
|
|
240
|
-
LockAlreadyFunded: AugmentedError<ApiType>;
|
|
241
|
-
/**
|
|
242
|
-
* Too many candidate UTXOs are being stored for this lock
|
|
243
|
-
**/
|
|
244
|
-
MaxCandidateUtxosExceeded: AugmentedError<ApiType>;
|
|
245
237
|
/**
|
|
246
238
|
* Too many UTXOs are being watched
|
|
247
239
|
**/
|
|
248
240
|
MaxUtxosExceeded: AugmentedError<ApiType>;
|
|
241
|
+
/**
|
|
242
|
+
* Too many outputs have been observed at one Lock address.
|
|
243
|
+
**/
|
|
244
|
+
MaxUtxosPerLockExceeded: AugmentedError<ApiType>;
|
|
249
245
|
/**
|
|
250
246
|
* No Oracle-provided bitcoin block has been provided to the network
|
|
251
247
|
**/
|
|
@@ -267,11 +263,7 @@ declare module '@polkadot/api-base/types/errors' {
|
|
|
267
263
|
**/
|
|
268
264
|
ScriptPubkeyConflict: AugmentedError<ApiType>;
|
|
269
265
|
/**
|
|
270
|
-
*
|
|
271
|
-
**/
|
|
272
|
-
UtxoNotCandidate: AugmentedError<ApiType>;
|
|
273
|
-
/**
|
|
274
|
-
* Locked Utxo Not Found
|
|
266
|
+
* Watched Lock or attached UTXO not found.
|
|
275
267
|
**/
|
|
276
268
|
UtxoNotLocked: AugmentedError<ApiType>;
|
|
277
269
|
};
|
|
@@ -24,7 +24,6 @@ import type { ITuple } from '@polkadot/types-codec/types';
|
|
|
24
24
|
import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';
|
|
25
25
|
import type {
|
|
26
26
|
ArgonNotaryAuditErrorVerifyError,
|
|
27
|
-
ArgonPrimitivesBitcoinBitcoinRejectedReason,
|
|
28
27
|
ArgonPrimitivesBitcoinUtxoRef,
|
|
29
28
|
ArgonPrimitivesBlockSealBlockPayout,
|
|
30
29
|
ArgonPrimitivesBlockSealMiningRegistration,
|
|
@@ -439,42 +438,32 @@ declare module '@polkadot/api-base/types/events' {
|
|
|
439
438
|
[utxoId: u64, vaultId: u32, newSatoshis: u64, accountId: AccountId32],
|
|
440
439
|
{ utxoId: u64; vaultId: u32; newSatoshis: u64; accountId: AccountId32 }
|
|
441
440
|
>;
|
|
442
|
-
UtxoFundedFromCandidate: AugmentedEvent<
|
|
443
|
-
ApiType,
|
|
444
|
-
[utxoId: u64, utxoRef: ArgonPrimitivesBitcoinUtxoRef, vaultId: u32, accountId: AccountId32],
|
|
445
|
-
{
|
|
446
|
-
utxoId: u64;
|
|
447
|
-
utxoRef: ArgonPrimitivesBitcoinUtxoRef;
|
|
448
|
-
vaultId: u32;
|
|
449
|
-
accountId: AccountId32;
|
|
450
|
-
}
|
|
451
|
-
>;
|
|
452
441
|
};
|
|
453
442
|
bitcoinUtxos: {
|
|
454
|
-
|
|
443
|
+
UtxoDetected: AugmentedEvent<
|
|
455
444
|
ApiType,
|
|
456
445
|
[
|
|
457
446
|
utxoId: u64,
|
|
458
447
|
utxoRef: ArgonPrimitivesBitcoinUtxoRef,
|
|
459
|
-
rejectedReason: ArgonPrimitivesBitcoinBitcoinRejectedReason,
|
|
460
448
|
satoshisReceived: u64,
|
|
449
|
+
bitcoinHeight: u64,
|
|
461
450
|
],
|
|
462
451
|
{
|
|
463
452
|
utxoId: u64;
|
|
464
453
|
utxoRef: ArgonPrimitivesBitcoinUtxoRef;
|
|
465
|
-
rejectedReason: ArgonPrimitivesBitcoinBitcoinRejectedReason;
|
|
466
454
|
satoshisReceived: u64;
|
|
455
|
+
bitcoinHeight: u64;
|
|
467
456
|
}
|
|
468
457
|
>;
|
|
469
|
-
|
|
458
|
+
UtxoDetectedError: AugmentedEvent<
|
|
470
459
|
ApiType,
|
|
471
460
|
[utxoId: u64, error: SpRuntimeDispatchError],
|
|
472
461
|
{ utxoId: u64; error: SpRuntimeDispatchError }
|
|
473
462
|
>;
|
|
474
463
|
UtxoSpent: AugmentedEvent<
|
|
475
464
|
ApiType,
|
|
476
|
-
[utxoId: u64, blockHeight: u64],
|
|
477
|
-
{ utxoId: u64; blockHeight: u64 }
|
|
465
|
+
[utxoId: u64, utxoRef: ArgonPrimitivesBitcoinUtxoRef, blockHeight: u64],
|
|
466
|
+
{ utxoId: u64; utxoRef: ArgonPrimitivesBitcoinUtxoRef; blockHeight: u64 }
|
|
478
467
|
>;
|
|
479
468
|
UtxoSpentError: AugmentedEvent<
|
|
480
469
|
ApiType,
|
|
@@ -482,16 +471,6 @@ declare module '@polkadot/api-base/types/events' {
|
|
|
482
471
|
{ utxoId: u64; error: SpRuntimeDispatchError }
|
|
483
472
|
>;
|
|
484
473
|
UtxoUnwatched: AugmentedEvent<ApiType, [utxoId: u64], { utxoId: u64 }>;
|
|
485
|
-
UtxoVerified: AugmentedEvent<
|
|
486
|
-
ApiType,
|
|
487
|
-
[utxoId: u64, satoshisReceived: u64],
|
|
488
|
-
{ utxoId: u64; satoshisReceived: u64 }
|
|
489
|
-
>;
|
|
490
|
-
UtxoVerifiedError: AugmentedEvent<
|
|
491
|
-
ApiType,
|
|
492
|
-
[utxoId: u64, error: SpRuntimeDispatchError],
|
|
493
|
-
{ utxoId: u64; error: SpRuntimeDispatchError }
|
|
494
|
-
>;
|
|
495
474
|
};
|
|
496
475
|
blockRewards: {
|
|
497
476
|
RewardCreated: AugmentedEvent<
|
|
@@ -27,10 +27,11 @@ import type {
|
|
|
27
27
|
ArgonNotaryAuditErrorVerifyError,
|
|
28
28
|
ArgonPrimitivesBalanceChangeAccountOrigin,
|
|
29
29
|
ArgonPrimitivesBitcoinBitcoinBlock,
|
|
30
|
+
ArgonPrimitivesBitcoinBitcoinCosignScriptPubkey,
|
|
30
31
|
ArgonPrimitivesBitcoinBitcoinNetwork,
|
|
31
32
|
ArgonPrimitivesBitcoinBitcoinXPub,
|
|
33
|
+
ArgonPrimitivesBitcoinUtxoAddress,
|
|
32
34
|
ArgonPrimitivesBitcoinUtxoRef,
|
|
33
|
-
ArgonPrimitivesBitcoinUtxoValue,
|
|
34
35
|
ArgonPrimitivesBlockSealBlockPayout,
|
|
35
36
|
ArgonPrimitivesBlockSealMiningBidStats,
|
|
36
37
|
ArgonPrimitivesBlockSealMiningRegistration,
|
|
@@ -261,6 +262,15 @@ declare module '@polkadot/api-base/types/storage' {
|
|
|
261
262
|
(arg: u64 | AnyNumber | Uint8Array) => Observable<Option<PalletBitcoinLocksLockedBitcoin>>,
|
|
262
263
|
[u64]
|
|
263
264
|
>;
|
|
265
|
+
/**
|
|
266
|
+
* Unfunded locks whose pending securitization reservation expires at the indexed height.
|
|
267
|
+
* Expiry releases the reservation but leaves the lock address watched for late orphan output.
|
|
268
|
+
**/
|
|
269
|
+
locksPendingFundingByBitcoinHeight: AugmentedQuery<
|
|
270
|
+
ApiType,
|
|
271
|
+
(arg: u64 | AnyNumber | Uint8Array) => Observable<BTreeSet<u64>>,
|
|
272
|
+
[u64]
|
|
273
|
+
>;
|
|
264
274
|
/**
|
|
265
275
|
* History of target microgons per btc.
|
|
266
276
|
**/
|
|
@@ -321,6 +331,14 @@ declare module '@polkadot/api-base/types/storage' {
|
|
|
321
331
|
) => Observable<Option<Null>>,
|
|
322
332
|
[u32, u64]
|
|
323
333
|
>;
|
|
334
|
+
/**
|
|
335
|
+
* The utxo funding this lock. In the current runtime, this is just the first utxo received
|
|
336
|
+
**/
|
|
337
|
+
utxoIdToFundingUtxoRef: AugmentedQuery<
|
|
338
|
+
ApiType,
|
|
339
|
+
(arg: u64 | AnyNumber | Uint8Array) => Observable<Option<ArgonPrimitivesBitcoinUtxoRef>>,
|
|
340
|
+
[u64]
|
|
341
|
+
>;
|
|
324
342
|
};
|
|
325
343
|
bitcoinUtxos: {
|
|
326
344
|
/**
|
|
@@ -331,16 +349,6 @@ declare module '@polkadot/api-base/types/storage' {
|
|
|
331
349
|
() => Observable<ArgonPrimitivesBitcoinBitcoinNetwork>,
|
|
332
350
|
[]
|
|
333
351
|
>;
|
|
334
|
-
/**
|
|
335
|
-
* Candidate UTXOs associated with a lock (mismatches, extra funding, etc.).
|
|
336
|
-
**/
|
|
337
|
-
candidateUtxoRefsByUtxoId: AugmentedQuery<
|
|
338
|
-
ApiType,
|
|
339
|
-
(
|
|
340
|
-
arg: u64 | AnyNumber | Uint8Array,
|
|
341
|
-
) => Observable<BTreeMap<ArgonPrimitivesBitcoinUtxoRef, u64>>,
|
|
342
|
-
[u64]
|
|
343
|
-
>;
|
|
344
352
|
/**
|
|
345
353
|
* An oracle-provided confirmed bitcoin block (eg, 6 blocks back)
|
|
346
354
|
**/
|
|
@@ -349,43 +357,10 @@ declare module '@polkadot/api-base/types/storage' {
|
|
|
349
357
|
() => Observable<Option<ArgonPrimitivesBitcoinBitcoinBlock>>,
|
|
350
358
|
[]
|
|
351
359
|
>;
|
|
352
|
-
/**
|
|
353
|
-
* Pending funding entries that have expired. These remain watched until their additional
|
|
354
|
-
* orphan-detection window ends, then await bounded cleanup.
|
|
355
|
-
**/
|
|
356
|
-
expiredPendingFunding: AugmentedQuery<
|
|
357
|
-
ApiType,
|
|
358
|
-
() => Observable<BTreeMap<u64, ArgonPrimitivesBitcoinUtxoValue>>,
|
|
359
|
-
[]
|
|
360
|
-
>;
|
|
361
360
|
/**
|
|
362
361
|
* Check if the inherent was included
|
|
363
362
|
**/
|
|
364
363
|
inherentIncluded: AugmentedQuery<ApiType, () => Observable<bool>, []>;
|
|
365
|
-
/**
|
|
366
|
-
* Locked Bitcoin UTXOs that have been funded with a UtxoRef from the Bitcoin network and
|
|
367
|
-
* amounts within the MinimumSatoshiThreshold of the expected. If a Bitcoin UTXO is moved
|
|
368
|
-
* before the expiration block, the funds are burned and the UTXO is unlocked.
|
|
369
|
-
**/
|
|
370
|
-
lockedUtxos: AugmentedQuery<
|
|
371
|
-
ApiType,
|
|
372
|
-
(
|
|
373
|
-
arg:
|
|
374
|
-
| ArgonPrimitivesBitcoinUtxoRef
|
|
375
|
-
| { txid?: any; outputIndex?: any }
|
|
376
|
-
| string
|
|
377
|
-
| Uint8Array,
|
|
378
|
-
) => Observable<Option<ArgonPrimitivesBitcoinUtxoValue>>,
|
|
379
|
-
[ArgonPrimitivesBitcoinUtxoRef]
|
|
380
|
-
>;
|
|
381
|
-
/**
|
|
382
|
-
* Bitcoin locks that are pending full funding on the bitcoin network
|
|
383
|
-
**/
|
|
384
|
-
locksPendingFunding: AugmentedQuery<
|
|
385
|
-
ApiType,
|
|
386
|
-
() => Observable<BTreeMap<u64, ArgonPrimitivesBitcoinUtxoValue>>,
|
|
387
|
-
[]
|
|
388
|
-
>;
|
|
389
364
|
/**
|
|
390
365
|
* Bitcoin Oracle Operator Account
|
|
391
366
|
**/
|
|
@@ -408,11 +383,35 @@ declare module '@polkadot/api-base/types/storage' {
|
|
|
408
383
|
**/
|
|
409
384
|
tempParentHasSyncState: AugmentedQuery<ApiType, () => Observable<bool>, []>;
|
|
410
385
|
/**
|
|
411
|
-
*
|
|
386
|
+
* Watched Lock addresses and the scan height needed to observe them.
|
|
412
387
|
**/
|
|
413
|
-
|
|
388
|
+
utxoAddressByUtxoId: AugmentedQuery<
|
|
414
389
|
ApiType,
|
|
415
|
-
(
|
|
390
|
+
(
|
|
391
|
+
arg: u64 | AnyNumber | Uint8Array,
|
|
392
|
+
) => Observable<Option<ArgonPrimitivesBitcoinUtxoAddress>>,
|
|
393
|
+
[u64]
|
|
394
|
+
>;
|
|
395
|
+
/**
|
|
396
|
+
* The Lock ID identified by each watched script pubkey.
|
|
397
|
+
**/
|
|
398
|
+
utxoIdByScriptPubkey: AugmentedQuery<
|
|
399
|
+
ApiType,
|
|
400
|
+
(
|
|
401
|
+
arg:
|
|
402
|
+
| ArgonPrimitivesBitcoinBitcoinCosignScriptPubkey
|
|
403
|
+
| { P2WSH: any }
|
|
404
|
+
| string
|
|
405
|
+
| Uint8Array,
|
|
406
|
+
) => Observable<Option<u64>>,
|
|
407
|
+
[ArgonPrimitivesBitcoinBitcoinCosignScriptPubkey]
|
|
408
|
+
>;
|
|
409
|
+
/**
|
|
410
|
+
* Every output observed at a watched Lock address, retained until explicitly removed.
|
|
411
|
+
**/
|
|
412
|
+
utxoRefsByUtxoId: AugmentedQuery<
|
|
413
|
+
ApiType,
|
|
414
|
+
(arg: u64 | AnyNumber | Uint8Array) => Observable<BTreeSet<ArgonPrimitivesBitcoinUtxoRef>>,
|
|
416
415
|
[u64]
|
|
417
416
|
>;
|
|
418
417
|
};
|
|
@@ -425,37 +425,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
|
|
425
425
|
>;
|
|
426
426
|
};
|
|
427
427
|
bitcoinUtxos: {
|
|
428
|
-
/**
|
|
429
|
-
* Bind a candidate UTXO ref as the funding UTXO for its lock.
|
|
430
|
-
* The locks pallet authorizes the promotion; this pallet binds the ref and begins
|
|
431
|
-
* tracking.
|
|
432
|
-
**/
|
|
433
|
-
fundWithUtxoCandidate: AugmentedSubmittable<
|
|
434
|
-
(
|
|
435
|
-
utxoId: u64 | AnyNumber | Uint8Array,
|
|
436
|
-
utxoRef:
|
|
437
|
-
| ArgonPrimitivesBitcoinUtxoRef
|
|
438
|
-
| { txid?: any; outputIndex?: any }
|
|
439
|
-
| string
|
|
440
|
-
| Uint8Array,
|
|
441
|
-
) => SubmittableExtrinsic<ApiType>,
|
|
442
|
-
[u64, ArgonPrimitivesBitcoinUtxoRef]
|
|
443
|
-
>;
|
|
444
|
-
/**
|
|
445
|
-
* Reject a pending candidate UTXO and materialize it as an orphan through the locks
|
|
446
|
-
* pallet.
|
|
447
|
-
**/
|
|
448
|
-
rejectUtxoCandidate: AugmentedSubmittable<
|
|
449
|
-
(
|
|
450
|
-
utxoId: u64 | AnyNumber | Uint8Array,
|
|
451
|
-
utxoRef:
|
|
452
|
-
| ArgonPrimitivesBitcoinUtxoRef
|
|
453
|
-
| { txid?: any; outputIndex?: any }
|
|
454
|
-
| string
|
|
455
|
-
| Uint8Array,
|
|
456
|
-
) => SubmittableExtrinsic<ApiType>,
|
|
457
|
-
[u64, ArgonPrimitivesBitcoinUtxoRef]
|
|
458
|
-
>;
|
|
459
428
|
/**
|
|
460
429
|
* Sets the most recent confirmed bitcoin block height (only executable by the Oracle
|
|
461
430
|
* Operator account)
|