@argonprotocol/mainchain 1.3.12 → 1.3.14

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.
@@ -93,12 +93,12 @@ import { SignerOptions, ApiDecoration, ApiOptions } from '@polkadot/api/types';
93
93
  export { ApiDecoration } from '@polkadot/api/types';
94
94
  import { SubmittableExtrinsic as SubmittableExtrinsic$1 } from '@polkadot/api/promise/types';
95
95
  export { SubmittableExtrinsic } from '@polkadot/api/promise/types';
96
+ import { DispatchError as DispatchError$1 } from '@polkadot/types/interfaces';
96
97
  import * as _polkadot_types_types_extrinsic from '@polkadot/types/types/extrinsic';
97
98
  import { ISubmittableResult } from '@polkadot/types/types/extrinsic';
98
99
  export { IExtrinsic, ISignerPayload, ISubmittableResult, Signer, SignerResult } from '@polkadot/types/types/extrinsic';
99
100
  import { GenericEvent } from '@polkadot/types/generic';
100
101
  export { GenericAddress, GenericBlock, GenericEvent } from '@polkadot/types/generic';
101
- import { DispatchError as DispatchError$1 } from '@polkadot/types/interfaces';
102
102
  import BigNumber from 'bignumber.js';
103
103
  export { hexToU8a, u8aEq, u8aToHex } from '@polkadot/util';
104
104
 
@@ -3814,7 +3814,7 @@ declare module '@polkadot/api-base/types/storage' {
3814
3814
  };
