@argonprotocol/mainchain 1.4.12-dev.4d726964 → 1.4.12-dev.9deec2d7

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.4d726964",
3
+ "version": "1.4.12-dev.9deec2d7",
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.4d726964",
70
+ "@argonprotocol/testing": "1.4.12-dev.9deec2d7",
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 configured or requested Lock amount is below the required minimum.
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,8 +325,8 @@ 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.
@@ -336,7 +337,7 @@ declare module '@polkadot/api-base/types/events' {
336
337
  accountId: AccountId32,
337
338
  fissionId: u64,
338
339
  liquidId: u64,
339
- utxoId: u64,
340
+ lockId: u64,
340
341
  satoshis: u64,
341
342
  microgonsAtTargetPerBtc: u128,
342
343
  liquidityPromised: u128,
@@ -345,7 +346,7 @@ declare module '@polkadot/api-base/types/events' {
345
346
  accountId: AccountId32;
346
347
  fissionId: u64;
347
348
  liquidId: u64;
348
- utxoId: u64;
349
+ lockId: u64;
349
350
  satoshis: u64;
350
351
  microgonsAtTargetPerBtc: u128;
351
352
  liquidityPromised: u128;
@@ -379,30 +380,35 @@ declare module '@polkadot/api-base/types/events' {
379
380
  bitcoinLocks: {
380
381
  BitcoinCosignPastDue: AugmentedEvent<
381
382
  ApiType,
382
- [utxoId: u64, vaultId: u32, compensationAmount: u128, compensatedAccountId: AccountId32],
383
- { utxoId: u64; vaultId: u32; compensationAmount: u128; compensatedAccountId: AccountId32 }
384
- >;
385
- BitcoinLockBurned: AugmentedEvent<
386
- ApiType,
387
- [utxoId: u64, vaultId: u32, wasUtxoSpent: bool],
388
- { utxoId: u64; vaultId: u32; wasUtxoSpent: bool }
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
+ }
389
397
  >;
390
398
  BitcoinLockCreated: AugmentedEvent<
391
399
  ApiType,
392
400
  [
393
- utxoId: u64,
401
+ lockId: u64,
394
402
  vaultId: u32,
395
- securitizedSatoshis: u64,
396
- microgonsAtTargetPerBtc: u128,
403
+ securitizationBasis: ArgonPrimitivesVaultBitcoinSecuritizationBasis,
397
404
  collateralRequired: u128,
398
405
  accountId: AccountId32,
399
406
  securityFee: u128,
400
407
  ],
401
408
  {
402
- utxoId: u64;
409
+ lockId: u64;
403
410
  vaultId: u32;
404
- securitizedSatoshis: u64;
405
- microgonsAtTargetPerBtc: u128;
411
+ securitizationBasis: ArgonPrimitivesVaultBitcoinSecuritizationBasis;
406
412
  collateralRequired: u128;
407
413
  accountId: AccountId32;
408
414
  securityFee: u128;
@@ -410,76 +416,79 @@ declare module '@polkadot/api-base/types/events' {
410
416
  >;
411
417
  BitcoinLockFlexibleChanged: AugmentedEvent<
412
418
  ApiType,
413
- [utxoId: u64, vaultId: u32, isFlexible: bool],
414
- { utxoId: u64; vaultId: u32; isFlexible: bool }
419
+ [lockId: u64, vaultId: u32, isFlexible: bool],
420
+ { lockId: u64; vaultId: u32; isFlexible: bool }
415
421
  >;
416
422
  BitcoinLockResecuritized: AugmentedEvent<
417
423
  ApiType,
418
424
  [
419
- utxoId: u64,
425
+ lockId: u64,
420
426
  vaultId: u32,
421
- securitizedSatoshis: u64,
422
- microgonsAtTargetPerBtc: u128,
427
+ securitizationBasis: ArgonPrimitivesVaultBitcoinSecuritizationBasis,
423
428
  accountId: AccountId32,
424
429
  ],
425
430
  {
426
- utxoId: u64;
431
+ lockId: u64;
427
432
  vaultId: u32;
428
- securitizedSatoshis: u64;
429
- microgonsAtTargetPerBtc: u128;
433
+ securitizationBasis: ArgonPrimitivesVaultBitcoinSecuritizationBasis;
430
434
  accountId: AccountId32;
431
435
  }
432
436
  >;
437
+ BitcoinLockTerminated: AugmentedEvent<
438
+ ApiType,
439
+ [lockId: u64, vaultId: u32, wasUtxoSpent: bool, burnedArgons: u128],
440
+ { lockId: u64; vaultId: u32; wasUtxoSpent: bool; burnedArgons: u128 }
441
+ >;
433
442
  BitcoinSpentAfterRelease: AugmentedEvent<
434
443
  ApiType,
435
- [utxoId: u64, vaultId: u32],
436
- { utxoId: u64; vaultId: u32 }
444
+ [lockId: u64, vaultId: u32, releaseNumber: u32, bitcoinHeight: u64],
445
+ { lockId: u64; vaultId: u32; releaseNumber: u32; bitcoinHeight: u64 }
437
446
  >;
438
447
  BitcoinUtxoCosigned: AugmentedEvent<
439
448
  ApiType,
440
- [utxoId: u64, vaultId: u32, signature: Bytes],
441
- { 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> }
442
451
  >;
443
452
  BitcoinUtxoCosignRequested: AugmentedEvent<
444
453
  ApiType,
445
- [utxoId: u64, vaultId: u32],
446
- { utxoId: u64; vaultId: u32 }
454
+ [lockId: u64, vaultId: u32, releaseNumber: u32],
455
+ { lockId: u64; vaultId: u32; releaseNumber: u32 }
447
456
  >;
448
457
  /**
449
458
  * An error occurred while refunding an overdue cosigned bitcoin lock
450
459
  **/
451
460
  CosignOverdueError: AugmentedEvent<
452
461
  ApiType,
453
- [utxoId: u64, error: SpRuntimeDispatchError],
454
- { utxoId: u64; error: SpRuntimeDispatchError }
462
+ [lockId: u64, error: SpRuntimeDispatchError],
463
+ { lockId: u64; error: SpRuntimeDispatchError }
455
464
  >;
456
465
  /**
457
466
  * An error occurred while completing a lock
458
467
  **/
459
468
  LockExpirationError: AugmentedEvent<
460
469
  ApiType,
461
- [utxoId: u64, error: SpRuntimeDispatchError],
462
- { utxoId: u64; error: SpRuntimeDispatchError }
470
+ [lockId: u64, error: SpRuntimeDispatchError],
471
+ { lockId: u64; error: SpRuntimeDispatchError }
463
472
  >;
464
473
  /**
465
474
  * Not all orphaned UTXOs for a retired Lock fit in the cleanup schedule.
466
475
  **/
467
476
  OrphanedUtxoCleanupScheduleOverflow: AugmentedEvent<
468
477
  ApiType,
469
- [accountId: AccountId32, utxoId: u64, expirationFrame: u64],
470
- { accountId: AccountId32; utxoId: u64; expirationFrame: u64 }
478
+ [accountId: AccountId32, lockId: u64, expirationFrame: u64],
479
+ { accountId: AccountId32; lockId: u64; expirationFrame: u64 }
471
480
  >;
472
481
  OrphanedUtxoCosigned: AugmentedEvent<
473
482
  ApiType,
474
483
  [
475
- utxoId: u64,
484
+ lockId: u64,
476
485
  utxoRef: ArgonPrimitivesBitcoinUtxoRef,
477
486
  vaultId: u32,
478
487
  accountId: AccountId32,
479
488
  signature: Bytes,
480
489
  ],
481
490
  {
482
- utxoId: u64;
491
+ lockId: u64;
483
492
  utxoRef: ArgonPrimitivesBitcoinUtxoRef;
484
493
  vaultId: u32;
485
494
  accountId: AccountId32;
@@ -504,14 +513,14 @@ declare module '@polkadot/api-base/types/events' {
504
513
  >;
505
514
  OrphanedUtxoReceived: AugmentedEvent<
506
515
  ApiType,
507
- [utxoId: u64, utxoRef: ArgonPrimitivesBitcoinUtxoRef, vaultId: u32, satoshis: u64],
508
- { 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 }
509
518
  >;
510
519
  OrphanedUtxoReleaseRequested: AugmentedEvent<
511
520
  ApiType,
512
- [utxoId: u64, utxoRef: ArgonPrimitivesBitcoinUtxoRef, vaultId: u32, accountId: AccountId32],
521
+ [lockId: u64, utxoRef: ArgonPrimitivesBitcoinUtxoRef, vaultId: u32, accountId: AccountId32],
513
522
  {
514
- utxoId: u64;
523
+ lockId: u64;
515
524
  utxoRef: ArgonPrimitivesBitcoinUtxoRef;
516
525
  vaultId: u32;
517
526
  accountId: AccountId32;
@@ -522,13 +531,13 @@ declare module '@polkadot/api-base/types/events' {
522
531
  UtxoDetected: AugmentedEvent<
523
532
  ApiType,
524
533
  [
525
- utxoId: u64,
534
+ lockId: u64,
526
535
  utxoRef: ArgonPrimitivesBitcoinUtxoRef,
527
536
  satoshisReceived: u64,
528
537
  bitcoinHeight: u64,
529
538
  ],
530
539
  {
531
- utxoId: u64;
540
+ lockId: u64;
532
541
  utxoRef: ArgonPrimitivesBitcoinUtxoRef;
533
542
  satoshisReceived: u64;
534
543
  bitcoinHeight: u64;
@@ -536,20 +545,20 @@ declare module '@polkadot/api-base/types/events' {
536
545
  >;
537
546
  UtxoDetectedError: AugmentedEvent<
538
547
  ApiType,
539
- [utxoId: u64, error: SpRuntimeDispatchError],
540
- { utxoId: u64; error: SpRuntimeDispatchError }
548
+ [lockId: u64, error: SpRuntimeDispatchError],
549
+ { lockId: u64; error: SpRuntimeDispatchError }
541
550
  >;
542
551
  UtxoSpent: AugmentedEvent<
543
552
  ApiType,
544
- [utxoId: u64, utxoRef: ArgonPrimitivesBitcoinUtxoRef, blockHeight: u64],
545
- { utxoId: u64; utxoRef: ArgonPrimitivesBitcoinUtxoRef; blockHeight: u64 }
553
+ [lockId: u64, utxoRef: ArgonPrimitivesBitcoinUtxoRef, blockHeight: u64],
554
+ { lockId: u64; utxoRef: ArgonPrimitivesBitcoinUtxoRef; blockHeight: u64 }
546
555
  >;
547
556
  UtxoSpentError: AugmentedEvent<
548
557
  ApiType,
549
- [utxoId: u64, error: SpRuntimeDispatchError],
550
- { utxoId: u64; error: SpRuntimeDispatchError }
558
+ [lockId: u64, error: SpRuntimeDispatchError],
559
+ { lockId: u64; error: SpRuntimeDispatchError }
551
560
  >;
552
- UtxoUnwatched: AugmentedEvent<ApiType, [utxoId: u64], { utxoId: u64 }>;
561
+ UtxoUnwatched: AugmentedEvent<ApiType, [lockId: u64], { lockId: u64 }>;
553
562
  };
554
563
  blockRewards: {
555
564
  RewardCreated: AugmentedEvent<
@@ -1162,8 +1171,8 @@ declare module '@polkadot/api-base/types/events' {
1162
1171
  **/
1163
1172
  BitcoinMint: AugmentedEvent<
1164
1173
  ApiType,
1165
- [accountId: AccountId32, fissionId: u64, utxoId: Option<u64>, amount: u128],
1166
- { accountId: AccountId32; fissionId: u64; 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 }
1167
1176
  >;
1168
1177
  /**
1169
1178
  * The amount of microgons minted for mining. NOTE: accounts below Existential Deposit
@@ -1184,7 +1193,7 @@ declare module '@polkadot/api-base/types/events' {
1184
1193
  mintType: PalletMintMintType,
1185
1194
  accountId: AccountId32,
1186
1195
  fissionId: Option<u64>,
1187
- utxoId: Option<u64>,
1196
+ lockId: Option<u64>,
1188
1197
  amount: u128,
1189
1198
  error: SpRuntimeDispatchError,
1190
1199
  ],
@@ -1192,7 +1201,7 @@ declare module '@polkadot/api-base/types/events' {
1192
1201
  mintType: PalletMintMintType;
1193
1202
  accountId: AccountId32;
1194
1203
  fissionId: Option<u64>;
1195
- utxoId: Option<u64>;
1204
+ lockId: Option<u64>;
1196
1205
  amount: u128;
1197
1206
  error: SpRuntimeDispatchError;
1198
1207
  }
@@ -2183,8 +2192,20 @@ declare module '@polkadot/api-base/types/events' {
2183
2192
  >;
2184
2193
  LostBitcoinCompensated: AugmentedEvent<
2185
2194
  ApiType,
2186
- [vaultId: u32, beneficiary: AccountId32, toBeneficiary: u128, burned: u128],
2187
- { vaultId: u32; beneficiary: AccountId32; toBeneficiary: u128; burned: u128 }
2195
+ [
2196
+ vaultId: u32,
2197
+ beneficiary: AccountId32,
2198
+ toBeneficiary: u128,
2199
+ shortfall: u128,
2200
+ burned: u128,
2201
+ ],
2202
+ {
2203
+ vaultId: u32;
2204
+ beneficiary: AccountId32;
2205
+ toBeneficiary: u128;
2206
+ shortfall: u128;
2207
+ burned: u128;
2208
+ }
2188
2209
  >;
2189
2210
  ReservedSecuritizationSpaceChanged: AugmentedEvent<
2190
2211
  ApiType,