@wireio/stake 1.2.69 → 1.3.69
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/README.md +1 -1
- package/lib/stake.browser.js +51 -47
- package/lib/stake.browser.js.map +1 -1
- package/lib/stake.d.ts +97 -68
- package/lib/stake.js +51 -46
- package/lib/stake.js.map +1 -1
- package/lib/stake.m.js +51 -47
- package/lib/stake.m.js.map +1 -1
- package/package.json +1 -1
- package/src/networks/solana/clients/instaswap.client.ts +59 -47
package/lib/stake.d.ts
CHANGED
|
@@ -18971,73 +18971,6 @@ declare class DistributionClient {
|
|
|
18971
18971
|
getAverageScaledPayRate(windowSize?: number): Promise<BN>;
|
|
18972
18972
|
}
|
|
18973
18973
|
|
|
18974
|
-
type SolanaInstaswapSubmitParams = {
|
|
18975
|
-
amountLamports: bigint;
|
|
18976
|
-
destinationChain: number | string | bigint;
|
|
18977
|
-
destinationAddress: Uint8Array;
|
|
18978
|
-
minOutLamports: bigint;
|
|
18979
|
-
};
|
|
18980
|
-
type SolanaInstaswapSubmitHooks = {
|
|
18981
|
-
onSubmitted?: (signature: string) => void | Promise<void>;
|
|
18982
|
-
};
|
|
18983
|
-
type SolanaDepositToWireParams = {
|
|
18984
|
-
quantityLamports: bigint;
|
|
18985
|
-
recipient: string;
|
|
18986
|
-
};
|
|
18987
|
-
type SolanaInstaswapConnectedBalances = {
|
|
18988
|
-
nativeLamports: string;
|
|
18989
|
-
liqsolLamports: string;
|
|
18990
|
-
liqsolDecimals: number;
|
|
18991
|
-
};
|
|
18992
|
-
declare class SolanaInstaswapClient {
|
|
18993
|
-
private readonly provider;
|
|
18994
|
-
private readonly pgs;
|
|
18995
|
-
private readonly submitInstructions?;
|
|
18996
|
-
private readonly program;
|
|
18997
|
-
private readonly convertClient;
|
|
18998
|
-
constructor(provider: AnchorProvider, pgs: SolanaProgramService, submitInstructions?: ((ix: TransactionInstruction | TransactionInstruction[]) => Promise<string>) | undefined);
|
|
18999
|
-
submitCrossChain(params: SolanaInstaswapSubmitParams, hooks?: SolanaInstaswapSubmitHooks): Promise<string>;
|
|
19000
|
-
depositToWire(params: SolanaDepositToWireParams, hooks?: SolanaInstaswapSubmitHooks): Promise<string>;
|
|
19001
|
-
getConnectedBalances(owner?: PublicKey$1 | string): Promise<SolanaInstaswapConnectedBalances>;
|
|
19002
|
-
private finalizeReadyEpoch;
|
|
19003
|
-
private fetchPendingAttestations;
|
|
19004
|
-
private isEpochFinalizationRequired;
|
|
19005
|
-
private runRpcWithRecovery;
|
|
19006
|
-
private extractTimedOutSignature;
|
|
19007
|
-
private waitForSignatureSuccess;
|
|
19008
|
-
private resolveOwner;
|
|
19009
|
-
private toSafeNumber;
|
|
19010
|
-
private sleep;
|
|
19011
|
-
private sendInstructions;
|
|
19012
|
-
}
|
|
19013
|
-
|
|
19014
|
-
/**
|
|
19015
|
-
* Simple read client for the validator_leaderboard program.
|
|
19016
|
-
*
|
|
19017
|
-
* Adjust account names/fields to match your IDL (state, validatorRecord, etc).
|
|
19018
|
-
*/
|
|
19019
|
-
declare class LeaderboardClient {
|
|
19020
|
-
private readonly provider;
|
|
19021
|
-
private readonly pgs;
|
|
19022
|
-
private program;
|
|
19023
|
-
constructor(provider: AnchorProvider, pgs: SolanaProgramService);
|
|
19024
|
-
getState(): Promise<LeaderboardState | null>;
|
|
19025
|
-
getValidatorRecord(voteAccount: PublicKey$1): Promise<ValidatorRecord | null>;
|
|
19026
|
-
/**
|
|
19027
|
-
* Convenience helper to fetch and return top validators ordered
|
|
19028
|
-
* by the on-chain leaderboard scores.
|
|
19029
|
-
*
|
|
19030
|
-
* Uses:
|
|
19031
|
-
* - `leaderboardState.scores`
|
|
19032
|
-
* - `leaderboardState.sortedIndices`
|
|
19033
|
-
* - `validatorRecord.registryIndex`
|
|
19034
|
-
*
|
|
19035
|
-
* Fallback: if leaderboardState can't be fetched, we sort by
|
|
19036
|
-
* `creditsObserved` descending.
|
|
19037
|
-
*/
|
|
19038
|
-
getTopValidators(limit?: number): Promise<ValidatorRecord[]>;
|
|
19039
|
-
}
|
|
19040
|
-
|
|
19041
18974
|
/** BN | bigint -> bigint helper (keeps code readable) */
|
|
19042
18975
|
declare function toBigint(x: any): bigint;
|
|
19043
18976
|
/**
|
|
@@ -19153,6 +19086,102 @@ declare function ceilDiv(n: BN, d: BN): BN;
|
|
|
19153
19086
|
declare function normalizeToBigInt(x: any): bigint;
|
|
19154
19087
|
declare const safeFetch: <T>(promise: Promise<T>, label?: string) => Promise<T | null>;
|
|
19155
19088
|
|
|
19089
|
+
type SolanaInstaswapSubmitParams = {
|
|
19090
|
+
amountLamports: bigint;
|
|
19091
|
+
destinationChain: number | string | bigint;
|
|
19092
|
+
destinationAddress: Uint8Array;
|
|
19093
|
+
minOutLamports: bigint;
|
|
19094
|
+
};
|
|
19095
|
+
type SolanaInstaswapSubmitHooks = {
|
|
19096
|
+
onSubmitted?: (signature: string) => void | Promise<void>;
|
|
19097
|
+
};
|
|
19098
|
+
type SolanaDepositToWireParams = {
|
|
19099
|
+
quantityLamports: bigint;
|
|
19100
|
+
recipient: string;
|
|
19101
|
+
};
|
|
19102
|
+
type SolanaInstaswapConnectedBalances = {
|
|
19103
|
+
nativeLamports: string;
|
|
19104
|
+
liqsolLamports: string;
|
|
19105
|
+
liqsolDecimals: number;
|
|
19106
|
+
};
|
|
19107
|
+
declare function buildSolanaInstaswapCrossChainAccounts(params: {
|
|
19108
|
+
user: PublicKey$1;
|
|
19109
|
+
accounts: OutpostAccounts;
|
|
19110
|
+
liqsolCoreProgram: PublicKey$1;
|
|
19111
|
+
transferHookProgram: PublicKey$1;
|
|
19112
|
+
pendingAttestations: PublicKey$1;
|
|
19113
|
+
}): {
|
|
19114
|
+
user: PublicKey$1;
|
|
19115
|
+
globalState: PublicKey$1;
|
|
19116
|
+
liqsolMint: PublicKey$1;
|
|
19117
|
+
distributionState: PublicKey$1;
|
|
19118
|
+
userAta: PublicKey$1;
|
|
19119
|
+
senderUserRecord: PublicKey$1;
|
|
19120
|
+
bridgeAuthority: PublicKey$1;
|
|
19121
|
+
bridgeVaultAta: PublicKey$1;
|
|
19122
|
+
bridgeUserRecord: PublicKey$1;
|
|
19123
|
+
bridgeState: PublicKey$1;
|
|
19124
|
+
extraAccountMetaList: PublicKey$1;
|
|
19125
|
+
liqsolCoreProgram: PublicKey$1;
|
|
19126
|
+
transferHookProgram: PublicKey$1;
|
|
19127
|
+
bucketAuthority: PublicKey$1;
|
|
19128
|
+
bucketTokenAccount: PublicKey$1;
|
|
19129
|
+
bucketUserRecord: PublicKey$1;
|
|
19130
|
+
tokenProgram: PublicKey$1;
|
|
19131
|
+
systemProgram: PublicKey$1;
|
|
19132
|
+
globalConfig: PublicKey$1;
|
|
19133
|
+
oppEpochState: PublicKey$1;
|
|
19134
|
+
pendingAttestations: PublicKey$1;
|
|
19135
|
+
};
|
|
19136
|
+
declare class SolanaInstaswapClient {
|
|
19137
|
+
private readonly provider;
|
|
19138
|
+
private readonly pgs;
|
|
19139
|
+
private readonly submitInstructions?;
|
|
19140
|
+
private readonly program;
|
|
19141
|
+
private readonly convertClient;
|
|
19142
|
+
constructor(provider: AnchorProvider, pgs: SolanaProgramService, submitInstructions?: ((ix: TransactionInstruction | TransactionInstruction[]) => Promise<string>) | undefined);
|
|
19143
|
+
submitCrossChain(params: SolanaInstaswapSubmitParams, hooks?: SolanaInstaswapSubmitHooks): Promise<string>;
|
|
19144
|
+
depositToWire(params: SolanaDepositToWireParams, hooks?: SolanaInstaswapSubmitHooks): Promise<string>;
|
|
19145
|
+
getConnectedBalances(owner?: PublicKey$1 | string): Promise<SolanaInstaswapConnectedBalances>;
|
|
19146
|
+
private finalizeReadyEpoch;
|
|
19147
|
+
private fetchPendingAttestations;
|
|
19148
|
+
private isEpochFinalizationRequired;
|
|
19149
|
+
private runRpcWithRecovery;
|
|
19150
|
+
private extractTimedOutSignature;
|
|
19151
|
+
private waitForSignatureSuccess;
|
|
19152
|
+
private resolveOwner;
|
|
19153
|
+
private toSafeNumber;
|
|
19154
|
+
private sleep;
|
|
19155
|
+
private sendInstructions;
|
|
19156
|
+
}
|
|
19157
|
+
|
|
19158
|
+
/**
|
|
19159
|
+
* Simple read client for the validator_leaderboard program.
|
|
19160
|
+
*
|
|
19161
|
+
* Adjust account names/fields to match your IDL (state, validatorRecord, etc).
|
|
19162
|
+
*/
|
|
19163
|
+
declare class LeaderboardClient {
|
|
19164
|
+
private readonly provider;
|
|
19165
|
+
private readonly pgs;
|
|
19166
|
+
private program;
|
|
19167
|
+
constructor(provider: AnchorProvider, pgs: SolanaProgramService);
|
|
19168
|
+
getState(): Promise<LeaderboardState | null>;
|
|
19169
|
+
getValidatorRecord(voteAccount: PublicKey$1): Promise<ValidatorRecord | null>;
|
|
19170
|
+
/**
|
|
19171
|
+
* Convenience helper to fetch and return top validators ordered
|
|
19172
|
+
* by the on-chain leaderboard scores.
|
|
19173
|
+
*
|
|
19174
|
+
* Uses:
|
|
19175
|
+
* - `leaderboardState.scores`
|
|
19176
|
+
* - `leaderboardState.sortedIndices`
|
|
19177
|
+
* - `validatorRecord.registryIndex`
|
|
19178
|
+
*
|
|
19179
|
+
* Fallback: if leaderboardState can't be fetched, we sort by
|
|
19180
|
+
* `creditsObserved` descending.
|
|
19181
|
+
*/
|
|
19182
|
+
getTopValidators(limit?: number): Promise<ValidatorRecord[]>;
|
|
19183
|
+
}
|
|
19184
|
+
|
|
19156
19185
|
/**
|
|
19157
19186
|
* OutpostClient
|
|
19158
19187
|
*
|
|
@@ -19499,5 +19528,5 @@ declare class SolanaStakingClient implements IStakingClient {
|
|
|
19499
19528
|
private getSingleTxFeeLamports;
|
|
19500
19529
|
}
|
|
19501
19530
|
|
|
19502
|
-
export { ADDRESSES, ADDRESS_BOOK_BY_CHAIN, CHAINLINK_FEED, CHAINLINK_PROGRAM, CONTRACTS_BY_CHAIN, ConvertClient, DEFAULT_AVERAGE_PAY_RATE, DEFAULT_PAY_RATE_LOOKBACK, DistributionClient, EPHEMERAL_RENT_EXEMPTION, ERC1155Abi, ERC20Abi, ERC721Abi, types$1 as ETH, EthereumContractService, EthereumInstaswapClient, EthereumStakingClient, HOODI_ADDRESSES, INDEX_SCALE, INITIAL_TRANCHE_SUPPLY, LAMPORTS_PER_SOL, LeaderboardClient, MAINNET_ADDRESSES, OutpostClient, PAY_RATE_SCALE_FACTOR, PDA_SEEDS, PROGRAM_IDS_BY_CHAIN, PurchaseAsset, ReceiptNFTKind, SCALE, types as SOL, SolanaInstaswapClient, SolanaStakingClient, Staker, SupportedEvmChainID, SupportedSolChainID, TokenClient, airdropSol, buildOutpostAccounts, buildSolanaTrancheLadder, buildSolanaTrancheSnapshot, ceilDiv, deriveEphemeralStakeAddress, generateRandomDepositAmount, generateTestKeypair, getEpochSnapshot, getErrorMessage, getProgramIds, lamportsToSol, msToEpochEnd, normalizeToBigInt, safeFetch, scheduledInstruction, sleep, solToLamports, toBigint, tokensToShares, waitForConfirmation, waitUntilSafeToExecuteFunction };
|
|
19531
|
+
export { ADDRESSES, ADDRESS_BOOK_BY_CHAIN, CHAINLINK_FEED, CHAINLINK_PROGRAM, CONTRACTS_BY_CHAIN, ConvertClient, DEFAULT_AVERAGE_PAY_RATE, DEFAULT_PAY_RATE_LOOKBACK, DistributionClient, EPHEMERAL_RENT_EXEMPTION, ERC1155Abi, ERC20Abi, ERC721Abi, types$1 as ETH, EthereumContractService, EthereumInstaswapClient, EthereumStakingClient, HOODI_ADDRESSES, INDEX_SCALE, INITIAL_TRANCHE_SUPPLY, LAMPORTS_PER_SOL, LeaderboardClient, MAINNET_ADDRESSES, OutpostClient, PAY_RATE_SCALE_FACTOR, PDA_SEEDS, PROGRAM_IDS_BY_CHAIN, PurchaseAsset, ReceiptNFTKind, SCALE, types as SOL, SolanaInstaswapClient, SolanaStakingClient, Staker, SupportedEvmChainID, SupportedSolChainID, TokenClient, airdropSol, buildOutpostAccounts, buildSolanaInstaswapCrossChainAccounts, buildSolanaTrancheLadder, buildSolanaTrancheSnapshot, ceilDiv, deriveEphemeralStakeAddress, generateRandomDepositAmount, generateTestKeypair, getEpochSnapshot, getErrorMessage, getProgramIds, lamportsToSol, msToEpochEnd, normalizeToBigInt, safeFetch, scheduledInstruction, sleep, solToLamports, toBigint, tokensToShares, waitForConfirmation, waitUntilSafeToExecuteFunction };
|
|
19503
19532
|
export type { BalanceView, ChainSymbol, ContractConfig, ContractOptions, Contracts, EpochSnapshot, EthereumDepositToWireParams, EthereumEnsureLiqEthBalanceParams, EthereumInstaswapConnectedBalances, EthereumInstaswapOutpostAddresses, EthereumInstaswapSubmitHooks, EthereumInstaswapSubmitParams, IStakingClient, OPPAssertion, OutpostAccounts, Portfolio, PurchaseQuote, ScheduleConfig, SolanaDepositToWireParams, SolanaInstaswapConnectedBalances, SolanaInstaswapSubmitHooks, SolanaInstaswapSubmitParams, SolanaProgramIds, SquadsXConfig, StakerConfig, TrancheLadderItem, TrancheSnapshot, WithdrawReceipt$1 as WithdrawReceipt, WithdrawStatus, YieldView };
|
package/lib/stake.js
CHANGED
|
@@ -19375,6 +19375,38 @@ var __async$f = (__this, __arguments, generator) => {
|
|
|
19375
19375
|
};
|
|
19376
19376
|
const commitment$1 = "confirmed";
|
|
19377
19377
|
const DEFAULT_SOLANA_EPOCH_CAP = 32;
|
|
19378
|
+
function buildSolanaInstaswapCrossChainAccounts(params) {
|
|
19379
|
+
const {
|
|
19380
|
+
user,
|
|
19381
|
+
accounts,
|
|
19382
|
+
liqsolCoreProgram,
|
|
19383
|
+
transferHookProgram,
|
|
19384
|
+
pendingAttestations
|
|
19385
|
+
} = params;
|
|
19386
|
+
return {
|
|
19387
|
+
user,
|
|
19388
|
+
globalState: accounts.globalState,
|
|
19389
|
+
liqsolMint: accounts.liqsolMint,
|
|
19390
|
+
distributionState: accounts.distributionState,
|
|
19391
|
+
userAta: accounts.userAta,
|
|
19392
|
+
senderUserRecord: accounts.userUserRecord,
|
|
19393
|
+
bridgeAuthority: accounts.bridgeAuthority,
|
|
19394
|
+
bridgeVaultAta: accounts.bridgeVaultAta,
|
|
19395
|
+
bridgeUserRecord: accounts.bridgeUserRecord,
|
|
19396
|
+
bridgeState: accounts.bridgeState,
|
|
19397
|
+
extraAccountMetaList: accounts.extraAccountMetaList,
|
|
19398
|
+
liqsolCoreProgram,
|
|
19399
|
+
transferHookProgram,
|
|
19400
|
+
bucketAuthority: accounts.bucketAuthority,
|
|
19401
|
+
bucketTokenAccount: accounts.bucketTokenAccount,
|
|
19402
|
+
bucketUserRecord: accounts.bucketUserRecord,
|
|
19403
|
+
tokenProgram: splToken.TOKEN_2022_PROGRAM_ID,
|
|
19404
|
+
systemProgram: web3_js.SystemProgram.programId,
|
|
19405
|
+
globalConfig: accounts.globalConfig,
|
|
19406
|
+
oppEpochState: accounts.oppEpochState,
|
|
19407
|
+
pendingAttestations
|
|
19408
|
+
};
|
|
19409
|
+
}
|
|
19378
19410
|
class SolanaInstaswapClient {
|
|
19379
19411
|
constructor(provider, pgs, submitInstructions) {
|
|
19380
19412
|
this.provider = provider;
|
|
@@ -19405,29 +19437,15 @@ class SolanaInstaswapClient {
|
|
|
19405
19437
|
destinationChain,
|
|
19406
19438
|
destinationAddress,
|
|
19407
19439
|
minOut
|
|
19408
|
-
).accounts(
|
|
19409
|
-
|
|
19410
|
-
|
|
19411
|
-
|
|
19412
|
-
|
|
19413
|
-
|
|
19414
|
-
|
|
19415
|
-
|
|
19416
|
-
|
|
19417
|
-
poolUserRecord: accounts.liqsolPoolUserRecord,
|
|
19418
|
-
bridgeState: accounts.bridgeState,
|
|
19419
|
-
extraAccountMetaList: accounts.extraAccountMetaList,
|
|
19420
|
-
liqsolCoreProgram: this.program.programId,
|
|
19421
|
-
transferHookProgram: this.pgs.PROGRAM_IDS.TRANSFER_HOOK,
|
|
19422
|
-
bucketAuthority: accounts.bucketAuthority,
|
|
19423
|
-
bucketTokenAccount: accounts.bucketTokenAccount,
|
|
19424
|
-
bucketUserRecord: accounts.bucketUserRecord,
|
|
19425
|
-
tokenProgram: splToken.TOKEN_2022_PROGRAM_ID,
|
|
19426
|
-
systemProgram: web3_js.SystemProgram.programId,
|
|
19427
|
-
globalConfig: accounts.globalConfig,
|
|
19428
|
-
oppEpochState: accounts.oppEpochState,
|
|
19429
|
-
pendingAttestations
|
|
19430
|
-
}).preInstructions([
|
|
19440
|
+
).accounts(
|
|
19441
|
+
buildSolanaInstaswapCrossChainAccounts({
|
|
19442
|
+
user,
|
|
19443
|
+
accounts,
|
|
19444
|
+
liqsolCoreProgram: this.program.programId,
|
|
19445
|
+
transferHookProgram: this.pgs.PROGRAM_IDS.TRANSFER_HOOK,
|
|
19446
|
+
pendingAttestations
|
|
19447
|
+
})
|
|
19448
|
+
).preInstructions([
|
|
19431
19449
|
web3_js.ComputeBudgetProgram.setComputeUnitLimit({ units: 9e5 })
|
|
19432
19450
|
]).rpc()
|
|
19433
19451
|
);
|
|
@@ -19444,29 +19462,15 @@ class SolanaInstaswapClient {
|
|
|
19444
19462
|
destinationChain,
|
|
19445
19463
|
destinationAddress,
|
|
19446
19464
|
minOut
|
|
19447
|
-
).accounts(
|
|
19448
|
-
|
|
19449
|
-
|
|
19450
|
-
|
|
19451
|
-
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
poolUserRecord: accounts.liqsolPoolUserRecord,
|
|
19457
|
-
bridgeState: accounts.bridgeState,
|
|
19458
|
-
extraAccountMetaList: accounts.extraAccountMetaList,
|
|
19459
|
-
liqsolCoreProgram: this.program.programId,
|
|
19460
|
-
transferHookProgram: this.pgs.PROGRAM_IDS.TRANSFER_HOOK,
|
|
19461
|
-
bucketAuthority: accounts.bucketAuthority,
|
|
19462
|
-
bucketTokenAccount: accounts.bucketTokenAccount,
|
|
19463
|
-
bucketUserRecord: accounts.bucketUserRecord,
|
|
19464
|
-
tokenProgram: splToken.TOKEN_2022_PROGRAM_ID,
|
|
19465
|
-
systemProgram: web3_js.SystemProgram.programId,
|
|
19466
|
-
globalConfig: accounts.globalConfig,
|
|
19467
|
-
oppEpochState: accounts.oppEpochState,
|
|
19468
|
-
pendingAttestations
|
|
19469
|
-
}).preInstructions([
|
|
19465
|
+
).accounts(
|
|
19466
|
+
buildSolanaInstaswapCrossChainAccounts({
|
|
19467
|
+
user,
|
|
19468
|
+
accounts,
|
|
19469
|
+
liqsolCoreProgram: this.program.programId,
|
|
19470
|
+
transferHookProgram: this.pgs.PROGRAM_IDS.TRANSFER_HOOK,
|
|
19471
|
+
pendingAttestations
|
|
19472
|
+
})
|
|
19473
|
+
).preInstructions([
|
|
19470
19474
|
web3_js.ComputeBudgetProgram.setComputeUnitLimit({ units: 9e5 })
|
|
19471
19475
|
]).rpc()
|
|
19472
19476
|
);
|
|
@@ -74921,6 +74925,7 @@ exports.SupportedSolChainID = SupportedSolChainID;
|
|
|
74921
74925
|
exports.TokenClient = TokenClient;
|
|
74922
74926
|
exports.airdropSol = airdropSol;
|
|
74923
74927
|
exports.buildOutpostAccounts = buildOutpostAccounts;
|
|
74928
|
+
exports.buildSolanaInstaswapCrossChainAccounts = buildSolanaInstaswapCrossChainAccounts;
|
|
74924
74929
|
exports.buildSolanaTrancheLadder = buildSolanaTrancheLadder;
|
|
74925
74930
|
exports.buildSolanaTrancheSnapshot = buildSolanaTrancheSnapshot;
|
|
74926
74931
|
exports.ceilDiv = ceilDiv;
|