@argonprotocol/mainchain 1.4.11 → 1.4.12-dev.2afa6e4a

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.11",
3
+ "version": "1.4.12-dev.2afa6e4a",
4
4
  "description": "A client for accessing the Argon mainchain apis.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,11 +14,14 @@
14
14
  "homepage": "https://github.com/argonprotocol/mainchain#readme",
15
15
  "scripts": {
16
16
  "build": "yarn generate:defs && yarn generate:meta && node clean-build.js && yarn tsc",
17
+ "generate:contract-declarations": "tsc -p tsconfig.contracts.json",
17
18
  "generate:defs": "polkadot-types-from-defs --endpoint metadata.json --input ./src/interfaces --package @argonprotocol/mainchain/interfaces",
18
19
  "generate:meta": "polkadot-types-from-chain --endpoint metadata.json --output ./src/interfaces --package @argonprotocol/mainchain/interfaces --strict",
19
20
  "test": "vitest --run --config vitest.config.ts",
20
- "tsc": "yarn workspace @argonprotocol/ethereum-contracts build && tsup",
21
- "watch": "tsup --watch",
21
+ "tsc": "yarn workspace @argonprotocol/ethereum-contracts build && yarn generate:contract-declarations && tsup && yarn validate:package",
22
+ "tsup": "yarn tsc",
23
+ "validate:package": "tsx src/scripts/validatePackage.ts",
24
+ "watch": "yarn generate:contract-declarations && tsup --watch",
22
25
  "typecheck": "tsc --noEmit -p tsconfig.test.json"
23
26
  },
24
27
  "files": [
@@ -59,13 +62,12 @@
59
62
  "@polkadot/util": "^14.0.3",
60
63
  "@polkadot/util-crypto": "^14.0.3",
61
64
  "bignumber.js": "^9.3.1",
62
- "bs58check": "^4.0.0",
63
65
  "camelcase-keys": "^9.1.3",
64
66
  "viem": "^2.38.5"
65
67
  },
