@argonprotocol/mainchain 1.3.11 → 1.3.13

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
 
@@ -10865,10 +10865,12 @@ declare module '@polkadot/types/lookup' {
10865
10865
  readonly frameId: Compact<u64>;
10866
10866
  readonly bitcoinLockFeeRevenue: Compact<u128>;
10867
10867
  readonly bitcoinLocksCreated: Compact<u32>;
10868
- readonly bitcoinLocksMarketValue: Compact<u128>;
10869
- readonly bitcoinLocksTotalSatoshis: Compact<u64>;
10870
- readonly satoshisReleased: Compact<u64>;
10868
+ readonly bitcoinLocksNewLiquidityPromised: Compact<u128>;
10869
+ readonly bitcoinLocksReleasedLiquidity: Compact<u128>;
10870
+ readonly bitcoinLocksAddedSatoshis: Compact<u64>;
10871
+ readonly bitcoinLocksReleasedSatoshis: Compact<u64>;
10871
10872
  readonly securitizationActivated: Compact<u128>;
10873
+ readonly securitizationRelockable: Compact<u128>;
10872
10874
  readonly securitization: Compact<u128>;
10873
10875
  readonly treasuryVaultEarnings: Compact<u128>;
10874
10876
  readonly treasuryTotalEarnings: Compact<u128>;
@@ -11416,41 +11418,54 @@ declare class WageProtector {
11416
11418
  static create(client: ArgonClient): Promise<WageProtector>;
11417
11419
  }
11418
11420
 
11419
- declare class TxSubmitter {
11420
- readonly client: ArgonClient;
11421
- tx: SubmittableExtrinsic$1;
11422
- pair: KeyringPair;
11423
- constructor(client: ArgonClient, tx: SubmittableExtrinsic$1, pair: KeyringPair);
11424
- feeEstimate(tip?: bigint): Promise<bigint>;
11425
- canAfford(options?: {
11426
- tip?: bigint;
11427
- unavailableBalance?: bigint;
11428
- includeExistentialDeposit?: boolean;
11429
- }): Promise<{
11430
- canAfford: boolean;
11431
- availableBalance: bigint;
11432
- txFee: bigint;
11433
- }>;
11434
- submit(options?: Partial<SignerOptions> & {
11435
- logResults?: boolean;
11436
- waitForBlock?: boolean;
11437
- useLatestNonce?: boolean;
11438
- txProgressCallback?: ITxProgressCallback;
11439
- }): Promise<TxResult>;
11421
+ declare const MICROGONS_PER_ARGON = 1000000;
11422
+ declare function formatArgons(microgons: bigint | number): string;
11423
+ declare function gettersToObject<T>(obj: T): Promise<T>;
11424
+ declare function dispatchErrorToString(client: ArgonClient, error: DispatchError$1): string;
11425
+ declare class ExtrinsicError extends Error {
11426
+ readonly errorCode: string;
11427
+ readonly details?: string | undefined;
11428
+ readonly batchInterruptedIndex?: number | undefined;
11429
+ readonly txFee: bigint;
11430
+ constructor(errorCode: string, details?: string | undefined, batchInterruptedIndex?: number | undefined, txFee?: bigint);
11431
+ toString(): string;
11440
11432
  }
11433
+ declare function dispatchErrorToExtrinsicError(client: ArgonClient, error: DispatchError$1, batchInterruptedIndex?: number, txFee?: bigint): ExtrinsicError;
11434
+ /**
11435
+ * Check for an extrinsic success event in the given events. Helpful to validate the result of an extrinsic inclusion in a block (it will be included even if it fails)
11436
+ * @param events The events to check
11437
+ * @param client The client to use
11438
+ * @returns A promise that resolves if the extrinsic was successful, and rejects if it failed
11439
+ */
11440
+ declare function checkForExtrinsicSuccess(events: EventRecord[], client: ArgonClient): Promise<void>;
11441
+
11441
11442
  type ITxProgressCallback = (progressToInBlock: number, result?: TxResult) => void;
11442
11443
  declare class TxResult {
11443
- private readonly client;
11444
- private shouldLog;
11445
- inBlockPromise: Promise<Uint8Array>;
11446
- finalizedPromise: Promise<Uint8Array>;
11447
- status?: ISubmittableResult['status'];
11448
- readonly events: GenericEvent[];
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;
11449
11463
  /**
11450
11464
  * The index of the batch that was interrupted, if any.
11451
11465
  */
11452
11466
  batchInterruptedIndex?: number;
11453
- includedInBlock?: Uint8Array;
11467
+ blockHash?: Uint8Array;
11468
+ blockNumber?: number;
11454
11469
  /**
11455
11470
  * The final fee paid for the transaction, including the fee tip.
11456
11471
  */
@@ -11459,35 +11474,56 @@ declare class TxResult {
11459
11474
  * The fee tip paid for the transaction.
11460
11475
  */
11461
11476
  finalFeeTip?: bigint;
11462
- txProgressCallback?: ITxProgressCallback;
11463
- private inBlockResolve;
11464
- private inBlockReject;
11465
- private finalizedResolve;
11466
- private finalizedReject;
11467
- constructor(client: ArgonClient, shouldLog?: boolean);
11468
- onResult(result: ISubmittableResult): void;
11469
- private reject;
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;
11470
11500
  }
11471
11501
 
11472
- declare const MICROGONS_PER_ARGON = 1000000;
11473
- declare function formatArgons(microgons: bigint | number): string;
11474
- declare function gettersToObject<T>(obj: T): Promise<T>;
11475
- declare function dispatchErrorToString(client: ArgonClient, error: DispatchError$1): string;
11476
- declare class ExtrinsicError extends Error {
11477
- readonly errorCode: string;
11478
- readonly details?: string | undefined;
11479
- readonly batchInterruptedIndex?: number | undefined;
11480
- constructor(errorCode: string, details?: string | undefined, batchInterruptedIndex?: number | undefined);
11481
- toString(): string;
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;
11482
11526
  }
11483
- declare function dispatchErrorToExtrinsicError(client: ArgonClient, error: DispatchError$1, batchInterruptedIndex?: number): ExtrinsicError;
11484
- /**
11485
- * Check for an extrinsic success event in the given events. Helpful to validate the result of an extrinsic inclusion in a block (it will be included even if it fails)
11486
- * @param events The events to check
11487
- * @param client The client to use
11488
- * @returns A promise that resolves if the extrinsic was successful, and rejects if it failed
11489
- */
11490
- declare function checkForExtrinsicSuccess(events: EventRecord[], client: ArgonClient): Promise<void>;
11491
11527
 
11492
11528
  declare function keyringFromSuri(suri: string, cryptoType?: 'sr25519' | 'ed25519'): KeyringPair;
11493
11529
  declare function createKeyringPair(opts: {
@@ -11533,13 +11569,11 @@ declare class Vault {
11533
11569
  baseFee: bigint | number;
11534
11570
  bitcoinXpub: string;
11535
11571
  treasuryProfitSharing: number;
11536
- tip?: bigint;
11537
11572
  doNotExceedBalance?: bigint;
11538
- txProgressCallback?: ITxProgressCallback;
11539
- }, config?: {
11573
+ } & ISubmittableOptions, config?: {
11540
11574
  tickDurationMillis?: number;
11541
11575
  }): Promise<{
11542
- vault: Vault;
11576
+ getVault(): Promise<Vault>;
11543
11577
  txResult: TxResult;
11544
11578
  }>;
11545
11579
  }
@@ -11601,8 +11635,7 @@ declare class BitcoinLocks {
11601
11635
  utxoId: number;
11602
11636
  vaultSignature: Uint8Array;
11603
11637
  argonKeyring: KeyringPair;
11604
- txProgressCallback?: ITxProgressCallback;
11605
- }): Promise<TxResult>;
11638
+ } & ISubmittableOptions): Promise<TxResult>;
11606
11639
  getBitcoinLock(utxoId: number): Promise<IBitcoinLock | undefined>;
