@argonprotocol/mainchain 1.3.2 → 1.3.3

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/lib/index.d.ts CHANGED
@@ -1,20 +1,23 @@
1
1
  import * as _polkadot_api_base_types from '@polkadot/api-base/types';
2
2
  import { ApiTypes, AugmentedConst, AugmentedError, AugmentedEvent, AugmentedQuery, AugmentedSubmittable, SubmittableExtrinsic, AugmentedCall } from '@polkadot/api-base/types';
3
3
  import { u128, u32, u64, u16, u8, bool, Bytes, Vec, Option, U8aFixed, U256, i128, Result, Null, BTreeSet, BTreeMap, Compact, Text, HashMap, U64, f64, Json, BitVec, Bool, f32, F32, F64, I128, i16, I16, i256, I256, i32, I32, i64, I64, i8, I8, isize, ISize, OptionBool, Raw, Type, U128, U16, u256, U32, U8, usize, USize, Struct, Enum } from '@polkadot/types-codec';
4
+ export { BTreeMap, Bool, Bytes, Compact, Enum, Null, Option, Range, Result, Struct, Text, Tuple, U256, U8aFixed, Vec, bool, i128, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
4
5
  import { ITuple, AnyNumber, IMethod, Codec } from '@polkadot/types-codec/types';
5
- export * from '@polkadot/types-codec/types';
6
+ export { Codec, ITuple } from '@polkadot/types-codec/types';
6
7
  import { Percent, AccountId32, H256, MultiAddress, Call, Hash, SignedBlock, BlockNumber, Header, StorageData, AccountId, Justification, H160, H64, KeyValue, Index, Block, ExtrinsicInclusionMode, KeyTypeId, Balance, Weight, AccountId20, AccountId33, AccountIdOf, AccountIndex, Address, AssetId, BalanceOf, BlockNumberFor, BlockNumberOf, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H2048, H32, H512, HeaderPartial, I32F32, IndicesLookupSource, Justifications, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletsOrigin, PalletVersion, Pays, Perbill, Permill, Perquintill, PerU16, Phantom, PhantomData, PreRuntime, Releases, RuntimeCall, RuntimeDbWeight, RuntimeEvent, Seal, SealV0, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, SlotDuration, StorageInfo, StorageProof, TransactionInfo, TransactionLongevity, TransactionPriority, TransactionStorageProof, TransactionTag, U32F32, ValidatorId, ValidatorIdOf, WeightMultiplier, WeightV0, WeightV1, WeightV2 } from '@polkadot/types/interfaces/runtime';
8
+ export { AccountId, AccountId32, Block, Call, H160, H256, Header, MultiAddress, Permill } from '@polkadot/types/interfaces/runtime';
7
9
  import { FrameSupportPalletId, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpWeightsRuntimeDbWeight, SpVersionRuntimeVersion, FrameSupportTokensMiscBalanceStatus, SpRuntimeDispatchError, ArgonPrimitivesBitcoinUtxoRef, ArgonPrimitivesBitcoinBitcoinRejectedReason, ArgonPrimitivesBlockSealBlockPayout, PalletDomainsDomainRegistration, ArgonPrimitivesDomainZoneRecord, ArgonRuntimeOriginCaller, SpConsensusGrandpaAppPublic, PalletHyperbridgeVersionedHostParams, PalletIsmpErrorsHandlingError, IsmpEventsRequestResponseHandled, IsmpEventsTimeoutHandled, IsmpHostStateMachine, IsmpConsensusStateMachineHeight, IsmpConsensusStateMachineId, ArgonPrimitivesBlockSealMiningRegistration, PalletMintMintType, PalletMultisigTimepoint, ArgonPrimitivesNotaryNotaryRecord, ArgonPrimitivesNotaryNotaryMeta, ArgonNotaryAuditErrorVerifyError, PalletProxyDepositKind, ArgonRuntimeProxyType, FrameSystemDispatchEventInfo, PalletBalancesAccountData, FrameSupportTokensMiscIdAmountRuntimeFreezeReason, FrameSupportTokensMiscIdAmountRuntimeHoldReason, PalletBalancesBalanceLock, PalletBalancesReserveData, PalletBitcoinLocksLockedBitcoin, PalletBitcoinLocksLockReleaseRequest, ArgonPrimitivesBitcoinBitcoinNetwork, ArgonPrimitivesBitcoinBitcoinBlock, ArgonPrimitivesBitcoinUtxoValue, ArgonPrimitivesForkPower, ArgonPrimitivesProvidersBlockSealerInfo, ArgonPrimitivesInherentsBlockSealInherent, ArgonPrimitivesDigestsBlockVoteDigest, ArgonPrimitivesNotaryNotaryNotebookVoteDigestDetails, PalletChainTransferQueuedTransferOut, ArgonPrimitivesDigestsDigestset, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, IsmpConsensusStateCommitment, PalletLiquidityPoolsLiquidityPoolCapital, PalletLiquidityPoolsPrebondedArgons, PalletLiquidityPoolsLiquidityPool, ArgonPrimitivesBlockSealMiningBidStats, ArgonPrimitivesBlockSealMiningSlotConfig, PalletMintMintAction, PalletMultisigMultisig, ArgonPrimitivesBalanceChangeAccountOrigin, ArgonPrimitivesDigestsNotebookDigest, ArgonPrimitivesNotaryNotaryNotebookKeyDetails, PalletPriceIndexPriceIndex, PalletProxyAnnouncement, PalletProxyProxyDefinition, FrameSystemAccountInfo, FrameSystemCodeUpgradeAuthorization, FrameSupportDispatchPerDispatchClassWeight, SpRuntimeDigest, FrameSystemEventRecord, FrameSystemPhase, SpWeightsWeightV2Weight, FrameSystemLastRuntimeUpgradeInfo, ArgonPrimitivesTickTicker, PalletTransactionPaymentReleases, PalletVaultsVaultFrameFeeRevenue, ArgonPrimitivesVault, ArgonPrimitivesBitcoinBitcoinXPub, PalletBalancesAdjustmentDirection, ArgonPrimitivesBitcoinCompressedBitcoinPubkey, ArgonPrimitivesBitcoinH256Le, ArgonPrimitivesInherentsBitcoinUtxoSync, SpConsensusGrandpaEquivocationProof, SpCoreVoid, IsmpMessagingCreateConsensusState, PalletIsmpUtilsFundMessageParams, IsmpMessagingMessage, PalletIsmpUtilsUpdateConsensusState, IsmpGrandpaAddStateMachine, ArgonRuntimeSessionKeys, ArgonPrimitivesNotebookSignedNotebookHeader, PalletTokenGatewayAssetRegistration, PalletTokenGatewayTeleportParams, PalletTokenGatewayPrecisionUpdate, TokenGatewayPrimitivesGatewayAssetUpdate, PalletVaultsVaultConfig, ArgonPrimitivesVaultVaultTerms, ArgonPrimitivesBitcoinOpaqueBitcoinXpub } from '@polkadot/types/lookup';
8
10
  export * from '@polkadot/types/lookup';
9
11
  import * as _polkadot_types_types from '@polkadot/types/types';
10
12
  import { Observable, IExtrinsic } from '@polkadot/types/types';
11
13
  import { AugmentedRpc } from '@polkadot/rpc-core/types';
12
- import { StorageKey, Metadata, Data, GenericEvent, Header as Header$2, ArgonPrimitivesVault as ArgonPrimitivesVault$1, ArgonPrimitivesBitcoinBitcoinNetwork as ArgonPrimitivesBitcoinBitcoinNetwork$1 } from '@polkadot/types';
13
- export * from '@polkadot/types';
14
+ import { StorageKey, Metadata, Data, GenericEvent as GenericEvent$1 } from '@polkadot/types';
14
15
  import { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
16
+ export { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
15
17
  import { EpochAuthorship, OpaqueKeyOwnershipProof, AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeGenesisConfiguration, BabeGenesisConfigurationV1, BabeWeight, Epoch, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe';
16
18
  import { BeefyVersionedFinalityProof, BeefyAuthoritySet, BeefyCommitment, BeefyCompactSignedCommitment, BeefyEquivocationProof, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefyPayloadId, BeefySignedCommitment, BeefyVoteMessage, MmrRootHash, ValidatorSet, ValidatorSetId } from '@polkadot/types/interfaces/beefy';
17
19
  import { BlockHash } from '@polkadot/types/interfaces/chain';
20
+ export { BlockHash } from '@polkadot/types/interfaces/chain';
18
21
  import { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
19
22
  import { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';
20
23
  import { ContractCallRequest, ContractExecResult, InstantiateRequestV1, ContractInstantiateResult, CodeUploadRequest, CodeUploadResult, AliveContractInfo, CodeHash, CodeSource, CodeUploadResultValue, ContractCallFlags, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractExecResultU64, ContractInfo, ContractInstantiateResultTo267, ContractInstantiateResultTo299, ContractInstantiateResultU64, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateRequestV2, InstantiateReturnValue, InstantiateReturnValueOk, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
@@ -90,9 +93,11 @@ export { KeypairType } from '@polkadot/util-crypto/types';
90
93
  import { ISubmittableResult } from '@polkadot/types/types/extrinsic';
91
94
  import { SubmittableExtrinsic as SubmittableExtrinsic$1 } from '@polkadot/api/promise/types';
92
95
  import { SignerOptions, ApiDecoration } from '@polkadot/api/types';
96
+ import { GenericEvent } from '@polkadot/types/generic';
97
+ export { GenericAddress, GenericBlock, GenericEvent } from '@polkadot/types/generic';
93
98
  import BigNumber from 'bignumber.js';
94
- import { DispatchError as DispatchError$1, Header as Header$1 } from '@polkadot/types/interfaces';
95
- export * from '@polkadot/types/interfaces';
99
+ import { DispatchError as DispatchError$1, Header as Header$1, ExtrinsicStatus as ExtrinsicStatus$1 } from '@polkadot/types/interfaces';
100
+ export { hexToU8a, u8aEq, u8aToHex } from '@polkadot/util';
96
101
 
97
102
  declare module '@polkadot/api-base/types/consts' {
98
103
  interface AugmentedConsts<ApiType extends ApiTypes> {
@@ -1779,12 +1784,14 @@ declare module '@polkadot/api-base/types/events' {
1779
1784
  utxoId: u64,
1780
1785
  vaultId: u32,
1781
1786
  lockPrice: u128,
1782
- accountId: AccountId32
1787
+ accountId: AccountId32,
1788
+ securityFee: u128
1783
1789
  ], {
1784
1790
  utxoId: u64;
1785
1791
  vaultId: u32;
1786
1792
  lockPrice: u128;
1787
1793
  accountId: AccountId32;
1794
+ securityFee: u128;
1788
1795
  }>;
1789
1796
  BitcoinLockRatcheted: AugmentedEvent<ApiType, [
1790
1797
  utxoId: u64,
@@ -3179,12 +3186,14 @@ declare module '@polkadot/api-base/types/events' {
3179
3186
  vaultId: u32,
3180
3187
  locker: AccountId32,
3181
3188
  amount: u128,
3182
- isRatchet: bool
3189
+ isRatchet: bool,
3190
+ feeRevenue: u128
3183
3191
  ], {
3184
3192
  vaultId: u32;
3185
3193
  locker: AccountId32;
3186
3194
  amount: u128;
3187
3195
  isRatchet: bool;
3196
+ feeRevenue: u128;
3188
3197
  }>;
3189
3198
  FundsReleased: AugmentedEvent<ApiType, [
3190
3199
  vaultId: u32,
@@ -8562,6 +8571,7 @@ declare module '@polkadot/types/lookup' {
8562
8571
  readonly locker: AccountId32;
8563
8572
  readonly amount: u128;
8564
8573
  readonly isRatchet: bool;
8574
+ readonly feeRevenue: u128;
8565
8575
  } & Struct;
8566
8576
  readonly isFundLockCanceled: boolean;
8567
8577
  readonly asFundLockCanceled: {
@@ -8601,6 +8611,7 @@ declare module '@polkadot/types/lookup' {
8601
8611
  readonly vaultId: u32;
8602
8612
  readonly lockPrice: u128;
8603
8613
  readonly accountId: AccountId32;
8614
+ readonly securityFee: u128;
8604
8615
  } & Struct;
8605
8616
  readonly isBitcoinLockRatcheted: boolean;
8606
8617
  readonly asBitcoinLockRatcheted: {
@@ -11243,6 +11254,7 @@ declare class TxSubmitter {
11243
11254
  logResults?: boolean;
11244
11255
  waitForBlock?: boolean;
11245
11256
  useLatestNonce?: boolean;
11257
+ onResultCallback?: (result: ISubmittableResult) => void;
11246
11258
  }): Promise<TxResult>;
11247
11259
  }
11248
11260
  declare class TxResult {
@@ -11265,6 +11277,7 @@ declare class TxResult {
11265
11277
  * The fee tip paid for the transaction.
11266
11278
  */
11267
11279
  finalFeeTip?: bigint;
11280
+ onResultCallback?: (result: ISubmittableResult) => void;
11268
11281
  private inBlockResolve;
11269
11282
  private inBlockReject;
11270
11283
  private finalizedResolve;
@@ -11291,7 +11304,8 @@ type NonNullableProps<T> = {
11291
11304
  };
11292
11305
  declare function filterUndefined<T extends Record<string, any>>(obj: Partial<T>): NonNullableProps<T>;
11293
11306
  declare function gettersToObject<T>(obj: T): Promise<T>;
11294
- declare function toFixedNumber(value: number, base: number): bigint;
11307
+ declare function toFixedNumber(value: string | number | BigNumber, // accept string to avoid early precision loss
11308
+ decimals: number): bigint;
11295
11309
  declare function convertNumberToFixedU128(value: number): bigint;
11296
11310
  declare function convertFixedU128ToBigNumber(fixedU128: bigint): BigNumber;
11297
11311
  declare function convertPermillToBigNumber(permill: bigint): BigNumber;
@@ -11389,7 +11403,7 @@ declare class FrameCalculator {
11389
11403
  private genesisTick;
11390
11404
  getForTick(client: ArgonClient, tick: number): Promise<number>;
11391
11405
  getTickRangeForFrame(client: ArgonClient, frameId: number): Promise<[number, number]>;
11392
- getForHeader(client: ArgonClient, header: Header$2): Promise<number | undefined>;
11406
+ getForHeader(client: ArgonClient, header: Header): Promise<number | undefined>;
11393
11407
  private getConfig;
11394
11408
  }
11395
11409
 
@@ -11413,18 +11427,16 @@ declare class AccountMiners {
11413
11427
  }>;
11414
11428
  frameCalculator: FrameCalculator;
11415
11429
  private trackedAccountsByAddress;
11416
- constructor(accountset: Accountset, registeredMiners: {
11417
- startingFrameId: number;
11418
- address: string;
11419
- subaccountIndex: number;
11420
- }[], options?: {
11430
+ constructor(accountset: Accountset, registeredMiners: (ISubaccountMiner & {
11431
+ seat: IMiningIndex;
11432
+ })[], options?: {
11421
11433
  shouldLog: boolean;
11422
11434
  });
11423
11435
  watch(): Promise<BlockWatch>;
11424
11436
  onBlock(header: Header, digests: {
11425
11437
  author: string;
11426
11438
  tick: number;
11427
- }, events: GenericEvent[]): Promise<{
11439
+ }, events: GenericEvent$1[]): Promise<{
11428
11440
  [cohortStartingFrameId: number]: {
11429
11441
  argonsMinted: bigint;
11430
11442
  argonsMined: bigint;
@@ -11444,13 +11456,14 @@ type IAddressNames = Map<string, string>;
11444
11456
  interface ISubaccountMiner {
11445
11457
  address: string;
11446
11458
  subaccountIndex: number;
11447
- seat?: {
11448
- frameId: number;
11449
- index: number;
11450
- bidAmount: bigint;
11451
- };
11459
+ seat?: IMiningIndex;
11452
11460
  isLastDay: boolean;
11453
11461
  }
11462
+ interface IMiningIndex {
11463
+ startingFrameId: number;
11464
+ index: number;
11465
+ bidAmount: bigint;
11466
+ }
11454
11467
  declare class Accountset {
11455
11468
  txSubmitterPair: KeyringPair;
11456
11469
  isProxy: boolean;
@@ -11569,10 +11582,7 @@ interface IAccountStatus {
11569
11582
  address: string;
11570
11583
  argons: string;
11571
11584
  argonots: string;
11572
- seat?: {
11573
- frameId: number;
11574
- index: number;
11575
- };
11585
+ seat?: IMiningIndex;
11576
11586
  bidPlace?: number;
11577
11587
  bidAmount?: bigint;
11578
11588
  isWorkingOn?: boolean;
@@ -11617,7 +11627,8 @@ declare class Vault {
11617
11627
  pendingTermsChangeTick?: number;
11618
11628
  openedDate: Date;
11619
11629
  openedTick: number;
11620
- constructor(id: number, vault: ArgonPrimitivesVault$1, tickDuration: number);
11630
+ constructor(id: number, vault: ArgonPrimitivesVault, tickDuration: number);
11631
+ load(vault: ArgonPrimitivesVault): void;
11621
11632
  availableBitcoinSpace(): bigint;
11622
11633
  getRelockCapacity(): bigint;
11623
11634
  recoverySecuritization(): bigint;
@@ -11628,7 +11639,7 @@ declare class Vault {
11628
11639
  */
11629
11640
  activatedSecuritizationPerSlot(): bigint;
11630
11641
  calculateBitcoinFee(amount: bigint): bigint;
11631
- static get(client: ArgonClient, vaultId: number): Promise<Vault>;
11642
+ static get(client: ArgonClient, vaultId: number, tickDurationMillis?: number): Promise<Vault>;
11632
11643
  static create(client: ArgonClient, keypair: KeyringPair, args: {
11633
11644
  securitization: bigint | number;
11634
11645
  securitizationRatio: number;
@@ -11637,9 +11648,14 @@ declare class Vault {
11637
11648
  bitcoinXpub: string;
11638
11649
  liquidityPoolProfitSharing: number;
11639
11650
  tip?: bigint;
11651
+ doNotExceedBalance?: bigint;
11652
+ progressCallback?: (progressPct: number, status: ExtrinsicStatus$1) => void;
11640
11653
  }, config?: {
11641
11654
  tickDurationMillis?: number;
11642
- }): Promise<Vault>;
11655
+ }): Promise<{
11656
+ vault: Vault;
11657
+ txResult: TxResult;
11658
+ }>;
11643
11659
  }
11644
11660
  interface ITerms {
11645
11661
  readonly bitcoinAnnualPercentRate: BigNumber;
@@ -11697,77 +11713,6 @@ type WatchAlerts = {
11697
11713
  liquidityPoolSpaceAvailable?: bigint;
11698
11714
  };
11699
11715
 
11700
- declare enum SeatReductionReason {
11701
- InsufficientFunds = "InsufficientFunds",
11702
- MaxBidTooLow = "MaxBidTooLow",
11703
- MaxBudgetTooLow = "MaxBudgetTooLow"
11704
- }
11705
- interface IBidHistoryEntry {
11706
- cohortStartingFrameId: number;
11707
- blockNumber: number;
11708
- tick: number;
11709
- bidChanges: {
11710
- address: string;
11711
- bidAmount: bigint;
11712
- bidPosition: number | null;
11713
- prevPosition: number | null;
11714
- prevBidAmount?: bigint;
11715
- }[];
11716
- myBidsPlaced?: {
11717
- bids: number;
11718
- bidPerSeat: bigint;
11719
- txFeePlusTip: bigint;
11720
- successfulBids: number;
11721
- failureReason?: ExtrinsicError;
11722
- };
11723
- winningSeats: number;
11724
- maxSeatsInPlay: number;
11725
- maxSeatsReductionReason?: SeatReductionReason;
11726
- }
11727
- declare class CohortBidderHistory {
11728
- readonly cohortStartingFrameId: number;
11729
- readonly subaccounts: {
11730
- index: number;
11731
- isRebid: boolean;
11732
- address: string;
11733
- }[];
11734
- bidHistory: IBidHistoryEntry[];
11735
- stats: {
11736
- seatsWon: number;
11737
- totalArgonsBid: bigint;
11738
- bidsAttempted: number;
11739
- fees: bigint;
11740
- maxBidPerSeat: bigint;
11741
- argonotsPerSeat: bigint;
11742
- argonotUsdPrice: number;
11743
- cohortArgonsPerBlock: bigint;
11744
- lastBlockNumber: number;
11745
- };
11746
- private lastBids;
11747
- private readonly myAddresses;
11748
- private maxSeatsInPlay;
11749
- constructor(cohortStartingFrameId: number, subaccounts: {
11750
- index: number;
11751
- isRebid: boolean;
11752
- address: string;
11753
- }[]);
11754
- init(client: ArgonClient): Promise<void>;
11755
- maybeReducingSeats(maxSeats: number, reason: SeatReductionReason, historyEntry: IBidHistoryEntry): void;
11756
- trackChange(next: {
11757
- accountId: AccountId;
11758
- bid: u128 | Compact<u128>;
11759
- }[], blockNumber: number, tick: number, isLastEntry?: boolean): IBidHistoryEntry;
11760
- onBidResult(historyEntry: IBidHistoryEntry, param: {
11761
- txFeePlusTip: bigint;
11762
- bidPerSeat: bigint;
11763
- blockNumber: number | undefined;
11764
- bidsAttempted: number;
11765
- successfulBids: number;
11766
- bidError?: ExtrinsicError;
11767
- }): void;
11768
- static getStartingData(api: ApiDecoration<'promise'>): Promise<Pick<CohortBidderHistory['stats'], 'argonotUsdPrice' | 'argonotsPerSeat' | 'cohortArgonsPerBlock'>>;
11769
- }
11770
-
11771
11716
  declare class CohortBidder {
11772
11717
  accountset: Accountset;
11773
11718
  cohortStartingFrameId: number;
@@ -11785,16 +11730,21 @@ declare class CohortBidder {
11785
11730
  tipPerTransaction?: bigint;
11786
11731
  };
11787
11732
  get client(): Promise<ArgonClient>;
11788
- get stats(): CohortBidderHistory['stats'];
11789
- get bidHistory(): CohortBidderHistory['bidHistory'];
11733
+ txFees: bigint;
11734
+ winningBids: {
11735
+ address: string;
11736
+ bid: bigint;
11737
+ }[];
11790
11738
  private unsubscribe?;
11791
11739
  private pendingRequest;
11792
11740
  private retryTimeout?;
11793
11741
  private isStopped;
11794
11742
  private needsRebid;
11795
11743
  private lastBidTime;
11796
- private history;
11797
11744
  private millisPerTick?;
11745
+ private minIncrement;
11746
+ private nextCohortSize?;
11747
+ private lastBidBlockNumber;
11798
11748
  private readonly myAddresses;
11799
11749
  constructor(accountset: Accountset, cohortStartingFrameId: number, subaccounts: {
11800
11750
  index: number;
@@ -11808,10 +11758,11 @@ declare class CohortBidder {
11808
11758
  bidDelay: number;
11809
11759
  tipPerTransaction?: bigint;
11810
11760
  });
11811
- stop(): Promise<CohortBidder['stats']>;
11812
11761
  start(): Promise<void>;
11762
+ stop(): Promise<CohortBidder['winningBids']>;
11813
11763
  private checkWinningBids;
11814
11764
  private bid;
11765
+ private updateSeatsWon;
11815
11766
  private checkCurrentSeats;
11816
11767
  }
11817
11768
 
@@ -11865,7 +11816,7 @@ declare const SATS_PER_BTC = 100000000n;
11865
11816
  declare class BitcoinLocks {
11866
11817
  readonly client: Promise<ArgonClient>;
11867
11818
  constructor(client: Promise<ArgonClient>);
11868
- getUtxoIdFromEvents(events: GenericEvent[]): Promise<number | undefined>;
11819
+ getUtxoIdFromEvents(events: GenericEvent$1[]): Promise<number | undefined>;
11869
11820
  getMarketRate(satoshis: bigint): Promise<bigint>;
11870
11821
  getRedemptionRate(satoshis: bigint): Promise<bigint>;
11871
11822
  getConfig(): Promise<IBitcoinLockConfig>;
@@ -11887,7 +11838,7 @@ declare class BitcoinLocks {
11887
11838
  getReleaseRequest(utxoId: number, atHeight?: number): Promise<IReleaseRequestDetails | undefined>;
11888
11839
  submitVaultSignature(args: {
11889
11840
  utxoId: number;
11890
- vaultSignature: Buffer;
11841
+ vaultSignature: Uint8Array;
11891
11842
  argonKeyring: KeyringPair;
11892
11843
  }): Promise<TxResult>;
11893
11844
  getBitcoinLock(utxoId: number): Promise<IBitcoinLock | undefined>;
@@ -11905,7 +11856,7 @@ declare class BitcoinLocks {
11905
11856
  findPendingMints(utxoId: number): Promise<bigint[]>;
11906
11857
  createInitializeLockTx(args: {
11907
11858
  vault: Vault;
11908
- ownerBitcoinPubkey: Buffer;
11859
+ ownerBitcoinPubkey: Uint8Array;
11909
11860
  satoshis: bigint;
11910
11861
  argonKeyring: KeyringPair;
11911
11862
  reducedBalanceBy?: bigint;
@@ -11917,7 +11868,7 @@ declare class BitcoinLocks {
11917
11868
  }>;
11918
11869
  initializeLock(args: {
11919
11870
  vault: Vault;
11920
- ownerBitcoinPubkey: Buffer;
11871
+ ownerBitcoinPubkey: Uint8Array;
11921
11872
  argonKeyring: KeyringPair;
11922
11873
  satoshis: bigint;
11923
11874
  tip?: bigint;
@@ -11976,7 +11927,7 @@ declare class BitcoinLocks {
11976
11927
  interface IBitcoinLockConfig {
11977
11928
  releaseExpirationBlocks: number;
11978
11929
  tickDurationMillis: number;
11979
- bitcoinNetwork: ArgonPrimitivesBitcoinBitcoinNetwork$1;
11930
+ bitcoinNetwork: ArgonPrimitivesBitcoinBitcoinNetwork;
11980
11931
  }
11981
11932
  interface IReleaseRequest {
11982
11933
  toScriptPubkey: string;
@@ -12015,6 +11966,15 @@ declare function createKeyringPair(opts: {
12015
11966
  cryptoType?: 'sr25519' | 'ed25519';
12016
11967
  }): KeyringPair;
12017
11968
 
11969
+ interface ArgonClientConfig {
11970
+ debug?: boolean;
11971
+ keysVersion?: number;
11972
+ keysMnemonic?: string;
11973
+ subaccountRange?: string;
11974
+ }
11975
+ declare function setConfig(newConfig: ArgonClientConfig): void;
11976
+ declare function getConfig(): ArgonClientConfig;
11977
+
12018
11978
  type ArgonClient = ApiPromise;
12019
11979
  /**
12020
11980
  * Wait for the crypto library to be ready (requires wasm, which needs async loading in commonjs)
@@ -12027,4 +11987,4 @@ declare function waitForLoad(): Promise<void>;
12027
11987
  */
12028
11988
  declare function getClient(host: string): Promise<ArgonClient>;
12029
11989
 
12030
- export { AccountMiners, AccountRegistry, Accountset, type ArgonClient, BidPool, BitcoinLocks, BlockWatch, CohortBidder, CohortBidderHistory, ExtrinsicError, FrameCalculator, type IBitcoinLock, type IBitcoinLockConfig, type IReleaseRequest, type IReleaseRequestDetails, JsonExt, MICROGONS_PER_ARGON, MiningBids, SATS_PER_BTC, TxSubmitter, TypedEmitter, Vault, VaultMonitor, WageProtector, checkForExtrinsicSuccess, convertFixedU128ToBigNumber, convertNumberToFixedU128, convertNumberToPermill, convertPermillToBigNumber, createKeyringPair, createNanoEvents, dispatchErrorToExtrinsicError, dispatchErrorToString, eventDataToJson, filterUndefined, formatArgons, formatPercent, getAuthorFromHeader, getClient, getTickFromHeader, gettersToObject, keyringFromSuri, toFixedNumber, waitForLoad };
11990
+ export { AccountMiners, AccountRegistry, Accountset, type ArgonClient, type ArgonClientConfig, BidPool, BitcoinLocks, BlockWatch, CohortBidder, ExtrinsicError, FrameCalculator, type IBitcoinLock, type IBitcoinLockConfig, type IMiningIndex, type IReleaseRequest, type IReleaseRequestDetails, type ISubaccountMiner, JsonExt, MICROGONS_PER_ARGON, MiningBids, SATS_PER_BTC, TxSubmitter, TypedEmitter, Vault, VaultMonitor, WageProtector, checkForExtrinsicSuccess, convertFixedU128ToBigNumber, convertNumberToFixedU128, convertNumberToPermill, convertPermillToBigNumber, createKeyringPair, createNanoEvents, dispatchErrorToExtrinsicError, dispatchErrorToString, eventDataToJson, filterUndefined, formatArgons, formatPercent, getAuthorFromHeader, getClient, getConfig, getTickFromHeader, gettersToObject, keyringFromSuri, setConfig, toFixedNumber, waitForLoad };
package/lib/index.js CHANGED
@@ -2,23 +2,41 @@ import {
2
2
  AccountMiners,
3
3
  AccountRegistry,
4
4
  Accountset,
5
+ BTreeMap,
5
6
  BidPool,
6
7
  BitcoinLocks,
7
8
  BlockWatch,
9
+ Bool,
10
+ Bytes,
8
11
  CohortBidder,
9
- CohortBidderHistory,
12
+ Compact,
13
+ Enum,
10
14
  ExtrinsicError,
11
15
  FrameCalculator,
16
+ GenericAddress,
17
+ GenericBlock,
18
+ GenericEvent,
12
19
  JsonExt,
13
20
  Keyring,
14
21
  MICROGONS_PER_ARGON,
15
22
  MiningBids,
23
+ Null,
24
+ Option,
25
+ Range,
26
+ Result,
16
27
  SATS_PER_BTC,
28
+ Struct,
29
+ Text,
30
+ Tuple,
17
31
  TxSubmitter,
18
32
  TypedEmitter,
33
+ U256,
34
+ U8aFixed,
19
35
  Vault,
20
36
  VaultMonitor,
37
+ Vec,
21
38
  WageProtector,
39
+ bool,
22
40
  checkForExtrinsicSuccess,
23
41
  convertFixedU128ToBigNumber,
24
42
  convertNumberToFixedU128,
@@ -35,34 +53,63 @@ import {
35
53
  formatPercent,
36
54
  getAuthorFromHeader,
37
55
  getClient,
56
+ getConfig,
38
57
  getTickFromHeader,
39
58
  gettersToObject,
59
+ hexToU8a,
60
+ i128,
40
61
  keyringFromSuri,
41
62
  mnemonicGenerate,
63
+ setConfig,
42
64
  toFixedNumber,
65
+ u128,
66
+ u16,
67
+ u32,
68
+ u64,
69
+ u8,
70
+ u8aEq,
71
+ u8aToHex,
43
72
  waitForLoad
44
- } from "./chunk-CGXT6XF7.js";
73
+ } from "./chunk-FCT7GMFN.js";
45
74
  export {
46
75
  AccountMiners,
47
76
  AccountRegistry,
48
77
  Accountset,
78
+ BTreeMap,
49
79
  BidPool,
50
80
  BitcoinLocks,
51
81
  BlockWatch,
82
+ Bool,
83
+ Bytes,
52
84
  CohortBidder,
53
- CohortBidderHistory,
85
+ Compact,
86
+ Enum,
54
87
  ExtrinsicError,
55
88
  FrameCalculator,
89
+ GenericAddress,
90
+ GenericBlock,
91
+ GenericEvent,
56
92
  JsonExt,
57
93
  Keyring,
58
94
  MICROGONS_PER_ARGON,
59
95
  MiningBids,
96
+ Null,
97
+ Option,
98
+ Range,
99
+ Result,
60
100
  SATS_PER_BTC,
101
+ Struct,
102
+ Text,
103
+ Tuple,
61
104
  TxSubmitter,
62
105
  TypedEmitter,
106
+ U256,
107
+ U8aFixed,
63
108
  Vault,
64
109
  VaultMonitor,
110
+ Vec,
65
111
  WageProtector,
112
+ bool,
66
113
  checkForExtrinsicSuccess,
67
114
  convertFixedU128ToBigNumber,
68
115
  convertNumberToFixedU128,
@@ -79,11 +126,22 @@ export {
79
126
  formatPercent,
80
127
  getAuthorFromHeader,
81
128
  getClient,
129
+ getConfig,
82
130
  getTickFromHeader,
83
131
  gettersToObject,
132
+ hexToU8a,
133
+ i128,
84
134
  keyringFromSuri,
85
135
  mnemonicGenerate,
136
+ setConfig,
86
137
  toFixedNumber,
138
+ u128,
139
+ u16,
140
+ u32,
141
+ u64,
142
+ u8,
143
+ u8aEq,
144
+ u8aToHex,
87
145
  waitForLoad
88
146
  };
89
147
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argonprotocol/mainchain",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "A client for accessing the Argon mainchain apis.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,7 +23,8 @@
23
23
  "test:ci": "vitest --run --retry=1"
24
24
  },
25
25
  "files": [
26
- "lib/"
26
+ "lib/",
27
+ "browser/"
27
28
  ],
28
29
  "type": "module",
29
30
  "bin": "./lib/cli.js",
@@ -32,6 +33,10 @@
32
33
  "exports": {
33
34
  ".": {
34
35
  "types": "./lib/index.d.ts",
36
+ "browser": {
37
+ "types": "./browser/index.d.ts",
38
+ "default": "./browser/index.js"
39
+ },
35
40
  "import": "./lib/index.js",
36
41
  "require": {
37
42
  "types": "./lib/index.d.cts",
@@ -65,7 +70,7 @@
65
70
  "dotenv": "^16.4.7"
66
71
  },
67
72
  "devDependencies": {
68
- "@argonprotocol/testing": "1.3.2",
73
+ "@argonprotocol/testing": "1.3.3",
69
74
  "@polkadot/typegen": "^16.2.1",
70
75
  "@substrate/ss58-registry": "^1.51.0",
71
76
  "@types/node": "^18.19.6",