@argonprotocol/mainchain 1.5.2-dev.04b26899 → 1.5.2-dev.085c3add

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.
Files changed (37) hide show
  1. package/README.md +20 -0
  2. package/browser/artifacts/contracts/ArgonBuyAndTransfer.sol/ArgonBuyAndTransfer.json +573 -0
  3. package/browser/artifacts/contracts/ArgonToken.sol/ArgonToken.json +11 -11
  4. package/browser/artifacts/contracts/ArgonotToken.sol/ArgonotToken.json +11 -11
  5. package/browser/artifacts/contracts/MintingGateway.sol/MintingGateway.json +328 -16
  6. package/browser/artifacts/contracts/ProxyArtifacts.sol/ProxyAdmin.json +3 -3
  7. package/browser/artifacts/contracts/ProxyArtifacts.sol/TransparentUpgradeableProxy.json +4 -4
  8. package/browser/artifacts/contracts/StabilizationPoolHook.sol/StabilizationPoolHook.json +699 -0
  9. package/browser/artifacts/contracts/StabilizationPoolSubscriber.sol/StabilizationPoolSubscriber.json +187 -0
  10. package/browser/artifacts/contracts/UniswapV4PriceQuoter.sol/UniswapV4PriceQuoter.json +391 -0
  11. package/browser/index.d.ts +5475 -614
  12. package/browser/index.js +3907 -972
  13. package/browser/index.js.map +1 -1
  14. package/lib/artifacts/contracts/ArgonBuyAndTransfer.sol/ArgonBuyAndTransfer.json +573 -0
  15. package/lib/artifacts/contracts/ArgonToken.sol/ArgonToken.json +11 -11
  16. package/lib/artifacts/contracts/ArgonotToken.sol/ArgonotToken.json +11 -11
  17. package/lib/artifacts/contracts/MintingGateway.sol/MintingGateway.json +328 -16
  18. package/lib/artifacts/contracts/ProxyArtifacts.sol/ProxyAdmin.json +3 -3
  19. package/lib/artifacts/contracts/ProxyArtifacts.sol/TransparentUpgradeableProxy.json +4 -4
  20. package/lib/artifacts/contracts/StabilizationPoolHook.sol/StabilizationPoolHook.json +699 -0
  21. package/lib/artifacts/contracts/StabilizationPoolSubscriber.sol/StabilizationPoolSubscriber.json +187 -0
  22. package/lib/artifacts/contracts/UniswapV4PriceQuoter.sol/UniswapV4PriceQuoter.json +391 -0
  23. package/lib/index.cjs +3905 -964
  24. package/lib/index.cjs.map +1 -1
  25. package/lib/index.d.cts +5475 -614
  26. package/lib/index.d.ts +5475 -614
  27. package/lib/index.js +3918 -977
  28. package/lib/index.js.map +1 -1
  29. package/package.json +8 -7
  30. package/src/interfaces/augment-api-consts.ts +86 -0
  31. package/src/interfaces/augment-api-errors.ts +132 -3
  32. package/src/interfaces/augment-api-events.ts +255 -53
  33. package/src/interfaces/augment-api-query.ts +336 -48
  34. package/src/interfaces/augment-api-tx.ts +123 -33
  35. package/src/interfaces/lookup.ts +763 -310
  36. package/src/interfaces/registry.ts +70 -10
  37. package/src/interfaces/types-lookup.ts +829 -321
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argonprotocol/mainchain",
3
- "version": "1.5.2-dev.04b26899",
3
+ "version": "1.5.2-dev.085c3add",
4
4
  "description": "A client for accessing the Argon mainchain apis.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,16 +14,16 @@
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
+ "generate:contract-declarations": "yarn workspace @argonprotocol/ethereum-contracts build && tsc -p tsconfig.contracts.json",
18
18
  "generate:defs": "polkadot-types-from-defs --endpoint metadata.json --input ./src/interfaces --package @argonprotocol/mainchain/interfaces",
19
19
  "generate:meta": "polkadot-types-from-chain --endpoint metadata.json --output ./src/interfaces --package @argonprotocol/mainchain/interfaces --strict",
20
20
  "test": "vitest --run --config vitest.config.ts",
21
- "tsc": "yarn workspace @argonprotocol/ethereum-contracts build && yarn generate:contract-declarations && tsup && yarn validate:package",
21
+ "tsc": "yarn generate:contract-declarations && tsup && yarn validate:package",
22
22
  "tsup": "yarn tsc",
23
23
  "validate:package": "tsx src/scripts/validatePackage.ts",