11607
11640
  /**
11608
11641
  * Finds the cosign signature for a vault lock by UTXO ID. Optionally waits for the signature
@@ -11628,6 +11661,9 @@ declare class BitcoinLocks {
11628
11661
  tx: _polkadot_api_types.SubmittableExtrinsic<"promise", _polkadot_types_types_extrinsic.ISubmittableResult>;
11629
11662
  securityFee: bigint;
11630
11663
  txFee: bigint;
11664
+ canAfford: boolean;
11665
+ availableBalance: bigint;
11666
+ txFeePlusTip: bigint;
11631
11667
  }>;
11632
11668
  getBitcoinLockFromTxResult(txResult: TxResult): Promise<{
11633
11669
  lock: IBitcoinLock;
@@ -11640,11 +11676,11 @@ declare class BitcoinLocks {
11640
11676
  ownerBitcoinPubkey: Uint8Array;
11641
11677
  argonKeyring: KeyringPair;
11642
11678
  satoshis: bigint;
11643
- tip?: bigint;
11644
- txProgressCallback?: ITxProgressCallback;
11645
- }): Promise<{
11646
- lock: IBitcoinLock;
11647
- createdAtHeight: number;
11679
+ } & ISubmittableOptions): Promise<{
11680
+ getLock(): Promise<{
11681
+ lock: IBitcoinLock;
11682
+ createdAtHeight: number;
11683
+ }>;
11648
11684
  txResult: TxResult;
11649
11685
  securityFee: bigint;
11650
11686
  }>;
@@ -11654,12 +11690,7 @@ declare class BitcoinLocks {
11654
11690
  priceIndex: PriceIndex;
11655
11691
  releaseRequest: IReleaseRequest;
11656
11692
  argonKeyring: KeyringPair;
11657
- tip?: bigint;
11658
- txProgressCallback?: ITxProgressCallback;
11659
- }): Promise<{
11660
- blockHash: Uint8Array;
11661
- blockHeight: number;
11662
- }>;
11693
+ } & ISubmittableOptions): Promise<TxResult>;
11663
11694
  releasePrice(priceIndex: PriceIndex, lock: {
11664
11695
  satoshis: bigint;
11665
11696
  peggedPrice: bigint;
@@ -11673,18 +11704,19 @@ declare class BitcoinLocks {
11673
11704
  lock: IBitcoinLock;
11674
11705
  priceIndex: PriceIndex;
11675
11706
  argonKeyring: KeyringPair;
11676
- tip?: bigint;
11677
11707
  vault: Vault;
11678
- txProgressCallback?: ITxProgressCallback;
11679
- }): Promise<{
11680
- securityFee: bigint;
11681
- txFee: bigint;
11682
- newPeggedPrice: bigint;
11683
- liquidityPromised: bigint;
11684
- pendingMint: bigint;
11685
- burned: bigint;
11686
- blockHeight: number;
11687
- 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
+ }>;
11688
11720
  }>;
11689
11721
  }
11690
11722
  interface IBitcoinLockConfig {
@@ -11740,4 +11772,4 @@ declare function waitForLoad(): Promise<void>;
11740
11772
  */
11741
11773
  declare function getClient(host: string, options?: ApiOptions): Promise<ArgonClient>;
11742
11774
 
11743
- 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 };