3815
3815
  miningSlot: {
3816
3816
  /**
3817
- * Lookup by account id to the corresponding index in MinersByCohort and MinerXorKeysByCohort
3817
+ * Lookup by account id to the corresponding index in MinersByCohort and MinerNoncesByCohort
3818
3818
  **/
3819
3819
  accountIndexLookup: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<ITuple<[u64, u32]>>>, [
3820
3820
  AccountId32
@@ -3852,17 +3852,17 @@ declare module '@polkadot/api-base/types/storage' {
3852
3852
  * Is the next slot still open for bids
3853
3853
  **/
3854
3854
  isNextSlotBiddingOpen: AugmentedQuery<ApiType, () => Observable<bool>, []>;
3855
+ /**
3856
+ * This is a lookup of each miner's nonce to use when picking a best authority to submit a block.
3857
+ * It's a blake2 256 hash of the miner account id and the block hash at time of activation.
3858
+ **/
3859
+ minerNoncesByCohort: AugmentedQuery<ApiType, () => Observable<BTreeMap<u64, Vec<U256>>>, []>;
3855
3860
  /**
3856
3861
  * Miners that are active in the current block (post initialize) by their starting frame
3857
3862
  **/
3858
3863
  minersByCohort: AugmentedQuery<ApiType, (arg: u64 | AnyNumber | Uint8Array) => Observable<Vec<ArgonPrimitivesBlockSealMiningRegistration>>, [
3859
3864
  u64
3860
3865
  ]>;
3861
- /**
3862
- * This is a lookup of each miner's XOR key to use. It's a blake2 256 hash of the miner account
3863
- * id and the block hash at time of activation.
3864
- **/
3865
- minerXorKeysByCohort: AugmentedQuery<ApiType, () => Observable<BTreeMap<u64, Vec<U256>>>, []>;
3866
3866
  /**
3867
3867
  * The mining slot configuration set in genesis
3868
3868
  **/
@@ -9796,7 +9796,7 @@ declare module '@polkadot/types/lookup' {
9796
9796
  readonly sealStrength: U256;
9797
9797
  readonly totalComputeDifficulty: U256;
9798
9798
  readonly voteCreatedBlocks: Compact<u128>;
9799
- readonly minerVoteXorDistance: Option<U256>;
9799
+ readonly minerNonceScore: Option<U256>;
9800
9800
  }
9801
9801
  /** @name ArgonPrimitivesDigestsNotebookDigest (170) */
9802
9802
  interface ArgonPrimitivesDigestsNotebookDigest extends Struct {
@@ -10261,7 +10261,7 @@ declare module '@polkadot/types/lookup' {
10261
10261
  readonly sourceNotebookNumber: Compact<u32>;
10262
10262
  readonly sourceNotebookProof: ArgonPrimitivesBalanceChangeMerkleProof;
10263
10263
  readonly blockVote: ArgonPrimitivesBlockVoteBlockVoteT;
10264
- readonly xorDistance: Option<U256>;
10264
+ readonly minerNonceScore: Option<U256>;
10265
10265
  } & Struct;
10266
10266
  readonly isCompute: boolean;
10267
10267
  readonly type: 'Vote' | 'Compute';
@@ -11418,59 +11418,6 @@ declare class WageProtector {
11418
11418
  static create(client: ArgonClient): Promise<WageProtector>;
11419
11419
  }
11420
11420
 
11421
- declare class TxSubmitter {
11422
- readonly client: ArgonClient;
11423
- tx: SubmittableExtrinsic$1;
11424
- pair: KeyringPair;
11425
- constructor(client: ArgonClient, tx: SubmittableExtrinsic$1, pair: KeyringPair);
11426
- feeEstimate(tip?: bigint): Promise<bigint>;
11427
- canAfford(options?: {
11428
- tip?: bigint;
11429
- unavailableBalance?: bigint;
11430
- includeExistentialDeposit?: boolean;
11431
- }): Promise<{
11432
- canAfford: boolean;
11433
- availableBalance: bigint;
11434
- txFee: bigint;
11435
- }>;
11436
- submit(options?: Partial<SignerOptions> & {
11437
- logResults?: boolean;
11438
- waitForBlock?: boolean;
11439
- useLatestNonce?: boolean;
11440
- txProgressCallback?: ITxProgressCallback;
11441
- }): Promise<TxResult>;
11442
- }
11443
- type ITxProgressCallback = (progressToInBlock: number, result?: TxResult) => void;
11444
- declare class TxResult {
11445
- private readonly client;
11446
- private shouldLog;
11447
- inBlockPromise: Promise<Uint8Array>;
11448
- finalizedPromise: Promise<Uint8Array>;
11449
- status?: ISubmittableResult['status'];
11450
- readonly events: GenericEvent[];
11451
- /**
11452
- * The index of the batch that was interrupted, if any.
11453
- */
11454
- batchInterruptedIndex?: number;
11455
- includedInBlock?: Uint8Array;
11456
- /**
11457
- * The final fee paid for the transaction, including the fee tip.
11458
- */
11459
- finalFee?: bigint;
11460
- /**
11461
- * The fee tip paid for the transaction.
11462
- */
11463
- finalFeeTip?: bigint;
11464
- txProgressCallback?: ITxProgressCallback;
11465
- private inBlockResolve;
11466
- private inBlockReject;
11467
- private finalizedResolve;
11468
- private finalizedReject;
11469
- constructor(client: ArgonClient, shouldLog?: boolean);
11470
- onResult(result: ISubmittableResult): void;
11471
- private reject;
11472
- }
11473
-
11474
11421
  declare const MICROGONS_PER_ARGON = 1000000;
11475
11422
  declare function formatArgons(microgons: bigint | number): string;
11476
11423
  declare function gettersToObject<T>(obj: T): Promise<T>;
@@ -11492,6 +11439,92 @@ declare function dispatchErrorToExtrinsicError(client: ArgonClient, error: Dispa
11492
11439
  */
11493
11440
  declare function checkForExtrinsicSuccess(events: EventRecord[], client: ArgonClient): Promise<void>;
11494
11441
 
11442
+ type ITxProgressCallback = (progressToInBlock: number, result?: TxResult) => void;
11443
+ declare class TxResult {
11444
+ #private;
11445
+ protected readonly client: ArgonClient;
11446
+ extrinsic: {
11447
+ signedHash: string;
11448
+ method: any;
11449
+ submittedTime: Date;
11450
+ submittedAtBlockNumber: number;
11451
+ accountAddress: string;
11452
+ };
11453
+ set isBroadcast(value: boolean);
11454
+ get isBroadcast(): boolean;
11455
+ set submissionError(value: Error);
11456
+ get submissionError(): Error | undefined;
11457
+ waitForFinalizedBlock: Promise<Uint8Array>;
11458
+ waitForInFirstBlock: Promise<Uint8Array>;
11459
+ events: GenericEvent[];
11460
+ extrinsicError: ExtrinsicError | Error | undefined;
11461
+ extrinsicIndex: number | undefined;
11462
+ txProgressCallback?: ITxProgressCallback;
11463
+ /**
11464
+ * The index of the batch that was interrupted, if any.
11465
+ */
11466
+ batchInterruptedIndex?: number;
11467
+ blockHash?: Uint8Array;
11468
+ blockNumber?: number;
11469
+ /**
11470
+ * The final fee paid for the transaction, including the fee tip.
11471
+ */
11472
+ finalFee?: bigint;
11473
+ /**
11474
+ * The fee tip paid for the transaction.
11475
+ */
11476
+ finalFeeTip?: bigint;
11477
+ txProgress: number;
11478
+ isFinalized: boolean;
11479
+ protected finalizedResolve: (block: Uint8Array) => void;
11480
+ protected finalizedReject: (error: ExtrinsicError | Error) => void;
11481
+ protected inBlockResolve: (block: Uint8Array) => void;
11482
+ protected inBlockReject: (error: ExtrinsicError | Error) => void;
11483
+ constructor(client: ArgonClient, extrinsic: {
11484
+ signedHash: string;
11485
+ method: any;
11486
+ submittedTime: Date;
11487
+ submittedAtBlockNumber: number;
11488
+ accountAddress: string;
11489
+ });
11490
+ setSeenInBlock(block: {
11491
+ blockHash: Uint8Array;
11492
+ blockNumber?: number;
11493
+ extrinsicIndex: number;
11494
+ events: GenericEvent[];
11495
+ }): Promise<void>;
11496
+ setFinalized(): void;
11497
+ onSubscriptionResult(result: ISubmittableResult): void;
11498
+ private updateProgress;
11499
+ private parseEvents;
11500
+ }
11501
+
11502
+ type ISubmittableOptions = Partial<SignerOptions> & {
11503
+ tip?: bigint;
11504
+ logResults?: boolean;
11505
+ useLatestNonce?: boolean;
11506
+ txProgressCallback?: ITxProgressCallback;
11507
+ disableAutomaticTxTracking?: boolean;
11508
+ };
11509
+ declare class TxSubmitter {
11510
+ readonly client: ArgonClient;
11511
+ tx: SubmittableExtrinsic$1;
11512
+ pair: KeyringPair;
11513
+ constructor(client: ArgonClient, tx: SubmittableExtrinsic$1, pair: KeyringPair);
11514
+ feeEstimate(tip?: bigint): Promise<bigint>;
11515
+ canAfford(options?: {
11516
+ tip?: bigint;
11517
+ unavailableBalance?: bigint;
11518
+ includeExistentialDeposit?: boolean;
11519
+ }): Promise<{
11520
+ canAfford: boolean;
11521
+ availableBalance: bigint;
11522
+ txFee: bigint;
11523
+ }>;
11524
+ submit(options?: ISubmittableOptions): Promise<TxResult>;
11525
+ private logRequest;
11526
+ }
11527
+
11495
11528
  declare function keyringFromSuri(suri: string, cryptoType?: 'sr25519' | 'ed25519'): KeyringPair;
11496
11529
  declare function createKeyringPair(opts: {
11497
11530
  cryptoType?: 'sr25519' | 'ed25519';
@@ -11536,13 +11569,11 @@ declare class Vault {
11536
11569
  baseFee: bigint | number;
11537
11570
  bitcoinXpub: string;
11538
11571
  treasuryProfitSharing: number;
11539
- tip?: bigint;
11540
11572
  doNotExceedBalance?: bigint;
11541
- txProgressCallback?: ITxProgressCallback;
11542
- }, config?: {
11573
+ } & ISubmittableOptions, config?: {
11543
11574
  tickDurationMillis?: number;
11544
11575
  }): Promise<{
11545
- vault: Vault;
11576
+ getVault(): Promise<Vault>;
11546
11577
  txResult: TxResult;
11547
11578
  }>;
11548
11579
  }
@@ -11604,8 +11635,7 @@ declare class BitcoinLocks {
11604
11635
  utxoId: number;
11605
11636
  vaultSignature: Uint8Array;
11606
11637
  argonKeyring: KeyringPair;
11607
- txProgressCallback?: ITxProgressCallback;
11608
- }): Promise<TxResult>;
11638
+ } & ISubmittableOptions): Promise<TxResult>;
11609
11639
  getBitcoinLock(utxoId: number): Promise<IBitcoinLock | undefined>;
11610
11640
  /**
11611
11641
  * Finds the cosign signature for a vault lock by UTXO ID. Optionally waits for the signature
@@ -11646,11 +11676,11 @@ declare class BitcoinLocks {
11646
11676
  ownerBitcoinPubkey: Uint8Array;
11647
11677
  argonKeyring: KeyringPair;
11648
11678
  satoshis: bigint;
11649
- tip?: bigint;
11650
- txProgressCallback?: ITxProgressCallback;
11651
- }): Promise<{
11652
- lock: IBitcoinLock;
11653
- createdAtHeight: number;
11679
+ } & ISubmittableOptions): Promise<{
11680
+ getLock(): Promise<{
11681
+ lock: IBitcoinLock;
11682
+ createdAtHeight: number;
11683
+ }>;
11654
11684
  txResult: TxResult;
11655
11685
  securityFee: bigint;
11656
11686
  }>;
@@ -11660,12 +11690,7 @@ declare class BitcoinLocks {
11660
11690
  priceIndex: PriceIndex;
11661
11691
  releaseRequest: IReleaseRequest;
11662
11692
  argonKeyring: KeyringPair;
11663
- tip?: bigint;
11664
- txProgressCallback?: ITxProgressCallback;
11665
- }): Promise<{
11666
- blockHash: Uint8Array;
11667
- blockHeight: number;
11668
- }>;
11693
+ } & ISubmittableOptions): Promise<TxResult>;
11669
11694
  releasePrice(priceIndex: PriceIndex, lock: {
11670
11695
  satoshis: bigint;
11671
11696
  peggedPrice: bigint;
@@ -11679,18 +11704,19 @@ declare class BitcoinLocks {
11679
11704
  lock: IBitcoinLock;
11680
11705
  priceIndex: PriceIndex;
11681
11706
  argonKeyring: KeyringPair;
11682
- tip?: bigint;
11683
11707
  vault: Vault;
11684
- txProgressCallback?: ITxProgressCallback;
11685
- }): Promise<{
11686
- securityFee: bigint;
11687
- txFee: bigint;
11688
- newPeggedPrice: bigint;
11689
- liquidityPromised: bigint;
11690
- pendingMint: bigint;
11691
- burned: bigint;
11692
- blockHeight: number;
11693
- bitcoinBlockHeight: number;
11708
+ } & ISubmittableOptions): Promise<{
11709
+ txResult: TxResult;
11710
+ getRatchetResult: () => Promise<{
11711
+ securityFee: bigint;
11712
+ txFee: bigint;
11713
+ newPeggedPrice: bigint;
11714
+ liquidityPromised: bigint;
11715
+ pendingMint: bigint;
11716
+ burned: bigint;
11717
+ blockHeight: number;
11718
+ bitcoinBlockHeight: number;
11719
+ }>;
11694
11720
  }>;
11695
11721
  }
11696
11722
  interface IBitcoinLockConfig {
@@ -11746,4 +11772,4 @@ declare function waitForLoad(): Promise<void>;
11746
11772
  */
11747
11773
  declare function getClient(host: string, options?: ApiOptions): Promise<ArgonClient>;
11748
11774
 
11749
- export { type ArgonClient, BitcoinLocks, ExtrinsicError, FIXED_U128_DECIMALS, type IBitcoinLock, type IBitcoinLockConfig, type IReleaseRequest, type IReleaseRequestDetails, type ITerms, type ITxProgressCallback, MICROGONS_PER_ARGON, PERMILL_DECIMALS, PriceIndex, SATS_PER_BTC, TxResult, TxSubmitter, Vault, WageProtector, checkForExtrinsicSuccess, createKeyringPair, dispatchErrorToExtrinsicError, dispatchErrorToString, formatArgons, fromFixedNumber, getAuthorFromHeader, getClient, getTickFromHeader, gettersToObject, keyringFromSuri, toFixedNumber, waitForLoad };
11775
+ export { type ArgonClient, BitcoinLocks, ExtrinsicError, FIXED_U128_DECIMALS, type IBitcoinLock, type IBitcoinLockConfig, type IReleaseRequest, type IReleaseRequestDetails, type ISubmittableOptions, type ITerms, type ITxProgressCallback, MICROGONS_PER_ARGON, PERMILL_DECIMALS, PriceIndex, SATS_PER_BTC, TxResult, TxSubmitter, Vault, WageProtector, checkForExtrinsicSuccess, createKeyringPair, dispatchErrorToExtrinsicError, dispatchErrorToString, formatArgons, fromFixedNumber, getAuthorFromHeader, getClient, getTickFromHeader, gettersToObject, keyringFromSuri, toFixedNumber, waitForLoad };