24
24
  "backfill:flexible-bond-metrics": "tsx src/scripts/backfillFlexibleBondMetrics.ts",
25
25
  "watch": "yarn generate:contract-declarations && tsup --watch",
26
- "typecheck": "tsc --noEmit -p tsconfig.test.json"
26
+ "typecheck": "yarn workspace @argonprotocol/ethereum-contracts build && tsc --noEmit -p tsconfig.test.json"
27
27
  },
28
28
  "files": [
29
29
  "lib/",
@@ -51,8 +51,9 @@
51
51
  }
52
52
  },
53
53
  "dependencies": {
54
- "@ethereumjs/block": "^10.1.1",
55
- "@ethereumjs/mpt": "^10.1.1",
54
+ "@ethereumjs/block": "^10.1.3",
55
+ "@ethereumjs/common": "^10.1.3",
56
+ "@ethereumjs/mpt": "^10.1.3",
56
57
  "@polkadot/api": "^17.0.1",
57
58
  "@polkadot/api-base": "^17.0.1",
58
59
  "@polkadot/keyring": "^14.0.3",
@@ -68,7 +69,7 @@
68
69
  },
69
70
  "devDependencies": {
70
71
  "@argonprotocol/ethereum-contracts": "workspace:*",
71
- "@argonprotocol/testing": "1.5.2-dev.04b26899",
72
+ "@argonprotocol/testing": "1.5.2-dev.085c3add",
72
73
  "@polkadot/typegen": "^17.0.1",
73
74
  "@substrate/ss58-registry": "^1.51.0",
74
75
  "@types/node": "^20",
@@ -51,14 +51,26 @@ declare module '@polkadot/api-base/types/consts' {
51
51
  maxReserves: u32 & AugmentedConst<ApiType>;
52
52
  };
53
53
  bitcoinFissions: {
54
+ /**
55
+ * Fissions per Liquid covered by repayment benchmarks and checked by try-state.
56
+ **/
57
+ maxExpectedFissionsPerLiquid: u32 & AugmentedConst<ApiType>;
54
58
  /**
55
59
  * Maximum number of active Fissions that may allocate satoshis from one Lock.
56
60
  **/
57
61
  maxFissionsPerLock: u32 & AugmentedConst<ApiType>;
62
+ /**
63
+ * Maximum older frame records pruned in one block after gateway sync catches up.
64
+ **/
65
+ maxRValueHistoryPrunesPerBlock: u32 & AugmentedConst<ApiType>;
58
66
  /**
59
67
  * Minimum percentage change required to ratchet a Fission.
60
68
  **/
61
69
  minimumRatchetPercent: Percent & AugmentedConst<ApiType>;
70
+ /**
71
+ * Number of recent frame high-water marks retained after their source interval has synced.
72
+ **/
73
+ rValueHistoryFrames: u32 & AugmentedConst<ApiType>;
62
74
  };
63
75
  bitcoinLocks: {
64
76
  /**
@@ -442,6 +454,11 @@ declare module '@polkadot/api-base/types/consts' {
442
454
  * Minimum vault securitization required to become operational.
443
455
  **/
444
456
  operationalMinimumVaultSecuritization: u128 & AugmentedConst<ApiType>;
457
+ /**
458
+ * Required operational registration signing contract. Clients must require version 2
459
+ * before signing; older clients must upgrade rather than reuse ownership-only proofs.
460
+ **/
461
+ registrationProofVersion: u8 & AugmentedConst<ApiType>;
445
462
  };
446
463
  ownership: {
447
464
  /**
@@ -540,6 +557,61 @@ declare module '@polkadot/api-base/types/consts' {
540
557
  **/
541
558
  proxyDepositFactor: u128 & AugmentedConst<ApiType>;
542
559
  };
560
+ stabilizerBuys: {
561
+ /**
562
+ * Fraction of total matching basis admitted to rewards, independent of bid rates.
563
+ * Configure 90%; reserve up to that amount, bounded separately by available Treasury
564
+ * funding.
565
+ **/
566
+ auctionInclusionPercent: Percent & AugmentedConst<ApiType>;
567
+ /**
568
+ * Additional burn-funded reward before applying the purchase's auction result.
569
+ **/
570
+ liquidRepaymentRewardPercent: Percent & AugmentedConst<ApiType>;
571
+ /**
572
+ * Maximum account/frame purchase buckets visited in one account payout.
573
+ * This bounds work, without limiting the number of purchases an account can hold.
574
+ **/
575
+ maxFramesPerPayout: u32 & AugmentedConst<ApiType>;
576
+ /**
577
+ * Maximum Liquid repayments attempted across all account payouts in one block.
578
+ **/
579
+ maxLiquidRepaysPerBlock: u32 & AugmentedConst<ApiType>;
580
+ /**
581
+ * Maximum work in each automatic stage per block: ranked bid decisions, then account
582
+ * payout attempts. Failures and empty-auction completion consume work; excess stays
583
+ * queued.
584
+ **/
585
+ maxPayoutsPerBlock: u32 & AugmentedConst<ApiType>;
586
+ /**
587
+ * Positive submissions per account and auction; four allows an initial bid and three
588
+ * revisions.
589
+ **/
590
+ maxPositiveBids: u8 & AugmentedConst<ApiType>;
591
+ /**
592
+ * Maximum observation age at purchase time; also bounds historical lookup reads.
593
+ **/
594
+ maxPriceAgeTicks: u64 & AugmentedConst<ApiType>;
595
+ /**
596
+ * Maximum obsolete price entries removed per block after gateway sync advances.
597
+ **/
598
+ maxPriceHistoryPrunesPerBlock: u32 & AugmentedConst<ApiType>;
599
+ /**
600
+ * Maximum frame visits per repayment attempt; a partial frame visit also reads one tick.
601
+ **/
602
+ maxPriceWindowSteps: u32 & AugmentedConst<ApiType>;
603
+ /**
604
+ * Total mining-frame hold from admission, including the bidding window.
605
+ **/
606
+ purchaseHoldFrames: u64 & AugmentedConst<ApiType>;
607
+ };
608
+ stabilizerPools: {
609
+ /**
610
+ * Opening references retained in financial-day frames, including the checkpoint buffer.
611
+ * Zero disables history. Both production runtimes retain 30 frames plus a 3-frame buffer.
612
+ **/
613
+ maxFramePriceHistoryFrames: u32 & AugmentedConst<ApiType>;
614
+ };
543
615
  system: {
544
616
  /**
545
617
  * Maximum number of block number to block hash mappings to keep (oldest pruned first).
@@ -629,6 +701,16 @@ declare module '@polkadot/api-base/types/consts' {
629
701
  * The maximum percent of ownership-token circulation that can be bonded.
630
702
  **/
631
703
  maxArgonotBondedPercentOfCirculation: Percent & AugmentedConst<ApiType>;
704
+ /**
705
+ * Maximum accounts whose queued bond collateral is attempted in one block.
706
+ **/
707
+ maxBondCollateralSettlementsPerBlock: u32 & AugmentedConst<ApiType>;
708
+ /**
709
+ * Owner bond/stake lot count assumed by scan benchmarks and checked by try_state.
710
+ * Includes lots awaiting release. Purchases remain unrestricted and scans are not
711
+ * truncated.
712
+ **/
713
+ maxExpectedBondLotsPerAccount: u32 & AugmentedConst<ApiType>;
632
714
  /**
633
715
  * The maximum number of bond lots whose release delay may mature in a single frame.
634
716
  **/
@@ -684,6 +766,10 @@ declare module '@polkadot/api-base/types/consts' {
684
766
  upstreamBitcoinTarget: u128 & AugmentedConst<ApiType>;
685
767
  upstreamBitcoinWeight: Permill & AugmentedConst<ApiType>;
686
768
  upstreamBondTarget: u128 & AugmentedConst<ApiType>;
769
+ /**
770
+ * Maximum share of the full bid pool paid for vault Bitcoin participation.
771
+ **/
772
+ vaultBitcoinRewardPercent: Permill & AugmentedConst<ApiType>;
687
773
  };
688
774
  txPause: {
689
775
  /**
@@ -105,6 +105,22 @@ declare module '@polkadot/api-base/types/errors' {
105
105
  * The fee coupon is invalid, expired, or already consumed.
106
106
  **/
107
107
  InvalidFeeCoupon: AugmentedError<ApiType>;
108
+ /**
109
+ * Zero is reserved for the absence of a Liquid and cannot identify a new allocation.
110
+ **/
111
+ InvalidLiquidId: AugmentedError<ApiType>;
112
+ /**
113
+ * Fissions can join an existing Liquid only during its original creation tick.
114
+ **/
115
+ LiquidCreationWindowClosed: AugmentedError<ApiType>;
116
+ /**
117
+ * This owner has no active Fissions in the selected Liquid.
118
+ **/
119
+ LiquidNotFound: AugmentedError<ApiType>;
120
+ /**
121
+ * This owner's Liquid has unsettled repayment purchases, so it cannot close or ratchet.
122
+ **/
123
+ LiquidRepaymentPending: AugmentedError<ApiType>;
108
124
  /**
109
125
  * The requested source Lock does not exist.
110
126
  **/
@@ -141,6 +157,18 @@ declare module '@polkadot/api-base/types/errors' {
141
157
  * The Fission's ratchet counter cannot be incremented.
142
158
  **/
143
159
  RatchetNumberOverflow: AugmentedError<ApiType>;
160
+ /**
161
+ * The actual burn exceeds the remaining purchase budget.
162
+ **/
163
+ RepaymentBudgetExceeded: AugmentedError<ApiType>;
164
+ /**
165
+ * The repayment requests more satoshis than the Fission currently allocates.
166
+ **/
167
+ RepaymentExceedsFission: AugmentedError<ApiType>;
168
+ /**
169
+ * A repayment must return at least one satoshi to its source Lock.
170
+ **/
171
+ RepaymentHasNoSatoshis: AugmentedError<ApiType>;
144
172
  /**
145
173
  * The Vault could not upgrade the guarantee assigned to this Fission.
146
174
  **/
@@ -613,7 +641,7 @@ declare module '@polkadot/api-base/types/errors' {
613
641
  **/
614
642
  InvalidTransferCollateralUpdate: AugmentedError<ApiType>;
615
643
  /**
616
- * The transfer-out amount must be nonzero.
644
+ * The transfer-out amount is below the selected currency's minimum account balance.
617
645
  **/
618
646
  InvalidTransferOutAmount: AugmentedError<ApiType>;
619
647
  /**
@@ -803,6 +831,7 @@ declare module '@polkadot/api-base/types/errors' {
803
831
  ExecutionHeaderAnchorNotHistorical: AugmentedError<ApiType>;
804
832
  ExpectedFinalizedHeaderNotStored: AugmentedError<ApiType>;
805
833
  ForkDataHashTreeRootFailed: AugmentedError<ApiType>;
834
+ GloasForkAlreadyActive: AugmentedError<ApiType>;
806
835
  Halted: AugmentedError<ApiType>;
807
836
  HeaderHashTreeRootFailed: AugmentedError<ApiType>;
808
837
  InvalidBackfillHeaderRoot: AugmentedError<ApiType>;
@@ -811,6 +840,7 @@ declare module '@polkadot/api-base/types/errors' {
811
840
  * The gap between finalized headers is larger than the retained historical window.
812
841
  **/
813
842
  InvalidFinalizedHeaderGap: AugmentedError<ApiType>;
843
+ InvalidForkSchedule: AugmentedError<ApiType>;
814
844
  InvalidHeaderMerkleProof: AugmentedError<ApiType>;
815
845
  InvalidSyncCommitteeMerkleProof: AugmentedError<ApiType>;
816
846
  /**
@@ -1178,6 +1208,11 @@ declare module '@polkadot/api-base/types/errors' {
1178
1208
  * alphanumeric.
1179
1209
  **/
1180
1210
  InvalidName: AugmentedError<ApiType>;
1211
+ /**
1212
+ * The operational signature does not authorize this registration on this chain.
1213
+ * Clients using ownership-only proofs must upgrade to registration proof version 2.
1214
+ **/
1215
+ InvalidRegistrationProof: AugmentedError<ApiType>;
1181
1216
  /**
1182
1217
  * The caller is not one of the accounts included in the registration.
1183
1218
  **/
@@ -1286,6 +1321,10 @@ declare module '@polkadot/api-base/types/errors' {
1286
1321
  * Ethereum prices must be non-zero and correspond to the submitted price-index tick.
1287
1322
  **/
1288
1323
  InvalidEthereumPrices: AugmentedError<ApiType>;
1324
+ /**
1325
+ * A supplied USDC observation must be positive and no later than the current tick.
1326
+ **/
1327
+ InvalidUsdcPrice: AugmentedError<ApiType>;
1289
1328
  /**
1290
1329
  * Change in argon price is too large
1291
1330
  **/
@@ -1337,6 +1376,96 @@ declare module '@polkadot/api-base/types/errors' {
1337
1376
  **/
1338
1377
  Unproxyable: AugmentedError<ApiType>;
1339
1378
  };
1379
+ stabilizerBuys: {
1380
+ /**
1381
+ * No auction exists for the supplied admission frame.
1382
+ **/
1383
+ AuctionNotFound: AugmentedError<ApiType>;
1384
+ /**
1385
+ * Allocation was requested before the auction's Treasury budget was finalized.
1386
+ **/
1387
+ AuctionNotReady: AugmentedError<ApiType>;
1388
+ /**
1389
+ * The call is outside F+1 or the auction no longer accepts bids.
1390
+ **/
1391
+ BiddingClosed: AugmentedError<ApiType>;
1392
+ /**
1393
+ * Positive submissions are exhausted; zero may still opt out.
1394
+ **/
1395
+ BidLimitReached: AugmentedError<ApiType>;
1396
+ /**
1397
+ * A positive rate produces zero whole microgons against the matching basis.
1398
+ **/
1399
+ BidRoundsToZero: AugmentedError<ApiType>;
1400
+ /**
1401
+ * A positive bid repeats the account's current rate.
1402
+ **/
1403
+ BidUnchanged: AugmentedError<ApiType>;
1404
+ /**
1405
+ * The account has no purchase bucket for this auction.
1406
+ **/
1407
+ EntryNotFound: AugmentedError<ApiType>;
1408
+ /**
1409
+ * A repayment hold has not matured, its price window is incomplete, or its auction
1410
+ * result is not available yet.
1411
+ **/
1412
+ PayoutNotReady: AugmentedError<ApiType>;
1413
+ };
1414
+ stabilizerPools: {
1415
+ /**
1416
+ * The three account witnesses do not contain identical execution-block proofs.
1417
+ **/
1418
+ InconsistentProofBlocks: AugmentedError<ApiType>;
1419
+ /**
1420
+ * A deployment address is zero or reused, or the pool key fails ordering or encoding
1421
+ * bounds.
1422
+ **/
1423
+ InvalidPool: AugmentedError<ApiType>;
1424
+ /**
1425
+ * The packed PoolId mismatches, ticks are invalid/misaligned, or liquidity exceeds
1426
+ * uint128.
1427
+ **/
1428
+ InvalidPosition: AugmentedError<ApiType>;
1429
+ /**
1430
+ * The Ethereum verifier is unavailable, or header ancestry/account/storage authentication
1431
+ * fails.
1432
+ **/
1433
+ InvalidProof: AugmentedError<ApiType>;
1434
+ /**
1435
+ * A witness has the wrong slot count or slot addresses for the requested NFT position.
1436
+ **/
1437
+ InvalidStorageSlots: AugmentedError<ApiType>;
1438
+ /**
1439
+ * The NFT's subscriber or subscription flag is invalid, or its permanent revision is
1440
+ * zero.
1441
+ **/
1442
+ InvalidSubscription: AugmentedError<ApiType>;
1443
+ /**
1444
+ * The signer does not match the beneficiary encoded in the subscription witness.
1445
+ **/
1446
+ NotBeneficiary: AugmentedError<ApiType>;
1447
+ /**
1448
+ * This PoolManager/PoolId pair already has an immutable registration.
1449
+ **/
1450
+ PoolAlreadyRegistered: AugmentedError<ApiType>;
1451
+ /**
1452
+ * No approved configuration exists for the supplied PoolManager/PoolId pair.
1453
+ **/
1454
+ PoolNotRegistered: AugmentedError<ApiType>;
1455
+ /**
1456
+ * Beneficiary, subscriber, pool, tick range, or liquidity changed without a revision
1457
+ * increase.
1458
+ **/
1459
+ PositionChangedWithoutRevision: AugmentedError<ApiType>;
1460
+ /**
1461
+ * The subscriber revision is lower than the NFT's last accepted revision.
1462
+ **/
1463
+ RevisionRegressed: AugmentedError<ApiType>;
1464
+ /**
1465
+ * Ethereum block height or time does not strictly advance past the stored checkpoint.
1466
+ **/
1467
+ StaleCheckpoint: AugmentedError<ApiType>;
1468
+ };
1340
1469
  sudo: {
1341
1470
  /**
1342
1471
  * Sender must be the Sudo account.
@@ -1388,8 +1517,8 @@ declare module '@polkadot/api-base/types/errors' {
1388
1517
  ticks: {};
1389
1518
  treasury: {
1390
1519
  /**
1391
- * Liquidating this bond lot would take the account below its crosschain-encumbered
1392
- * treasury backing.
1520
+ * A reservation or liquidation would leave Treasury backing uncovered, or queued
1521
+ * settlement exceeds the account's remaining encumbrance.
1393
1522
  **/
1394
1523
  ActiveBondAmountBelowEncumberedBacking: AugmentedError<ApiType>;
1395
1524
  /**