@solana/client 1.3.0 → 1.4.0
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/dist/index.browser.mjs +2 -2
- package/dist/index.native.mjs +2 -2
- package/dist/index.node.mjs +406 -61
- package/dist/types/client/actions.d.ts +3 -1
- package/dist/types/client/actions.d.ts.map +1 -1
- package/dist/types/client/createClient.d.ts.map +1 -1
- package/dist/types/client/createClientHelpers.d.ts +2 -1
- package/dist/types/client/createClientHelpers.d.ts.map +1 -1
- package/dist/types/client/defaultClient.d.ts +2 -1
- package/dist/types/client/defaultClient.d.ts.map +1 -1
- package/dist/types/client/watchers.d.ts +2 -1
- package/dist/types/client/watchers.d.ts.map +1 -1
- package/dist/types/controllers/wsolController.d.ts +30 -0
- package/dist/types/controllers/wsolController.d.ts.map +1 -0
- package/dist/types/features/sol.d.ts +2 -1
- package/dist/types/features/sol.d.ts.map +1 -1
- package/dist/types/features/spl.d.ts +2 -1
- package/dist/types/features/spl.d.ts.map +1 -1
- package/dist/types/features/stake.d.ts +2 -1
- package/dist/types/features/stake.d.ts.map +1 -1
- package/dist/types/features/transactions.d.ts +2 -1
- package/dist/types/features/transactions.d.ts.map +1 -1
- package/dist/types/features/wsol.d.ts +86 -0
- package/dist/types/features/wsol.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/rpc/types.d.ts +8 -0
- package/dist/types/rpc/types.d.ts.map +1 -0
- package/dist/types/signers/walletTransactionSigner.d.ts +1 -1
- package/dist/types/signers/walletTransactionSigner.d.ts.map +1 -1
- package/dist/types/types.d.ts +6 -64
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/wallet/connectors.d.ts +1 -1
- package/dist/types/wallet/connectors.d.ts.map +1 -1
- package/dist/types/wallet/registry.d.ts +1 -1
- package/dist/types/wallet/registry.d.ts.map +1 -1
- package/dist/types/wallet/standard.d.ts +1 -1
- package/dist/types/wallet/standard.d.ts.map +1 -1
- package/dist/types/wallet/types.d.ts +60 -0
- package/dist/types/wallet/types.d.ts.map +1 -0
- package/package.json +4 -3
package/dist/index.node.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createSolanaRpc, createSolanaRpcSubscriptions,
|
|
1
|
+
import { address, createSolanaRpc, createSolanaRpcSubscriptions, getBase64EncodedWireTransaction, compileTransaction, partiallySignTransactionMessageWithSigners, appendTransactionMessageInstruction, setTransactionMessageLifetimeUsingBlockhash, isTransactionSendingSigner, getMessagePackerInstructionPlanFromInstructions, signature, AccountRole, pipe, createTransactionMessage, setTransactionMessageFeePayer, singleTransactionPlan, signAndSendTransactionMessageWithSigners, createTransactionPlanExecutor, signTransactionMessageWithSigners, isSolanaError, SOLANA_ERROR__TRANSACTION_ERROR__ALREADY_PROCESSED, generateKeyPairSigner, appendTransactionMessageInstructions, createTransactionPlanner, setTransactionMessageFeePayerSigner, isTransactionPartialSigner, SOLANA_ERROR__INSTRUCTION_ERROR__COMPUTATIONAL_BUDGET_EXCEEDED, isInstructionForProgram, isInstructionWithData, SolanaError, SOLANA_ERROR__INSTRUCTION_ERROR__GENERIC_ERROR, isSome, airdropFactory, signatureBytes } from '@solana/kit';
|
|
2
2
|
import { createBlockHeightExceedencePromiseFactory, createRecentSignatureConfirmationPromiseFactory, waitForRecentTransactionConfirmation } from '@solana/transaction-confirmation';
|
|
3
3
|
import { fetchAddressLookupTable, fetchAllAddressLookupTable } from '@solana-program/address-lookup-table';
|
|
4
4
|
import { getTransferSolInstruction, getCreateAccountInstruction, fetchNonce } from '@solana-program/system';
|
|
5
5
|
import { getBase58Decoder, getBase58Encoder } from '@solana/codecs-strings';
|
|
6
|
-
import { TOKEN_PROGRAM_ADDRESS, fetchMint, findAssociatedTokenPda, getCreateAssociatedTokenInstruction, getTransferCheckedInstruction } from '@solana-program/token';
|
|
6
|
+
import { TOKEN_PROGRAM_ADDRESS, fetchMint, findAssociatedTokenPda, getCreateAssociatedTokenInstruction, getTransferCheckedInstruction, getCreateAssociatedTokenIdempotentInstruction, getSyncNativeInstruction, getCloseAccountInstruction } from '@solana-program/token';
|
|
7
7
|
import { getInitializeInstruction, getDelegateStakeInstruction, getDeactivateInstruction, getWithdrawInstruction } from '@solana-program/stake';
|
|
8
8
|
import { getSetComputeUnitLimitInstruction, getSetComputeUnitPriceInstruction, COMPUTE_BUDGET_PROGRAM_ADDRESS, ComputeBudgetInstruction } from '@solana-program/compute-budget';
|
|
9
9
|
import { createStore } from 'zustand/vanilla';
|
|
@@ -500,6 +500,7 @@ function createActions({ connectors, logger: inputLogger, runtime, store }) {
|
|
|
500
500
|
level: "info",
|
|
501
501
|
message: "wallet connected"
|
|
502
502
|
});
|
|
503
|
+
return session;
|
|
503
504
|
} catch (error) {
|
|
504
505
|
store.setState((state) => ({
|
|
505
506
|
...state,
|
|
@@ -540,14 +541,14 @@ function createActions({ connectors, logger: inputLogger, runtime, store }) {
|
|
|
540
541
|
}
|
|
541
542
|
}
|
|
542
543
|
__name(disconnectWallet3, "disconnectWallet");
|
|
543
|
-
async function fetchBalance2(
|
|
544
|
-
const key =
|
|
544
|
+
async function fetchBalance2(address6, commitment) {
|
|
545
|
+
const key = address6.toString();
|
|
545
546
|
store.setState((state) => ({
|
|
546
547
|
...state,
|
|
547
548
|
accounts: {
|
|
548
549
|
...state.accounts,
|
|
549
550
|
[key]: {
|
|
550
|
-
address:
|
|
551
|
+
address: address6,
|
|
551
552
|
data: state.accounts[key]?.data,
|
|
552
553
|
error: void 0,
|
|
553
554
|
executable: state.accounts[key]?.executable ?? null,
|
|
@@ -561,14 +562,14 @@ function createActions({ connectors, logger: inputLogger, runtime, store }) {
|
|
|
561
562
|
lastUpdatedAt: now()
|
|
562
563
|
}));
|
|
563
564
|
try {
|
|
564
|
-
const response = await runtime.rpc.getBalance(
|
|
565
|
+
const response = await runtime.rpc.getBalance(address6, { commitment: getCommitment(commitment) }).send({ abortSignal: AbortSignal.timeout(1e4) });
|
|
565
566
|
const lamports2 = response.value;
|
|
566
567
|
store.setState((state) => ({
|
|
567
568
|
...state,
|
|
568
569
|
accounts: {
|
|
569
570
|
...state.accounts,
|
|
570
571
|
[key]: {
|
|
571
|
-
address:
|
|
572
|
+
address: address6,
|
|
572
573
|
data: state.accounts[key]?.data,
|
|
573
574
|
error: void 0,
|
|
574
575
|
executable: state.accounts[key]?.executable ?? null,
|
|
@@ -588,7 +589,7 @@ function createActions({ connectors, logger: inputLogger, runtime, store }) {
|
|
|
588
589
|
accounts: {
|
|
589
590
|
...state.accounts,
|
|
590
591
|
[key]: {
|
|
591
|
-
address:
|
|
592
|
+
address: address6,
|
|
592
593
|
data: state.accounts[key]?.data,
|
|
593
594
|
error,
|
|
594
595
|
executable: state.accounts[key]?.executable ?? null,
|
|
@@ -610,14 +611,14 @@ function createActions({ connectors, logger: inputLogger, runtime, store }) {
|
|
|
610
611
|
}
|
|
611
612
|
}
|
|
612
613
|
__name(fetchBalance2, "fetchBalance");
|
|
613
|
-
async function fetchAccount2(
|
|
614
|
-
const key =
|
|
614
|
+
async function fetchAccount2(address6, commitment) {
|
|
615
|
+
const key = address6.toString();
|
|
615
616
|
store.setState((state) => ({
|
|
616
617
|
...state,
|
|
617
618
|
accounts: {
|
|
618
619
|
...state.accounts,
|
|
619
620
|
[key]: {
|
|
620
|
-
address:
|
|
621
|
+
address: address6,
|
|
621
622
|
data: state.accounts[key]?.data,
|
|
622
623
|
error: void 0,
|
|
623
624
|
executable: state.accounts[key]?.executable ?? null,
|
|
@@ -631,7 +632,7 @@ function createActions({ connectors, logger: inputLogger, runtime, store }) {
|
|
|
631
632
|
lastUpdatedAt: now()
|
|
632
633
|
}));
|
|
633
634
|
try {
|
|
634
|
-
const response = await runtime.rpc.getAccountInfo(
|
|
635
|
+
const response = await runtime.rpc.getAccountInfo(address6, { commitment: getCommitment(commitment), encoding: "base64" }).send({ abortSignal: AbortSignal.timeout(1e4) });
|
|
635
636
|
const value = response.value;
|
|
636
637
|
const lamports2 = value?.lamports ?? null;
|
|
637
638
|
const executable = value?.executable ?? null;
|
|
@@ -641,7 +642,7 @@ function createActions({ connectors, logger: inputLogger, runtime, store }) {
|
|
|
641
642
|
accounts: {
|
|
642
643
|
...state.accounts,
|
|
643
644
|
[key]: {
|
|
644
|
-
address:
|
|
645
|
+
address: address6,
|
|
645
646
|
data: value,
|
|
646
647
|
error: void 0,
|
|
647
648
|
executable,
|
|
@@ -661,7 +662,7 @@ function createActions({ connectors, logger: inputLogger, runtime, store }) {
|
|
|
661
662
|
accounts: {
|
|
662
663
|
...state.accounts,
|
|
663
664
|
[key]: {
|
|
664
|
-
address:
|
|
665
|
+
address: address6,
|
|
665
666
|
data: state.accounts[key]?.data,
|
|
666
667
|
error,
|
|
667
668
|
executable: state.accounts[key]?.executable ?? null,
|
|
@@ -721,11 +722,11 @@ function createActions({ connectors, logger: inputLogger, runtime, store }) {
|
|
|
721
722
|
async function sendTransaction2(transaction, commitment) {
|
|
722
723
|
const targetCommitment = getCommitment(commitment);
|
|
723
724
|
const abortController = new AbortController();
|
|
724
|
-
const
|
|
725
|
+
const signature6 = await runtime.rpc.sendTransaction(getBase64EncodedWireTransaction(transaction), {
|
|
725
726
|
encoding: "base64",
|
|
726
727
|
preflightCommitment: targetCommitment
|
|
727
728
|
}).send({ abortSignal: abortController.signal });
|
|
728
|
-
const key =
|
|
729
|
+
const key = signature6.toString();
|
|
729
730
|
store.setState((state) => ({
|
|
730
731
|
...state,
|
|
731
732
|
lastUpdatedAt: now(),
|
|
@@ -733,7 +734,7 @@ function createActions({ connectors, logger: inputLogger, runtime, store }) {
|
|
|
733
734
|
...state.transactions,
|
|
734
735
|
[key]: {
|
|
735
736
|
lastUpdatedAt: now(),
|
|
736
|
-
signature:
|
|
737
|
+
signature: signature6,
|
|
737
738
|
status: "sending"
|
|
738
739
|
}
|
|
739
740
|
}
|
|
@@ -761,12 +762,12 @@ function createActions({ connectors, logger: inputLogger, runtime, store }) {
|
|
|
761
762
|
...state.transactions,
|
|
762
763
|
[key]: {
|
|
763
764
|
lastUpdatedAt: now(),
|
|
764
|
-
signature:
|
|
765
|
+
signature: signature6,
|
|
765
766
|
status: "confirmed"
|
|
766
767
|
}
|
|
767
768
|
}
|
|
768
769
|
}));
|
|
769
|
-
return
|
|
770
|
+
return signature6;
|
|
770
771
|
} catch (error) {
|
|
771
772
|
store.setState((state) => ({
|
|
772
773
|
...state,
|
|
@@ -776,7 +777,7 @@ function createActions({ connectors, logger: inputLogger, runtime, store }) {
|
|
|
776
777
|
[key]: {
|
|
777
778
|
error,
|
|
778
779
|
lastUpdatedAt: now(),
|
|
779
|
-
signature:
|
|
780
|
+
signature: signature6,
|
|
780
781
|
status: "failed"
|
|
781
782
|
}
|
|
782
783
|
}
|
|
@@ -790,26 +791,26 @@ function createActions({ connectors, logger: inputLogger, runtime, store }) {
|
|
|
790
791
|
}
|
|
791
792
|
}
|
|
792
793
|
__name(sendTransaction2, "sendTransaction");
|
|
793
|
-
async function requestAirdrop2(
|
|
794
|
+
async function requestAirdrop2(address6, lamports2) {
|
|
794
795
|
try {
|
|
795
796
|
const factory = airdropFactory({
|
|
796
797
|
rpc: runtime.rpc,
|
|
797
798
|
rpcSubscriptions: runtime.rpcSubscriptions
|
|
798
799
|
});
|
|
799
|
-
const
|
|
800
|
+
const signature6 = await factory({
|
|
800
801
|
commitment: getCommitment("confirmed"),
|
|
801
802
|
lamports: lamports2,
|
|
802
|
-
recipientAddress:
|
|
803
|
+
recipientAddress: address6
|
|
803
804
|
});
|
|
804
805
|
logger({
|
|
805
|
-
data: { address:
|
|
806
|
+
data: { address: address6.toString(), lamports: lamports2.toString(), signature: signature6 },
|
|
806
807
|
level: "info",
|
|
807
808
|
message: "airdrop requested"
|
|
808
809
|
});
|
|
809
|
-
return
|
|
810
|
+
return signature6;
|
|
810
811
|
} catch (error) {
|
|
811
812
|
logger({
|
|
812
|
-
data: { address:
|
|
813
|
+
data: { address: address6.toString(), lamports: lamports2.toString(), ...formatError(error) },
|
|
813
814
|
level: "error",
|
|
814
815
|
message: "airdrop request failed"
|
|
815
816
|
});
|
|
@@ -1213,11 +1214,11 @@ function isWalletSession(value) {
|
|
|
1213
1214
|
__name(isWalletSession, "isWalletSession");
|
|
1214
1215
|
function createWalletTransactionSigner(session, config = {}) {
|
|
1215
1216
|
const { commitment } = config;
|
|
1216
|
-
const
|
|
1217
|
+
const address6 = session.account.address;
|
|
1217
1218
|
if (session.signTransaction) {
|
|
1218
1219
|
const signTransaction = session.signTransaction.bind(session);
|
|
1219
1220
|
const modifyingSigner = Object.freeze({
|
|
1220
|
-
address:
|
|
1221
|
+
address: address6,
|
|
1221
1222
|
async modifyAndSignTransactions(transactions) {
|
|
1222
1223
|
const signedTransactions = [];
|
|
1223
1224
|
for (const transaction of transactions) {
|
|
@@ -1225,8 +1226,8 @@ function createWalletTransactionSigner(session, config = {}) {
|
|
|
1225
1226
|
const signed = await signTransaction(
|
|
1226
1227
|
castTransaction
|
|
1227
1228
|
);
|
|
1228
|
-
const
|
|
1229
|
-
if (!
|
|
1229
|
+
const signature6 = signed.signatures[address6];
|
|
1230
|
+
if (!signature6) {
|
|
1230
1231
|
throw new Error("Wallet did not populate the expected fee payer signature.");
|
|
1231
1232
|
}
|
|
1232
1233
|
const mergedTransaction = Object.freeze({
|
|
@@ -1245,11 +1246,11 @@ function createWalletTransactionSigner(session, config = {}) {
|
|
|
1245
1246
|
const signedTransactions = await this.modifyAndSignTransactions(transactions);
|
|
1246
1247
|
return Object.freeze(
|
|
1247
1248
|
signedTransactions.map((signedTransaction) => {
|
|
1248
|
-
const
|
|
1249
|
-
if (!
|
|
1249
|
+
const signature6 = signedTransaction.signatures[address6];
|
|
1250
|
+
if (!signature6) {
|
|
1250
1251
|
throw new Error("Expected signer to produce a signature for the provided address.");
|
|
1251
1252
|
}
|
|
1252
|
-
return Object.freeze({ [
|
|
1253
|
+
return Object.freeze({ [address6]: signature6 });
|
|
1253
1254
|
})
|
|
1254
1255
|
);
|
|
1255
1256
|
}
|
|
@@ -1263,7 +1264,7 @@ function createWalletTransactionSigner(session, config = {}) {
|
|
|
1263
1264
|
const base58Encoder = getBase58Encoder();
|
|
1264
1265
|
const sendTransaction2 = session.sendTransaction.bind(session);
|
|
1265
1266
|
const sendingSigner = Object.freeze({
|
|
1266
|
-
address:
|
|
1267
|
+
address: address6,
|
|
1267
1268
|
async signAndSendTransactions(transactions) {
|
|
1268
1269
|
const signatures = [];
|
|
1269
1270
|
for (const transaction of transactions) {
|
|
@@ -2058,11 +2059,11 @@ function resolveFeePayerAddress(feePayer, authoritySigner) {
|
|
|
2058
2059
|
return { address: feePayer.address, signer: feePayer };
|
|
2059
2060
|
}
|
|
2060
2061
|
if (feePayer) {
|
|
2061
|
-
const
|
|
2062
|
-
if (authoritySigner && authoritySigner.address ===
|
|
2063
|
-
return { address:
|
|
2062
|
+
const address6 = toAddress(feePayer);
|
|
2063
|
+
if (authoritySigner && authoritySigner.address === address6) {
|
|
2064
|
+
return { address: address6, signer: authoritySigner };
|
|
2064
2065
|
}
|
|
2065
|
-
return { address:
|
|
2066
|
+
return { address: address6 };
|
|
2066
2067
|
}
|
|
2067
2068
|
if (!authoritySigner) {
|
|
2068
2069
|
throw new Error("Unable to resolve authority signer for the fee payer.");
|
|
@@ -2282,6 +2283,221 @@ function createTransactionHelper(runtime, getFallbackCommitment) {
|
|
|
2282
2283
|
});
|
|
2283
2284
|
}
|
|
2284
2285
|
__name(createTransactionHelper, "createTransactionHelper");
|
|
2286
|
+
var WRAPPED_SOL_MINT = address("So11111111111111111111111111111111111111112");
|
|
2287
|
+
function ensureAddress4(value, fallback) {
|
|
2288
|
+
if (value) {
|
|
2289
|
+
return typeof value === "string" ? address(value) : value;
|
|
2290
|
+
}
|
|
2291
|
+
if (!fallback) {
|
|
2292
|
+
throw new Error("An address value was expected but not provided.");
|
|
2293
|
+
}
|
|
2294
|
+
return fallback;
|
|
2295
|
+
}
|
|
2296
|
+
__name(ensureAddress4, "ensureAddress");
|
|
2297
|
+
async function resolveLifetime4(runtime, commitment, fallback) {
|
|
2298
|
+
if (fallback) {
|
|
2299
|
+
return fallback;
|
|
2300
|
+
}
|
|
2301
|
+
const { value } = await runtime.rpc.getLatestBlockhash({ commitment }).send();
|
|
2302
|
+
return value;
|
|
2303
|
+
}
|
|
2304
|
+
__name(resolveLifetime4, "resolveLifetime");
|
|
2305
|
+
function resolveSigner4(authority, commitment) {
|
|
2306
|
+
if (isWalletSession(authority)) {
|
|
2307
|
+
const { signer, mode } = createWalletTransactionSigner(authority, { commitment });
|
|
2308
|
+
return { mode, signer };
|
|
2309
|
+
}
|
|
2310
|
+
return { mode: resolveSignerMode(authority), signer: authority };
|
|
2311
|
+
}
|
|
2312
|
+
__name(resolveSigner4, "resolveSigner");
|
|
2313
|
+
function toLamportAmount3(input) {
|
|
2314
|
+
return lamportsMath.fromLamports(input);
|
|
2315
|
+
}
|
|
2316
|
+
__name(toLamportAmount3, "toLamportAmount");
|
|
2317
|
+
function createWsolHelper(runtime) {
|
|
2318
|
+
const tokenProgram = address(TOKEN_PROGRAM_ADDRESS);
|
|
2319
|
+
async function deriveWsolAddress(owner) {
|
|
2320
|
+
const [ata] = await findAssociatedTokenPda({
|
|
2321
|
+
mint: WRAPPED_SOL_MINT,
|
|
2322
|
+
owner: ensureAddress4(owner),
|
|
2323
|
+
tokenProgram
|
|
2324
|
+
});
|
|
2325
|
+
return ata;
|
|
2326
|
+
}
|
|
2327
|
+
__name(deriveWsolAddress, "deriveWsolAddress");
|
|
2328
|
+
async function fetchWsolBalance(owner, commitment) {
|
|
2329
|
+
const ataAddress = await deriveWsolAddress(owner);
|
|
2330
|
+
try {
|
|
2331
|
+
const { value } = await runtime.rpc.getTokenAccountBalance(ataAddress, { commitment }).send();
|
|
2332
|
+
const amount = BigInt(value.amount);
|
|
2333
|
+
return {
|
|
2334
|
+
amount,
|
|
2335
|
+
ataAddress,
|
|
2336
|
+
exists: true
|
|
2337
|
+
};
|
|
2338
|
+
} catch {
|
|
2339
|
+
return {
|
|
2340
|
+
amount: 0n,
|
|
2341
|
+
ataAddress,
|
|
2342
|
+
exists: false
|
|
2343
|
+
};
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
__name(fetchWsolBalance, "fetchWsolBalance");
|
|
2347
|
+
async function prepareWrap(config) {
|
|
2348
|
+
const commitment = config.commitment;
|
|
2349
|
+
const lifetime = await resolveLifetime4(runtime, commitment, config.lifetime);
|
|
2350
|
+
const { signer, mode } = resolveSigner4(config.authority, commitment);
|
|
2351
|
+
const owner = ensureAddress4(config.owner, signer.address);
|
|
2352
|
+
const amount = toLamportAmount3(config.amount);
|
|
2353
|
+
const ataAddress = await deriveWsolAddress(owner);
|
|
2354
|
+
const instructions = [
|
|
2355
|
+
getCreateAssociatedTokenIdempotentInstruction({
|
|
2356
|
+
ata: ataAddress,
|
|
2357
|
+
mint: WRAPPED_SOL_MINT,
|
|
2358
|
+
owner,
|
|
2359
|
+
payer: signer,
|
|
2360
|
+
tokenProgram
|
|
2361
|
+
}),
|
|
2362
|
+
getTransferSolInstruction({
|
|
2363
|
+
amount,
|
|
2364
|
+
destination: ataAddress,
|
|
2365
|
+
source: signer
|
|
2366
|
+
}),
|
|
2367
|
+
getSyncNativeInstruction({
|
|
2368
|
+
account: ataAddress
|
|
2369
|
+
})
|
|
2370
|
+
];
|
|
2371
|
+
const message = pipe(
|
|
2372
|
+
createTransactionMessage({ version: config.transactionVersion ?? 0 }),
|
|
2373
|
+
(m) => setTransactionMessageFeePayer(signer.address, m),
|
|
2374
|
+
(m) => setTransactionMessageLifetimeUsingBlockhash(lifetime, m),
|
|
2375
|
+
(m) => appendTransactionMessageInstructions(instructions, m)
|
|
2376
|
+
);
|
|
2377
|
+
return {
|
|
2378
|
+
amount,
|
|
2379
|
+
ataAddress,
|
|
2380
|
+
commitment,
|
|
2381
|
+
lifetime,
|
|
2382
|
+
message,
|
|
2383
|
+
mode,
|
|
2384
|
+
owner,
|
|
2385
|
+
plan: singleTransactionPlan(message),
|
|
2386
|
+
signer
|
|
2387
|
+
};
|
|
2388
|
+
}
|
|
2389
|
+
__name(prepareWrap, "prepareWrap");
|
|
2390
|
+
async function prepareUnwrap(config) {
|
|
2391
|
+
const commitment = config.commitment;
|
|
2392
|
+
const lifetime = await resolveLifetime4(runtime, commitment, config.lifetime);
|
|
2393
|
+
const { signer, mode } = resolveSigner4(config.authority, commitment);
|
|
2394
|
+
const owner = ensureAddress4(config.owner, signer.address);
|
|
2395
|
+
const ataAddress = await deriveWsolAddress(owner);
|
|
2396
|
+
const instruction = getCloseAccountInstruction({
|
|
2397
|
+
account: ataAddress,
|
|
2398
|
+
destination: owner,
|
|
2399
|
+
owner: signer
|
|
2400
|
+
});
|
|
2401
|
+
const message = pipe(
|
|
2402
|
+
createTransactionMessage({ version: config.transactionVersion ?? 0 }),
|
|
2403
|
+
(m) => setTransactionMessageFeePayer(signer.address, m),
|
|
2404
|
+
(m) => setTransactionMessageLifetimeUsingBlockhash(lifetime, m),
|
|
2405
|
+
(m) => appendTransactionMessageInstruction(instruction, m)
|
|
2406
|
+
);
|
|
2407
|
+
return {
|
|
2408
|
+
ataAddress,
|
|
2409
|
+
commitment,
|
|
2410
|
+
lifetime,
|
|
2411
|
+
message,
|
|
2412
|
+
mode,
|
|
2413
|
+
owner,
|
|
2414
|
+
plan: singleTransactionPlan(message),
|
|
2415
|
+
signer
|
|
2416
|
+
};
|
|
2417
|
+
}
|
|
2418
|
+
__name(prepareUnwrap, "prepareUnwrap");
|
|
2419
|
+
async function sendPreparedTransaction(prepared, options = {}) {
|
|
2420
|
+
if (prepared.mode === "send" && isTransactionSendingSigner(prepared.signer)) {
|
|
2421
|
+
const signatureBytes2 = await signAndSendTransactionMessageWithSigners(prepared.message, {
|
|
2422
|
+
abortSignal: options.abortSignal,
|
|
2423
|
+
minContextSlot: options.minContextSlot
|
|
2424
|
+
});
|
|
2425
|
+
const base58Decoder2 = getBase58Decoder();
|
|
2426
|
+
return signature(base58Decoder2.decode(signatureBytes2));
|
|
2427
|
+
}
|
|
2428
|
+
const commitment = options.commitment ?? prepared.commitment;
|
|
2429
|
+
const maxRetries = options.maxRetries === void 0 ? void 0 : typeof options.maxRetries === "bigint" ? options.maxRetries : BigInt(options.maxRetries);
|
|
2430
|
+
let latestSignature = null;
|
|
2431
|
+
const executor = createTransactionPlanExecutor({
|
|
2432
|
+
async executeTransactionMessage(message, config = {}) {
|
|
2433
|
+
const signed = await signTransactionMessageWithSigners(message, {
|
|
2434
|
+
abortSignal: config.abortSignal ?? options.abortSignal,
|
|
2435
|
+
minContextSlot: options.minContextSlot
|
|
2436
|
+
});
|
|
2437
|
+
const wire = getBase64EncodedWireTransaction(signed);
|
|
2438
|
+
const response = await runtime.rpc.sendTransaction(wire, {
|
|
2439
|
+
encoding: "base64",
|
|
2440
|
+
maxRetries,
|
|
2441
|
+
preflightCommitment: commitment,
|
|
2442
|
+
skipPreflight: options.skipPreflight
|
|
2443
|
+
}).send({ abortSignal: config.abortSignal ?? options.abortSignal });
|
|
2444
|
+
latestSignature = signature(response);
|
|
2445
|
+
return { transaction: signed };
|
|
2446
|
+
}
|
|
2447
|
+
});
|
|
2448
|
+
await executor(prepared.plan ?? singleTransactionPlan(prepared.message), { abortSignal: options.abortSignal });
|
|
2449
|
+
if (!latestSignature) {
|
|
2450
|
+
throw new Error("Failed to resolve transaction signature.");
|
|
2451
|
+
}
|
|
2452
|
+
return latestSignature;
|
|
2453
|
+
}
|
|
2454
|
+
__name(sendPreparedTransaction, "sendPreparedTransaction");
|
|
2455
|
+
async function sendPreparedWrap(prepared, options) {
|
|
2456
|
+
return sendPreparedTransaction(prepared, options);
|
|
2457
|
+
}
|
|
2458
|
+
__name(sendPreparedWrap, "sendPreparedWrap");
|
|
2459
|
+
async function sendPreparedUnwrap(prepared, options) {
|
|
2460
|
+
return sendPreparedTransaction(prepared, options);
|
|
2461
|
+
}
|
|
2462
|
+
__name(sendPreparedUnwrap, "sendPreparedUnwrap");
|
|
2463
|
+
async function sendWrap(config, options) {
|
|
2464
|
+
const prepared = await prepareWrap(config);
|
|
2465
|
+
try {
|
|
2466
|
+
return await sendPreparedWrap(prepared, options);
|
|
2467
|
+
} catch (error) {
|
|
2468
|
+
if (isSolanaError(error, SOLANA_ERROR__TRANSACTION_ERROR__ALREADY_PROCESSED)) {
|
|
2469
|
+
const retriedPrepared = await prepareWrap({ ...config, lifetime: void 0 });
|
|
2470
|
+
return await sendPreparedWrap(retriedPrepared, options);
|
|
2471
|
+
}
|
|
2472
|
+
throw error;
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
__name(sendWrap, "sendWrap");
|
|
2476
|
+
async function sendUnwrap(config, options) {
|
|
2477
|
+
const prepared = await prepareUnwrap(config);
|
|
2478
|
+
try {
|
|
2479
|
+
return await sendPreparedUnwrap(prepared, options);
|
|
2480
|
+
} catch (error) {
|
|
2481
|
+
if (isSolanaError(error, SOLANA_ERROR__TRANSACTION_ERROR__ALREADY_PROCESSED)) {
|
|
2482
|
+
const retriedPrepared = await prepareUnwrap({ ...config, lifetime: void 0 });
|
|
2483
|
+
return await sendPreparedUnwrap(retriedPrepared, options);
|
|
2484
|
+
}
|
|
2485
|
+
throw error;
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2488
|
+
__name(sendUnwrap, "sendUnwrap");
|
|
2489
|
+
return {
|
|
2490
|
+
deriveWsolAddress,
|
|
2491
|
+
fetchWsolBalance,
|
|
2492
|
+
prepareUnwrap,
|
|
2493
|
+
prepareWrap,
|
|
2494
|
+
sendPreparedUnwrap,
|
|
2495
|
+
sendPreparedWrap,
|
|
2496
|
+
sendUnwrap,
|
|
2497
|
+
sendWrap
|
|
2498
|
+
};
|
|
2499
|
+
}
|
|
2500
|
+
__name(createWsolHelper, "createWsolHelper");
|
|
2285
2501
|
|
|
2286
2502
|
// src/client/createClientHelpers.ts
|
|
2287
2503
|
function withDefaultCommitment(config, getFallback, baseCommitment) {
|
|
@@ -2329,6 +2545,19 @@ function wrapStakeHelper(helper, getFallback) {
|
|
|
2329
2545
|
};
|
|
2330
2546
|
}
|
|
2331
2547
|
__name(wrapStakeHelper, "wrapStakeHelper");
|
|
2548
|
+
function wrapWsolHelper(helper, getFallback) {
|
|
2549
|
+
return {
|
|
2550
|
+
deriveWsolAddress: helper.deriveWsolAddress,
|
|
2551
|
+
fetchWsolBalance: /* @__PURE__ */ __name((owner, commitment) => helper.fetchWsolBalance(owner, commitment ?? getFallback()), "fetchWsolBalance"),
|
|
2552
|
+
prepareWrap: /* @__PURE__ */ __name((config) => helper.prepareWrap(withDefaultCommitment(config, getFallback)), "prepareWrap"),
|
|
2553
|
+
prepareUnwrap: /* @__PURE__ */ __name((config) => helper.prepareUnwrap(withDefaultCommitment(config, getFallback)), "prepareUnwrap"),
|
|
2554
|
+
sendPreparedWrap: helper.sendPreparedWrap,
|
|
2555
|
+
sendPreparedUnwrap: helper.sendPreparedUnwrap,
|
|
2556
|
+
sendWrap: /* @__PURE__ */ __name((config, options) => helper.sendWrap(withDefaultCommitment(config, getFallback), options), "sendWrap"),
|
|
2557
|
+
sendUnwrap: /* @__PURE__ */ __name((config, options) => helper.sendUnwrap(withDefaultCommitment(config, getFallback), options), "sendUnwrap")
|
|
2558
|
+
};
|
|
2559
|
+
}
|
|
2560
|
+
__name(wrapWsolHelper, "wrapWsolHelper");
|
|
2332
2561
|
function normaliseConfigValue(value) {
|
|
2333
2562
|
if (value === null || value === void 0) {
|
|
2334
2563
|
return void 0;
|
|
@@ -2358,6 +2587,7 @@ function createClientHelpers(runtime, store) {
|
|
|
2358
2587
|
let solTransfer;
|
|
2359
2588
|
let stake;
|
|
2360
2589
|
let transaction;
|
|
2590
|
+
let wsol;
|
|
2361
2591
|
const getSolTransfer = /* @__PURE__ */ __name(() => {
|
|
2362
2592
|
if (!solTransfer) {
|
|
2363
2593
|
solTransfer = wrapSolTransferHelper(createSolTransferHelper(runtime), getFallbackCommitment);
|
|
@@ -2376,6 +2606,12 @@ function createClientHelpers(runtime, store) {
|
|
|
2376
2606
|
}
|
|
2377
2607
|
return transaction;
|
|
2378
2608
|
}, "getTransaction");
|
|
2609
|
+
const getWsol = /* @__PURE__ */ __name(() => {
|
|
2610
|
+
if (!wsol) {
|
|
2611
|
+
wsol = wrapWsolHelper(createWsolHelper(runtime), getFallbackCommitment);
|
|
2612
|
+
}
|
|
2613
|
+
return wsol;
|
|
2614
|
+
}, "getWsol");
|
|
2379
2615
|
function getSplTokenHelper(config) {
|
|
2380
2616
|
const cacheKey = serialiseSplConfig(config);
|
|
2381
2617
|
const cached = splTokenCache.get(cacheKey);
|
|
@@ -2406,6 +2642,9 @@ function createClientHelpers(runtime, store) {
|
|
|
2406
2642
|
get transaction() {
|
|
2407
2643
|
return getTransaction();
|
|
2408
2644
|
},
|
|
2645
|
+
get wsol() {
|
|
2646
|
+
return getWsol();
|
|
2647
|
+
},
|
|
2409
2648
|
prepareTransaction: prepareTransactionWithRuntime
|
|
2410
2649
|
});
|
|
2411
2650
|
}
|
|
@@ -2680,6 +2919,9 @@ function createClient(config) {
|
|
|
2680
2919
|
get transaction() {
|
|
2681
2920
|
return helpers.transaction;
|
|
2682
2921
|
},
|
|
2922
|
+
get wsol() {
|
|
2923
|
+
return helpers.wsol;
|
|
2924
|
+
},
|
|
2683
2925
|
prepareTransaction: helpers.prepareTransaction,
|
|
2684
2926
|
watchers
|
|
2685
2927
|
};
|
|
@@ -3052,9 +3294,9 @@ function createSolTransferController(config) {
|
|
|
3052
3294
|
const request = ensureAuthority(config2, authorityProvider);
|
|
3053
3295
|
setState(createAsyncState("loading"));
|
|
3054
3296
|
try {
|
|
3055
|
-
const
|
|
3056
|
-
setState(createAsyncState("success", { data:
|
|
3057
|
-
return
|
|
3297
|
+
const signature6 = await helper.sendTransfer(request, options);
|
|
3298
|
+
setState(createAsyncState("success", { data: signature6 }));
|
|
3299
|
+
return signature6;
|
|
3058
3300
|
} catch (error) {
|
|
3059
3301
|
setState(createAsyncState("error", { error }));
|
|
3060
3302
|
throw error;
|
|
@@ -3124,9 +3366,9 @@ function createSplTransferController(config) {
|
|
|
3124
3366
|
);
|
|
3125
3367
|
setState(createAsyncState("loading"));
|
|
3126
3368
|
try {
|
|
3127
|
-
const
|
|
3128
|
-
setState(createAsyncState("success", { data:
|
|
3129
|
-
return
|
|
3369
|
+
const signature6 = await helper.sendTransfer(resolvedConfig, options);
|
|
3370
|
+
setState(createAsyncState("success", { data: signature6 }));
|
|
3371
|
+
return signature6;
|
|
3130
3372
|
} catch (error) {
|
|
3131
3373
|
setState(createAsyncState("error", { error }));
|
|
3132
3374
|
throw error;
|
|
@@ -3234,9 +3476,9 @@ function createStakeController(config) {
|
|
|
3234
3476
|
const request = ensureAuthority2(config2, authorityProvider);
|
|
3235
3477
|
setState(createAsyncState("loading"));
|
|
3236
3478
|
try {
|
|
3237
|
-
const
|
|
3238
|
-
setState(createAsyncState("success", { data:
|
|
3239
|
-
return
|
|
3479
|
+
const signature6 = await helper.sendStake(request, options);
|
|
3480
|
+
setState(createAsyncState("success", { data: signature6 }));
|
|
3481
|
+
return signature6;
|
|
3240
3482
|
} catch (error) {
|
|
3241
3483
|
setState(createAsyncState("error", { error }));
|
|
3242
3484
|
throw error;
|
|
@@ -3247,9 +3489,9 @@ function createStakeController(config) {
|
|
|
3247
3489
|
const request = ensureUnstakeAuthority(config2, authorityProvider);
|
|
3248
3490
|
setUnstakeState(createAsyncState("loading"));
|
|
3249
3491
|
try {
|
|
3250
|
-
const
|
|
3251
|
-
setUnstakeState(createAsyncState("success", { data:
|
|
3252
|
-
return
|
|
3492
|
+
const signature6 = await helper.sendUnstake(request, options);
|
|
3493
|
+
setUnstakeState(createAsyncState("success", { data: signature6 }));
|
|
3494
|
+
return signature6;
|
|
3253
3495
|
} catch (error) {
|
|
3254
3496
|
setUnstakeState(createAsyncState("error", { error }));
|
|
3255
3497
|
throw error;
|
|
@@ -3260,9 +3502,9 @@ function createStakeController(config) {
|
|
|
3260
3502
|
const request = ensureWithdrawAuthority(config2, authorityProvider);
|
|
3261
3503
|
setWithdrawState(createAsyncState("loading"));
|
|
3262
3504
|
try {
|
|
3263
|
-
const
|
|
3264
|
-
setWithdrawState(createAsyncState("success", { data:
|
|
3265
|
-
return
|
|
3505
|
+
const signature6 = await helper.sendWithdraw(request, options);
|
|
3506
|
+
setWithdrawState(createAsyncState("success", { data: signature6 }));
|
|
3507
|
+
return signature6;
|
|
3266
3508
|
} catch (error) {
|
|
3267
3509
|
setWithdrawState(createAsyncState("error", { error }));
|
|
3268
3510
|
throw error;
|
|
@@ -3320,6 +3562,109 @@ function createStakeController(config) {
|
|
|
3320
3562
|
}
|
|
3321
3563
|
__name(createStakeController, "createStakeController");
|
|
3322
3564
|
|
|
3565
|
+
// src/controllers/wsolController.ts
|
|
3566
|
+
function ensureAuthority3(input, resolveDefault) {
|
|
3567
|
+
const authority = input.authority ?? resolveDefault?.();
|
|
3568
|
+
if (!authority) {
|
|
3569
|
+
throw new Error("Connect a wallet or supply an `authority` before wrapping/unwrapping SOL.");
|
|
3570
|
+
}
|
|
3571
|
+
return {
|
|
3572
|
+
...input,
|
|
3573
|
+
authority
|
|
3574
|
+
};
|
|
3575
|
+
}
|
|
3576
|
+
__name(ensureAuthority3, "ensureAuthority");
|
|
3577
|
+
function createWsolController(config) {
|
|
3578
|
+
const wrapListeners = /* @__PURE__ */ new Set();
|
|
3579
|
+
const unwrapListeners = /* @__PURE__ */ new Set();
|
|
3580
|
+
const helper = config.helper;
|
|
3581
|
+
const authorityProvider = config.authorityProvider;
|
|
3582
|
+
let wrapState = createInitialAsyncState();
|
|
3583
|
+
let unwrapState = createInitialAsyncState();
|
|
3584
|
+
function notifyWrap() {
|
|
3585
|
+
for (const listener of wrapListeners) {
|
|
3586
|
+
listener();
|
|
3587
|
+
}
|
|
3588
|
+
}
|
|
3589
|
+
__name(notifyWrap, "notifyWrap");
|
|
3590
|
+
function notifyUnwrap() {
|
|
3591
|
+
for (const listener of unwrapListeners) {
|
|
3592
|
+
listener();
|
|
3593
|
+
}
|
|
3594
|
+
}
|
|
3595
|
+
__name(notifyUnwrap, "notifyUnwrap");
|
|
3596
|
+
function setWrapState(next) {
|
|
3597
|
+
wrapState = next;
|
|
3598
|
+
notifyWrap();
|
|
3599
|
+
}
|
|
3600
|
+
__name(setWrapState, "setWrapState");
|
|
3601
|
+
function setUnwrapState(next) {
|
|
3602
|
+
unwrapState = next;
|
|
3603
|
+
notifyUnwrap();
|
|
3604
|
+
}
|
|
3605
|
+
__name(setUnwrapState, "setUnwrapState");
|
|
3606
|
+
async function wrap(input, options) {
|
|
3607
|
+
const request = ensureAuthority3(input, authorityProvider);
|
|
3608
|
+
setWrapState(createAsyncState("loading"));
|
|
3609
|
+
try {
|
|
3610
|
+
const signature6 = await helper.sendWrap(request, options);
|
|
3611
|
+
setWrapState(createAsyncState("success", { data: signature6 }));
|
|
3612
|
+
return signature6;
|
|
3613
|
+
} catch (error) {
|
|
3614
|
+
setWrapState(createAsyncState("error", { error }));
|
|
3615
|
+
throw error;
|
|
3616
|
+
}
|
|
3617
|
+
}
|
|
3618
|
+
__name(wrap, "wrap");
|
|
3619
|
+
async function unwrap(input, options) {
|
|
3620
|
+
const request = ensureAuthority3(input, authorityProvider);
|
|
3621
|
+
setUnwrapState(createAsyncState("loading"));
|
|
3622
|
+
try {
|
|
3623
|
+
const signature6 = await helper.sendUnwrap(request, options);
|
|
3624
|
+
setUnwrapState(createAsyncState("success", { data: signature6 }));
|
|
3625
|
+
return signature6;
|
|
3626
|
+
} catch (error) {
|
|
3627
|
+
setUnwrapState(createAsyncState("error", { error }));
|
|
3628
|
+
throw error;
|
|
3629
|
+
}
|
|
3630
|
+
}
|
|
3631
|
+
__name(unwrap, "unwrap");
|
|
3632
|
+
function subscribeWrap(listener) {
|
|
3633
|
+
wrapListeners.add(listener);
|
|
3634
|
+
return () => {
|
|
3635
|
+
wrapListeners.delete(listener);
|
|
3636
|
+
};
|
|
3637
|
+
}
|
|
3638
|
+
__name(subscribeWrap, "subscribeWrap");
|
|
3639
|
+
function subscribeUnwrap(listener) {
|
|
3640
|
+
unwrapListeners.add(listener);
|
|
3641
|
+
return () => {
|
|
3642
|
+
unwrapListeners.delete(listener);
|
|
3643
|
+
};
|
|
3644
|
+
}
|
|
3645
|
+
__name(subscribeUnwrap, "subscribeUnwrap");
|
|
3646
|
+
function resetWrap() {
|
|
3647
|
+
setWrapState(createInitialAsyncState());
|
|
3648
|
+
}
|
|
3649
|
+
__name(resetWrap, "resetWrap");
|
|
3650
|
+
function resetUnwrap() {
|
|
3651
|
+
setUnwrapState(createInitialAsyncState());
|
|
3652
|
+
}
|
|
3653
|
+
__name(resetUnwrap, "resetUnwrap");
|
|
3654
|
+
return {
|
|
3655
|
+
getHelper: /* @__PURE__ */ __name(() => helper, "getHelper"),
|
|
3656
|
+
getWrapState: /* @__PURE__ */ __name(() => wrapState, "getWrapState"),
|
|
3657
|
+
getUnwrapState: /* @__PURE__ */ __name(() => unwrapState, "getUnwrapState"),
|
|
3658
|
+
resetWrap,
|
|
3659
|
+
resetUnwrap,
|
|
3660
|
+
wrap,
|
|
3661
|
+
unwrap,
|
|
3662
|
+
subscribeWrap,
|
|
3663
|
+
subscribeUnwrap
|
|
3664
|
+
};
|
|
3665
|
+
}
|
|
3666
|
+
__name(createWsolController, "createWsolController");
|
|
3667
|
+
|
|
3323
3668
|
// src/serialization/json.ts
|
|
3324
3669
|
function bigintToJson(value) {
|
|
3325
3670
|
return value.toString();
|
|
@@ -3394,7 +3739,7 @@ function insertReferenceKeys(references, transaction) {
|
|
|
3394
3739
|
const targetInstruction = transaction.instructions[index];
|
|
3395
3740
|
const accounts = [
|
|
3396
3741
|
...targetInstruction.accounts ?? [],
|
|
3397
|
-
...references.map((
|
|
3742
|
+
...references.map((address6) => ({ address: address6, role: AccountRole.READONLY }))
|
|
3398
3743
|
];
|
|
3399
3744
|
const updatedInstructions = [...transaction.instructions];
|
|
3400
3745
|
updatedInstructions.splice(index, 1, { ...targetInstruction, accounts });
|
|
@@ -3549,9 +3894,9 @@ function createTransactionPoolController(config) {
|
|
|
3549
3894
|
const target = resolvePrepared(overridePrepared);
|
|
3550
3895
|
sendStateStore.setSnapshot(createAsyncState("loading"));
|
|
3551
3896
|
try {
|
|
3552
|
-
const
|
|
3553
|
-
sendStateStore.setSnapshot(createAsyncState("success", { data:
|
|
3554
|
-
return
|
|
3897
|
+
const signature6 = await helper.send(target, rest);
|
|
3898
|
+
sendStateStore.setSnapshot(createAsyncState("success", { data: signature6 }));
|
|
3899
|
+
return signature6;
|
|
3555
3900
|
} catch (error) {
|
|
3556
3901
|
sendStateStore.setSnapshot(createAsyncState("error", { error }));
|
|
3557
3902
|
throw error;
|
|
@@ -3565,15 +3910,15 @@ function createTransactionPoolController(config) {
|
|
|
3565
3910
|
sendStateStore.setSnapshot(createAsyncState("loading"));
|
|
3566
3911
|
try {
|
|
3567
3912
|
const restWithLifetime = resolveLifetimeOptions(rest);
|
|
3568
|
-
const
|
|
3913
|
+
const signature6 = await helper.prepareAndSend(
|
|
3569
3914
|
{
|
|
3570
3915
|
...restWithLifetime,
|
|
3571
3916
|
instructions: nextInstructions
|
|
3572
3917
|
},
|
|
3573
3918
|
sendOptions
|
|
3574
3919
|
);
|
|
3575
|
-
sendStateStore.setSnapshot(createAsyncState("success", { data:
|
|
3576
|
-
return
|
|
3920
|
+
sendStateStore.setSnapshot(createAsyncState("success", { data: signature6 }));
|
|
3921
|
+
return signature6;
|
|
3577
3922
|
} catch (error) {
|
|
3578
3923
|
sendStateStore.setSnapshot(createAsyncState("error", { error }));
|
|
3579
3924
|
throw error;
|
|
@@ -3664,6 +4009,6 @@ function stableStringify(value) {
|
|
|
3664
4009
|
}
|
|
3665
4010
|
__name(stableStringify, "stableStringify");
|
|
3666
4011
|
|
|
3667
|
-
export { LAMPORTS_PER_SOL, SIGNATURE_STATUS_TIMEOUT_MS, applyRatio, applySerializableState, assertDecimals, assertNonNegative, autoDiscover, backpack, bigintFromJson, bigintToJson, checkedAdd, checkedDivide, checkedMultiply, checkedSubtract, confirmationMeetsCommitment, connectWallet, createAsyncState, createClient, createClientStore, createDefaultClient, createDefaultClientStore, createInitialAsyncState, createInitialClientState, createRatio, createSolTransferController, createSolTransferHelper, createSolanaRpcClient, createSplTokenHelper, createSplTransferController, createStakeController, createStakeHelper, createTokenAmount, createTransactionHelper, createTransactionPoolController, createTransactionRecipe, createWalletRegistry, createWalletStandardConnector, defaultWalletConnectors, deriveConfirmationStatus, deserializeSolanaState, disconnectWallet, fetchAccount, fetchBalance, fetchLookupTable, fetchLookupTables, fetchNonceAccount, getInitialSerializableState, getWalletStandardConnectors, injected, insertReferenceKey, insertReferenceKeys, lamports, lamportsFromJson, lamportsFromSol, lamportsMath, lamportsToJson, lamportsToSolString, metamask, normalizeSignature, phantom, pow10, prepareTransaction, requestAirdrop, resolveClientConfig, resolveCluster, sendTransaction, serializeSolanaState, setCluster, solflare, stableStringify, subscribeSolanaState, toAddress2 as toAddress, toAddressString, toBigint2 as toBigint, transactionToBase64, transactionToBase64WithSigners, watchWalletStandardConnectors };
|
|
4012
|
+
export { LAMPORTS_PER_SOL, SIGNATURE_STATUS_TIMEOUT_MS, WRAPPED_SOL_MINT, applyRatio, applySerializableState, assertDecimals, assertNonNegative, autoDiscover, backpack, bigintFromJson, bigintToJson, checkedAdd, checkedDivide, checkedMultiply, checkedSubtract, confirmationMeetsCommitment, connectWallet, createAsyncState, createClient, createClientStore, createDefaultClient, createDefaultClientStore, createInitialAsyncState, createInitialClientState, createRatio, createSolTransferController, createSolTransferHelper, createSolanaRpcClient, createSplTokenHelper, createSplTransferController, createStakeController, createStakeHelper, createTokenAmount, createTransactionHelper, createTransactionPoolController, createTransactionRecipe, createWalletRegistry, createWalletStandardConnector, createWsolController, createWsolHelper, defaultWalletConnectors, deriveConfirmationStatus, deserializeSolanaState, disconnectWallet, fetchAccount, fetchBalance, fetchLookupTable, fetchLookupTables, fetchNonceAccount, getInitialSerializableState, getWalletStandardConnectors, injected, insertReferenceKey, insertReferenceKeys, lamports, lamportsFromJson, lamportsFromSol, lamportsMath, lamportsToJson, lamportsToSolString, metamask, normalizeSignature, phantom, pow10, prepareTransaction, requestAirdrop, resolveClientConfig, resolveCluster, sendTransaction, serializeSolanaState, setCluster, solflare, stableStringify, subscribeSolanaState, toAddress2 as toAddress, toAddressString, toBigint2 as toBigint, transactionToBase64, transactionToBase64WithSigners, watchWalletStandardConnectors };
|
|
3668
4013
|
//# sourceMappingURL=index.node.mjs.map
|
|
3669
4014
|
//# sourceMappingURL=index.node.mjs.map
|