@argonprotocol/mainchain 1.4.12-dev.dd86fab9 → 1.4.12-dev.ece9349b

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argonprotocol/mainchain",
3
- "version": "1.4.12-dev.dd86fab9",
3
+ "version": "1.4.12-dev.ece9349b",
4
4
  "description": "A client for accessing the Argon mainchain apis.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -67,7 +67,7 @@
67
67
  },
68
68
  "devDependencies": {
69
69
  "@argonprotocol/ethereum-contracts": "workspace:*",
70
- "@argonprotocol/testing": "1.4.12-dev.dd86fab9",
70
+ "@argonprotocol/testing": "1.4.12-dev.ece9349b",
71
71
  "@polkadot/typegen": "^16.5.6",
72
72
  "@substrate/ss58-registry": "^1.51.0",
73
73
  "@types/node": "^20",
@@ -75,7 +75,7 @@
75
75
  "tsup": "^8.5.0",
76
76
  "tsx": "^4.20.4",
77
77
  "typescript": "^5.9.2",
78
- "vitest": "^4.0.5"
78
+ "vitest": "^5.0.0"
79
79
  },
80
80
  "packageManager": "yarn@4.1.0"
81
81
  }
@@ -92,14 +92,18 @@ declare module '@polkadot/api-base/types/consts' {
92
92
  **/
93
93
  maxConcurrentlyReleasingLocks: u32 & AugmentedConst<ApiType>;
94
94
  /**
95
- * Max bitcoin blocks up to which the first observed output may fund the Lock.
95
+ * Maximum number of confirmed Bitcoin outputs that may fund one Lock.
96
96
  **/
97
- maxPendingConfirmationBlocks: u64 & AugmentedConst<ApiType>;
97
+ maxUtxosPerLock: u32 & AugmentedConst<ApiType>;
98
98
  /**
99
99
  * Number of frames orphaned UTXO release entries are retained after a lock lifecycle
100
100
  * transition before being cleaned up.
101
101
  **/
102
102
  orphanedUtxoReleaseExpiryFrames: u64 & AugmentedConst<ApiType>;
103
+ /**
104
+ * Number of Bitcoin blocks to reserve securitization that has not yet been activated.
105
+ **/
106
+ securitizationHoldBlocks: u64 & AugmentedConst<ApiType>;
103
107
  /**
104
108
  * Number of ticks per bitcoin block
105
109
  **/
@@ -160,6 +160,14 @@ declare module '@polkadot/api-base/types/errors' {
160
160
  * This bitcoin pubkey couldn't be decoded for release
161
161
  **/
162
162
  BitcoinPubkeyUnableToBeDecoded: AugmentedError<ApiType>;
163
+ /**
164
+ * A partial release would leave less than the minimum watched Lock amount.
165
+ **/
166
+ BitcoinReleaseChangeBelowMinimum: AugmentedError<ApiType>;
167
+ /**
168
+ * The release destination cannot be the Lock's own script.
169
+ **/
170
+ BitcoinReleaseDestinationIsLockScript: AugmentedError<ApiType>;
163
171
  /**
164
172
  * The bitcoin has passed the deadline to release it
165
173
  **/
@@ -218,6 +226,10 @@ declare module '@polkadot/api-base/types/errors' {
218
226
  **/
219
227
  InsufficientSecuritizationForFissions: AugmentedError<ApiType>;
220
228
  InsufficientVaultFunds: AugmentedError<ApiType>;
229
+ /**
230
+ * The external destination amount must be nonzero and fit with the network fee.
231
+ **/
232
+ InvalidBitcoinReleaseAmount: AugmentedError<ApiType>;
221
233
  /**
222
234
  * The bitcoin script to lock this bitcoin has errors
223
235
  **/
@@ -245,15 +257,23 @@ declare module '@polkadot/api-base/types/errors' {
245
257
  /**
246
258
  * The lock funding has not been confirmed on bitcoin
247
259
  **/
248
- LockPendingFunding: AugmentedError<ApiType>;
260
+ LockNotFunded: AugmentedError<ApiType>;
249
261
  /**
250
262
  * Too many orphaned utxo release requests for a lock
251
263
  **/
252
264
  MaxOrphanedUtxoReleaseRequestsExceeded: AugmentedError<ApiType>;
265
+ /**
266
+ * Too many confirmed Bitcoin outputs were assigned to one Lock.
267
+ **/
268
+ MaxUtxosPerLockExceeded: AugmentedError<ApiType>;
253
269
  /**
254
270
  * The requested price-history entry predates the Lock's current securitization.
255
271
  **/
256
272
  MicrogonsAtTargetPerBtcTickOlderThanCurrent: AugmentedError<ApiType>;
273
+ /**
274
+ * The minimum cannot increase while a release is pending.
275
+ **/
276
+ MinimumSatoshisIncreaseBlockedByPendingRelease: AugmentedError<ApiType>;
257
277
  /**
258
278
  * The price provider has no bitcoin prices available. This is a temporary error
259
279
  **/
@@ -313,9 +333,9 @@ declare module '@polkadot/api-base/types/errors' {
313
333
  **/
314
334
  BitcoinHeightNotConfirmed: AugmentedError<ApiType>;
315
335
  /**
316
- * Duplicated UtxoId. Already in use
336
+ * Duplicated BitcoinLockId. Already in use
317
337
  **/
318
- DuplicateUtxoId: AugmentedError<ApiType>;
338
+ DuplicateLockId: AugmentedError<ApiType>;
319
339
  /**
320
340
  * Insufficient bitcoin amount
321
341
  **/
@@ -332,10 +352,6 @@ declare module '@polkadot/api-base/types/errors' {
332
352
  * Too many UTXOs are being watched
333
353
  **/
334
354
  MaxUtxosExceeded: AugmentedError<ApiType>;
335
- /**
336
- * Too many outputs have been observed at one Lock address.
337
- **/
338
- MaxUtxosPerLockExceeded: AugmentedError<ApiType>;
339
355
  /**
340
356
  * No Oracle-provided bitcoin block has been provided to the network
341
357
  **/
@@ -31,6 +31,7 @@ import type {
31
31
  ArgonPrimitivesNotaryNotaryMeta,
32
32
  ArgonPrimitivesNotaryNotaryRecord,
33
33
  ArgonPrimitivesProvidersOperationalRewardKind,
34
+ ArgonPrimitivesVaultBitcoinSecuritizationBasis,
34
35
  ArgonRuntimeOriginCaller,
35
36
  ArgonRuntimeProxyType,
36
37
  ArgonRuntimeRuntimeHoldReason,
@@ -324,16 +325,32 @@ declare module '@polkadot/api-base/types/events' {
324
325
  **/
325
326
  FissionClosedByLock: AugmentedEvent<
326
327
  ApiType,
327
- [accountId: AccountId32, fissionId: u64, utxoId: u64],
328
- { accountId: AccountId32; fissionId: u64; utxoId: u64 }
328
+ [accountId: AccountId32, fissionId: u64, lockId: u64],
329
+ { accountId: AccountId32; fissionId: u64; lockId: u64 }
329
330
  >;
330
331
  /**
331
332
  * A Fission was created and allocated from its source Lock.
332
333
  **/
333
334
  FissionCreated: AugmentedEvent<
334
335
  ApiType,
335
- [accountId: AccountId32, fissionId: u64, liquidId: u64, liquidityPromised: u128],
336
- { accountId: AccountId32; fissionId: u64; liquidId: u64; liquidityPromised: u128 }
336
+ [
337
+ accountId: AccountId32,
338
+ fissionId: u64,
339
+ liquidId: u64,
340
+ lockId: u64,
341
+ satoshis: u64,
342
+ microgonsAtTargetPerBtc: u128,
343
+ liquidityPromised: u128,
344
+ ],
345
+ {
346
+ accountId: AccountId32;
347
+ fissionId: u64;
348
+ liquidId: u64;
349
+ lockId: u64;
350
+ satoshis: u64;
351
+ microgonsAtTargetPerBtc: u128;
352
+ liquidityPromised: u128;
353
+ }
337
354
  >;
338
355
  /**
339
356
  * A Fission ratchet changed its target-normalized BTC value and liability.
@@ -344,6 +361,7 @@ declare module '@polkadot/api-base/types/events' {
344
361
  accountId: AccountId32,
345
362
  fissionId: u64,
346
363
  ratchetNumber: u32,
364
+ microgonsAtTargetPerBtc: u128,
347
365
  liquidityPromised: u128,
348
366
  amountMinted: u128,
349
367
  amountBurned: u128,
@@ -352,6 +370,7 @@ declare module '@polkadot/api-base/types/events' {
352
370
  accountId: AccountId32;
353
371
  fissionId: u64;
354
372
  ratchetNumber: u32;
373
+ microgonsAtTargetPerBtc: u128;
355
374
  liquidityPromised: u128;
356
375
  amountMinted: u128;
357
376
  amountBurned: u128;
@@ -361,30 +380,40 @@ declare module '@polkadot/api-base/types/events' {
361
380
  bitcoinLocks: {
362
381
  BitcoinCosignPastDue: AugmentedEvent<
363
382
  ApiType,
364
- [utxoId: u64, vaultId: u32, compensationAmount: u128, compensatedAccountId: AccountId32],
365
- { utxoId: u64; vaultId: u32; compensationAmount: u128; compensatedAccountId: AccountId32 }
383
+ [
384
+ lockId: u64,
385
+ vaultId: u32,
386
+ releaseNumber: u32,
387
+ compensationAmount: u128,
388
+ compensatedAccountId: AccountId32,
389
+ ],
390
+ {
391
+ lockId: u64;
392
+ vaultId: u32;
393
+ releaseNumber: u32;
394
+ compensationAmount: u128;
395
+ compensatedAccountId: AccountId32;
396
+ }
366
397
  >;
367
398
  BitcoinLockBurned: AugmentedEvent<
368
399
  ApiType,
369
- [utxoId: u64, vaultId: u32, wasUtxoSpent: bool],
370
- { utxoId: u64; vaultId: u32; wasUtxoSpent: bool }
400
+ [lockId: u64, vaultId: u32, wasUtxoSpent: bool],
401
+ { lockId: u64; vaultId: u32; wasUtxoSpent: bool }
371
402
  >;
372
403
  BitcoinLockCreated: AugmentedEvent<
373
404
  ApiType,
374
405
  [
375
- utxoId: u64,
406
+ lockId: u64,
376
407
  vaultId: u32,
377
- securitizedSatoshis: u64,
378
- microgonsAtTargetPerBtc: u128,
408
+ securitizationBasis: ArgonPrimitivesVaultBitcoinSecuritizationBasis,
379
409
  collateralRequired: u128,
380
410
  accountId: AccountId32,
381
411
  securityFee: u128,
382
412
  ],
383
413
  {
384
- utxoId: u64;
414
+ lockId: u64;
385
415
  vaultId: u32;
386
- securitizedSatoshis: u64;
387
- microgonsAtTargetPerBtc: u128;
416
+ securitizationBasis: ArgonPrimitivesVaultBitcoinSecuritizationBasis;
388
417
  collateralRequired: u128;
389
418
  accountId: AccountId32;
390
419
  securityFee: u128;
@@ -392,76 +421,74 @@ declare module '@polkadot/api-base/types/events' {
392
421
  >;
393
422
  BitcoinLockFlexibleChanged: AugmentedEvent<
394
423
  ApiType,
395
- [utxoId: u64, vaultId: u32, isFlexible: bool],
396
- { utxoId: u64; vaultId: u32; isFlexible: bool }
424
+ [lockId: u64, vaultId: u32, isFlexible: bool],
425
+ { lockId: u64; vaultId: u32; isFlexible: bool }
397
426
  >;
398
427
  BitcoinLockResecuritized: AugmentedEvent<
399
428
  ApiType,
400
429
  [
401
- utxoId: u64,
430
+ lockId: u64,
402
431
  vaultId: u32,
403
- securitizedSatoshis: u64,
404
- microgonsAtTargetPerBtc: u128,
432
+ securitizationBasis: ArgonPrimitivesVaultBitcoinSecuritizationBasis,
405
433
  accountId: AccountId32,
406
434
  ],
407
435
  {
408
- utxoId: u64;
436
+ lockId: u64;
409
437
  vaultId: u32;
410
- securitizedSatoshis: u64;
411
- microgonsAtTargetPerBtc: u128;
438
+ securitizationBasis: ArgonPrimitivesVaultBitcoinSecuritizationBasis;
412
439
  accountId: AccountId32;
413
440
  }
414
441
  >;
415
442
  BitcoinSpentAfterRelease: AugmentedEvent<
416
443
  ApiType,
417
- [utxoId: u64, vaultId: u32],
418
- { utxoId: u64; vaultId: u32 }
444
+ [lockId: u64, vaultId: u32, releaseNumber: u32, bitcoinHeight: u64],
445
+ { lockId: u64; vaultId: u32; releaseNumber: u32; bitcoinHeight: u64 }
419
446
  >;
420
447
  BitcoinUtxoCosigned: AugmentedEvent<
421
448
  ApiType,
422
- [utxoId: u64, vaultId: u32, signature: Bytes],
423
- { utxoId: u64; vaultId: u32; signature: Bytes }
449
+ [lockId: u64, vaultId: u32, releaseNumber: u32, signatures: Vec<Bytes>],
450
+ { lockId: u64; vaultId: u32; releaseNumber: u32; signatures: Vec<Bytes> }
424
451
  >;
425
452
  BitcoinUtxoCosignRequested: AugmentedEvent<
426
453
  ApiType,
427
- [utxoId: u64, vaultId: u32],
428
- { utxoId: u64; vaultId: u32 }
454
+ [lockId: u64, vaultId: u32, releaseNumber: u32],
455
+ { lockId: u64; vaultId: u32; releaseNumber: u32 }
429
456
  >;
430
457
  /**
431
458
  * An error occurred while refunding an overdue cosigned bitcoin lock
432
459
  **/
433
460
  CosignOverdueError: AugmentedEvent<
434
461
  ApiType,
435
- [utxoId: u64, error: SpRuntimeDispatchError],
436
- { utxoId: u64; error: SpRuntimeDispatchError }
462
+ [lockId: u64, error: SpRuntimeDispatchError],
463
+ { lockId: u64; error: SpRuntimeDispatchError }
437
464
  >;
438
465
  /**
439
466
  * An error occurred while completing a lock
440
467
  **/
441
468
  LockExpirationError: AugmentedEvent<
442
469
  ApiType,
443
- [utxoId: u64, error: SpRuntimeDispatchError],
444
- { utxoId: u64; error: SpRuntimeDispatchError }
470
+ [lockId: u64, error: SpRuntimeDispatchError],
471
+ { lockId: u64; error: SpRuntimeDispatchError }
445
472
  >;
446
473
  /**
447
474
  * Not all orphaned UTXOs for a retired Lock fit in the cleanup schedule.
448
475
  **/
449
476
  OrphanedUtxoCleanupScheduleOverflow: AugmentedEvent<
450
477
  ApiType,
451
- [accountId: AccountId32, utxoId: u64, expirationFrame: u64],
452
- { accountId: AccountId32; utxoId: u64; expirationFrame: u64 }
478
+ [accountId: AccountId32, lockId: u64, expirationFrame: u64],
479
+ { accountId: AccountId32; lockId: u64; expirationFrame: u64 }
453
480
  >;
454
481
  OrphanedUtxoCosigned: AugmentedEvent<
455
482
  ApiType,
456
483
  [
457
- utxoId: u64,
484
+ lockId: u64,
458
485
  utxoRef: ArgonPrimitivesBitcoinUtxoRef,
459
486
  vaultId: u32,
460
487
  accountId: AccountId32,
461
488
  signature: Bytes,
462
489
  ],
463
490
  {
464
- utxoId: u64;
491
+ lockId: u64;
465
492
  utxoRef: ArgonPrimitivesBitcoinUtxoRef;
466
493
  vaultId: u32;
467
494
  accountId: AccountId32;
@@ -486,14 +513,14 @@ declare module '@polkadot/api-base/types/events' {
486
513
  >;
487
514
  OrphanedUtxoReceived: AugmentedEvent<
488
515
  ApiType,
489
- [utxoId: u64, utxoRef: ArgonPrimitivesBitcoinUtxoRef, vaultId: u32, satoshis: u64],
490
- { utxoId: u64; utxoRef: ArgonPrimitivesBitcoinUtxoRef; vaultId: u32; satoshis: u64 }
516
+ [lockId: u64, utxoRef: ArgonPrimitivesBitcoinUtxoRef, vaultId: u32, satoshis: u64],
517
+ { lockId: u64; utxoRef: ArgonPrimitivesBitcoinUtxoRef; vaultId: u32; satoshis: u64 }
491
518
  >;
492
519
  OrphanedUtxoReleaseRequested: AugmentedEvent<
493
520
  ApiType,
494
- [utxoId: u64, utxoRef: ArgonPrimitivesBitcoinUtxoRef, vaultId: u32, accountId: AccountId32],
521
+ [lockId: u64, utxoRef: ArgonPrimitivesBitcoinUtxoRef, vaultId: u32, accountId: AccountId32],
495
522
  {
496
- utxoId: u64;
523
+ lockId: u64;
497
524
  utxoRef: ArgonPrimitivesBitcoinUtxoRef;
498
525
  vaultId: u32;
499
526
  accountId: AccountId32;
@@ -504,13 +531,13 @@ declare module '@polkadot/api-base/types/events' {
504
531
  UtxoDetected: AugmentedEvent<
505
532
  ApiType,
506
533
  [
507
- utxoId: u64,
534
+ lockId: u64,
508
535
  utxoRef: ArgonPrimitivesBitcoinUtxoRef,
509
536
  satoshisReceived: u64,
510
537
  bitcoinHeight: u64,
511
538
  ],
512
539
  {
513
- utxoId: u64;
540
+ lockId: u64;
514
541
  utxoRef: ArgonPrimitivesBitcoinUtxoRef;
515
542
  satoshisReceived: u64;
516
543
  bitcoinHeight: u64;
@@ -518,20 +545,20 @@ declare module '@polkadot/api-base/types/events' {
518
545
  >;
519
546
  UtxoDetectedError: AugmentedEvent<
520
547
  ApiType,
521
- [utxoId: u64, error: SpRuntimeDispatchError],
522
- { utxoId: u64; error: SpRuntimeDispatchError }
548
+ [lockId: u64, error: SpRuntimeDispatchError],
549
+ { lockId: u64; error: SpRuntimeDispatchError }
523
550
  >;
524
551
  UtxoSpent: AugmentedEvent<
525
552
  ApiType,
526
- [utxoId: u64, utxoRef: ArgonPrimitivesBitcoinUtxoRef, blockHeight: u64],
527
- { utxoId: u64; utxoRef: ArgonPrimitivesBitcoinUtxoRef; blockHeight: u64 }
553
+ [lockId: u64, utxoRef: ArgonPrimitivesBitcoinUtxoRef, blockHeight: u64],
554
+ { lockId: u64; utxoRef: ArgonPrimitivesBitcoinUtxoRef; blockHeight: u64 }
528
555
  >;
529
556
  UtxoSpentError: AugmentedEvent<
530
557
  ApiType,
531
- [utxoId: u64, error: SpRuntimeDispatchError],
532
- { utxoId: u64; error: SpRuntimeDispatchError }
558
+ [lockId: u64, error: SpRuntimeDispatchError],
559
+ { lockId: u64; error: SpRuntimeDispatchError }
533
560
  >;
534
- UtxoUnwatched: AugmentedEvent<ApiType, [utxoId: u64], { utxoId: u64 }>;
561
+ UtxoUnwatched: AugmentedEvent<ApiType, [lockId: u64], { lockId: u64 }>;
535
562
  };
536
563
  blockRewards: {
537
564
  RewardCreated: AugmentedEvent<
@@ -1144,8 +1171,8 @@ declare module '@polkadot/api-base/types/events' {
1144
1171
  **/
1145
1172
  BitcoinMint: AugmentedEvent<
1146
1173
  ApiType,
1147
- [accountId: AccountId32, utxoId: Option<u64>, amount: u128],
1148
- { accountId: AccountId32; utxoId: Option<u64>; amount: u128 }
1174
+ [accountId: AccountId32, fissionId: u64, lockId: Option<u64>, amount: u128],
1175
+ { accountId: AccountId32; fissionId: u64; lockId: Option<u64>; amount: u128 }
1149
1176
  >;
1150
1177
  /**
1151
1178
  * The amount of microgons minted for mining. NOTE: accounts below Existential Deposit
@@ -1165,14 +1192,16 @@ declare module '@polkadot/api-base/types/events' {
1165
1192
  [
1166
1193
  mintType: PalletMintMintType,
1167
1194
  accountId: AccountId32,
1168
- utxoId: Option<u64>,
1195
+ fissionId: Option<u64>,
1196
+ lockId: Option<u64>,
1169
1197
  amount: u128,
1170
1198
  error: SpRuntimeDispatchError,
1171
1199
  ],
1172
1200
  {
1173
1201
  mintType: PalletMintMintType;
1174
1202
  accountId: AccountId32;
1175
- utxoId: Option<u64>;
1203
+ fissionId: Option<u64>;
1204
+ lockId: Option<u64>;
1176
1205
  amount: u128;
1177
1206
  error: SpRuntimeDispatchError;
1178
1207
  }