66
68
  "devDependencies": {
67
69
  "@argonprotocol/ethereum-contracts": "workspace:*",
68
- "@argonprotocol/testing": "1.4.11",
70
+ "@argonprotocol/testing": "1.4.12-dev.2afa6e4a",
69
71
  "@polkadot/typegen": "^16.5.6",
70
72
  "@substrate/ss58-registry": "^1.51.0",
71
73
  "@types/node": "^20",
@@ -1,5 +1,4 @@
1
1
  // Auto-generated via `yarn polkadot-types-from-chain`, do not edit
2
- /* eslint-disable */
3
2
 
4
3
  // import type lookup before we augment - in some environments
5
4
  // this is required to allow for ambient/previous definitions
@@ -51,6 +50,16 @@ declare module '@polkadot/api-base/types/consts' {
51
50
  **/
52
51
  maxReserves: u32 & AugmentedConst<ApiType>;
53
52
  };
53
+ bitcoinFissions: {
54
+ /**
55
+ * Maximum number of active Fissions that may allocate satoshis from one Lock.
56
+ **/
57
+ maxFissionsPerLock: u32 & AugmentedConst<ApiType>;
58
+ /**
59
+ * Minimum percentage change required to ratchet a Fission.
60
+ **/
61
+ minimumRatchetPercent: Percent & AugmentedConst<ApiType>;
62
+ };
54
63
  bitcoinLocks: {
55
64
  /**
56
65
  * Argon tick per day
@@ -82,6 +91,10 @@ declare module '@polkadot/api-base/types/consts' {
82
91
  * Maximum releasing utxos at a time
83
92
  **/
84
93
  maxConcurrentlyReleasingLocks: u32 & AugmentedConst<ApiType>;
94
+ /**
95
+ * Max bitcoin blocks up to which the first observed output may fund the Lock.
96
+ **/
97
+ maxPendingConfirmationBlocks: u64 & AugmentedConst<ApiType>;
85
98
  /**
86
99
  * Number of frames orphaned UTXO release entries are retained after a lock lifecycle
87
100
  * transition before being cleaned up.
@@ -94,26 +107,9 @@ declare module '@polkadot/api-base/types/consts' {
94
107
  };
95
108
  bitcoinUtxos: {
96
109
  /**
97
- * Maximum number of candidate UTXOs stored per lock
98
- **/
99
- maxCandidateUtxosPerLock: u32 & AugmentedConst<ApiType>;
100
- /**
101
- * Maximum number of satoshi difference allowed from expected to consider a UTXO as
102
- * "confirmed"
110
+ * Maximum number of outputs tracked for a single Lock address.
103
111
  **/
104
- maximumSatoshiThresholdFromExpected: u64 & AugmentedConst<ApiType>;
105
- /**
106
- * Maximum bitcoin blocks to watch a Utxo for confirmation before canceling
107
- **/
108
- maxPendingConfirmationBlocks: u64 & AugmentedConst<ApiType>;
109
- /**
110
- * The maximum number of UTXOs that can be watched in a block and/or expiring at same block
111
- **/
112
- maxPendingConfirmationUtxos: u32 & AugmentedConst<ApiType>;
113
- /**
114
- * The maximum number of expired pending funding entries cleaned up in a block
115
- **/
116
- maxPendingFundingExpirationsPerBlock: u32 & AugmentedConst<ApiType>;
112
+ maxUtxosPerLock: u32 & AugmentedConst<ApiType>;
117
113
  };
118
114
  blockRewards: {
119
115
  /**
@@ -375,6 +371,10 @@ declare module '@polkadot/api-base/types/consts' {
375
371
  * becomes operational.
376
372
  **/
377
373
  bitcoinLockSizeForAccessCode: u128 & AugmentedConst<ApiType>;
374
+ /**
375
+ * Maximum number of accrued access codes awarded at one frame boundary.
376
+ **/
377
+ maxAccessCodeAwardsPerFrame: u32 & AugmentedConst<ApiType>;
378
378
  /**
379
379
  * Maximum number of available access codes allowed at once.
380
380
  **/
@@ -646,11 +646,6 @@ declare module '@polkadot/api-base/types/consts' {
646
646
  batchedCallsLimit: u32 & AugmentedConst<ApiType>;
647
647
  };
648
648
  vaults: {
649
- /**
650
- * One no-fee stale `initialize_for` failure is allowed for each this-many units of lost
651
- * `available_for_lock`.
652
- **/
653
- capacityDropAttemptUnit: u128 & AugmentedConst<ApiType>;
654
649
  /**
655
650
  * Max concurrent cosigns pending per vault
656
651
  **/
@@ -659,10 +654,6 @@ declare module '@polkadot/api-base/types/consts' {
659
654
  * The max pending vault term changes per block
660
655
  **/
661
656
  maxPendingTermModificationsPerTick: u32 & AugmentedConst<ApiType>;
662
- /**
663
- * Maximum number of recent `available_for_lock` drops retained per vault.
664
- **/
665
- maxRecentCapacityDropsPerVault: u32 & AugmentedConst<ApiType>;
666
657
  /**
667
658
  * The max number of vaults that can be created
668
659
  **/
@@ -675,10 +666,6 @@ declare module '@polkadot/api-base/types/consts' {
675
666
  * Minimum vault securitization required while the operational floor lock is active.
676
667
  **/
677
668
  operationalMinimumVaultSecuritization: u128 & AugmentedConst<ApiType>;
678
- /**
679
- * Number of Argon blocks to keep recent `available_for_lock` drops for stale init checks.
680
- **/
681
- recentCapacityDropBlockWindow: u32 & AugmentedConst<ApiType>;
682
669
  /**
683
670
  * The number of frames within which revenue must be collected
684
671
  **/
@@ -61,6 +61,88 @@ declare module '@polkadot/api-base/types/errors' {
61
61
  **/
62
62
  VestingBalance: AugmentedError<ApiType>;
63
63
  };
64
+ bitcoinFissions: {
65
+ /**
66
+ * A Fission already exists under this owner and Fission ID.
67
+ **/
68
+ FissionAlreadyExists: AugmentedError<ApiType>;
69
+ /**
70
+ * A Fission must allocate at least one satoshi.
71
+ **/
72
+ FissionHasNoSatoshis: AugmentedError<ApiType>;
73
+ /**
74
+ * The submitted Fission ID is below the owner's current minimum.
75
+ **/
76
+ FissionIdBelowMinimum: AugmentedError<ApiType>;
77
+ /**
78
+ * The owner's Fission ID counter cannot be incremented.
79
+ **/
80
+ FissionIdOverflow: AugmentedError<ApiType>;
81
+ /**
82
+ * No Fission exists under this owner and Fission ID.
83
+ **/
84
+ FissionNotFound: AugmentedError<ApiType>;
85
+ /**
86
+ * The requested target-normalized BTC value is not present in recent price history.
87
+ **/
88
+ IneligibleMicrogonsAtTargetPerBtc: AugmentedError<ApiType>;
89
+ /**
90
+ * A source Lock has fewer active Fission satoshis than the Fission being closed.
91
+ **/
92
+ InsufficientFissionedSatoshis: AugmentedError<ApiType>;
93
+ /**
94
+ * A requested source Lock does not have enough unallocated funded satoshis.
95
+ **/
96
+ InsufficientFundedSatoshis: AugmentedError<ApiType>;
97
+ /**
98
+ * The Fission owner cannot burn the complete redemption amount.
99
+ **/
100
+ InsufficientFunds: AugmentedError<ApiType>;
101
+ /**
102
+ * A source Lock's securitization does not cover the requested allocation and liability.
103
+ **/
104
+ InsufficientSecuritization: AugmentedError<ApiType>;
105
+ /**
106
+ * The requested source Lock does not exist.
107
+ **/
108
+ LockNotFound: AugmentedError<ApiType>;
109
+ /**
110
+ * A requested source Lock has no confirmed funding satoshis.
111
+ **/
112
+ LockNotFunded: AugmentedError<ApiType>;
113
+ /**
114
+ * A requested source Lock is already in the release process.
115
+ **/
116
+ LockReleasePending: AugmentedError<ApiType>;
117
+ /**
118
+ * The requested price-history entry predates the Fission or Lock coverage floor.
119
+ **/
120
+ MicrogonsAtTargetPerBtcTickOlderThanCurrent: AugmentedError<ApiType>;
121
+ /**
122
+ * No current Bitcoin price is available to calculate the redemption amount.
123
+ **/
124
+ NoBitcoinPricesAvailable: AugmentedError<ApiType>;
125
+ /**
126
+ * The caller does not own a requested source Lock.
127
+ **/
128
+ NoPermissions: AugmentedError<ApiType>;
129
+ /**
130
+ * The Fission did not meet both the minimum change and Lock coverage requirements.
131
+ **/
132
+ NoRatchetingAvailable: AugmentedError<ApiType>;
133
+ /**
134
+ * A Fission allocation, liability, or identifier overflowed.
135
+ **/
136
+ Overflow: AugmentedError<ApiType>;
137
+ /**
138
+ * The Fission's ratchet counter cannot be incremented.
139
+ **/
140
+ RatchetNumberOverflow: AugmentedError<ApiType>;
141
+ /**
142
+ * The source Lock already has the maximum number of active Fissions.
143
+ **/
144
+ TooManyFissionsForLock: AugmentedError<ApiType>;
145
+ };
64
146
  bitcoinLocks: {
65
147
  /**
66
148
  * The proposed transaction would take the account below the minimum (existential) balance
@@ -98,6 +180,18 @@ declare module '@polkadot/api-base/types/errors' {
98
180
  * An overflow occurred recording a lock expiration
99
181
  **/
100
182
  ExpirationAtBlockOverflow: AugmentedError<ApiType>;
183
+ /**
184
+ * The fee coupon nonce is not the next unconsumed nonce.
185
+ **/
186
+ FeeCouponAlreadyUsed: AugmentedError<ApiType>;
187
+ /**
188
+ * The fee coupon is past its expiration frame.
189
+ **/
190
+ FeeCouponExpired: AugmentedError<ApiType>;
191
+ /**
192
+ * The Lock records fissioned satoshis without matching active Fission requirements.
193
+ **/
194
+ FissionStateMismatch: AugmentedError<ApiType>;
101
195
  /**
102
196
  * Cannot request an orphaned release for the funding UTXO
103
197
  **/
@@ -111,25 +205,37 @@ declare module '@polkadot/api-base/types/errors' {
111
205
  **/
112
206
  HoldUnexpectedlyModified: AugmentedError<ApiType>;
113
207
  /**
114
- * An ineligible microgon rate per btc was requested
208
+ * The requested target-normalized BTC value is not present in recent price history.
115
209
  **/
116
- IneligibleMicrogonRateRequested: AugmentedError<ApiType>;
210
+ IneligibleMicrogonsAtTargetPerBtcRequested: AugmentedError<ApiType>;
117
211
  InsufficientFunds: AugmentedError<ApiType>;
118
212
  /**
119
- * The minimum number of satoshis was not met
213
+ * The requested Lock securitization has fewer satoshis than its active Fissions.
214
+ **/
215
+ InsufficientSatoshisForFissions: AugmentedError<ApiType>;
216
+ /**
217
+ * The requested Lock securitization does not cover its active Fission liabilities.
120
218
  **/
121
- InsufficientSatoshisLocked: AugmentedError<ApiType>;
219
+ InsufficientSecuritizationForFissions: AugmentedError<ApiType>;
122
220
  InsufficientVaultFunds: AugmentedError<ApiType>;
123
221
  /**
124
222
  * The bitcoin script to lock this bitcoin has errors
125
223
  **/
126
224
  InvalidBitcoinScript: AugmentedError<ApiType>;
225
+ /**
226
+ * The fee coupon was not signed by the vault delegate.
227
+ **/
228
+ InvalidFeeCouponSignature: AugmentedError<ApiType>;
127
229
  /**
128
230
  * Funding would result in an overflow of the balance type
129
231
  **/
130
232
  InvalidVaultAmount: AugmentedError<ApiType>;
131
233
  /**
132
- * A lock in process of release cannot be ratcheted
234
+ * The Lock cannot be released while it has active Fissions.
235
+ **/
236
+ LockHasActiveFissions: AugmentedError<ApiType>;
237
+ /**
238
+ * A Lock in the release process cannot be resecuritized.
133
239
  **/
134
240
  LockInProcessOfRelease: AugmentedError<ApiType>;
135
241
  /**
@@ -144,6 +250,10 @@ declare module '@polkadot/api-base/types/errors' {
144
250
  * Too many orphaned utxo release requests for a lock
145
251
  **/
146
252
  MaxOrphanedUtxoReleaseRequestsExceeded: AugmentedError<ApiType>;
253
+ /**
254
+ * The requested price-history entry predates the Lock's current securitization.
255
+ **/
256
+ MicrogonsAtTargetPerBtcTickOlderThanCurrent: AugmentedError<ApiType>;
147
257
  /**
148
258
  * The price provider has no bitcoin prices available. This is a temporary error
149
259
  **/
@@ -153,9 +263,9 @@ declare module '@polkadot/api-base/types/errors' {
153
263
  **/
154
264
  NoPermissions: AugmentedError<ApiType>;
155
265
  /**
156
- * Nothing to ratchet
266
+ * The requested securitization matches the Lock's current securitization.
157
267
  **/
158
- NoRatchetingAvailable: AugmentedError<ApiType>;
268
+ NoResecuritizationChange: AugmentedError<ApiType>;
159
269
  /**
160
270
  * No Vault public keys are available
161
271
  **/
@@ -218,18 +328,14 @@ declare module '@polkadot/api-base/types/errors' {
218
328
  * Invalid bitcoin sync height attempted
219
329
  **/
220
330
  InvalidBitcoinSyncHeight: AugmentedError<ApiType>;
221
- /**
222
- * This Lock already has an attached funding UTXO
223
- **/
224
- LockAlreadyFunded: AugmentedError<ApiType>;
225
- /**
226
- * Too many candidate UTXOs are being stored for this lock
227
- **/
228
- MaxCandidateUtxosExceeded: AugmentedError<ApiType>;
229
331
  /**
230
332
  * Too many UTXOs are being watched
231
333
  **/
232
334
  MaxUtxosExceeded: AugmentedError<ApiType>;
335
+ /**
336
+ * Too many outputs have been observed at one Lock address.
337
+ **/
338
+ MaxUtxosPerLockExceeded: AugmentedError<ApiType>;
233
339
  /**
234
340
  * No Oracle-provided bitcoin block has been provided to the network
235
341
  **/
@@ -251,11 +357,7 @@ declare module '@polkadot/api-base/types/errors' {
251
357
  **/
252
358
  ScriptPubkeyConflict: AugmentedError<ApiType>;
253
359
  /**
254
- * The UTXO reference does not map to a candidate entry
255
- **/
256
- UtxoNotCandidate: AugmentedError<ApiType>;
257
- /**
258
- * Locked Utxo Not Found
360
+ * Watched Lock or attached UTXO not found.
259
361
  **/
260
362
  UtxoNotLocked: AugmentedError<ApiType>;
261
363
  };
@@ -1012,6 +1114,11 @@ declare module '@polkadot/api-base/types/errors' {
1012
1114
  * One of the linked account ownership proofs is invalid.
1013
1115
  **/
1014
1116
  InvalidAccountProof: AugmentedError<ApiType>;
1117
+ /**
1118
+ * Profile names must start with an uppercase ASCII letter and otherwise be ASCII
1119
+ * alphanumeric.
1120
+ **/
1121
+ InvalidName: AugmentedError<ApiType>;
1015
1122
  /**
1016
1123
  * The caller is not one of the accounts included in the registration.
1017
1124
  **/
@@ -1239,17 +1346,13 @@ declare module '@polkadot/api-base/types/errors' {
1239
1346
  **/
1240
1347
  BondLotAlreadyReleasing: AugmentedError<ApiType>;
1241
1348
  /**
1242
- * Only an active vault bond owned by its operator can be used as backfill.
1349
+ * Only an active vault bond owned by its operator can be used as flexible.
1243
1350
  **/
1244
- BondLotNotEligibleForBackfill: AugmentedError<ApiType>;
1351
+ BondLotCannotBeFlexible: AugmentedError<ApiType>;
1245
1352
  /**
1246
1353
  * The bond lot could not be found.
1247
1354
  **/
1248
1355
  BondLotNotFound: AugmentedError<ApiType>;
1249
- /**
1250
- * The vault doesn't have enough bitcoin security to support this bond purchase
1251
- **/
1252
- BondPurchaseAboveSecurity: AugmentedError<ApiType>;
1253
1356
  /**
1254
1357
  * The purchase is below the minimum amount.
1255
1358
  **/
@@ -1259,9 +1362,13 @@ declare module '@polkadot/api-base/types/errors' {
1259
1362
  **/
1260
1363
  BondPurchaseRejected: AugmentedError<ApiType>;
1261
1364
  /**
1262
- * The beneficiary already has a bond lot for this vault.
1365
+ * The bonus approval nonce has already been consumed or superseded.
1263
1366
  **/
1264
- BonusApprovalExistingBondLot: AugmentedError<ApiType>;
1367
+ BonusApprovalAlreadyUsed: AugmentedError<ApiType>;
1368
+ /**
1369
+ * The approved bonus plus the vault's profit sharing exceeds 100%.
1370
+ **/
1371
+ BonusApprovalExceedsProfitSharing: AugmentedError<ApiType>;
1265
1372
  /**
1266
1373
  * The bonus approval already expired.
1267
1374
  **/
@@ -1274,6 +1381,10 @@ declare module '@polkadot/api-base/types/errors' {
1274
1381
  * The bonus approval was signed for a different vault.
1275
1382
  **/
1276
1383
  BonusApprovalWrongVault: AugmentedError<ApiType>;
1384
+ /**
1385
+ * The vault doesn't have enough bitcoin security to support this bond purchase
1386
+ **/
1387
+ InsufficientBondSpace: AugmentedError<ApiType>;
1277
1388
  /**
1278
1389
  * An internal error occurred.
1279
1390
  **/
@@ -1362,10 +1473,6 @@ declare module '@polkadot/api-base/types/errors' {
1362
1473
  * The bitcoin script to lock this bitcoin has errors
1363
1474
  **/
1364
1475
  InvalidBitcoinScript: AugmentedError<ApiType>;
1365
- /**
1366
- * Treasury bond sharing plus bonus cannot exceed 100%.
1367
- **/
1368
- InvalidBondSharingTerms: AugmentedError<ApiType>;
1369
1476
  /**
1370
1477
  * An invalid securitization percent was provided for the vault. NOTE: it cannot be
1371
1478
  * decreased (or negative)
@@ -1375,11 +1482,6 @@ declare module '@polkadot/api-base/types/errors' {
1375
1482
  * Funding would result in an overflow of the balance type
1376
1483
  **/
1377
1484
  InvalidVaultAmount: AugmentedError<ApiType>;
1378
- /**
1379
- * Vault names must start with an uppercase ASCII letter and otherwise be ASCII
1380
- * alphanumeric.
1381
- **/
1382
- InvalidVaultName: AugmentedError<ApiType>;
1383
1485
  /**
1384
1486
  * Unable to decode xpubkey
1385
1487
  **/