@coinbase/cdp-sdk 1.38.3 → 1.38.4
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/CHANGELOG.md +6 -0
- package/_cjs/actions/evm/fund/fund.js +1 -0
- package/_cjs/actions/evm/fund/fund.js.map +1 -1
- package/_cjs/actions/evm/fund/quoteFund.js +1 -0
- package/_cjs/actions/evm/fund/quoteFund.js.map +1 -1
- package/_cjs/actions/solana/fund/fund.js +1 -0
- package/_cjs/actions/solana/fund/fund.js.map +1 -1
- package/_cjs/actions/solana/fund/quoteFund.js +1 -0
- package/_cjs/actions/solana/fund/quoteFund.js.map +1 -1
- package/_cjs/actions/solana/rpc.js +16 -0
- package/_cjs/actions/solana/rpc.js.map +1 -0
- package/_cjs/actions/solana/transfer.js +74 -48
- package/_cjs/actions/solana/transfer.js.map +1 -1
- package/_cjs/actions/solana/utils.js +4 -6
- package/_cjs/actions/solana/utils.js.map +1 -1
- package/_cjs/actions/waitForFundOperationReceipt.js +1 -0
- package/_cjs/actions/waitForFundOperationReceipt.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/actions/evm/fund/fund.js +1 -0
- package/_esm/actions/evm/fund/fund.js.map +1 -1
- package/_esm/actions/evm/fund/quoteFund.js +1 -0
- package/_esm/actions/evm/fund/quoteFund.js.map +1 -1
- package/_esm/actions/solana/fund/fund.js +1 -0
- package/_esm/actions/solana/fund/fund.js.map +1 -1
- package/_esm/actions/solana/fund/quoteFund.js +1 -0
- package/_esm/actions/solana/fund/quoteFund.js.map +1 -1
- package/_esm/actions/solana/rpc.js +13 -0
- package/_esm/actions/solana/rpc.js.map +1 -0
- package/_esm/actions/solana/transfer.js +72 -48
- package/_esm/actions/solana/transfer.js.map +1 -1
- package/_esm/actions/solana/utils.js +4 -6
- package/_esm/actions/solana/utils.js.map +1 -1
- package/_esm/actions/waitForFundOperationReceipt.js +1 -0
- package/_esm/actions/waitForFundOperationReceipt.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/actions/evm/fund/fund.d.ts +1 -0
- package/_types/actions/evm/fund/fund.d.ts.map +1 -1
- package/_types/actions/evm/fund/quoteFund.d.ts +1 -0
- package/_types/actions/evm/fund/quoteFund.d.ts.map +1 -1
- package/_types/actions/solana/fund/fund.d.ts +1 -0
- package/_types/actions/solana/fund/fund.d.ts.map +1 -1
- package/_types/actions/solana/fund/quoteFund.d.ts +1 -0
- package/_types/actions/solana/fund/quoteFund.d.ts.map +1 -1
- package/_types/actions/solana/rpc.d.ts +10 -0
- package/_types/actions/solana/rpc.d.ts.map +1 -0
- package/_types/actions/solana/transfer.d.ts +37 -1
- package/_types/actions/solana/transfer.d.ts.map +1 -1
- package/_types/actions/solana/utils.d.ts +4 -6
- package/_types/actions/solana/utils.d.ts.map +1 -1
- package/_types/actions/waitForFundOperationReceipt.d.ts +1 -0
- package/_types/actions/waitForFundOperationReceipt.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/actions/evm/fund/fund.ts +1 -0
- package/actions/evm/fund/quoteFund.ts +1 -0
- package/actions/solana/fund/fund.ts +1 -0
- package/actions/solana/fund/quoteFund.ts +1 -0
- package/actions/solana/rpc.ts +17 -0
- package/actions/solana/transfer.ts +115 -84
- package/actions/solana/utils.ts +4 -6
- package/actions/waitForFundOperationReceipt.ts +1 -0
- package/package.json +5 -6
- package/version.ts +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { pipe, createTransactionMessage, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, address, compileTransaction, setTransactionMessageFeePayer, createNoopSigner, getBase64EncodedWireTransaction, } from "@solana/kit";
|
|
2
|
+
import { getTransferSolInstruction } from "@solana-program/system";
|
|
3
|
+
import { findAssociatedTokenPda, getCreateAssociatedTokenInstructionAsync, getTransferCheckedInstruction, fetchToken, fetchMint, TOKEN_PROGRAM_ADDRESS, } from "@solana-program/token";
|
|
4
|
+
import { createRpcClient } from "./rpc.js";
|
|
3
5
|
import { sendTransaction } from "./sendTransaction.js";
|
|
4
6
|
import { getConnectedNetwork, getOrCreateConnection, getUsdcMintAddress, } from "./utils.js";
|
|
5
7
|
/**
|
|
@@ -13,89 +15,111 @@ import { getConnectedNetwork, getOrCreateConnection, getUsdcMintAddress, } from
|
|
|
13
15
|
export async function transfer(apiClient, options) {
|
|
14
16
|
const connection = getOrCreateConnection({ networkOrConnection: options.network });
|
|
15
17
|
const connectedNetwork = await getConnectedNetwork(connection);
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
+
const rpc = createRpcClient(connectedNetwork);
|
|
19
|
+
const base64Transaction = options.token === "sol"
|
|
20
|
+
? await getNativeTransferBase64Transaction({
|
|
21
|
+
rpc,
|
|
18
22
|
from: options.from,
|
|
19
23
|
to: options.to,
|
|
20
24
|
amount: options.amount,
|
|
21
25
|
})
|
|
22
|
-
: await
|
|
23
|
-
|
|
26
|
+
: await getSplTransferBase64Transaction({
|
|
27
|
+
rpc,
|
|
24
28
|
from: options.from,
|
|
25
29
|
to: options.to,
|
|
26
30
|
mintAddress: options.token === "usdc" ? getUsdcMintAddress(connectedNetwork) : options.token,
|
|
27
31
|
amount: options.amount,
|
|
28
32
|
});
|
|
29
|
-
const serializedTx = Buffer.from(tx.serialize({ requireAllSignatures: false })).toString("base64");
|
|
30
33
|
const signature = await sendTransaction(apiClient, {
|
|
31
34
|
network: connectedNetwork === "mainnet" ? "solana" : "solana-devnet",
|
|
32
|
-
transaction:
|
|
35
|
+
transaction: base64Transaction,
|
|
33
36
|
});
|
|
34
37
|
return signature;
|
|
35
38
|
}
|
|
36
39
|
/**
|
|
37
|
-
* Gets the transaction for a
|
|
40
|
+
* Gets the transaction for a SOL transfer
|
|
38
41
|
*
|
|
39
|
-
* @param options - The options for the
|
|
42
|
+
* @param options - The options for the SOL transfer
|
|
40
43
|
*
|
|
44
|
+
* @param options.rpc - The Solana RPC client
|
|
41
45
|
* @param options.from - The source address
|
|
42
46
|
* @param options.to - The destination address
|
|
43
|
-
* @param options.amount - The amount to transfer
|
|
47
|
+
* @param options.amount - The amount in lamports to transfer
|
|
44
48
|
*
|
|
45
|
-
* @returns The
|
|
49
|
+
* @returns The SOL transfer transaction
|
|
46
50
|
*/
|
|
47
|
-
async function
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
export async function getNativeTransferBase64Transaction({ rpc, from, to, amount, }) {
|
|
52
|
+
const fromAddr = address(from);
|
|
53
|
+
const toAddr = address(to);
|
|
54
|
+
const instructions = [
|
|
55
|
+
getTransferSolInstruction({
|
|
56
|
+
source: createNoopSigner(fromAddr),
|
|
57
|
+
destination: toAddr,
|
|
58
|
+
amount,
|
|
59
|
+
}),
|
|
60
|
+
];
|
|
61
|
+
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
|
|
62
|
+
const txMsg = pipe(createTransactionMessage({ version: 0 }), tx => setTransactionMessageFeePayer(fromAddr, tx), tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), tx => appendTransactionMessageInstructions(instructions, tx));
|
|
63
|
+
const compiledTransaction = compileTransaction(txMsg);
|
|
64
|
+
return getBase64EncodedWireTransaction(compiledTransaction);
|
|
57
65
|
}
|
|
58
66
|
/**
|
|
59
67
|
* Gets the transaction for a SPL token transfer
|
|
60
68
|
*
|
|
61
69
|
* @param options - The options for the SPL token transfer
|
|
62
70
|
*
|
|
63
|
-
* @param options.
|
|
71
|
+
* @param options.rpc - The Solana RPC client
|
|
64
72
|
* @param options.from - The source address
|
|
65
73
|
* @param options.to - The destination address
|
|
66
74
|
* @param options.mintAddress - The mint address of the token
|
|
67
|
-
* @param options.amount - The amount to transfer
|
|
75
|
+
* @param options.amount - The amount in units of the token to transfer
|
|
68
76
|
*
|
|
69
77
|
* @returns The SPL token transfer transaction
|
|
70
78
|
*/
|
|
71
|
-
async function
|
|
72
|
-
const
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
export async function getSplTransferBase64Transaction({ rpc, from, to, mintAddress, amount, }) {
|
|
80
|
+
const fromAddr = address(from);
|
|
81
|
+
const toAddr = address(to);
|
|
82
|
+
const mintAddr = address(mintAddress);
|
|
83
|
+
const mintInfo = await fetchMint(rpc, mintAddr);
|
|
84
|
+
const [sourceAta] = await findAssociatedTokenPda({
|
|
85
|
+
mint: mintAddr,
|
|
86
|
+
owner: fromAddr,
|
|
87
|
+
tokenProgram: TOKEN_PROGRAM_ADDRESS,
|
|
88
|
+
});
|
|
89
|
+
const [destAta] = await findAssociatedTokenPda({
|
|
90
|
+
mint: mintAddr,
|
|
91
|
+
owner: toAddr,
|
|
92
|
+
tokenProgram: TOKEN_PROGRAM_ADDRESS,
|
|
93
|
+
});
|
|
94
|
+
const sourceAcct = await fetchToken(rpc, sourceAta);
|
|
95
|
+
if (sourceAcct.data.amount < amount) {
|
|
96
|
+
throw new Error(`Insufficient token balance: have ${sourceAcct.data.amount}, need ${amount}`);
|
|
88
97
|
}
|
|
89
|
-
|
|
98
|
+
const instructions = [];
|
|
99
|
+
// If destination ATA does not exist, add create instruction
|
|
90
100
|
try {
|
|
91
|
-
await
|
|
101
|
+
await fetchToken(rpc, destAta);
|
|
92
102
|
}
|
|
93
103
|
catch {
|
|
94
|
-
|
|
104
|
+
const createDestIx = await getCreateAssociatedTokenInstructionAsync({
|
|
105
|
+
payer: createNoopSigner(fromAddr),
|
|
106
|
+
owner: toAddr,
|
|
107
|
+
ata: destAta,
|
|
108
|
+
mint: mintAddr,
|
|
109
|
+
});
|
|
110
|
+
instructions.push(createDestIx);
|
|
95
111
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
112
|
+
instructions.push(getTransferCheckedInstruction({
|
|
113
|
+
source: sourceAta,
|
|
114
|
+
mint: mintAddr,
|
|
115
|
+
destination: destAta,
|
|
116
|
+
authority: fromAddr,
|
|
117
|
+
amount,
|
|
118
|
+
decimals: mintInfo.data.decimals,
|
|
119
|
+
}));
|
|
120
|
+
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
|
|
121
|
+
const txMsg = pipe(createTransactionMessage({ version: 0 }), tx => setTransactionMessageFeePayer(fromAddr, tx), tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), tx => appendTransactionMessageInstructions(instructions, tx));
|
|
122
|
+
const compiledTransaction = compileTransaction(txMsg);
|
|
123
|
+
return getBase64EncodedWireTransaction(compiledTransaction);
|
|
100
124
|
}
|
|
101
125
|
//# sourceMappingURL=transfer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer.js","sourceRoot":"","sources":["../../../actions/solana/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"transfer.js","sourceRoot":"","sources":["../../../actions/solana/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,wBAAwB,EACxB,2CAA2C,EAC3C,oCAAoC,EAGpC,OAAO,EACP,kBAAkB,EAClB,6BAA6B,EAC7B,gBAAgB,EAChB,+BAA+B,GAChC,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EACL,sBAAsB,EACtB,wCAAwC,EACxC,6BAA6B,EAC7B,UAAU,EACV,SAAS,EACT,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,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AChB,wBAAwB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EACxC,EAAE,CAAC,EAAE,CAAC,6BAA6B,CAAC,QAAQ,EAAE,EAAE,CAAC,EACjD,EAAE,CAAC,EAAE,CAAC,2CAA2C,CAAC,eAAe,EAAE,EAAE,CAAC,EACtE,EAAE,CAAC,EAAE,CAAC,oCAAoC,CAAC,YAAY,EAAE,EAAE,CAAC,CAC7D,CAAC;IAEF,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACtD,OAAO,+BAA+B,CAAC,mBAAmB,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Connection } from "@solana/web3.js";
|
|
2
2
|
import { GENESIS_HASH_MAINNET, GENESIS_HASH_DEVNET, USDC_MAINNET_MINT_ADDRESS, USDC_DEVNET_MINT_ADDRESS, } from "./constants.js";
|
|
3
3
|
/**
|
|
4
|
-
* Get a connection
|
|
4
|
+
* Get a connection for the Solana network
|
|
5
5
|
*
|
|
6
6
|
* @param options - The options for the connection
|
|
7
7
|
*
|
|
@@ -18,12 +18,10 @@ export function getOrCreateConnection({ networkOrConnection, }) {
|
|
|
18
18
|
: "https://api.devnet.solana.com");
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Legacy function for compatibility during migration
|
|
22
22
|
*
|
|
23
|
-
* @param connection - The
|
|
24
|
-
* @
|
|
25
|
-
*
|
|
26
|
-
* @returns The network of the connected Solana node
|
|
23
|
+
* @param connection - The Solana Connection instance
|
|
24
|
+
* @returns The network type (mainnet or devnet)
|
|
27
25
|
*/
|
|
28
26
|
export async function getConnectedNetwork(connection) {
|
|
29
27
|
const genesisHash = await connection.getGenesisHash();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../actions/solana/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,M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AM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACpD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IACjD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,yBAAyB,CAAC;IACnC,CAAC;IACD,OAAO,wBAAwB,CAAC;AAClC,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { wait } from "../utils/wait.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Waits for a fund operation to complete or fail.
|
|
5
5
|
*
|
|
6
|
+
* @deprecated This method will be removed in a future version. Consider using our Onramp API instead. See https://docs.cdp.coinbase.com/api-reference/v2/rest-api/onramp/create-an-onramp-order.
|
|
6
7
|
* @example
|
|
7
8
|
* ```ts
|
|
8
9
|
* import { waitForFundOperation } from "@coinbase/cdp-sdk";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForFundOperationReceipt.js","sourceRoot":"","sources":["../../actions/waitForFundOperationReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,IAAI,EAAe,MAAM,kBAAkB,CAAC;AAmDrD
|
|
1
|
+
{"version":3,"file":"waitForFundOperationReceipt.js","sourceRoot":"","sources":["../../actions/waitForFundOperationReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,IAAI,EAAe,MAAM,kBAAkB,CAAC;AAmDrD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,MAA4B,EAC5B,OAAoC;IAEpC,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAE/B,MAAM,MAAM,GAAG,KAAK,IAAI,EAAE;QACxB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;Q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ANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = "1.38.
|
|
1
|
+
export const version = "1.38.4";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -12,6 +12,7 @@ export interface EvmFundOptions extends BaseFundOptions {
|
|
|
12
12
|
/**
|
|
13
13
|
* Funds an EVM account.
|
|
14
14
|
*
|
|
15
|
+
* @deprecated This method will be removed in a future version. Consider using our Onramp API instead. See https://docs.cdp.coinbase.com/api-reference/v2/rest-api/onramp/create-an-onramp-order.
|
|
15
16
|
* @param apiClient - The API client.
|
|
16
17
|
* @param options - The options for funding an EVM account.
|
|
17
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fund.d.ts","sourceRoot":"","sources":["../../../../actions/evm/fund/fund.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,yCAAyC;IACzC,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,sCAAsC;IACtC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB;AAED
|
|
1
|
+
{"version":3,"file":"fund.d.ts","sourceRoot":"","sources":["../../../../actions/evm/fund/fund.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,yCAAyC;IACzC,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,sCAAsC;IACtC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,wBAAsB,IAAI,CACxB,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,mBAAmB,CAAC,CAyC9B"}
|
|
@@ -13,6 +13,7 @@ export interface EvmQuoteFundOptions extends BaseQuoteFundOptions {
|
|
|
13
13
|
/**
|
|
14
14
|
* Gets a quote to fund an EVM account.
|
|
15
15
|
*
|
|
16
|
+
* @deprecated This method will be removed in a future version. Consider using our Onramp API instead. See https://docs.cdp.coinbase.com/api-reference/v2/rest-api/onramp/create-an-onramp-order.
|
|
16
17
|
* @param apiClient - The API client.
|
|
17
18
|
* @param options - The options for getting a quote to fund an EVM account.
|
|
18
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quoteFund.d.ts","sourceRoot":"","sources":["../../../../actions/evm/fund/quoteFund.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,yCAAyC;IACzC,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,sCAAsC;IACtC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB;AAED
|
|
1
|
+
{"version":3,"file":"quoteFund.d.ts","sourceRoot":"","sources":["../../../../actions/evm/fund/quoteFund.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,yCAAyC;IACzC,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,sCAAsC;IACtC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,QAAQ,CAAC,CA8CnB"}
|
|
@@ -10,6 +10,7 @@ export interface SolanaFundOptions extends BaseFundOptions {
|
|
|
10
10
|
/**
|
|
11
11
|
* Funds a Solana account.
|
|
12
12
|
*
|
|
13
|
+
* @deprecated This method will be removed in a future version. Consider using our Onramp API instead. See https://docs.cdp.coinbase.com/api-reference/v2/rest-api/onramp/create-an-onramp-order.
|
|
13
14
|
* @param apiClient - The API client.
|
|
14
15
|
* @param options - The options for funding a Solana account.
|
|
15
16
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fund.d.ts","sourceRoot":"","sources":["../../../../actions/solana/fund/fund.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD,sCAAsC;IACtC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB;AAED
|
|
1
|
+
{"version":3,"file":"fund.d.ts","sourceRoot":"","sources":["../../../../actions/solana/fund/fund.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD,sCAAsC;IACtC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,wBAAsB,IAAI,CACxB,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,mBAAmB,CAAC,CAyC9B"}
|
|
@@ -11,6 +11,7 @@ export interface SolanaQuoteFundOptions extends BaseQuoteFundOptions {
|
|
|
11
11
|
/**
|
|
12
12
|
* Gets a quote to fund a Solana account.
|
|
13
13
|
*
|
|
14
|
+
* @deprecated This method will be removed in a future version. Consider using our Onramp API instead. See https://docs.cdp.coinbase.com/api-reference/v2/rest-api/onramp/create-an-onramp-order.
|
|
14
15
|
* @param apiClient - The API client.
|
|
15
16
|
* @param options - The options for getting a quote to fund a Solana account.
|
|
16
17
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quoteFund.d.ts","sourceRoot":"","sources":["../../../../actions/solana/fund/quoteFund.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EAGrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB;IAClE,sCAAsC;IACtC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB;AAED
|
|
1
|
+
{"version":3,"file":"quoteFund.d.ts","sourceRoot":"","sources":["../../../../actions/solana/fund/quoteFund.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EAGrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB;IAClE,sCAAsC;IACtC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,WAAW,CAAC,CA8CtB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Network } from "./utils.js";
|
|
2
|
+
/**
|
|
3
|
+
* Create a Solana RPC client for the given network
|
|
4
|
+
*
|
|
5
|
+
* @param network - The network to connect to
|
|
6
|
+
*
|
|
7
|
+
* @returns The RPC client
|
|
8
|
+
*/
|
|
9
|
+
export declare function createRpcClient(network: Network): import("@solana/kit").Rpc<import("@solana/kit").RequestAirdropApi & import("@solana/kit").GetAccountInfoApi & import("@solana/kit").GetBalanceApi & import("@solana/kit").GetBlockApi & import("@solana/kit").GetBlockCommitmentApi & import("@solana/kit").GetBlockHeightApi & import("@solana/kit").GetBlockProductionApi & import("@solana/kit").GetBlocksApi & import("@solana/kit").GetBlocksWithLimitApi & import("@solana/kit").GetBlockTimeApi & import("@solana/kit").GetClusterNodesApi & import("@solana/kit").GetEpochInfoApi & import("@solana/kit").GetEpochScheduleApi & import("@solana/kit").GetFeeForMessageApi & import("@solana/kit").GetFirstAvailableBlockApi & import("@solana/kit").GetGenesisHashApi & import("@solana/kit").GetHealthApi & import("@solana/kit").GetHighestSnapshotSlotApi & import("@solana/kit").GetIdentityApi & import("@solana/kit").GetInflationGovernorApi & import("@solana/kit").GetInflationRateApi & import("@solana/kit").GetInflationRewardApi & import("@solana/kit").GetLargestAccountsApi & import("@solana/kit").GetLatestBlockhashApi & import("@solana/kit").GetLeaderScheduleApi & import("@solana/kit").GetMaxRetransmitSlotApi & import("@solana/kit").GetMaxShredInsertSlotApi & import("@solana/kit").GetMinimumBalanceForRentExemptionApi & import("@solana/kit").GetMultipleAccountsApi & import("@solana/kit").GetProgramAccountsApi & import("@solana/kit").GetRecentPerformanceSamplesApi & import("@solana/kit").GetRecentPrioritizationFeesApi & import("@solana/kit").GetSignaturesForAddressApi & import("@solana/kit").GetSignatureStatusesApi & import("@solana/kit").GetSlotApi & import("@solana/kit").GetSlotLeaderApi & import("@solana/kit").GetSlotLeadersApi & import("@solana/kit").GetStakeMinimumDelegationApi & import("@solana/kit").GetSupplyApi & import("@solana/kit").GetTokenAccountBalanceApi & import("@solana/kit").GetTokenAccountsByDelegateApi & import("@solana/kit").GetTokenAccountsByOwnerApi & import("@solana/kit").GetTokenLargestAccountsApi & import("@solana/kit").GetTokenSupplyApi & import("@solana/kit").GetTransactionApi & import("@solana/kit").GetTransactionCountApi & import("@solana/kit").GetVersionApi & import("@solana/kit").GetVoteAccountsApi & import("@solana/kit").IsBlockhashValidApi & import("@solana/kit").MinimumLedgerSlotApi & import("@solana/kit").SendTransactionApi & import("@solana/kit").SimulateTransactionApi>;
|
|
10
|
+
//# sourceMappingURL=rpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../../actions/solana/rpc.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,o0EAK/C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createSolanaRpc } from "@solana/kit";
|
|
1
2
|
import { Connection } from "@solana/web3.js";
|
|
2
3
|
import { type Network } from "./utils.js";
|
|
3
4
|
import type { SignatureResult } from "../../client/solana/solana.types.js";
|
|
@@ -20,7 +21,7 @@ export interface TransferOptions {
|
|
|
20
21
|
*/
|
|
21
22
|
token: "sol" | "usdc" | string;
|
|
22
23
|
/**
|
|
23
|
-
* The network to use which will be used to create
|
|
24
|
+
* The network to use which will be used to create an RPC client, otherwise an RPC client can be provided.
|
|
24
25
|
*/
|
|
25
26
|
network: Network | Connection;
|
|
26
27
|
}
|
|
@@ -33,4 +34,39 @@ export interface TransferOptions {
|
|
|
33
34
|
* @returns The transfer result
|
|
34
35
|
*/
|
|
35
36
|
export declare function transfer(apiClient: CdpOpenApiClientType, options: TransferOptions): Promise<SignatureResult>;
|
|
37
|
+
type GetNativeTransferOptions = Omit<TransferOptions, "token" | "network"> & {
|
|
38
|
+
rpc: ReturnType<typeof createSolanaRpc>;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Gets the transaction for a SOL transfer
|
|
42
|
+
*
|
|
43
|
+
* @param options - The options for the SOL transfer
|
|
44
|
+
*
|
|
45
|
+
* @param options.rpc - The Solana RPC client
|
|
46
|
+
* @param options.from - The source address
|
|
47
|
+
* @param options.to - The destination address
|
|
48
|
+
* @param options.amount - The amount in lamports to transfer
|
|
49
|
+
*
|
|
50
|
+
* @returns The SOL transfer transaction
|
|
51
|
+
*/
|
|
52
|
+
export declare function getNativeTransferBase64Transaction({ rpc, from, to, amount, }: GetNativeTransferOptions): Promise<string>;
|
|
53
|
+
type GetSplTokenTransferOptions = Omit<TransferOptions, "network" | "token"> & {
|
|
54
|
+
mintAddress: string;
|
|
55
|
+
rpc: ReturnType<typeof createSolanaRpc>;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Gets the transaction for a SPL token transfer
|
|
59
|
+
*
|
|
60
|
+
* @param options - The options for the SPL token transfer
|
|
61
|
+
*
|
|
62
|
+
* @param options.rpc - The Solana RPC client
|
|
63
|
+
* @param options.from - The source address
|
|
64
|
+
* @param options.to - The destination address
|
|
65
|
+
* @param options.mintAddress - The mint address of the token
|
|
66
|
+
* @param options.amount - The amount in units of the token to transfer
|
|
67
|
+
*
|
|
68
|
+
* @returns The SPL token transfer transaction
|
|
69
|
+
*/
|
|
70
|
+
export declare function getSplTransferBase64Transaction({ rpc, from, to, mintAddress, amount, }: GetSplTokenTransferOptions): Promise<string>;
|
|
71
|
+
export {};
|
|
36
72
|
//# sourceMappingURL=transfer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../../actions/solana/transfer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transfer.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GAYG;AACH,wBAAsB,+BAA+B,CAAC,EACpD,GAAG,EACH,IAAI,EACJ,EAAE,EACF,WAAW,EACX,MAAM,GACP,EAAE,0BAA0B,GAAG,OAAO,CAAC,MAAM,CAAC,CA4D9C"}
|
|
@@ -4,7 +4,7 @@ type GetOrCreateConnectionOptions = {
|
|
|
4
4
|
networkOrConnection: Network | Connection;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
|
-
* Get a connection
|
|
7
|
+
* Get a connection for the Solana network
|
|
8
8
|
*
|
|
9
9
|
* @param options - The options for the connection
|
|
10
10
|
*
|
|
@@ -14,12 +14,10 @@ type GetOrCreateConnectionOptions = {
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function getOrCreateConnection({ networkOrConnection, }: GetOrCreateConnectionOptions): Connection;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Legacy function for compatibility during migration
|
|
18
18
|
*
|
|
19
|
-
* @param connection - The
|
|
20
|
-
* @
|
|
21
|
-
*
|
|
22
|
-
* @returns The network of the connected Solana node
|
|
19
|
+
* @param connection - The Solana Connection instance
|
|
20
|
+
* @returns The network type (mainnet or devnet)
|
|
23
21
|
*/
|
|
24
22
|
export declare function getConnectedNetwork(connection: Connection): Promise<Network>;
|
|
25
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../actions/solana/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAS7C,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE3C,KAAK,4BAA4B,GAAG;IAClC,mBAAmB,EAAE,OAAO,GAAG,UAAU,CAAC;CAC3C,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,mBAAmB,GACpB,EAAE,4BAA4B,GAAG,UAAU,CAU3C;AAED
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../actions/solana/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAS7C,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE3C,KAAK,4BAA4B,GAAG;IAClC,mBAAmB,EAAE,OAAO,GAAG,UAAU,CAAC;CAC3C,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,mBAAmB,GACpB,EAAE,4BAA4B,GAAG,UAAU,CAU3C;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAUlF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAK3D"}
|
|
@@ -48,6 +48,7 @@ export type WaitForFundOperationResult = FailedFundOperation | CompletedFundOper
|
|
|
48
48
|
/**
|
|
49
49
|
* Waits for a fund operation to complete or fail.
|
|
50
50
|
*
|
|
51
|
+
* @deprecated This method will be removed in a future version. Consider using our Onramp API instead. See https://docs.cdp.coinbase.com/api-reference/v2/rest-api/onramp/create-an-onramp-order.
|
|
51
52
|
* @example
|
|
52
53
|
* ```ts
|
|
53
54
|
* import { waitForFundOperation } from "@coinbase/cdp-sdk";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForFundOperationReceipt.d.ts","sourceRoot":"","sources":["../../actions/waitForFundOperationReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAY,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAQ,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,MAAM,EAAE,OAAO,cAAc,CAAC,MAAM,CAAC;CACtC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,MAAM,EAAE,OAAO,cAAc,CAAC,SAAS,CAAC;IACxC,4CAA4C;IAC5C,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;AAEtF
|
|
1
|
+
{"version":3,"file":"waitForFundOperationReceipt.d.ts","sourceRoot":"","sources":["../../actions/waitForFundOperationReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAY,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAQ,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,MAAM,EAAE,OAAO,cAAc,CAAC,MAAM,CAAC;CACtC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,MAAM,EAAE,OAAO,cAAc,CAAC,SAAS,CAAC;IACxC,4CAA4C;IAC5C,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;AAEtF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,oBAAoB,EAC5B,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,0BAA0B,CAAC,CAqCrC"}
|
package/_types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.38.
|
|
1
|
+
export declare const version = "1.38.4";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/actions/evm/fund/fund.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface EvmFundOptions extends BaseFundOptions {
|
|
|
21
21
|
/**
|
|
22
22
|
* Funds an EVM account.
|
|
23
23
|
*
|
|
24
|
+
* @deprecated This method will be removed in a future version. Consider using our Onramp API instead. See https://docs.cdp.coinbase.com/api-reference/v2/rest-api/onramp/create-an-onramp-order.
|
|
24
25
|
* @param apiClient - The API client.
|
|
25
26
|
* @param options - The options for funding an EVM account.
|
|
26
27
|
*
|
|
@@ -22,6 +22,7 @@ export interface EvmQuoteFundOptions extends BaseQuoteFundOptions {
|
|
|
22
22
|
/**
|
|
23
23
|
* Gets a quote to fund an EVM account.
|
|
24
24
|
*
|
|
25
|
+
* @deprecated This method will be removed in a future version. Consider using our Onramp API instead. See https://docs.cdp.coinbase.com/api-reference/v2/rest-api/onramp/create-an-onramp-order.
|
|
25
26
|
* @param apiClient - The API client.
|
|
26
27
|
* @param options - The options for getting a quote to fund an EVM account.
|
|
27
28
|
*
|
|
@@ -19,6 +19,7 @@ export interface SolanaFundOptions extends BaseFundOptions {
|
|
|
19
19
|
/**
|
|
20
20
|
* Funds a Solana account.
|
|
21
21
|
*
|
|
22
|
+
* @deprecated This method will be removed in a future version. Consider using our Onramp API instead. See https://docs.cdp.coinbase.com/api-reference/v2/rest-api/onramp/create-an-onramp-order.
|
|
22
23
|
* @param apiClient - The API client.
|
|
23
24
|
* @param options - The options for funding a Solana account.
|
|
24
25
|
*
|
|
@@ -20,6 +20,7 @@ export interface SolanaQuoteFundOptions extends BaseQuoteFundOptions {
|
|
|
20
20
|
/**
|
|
21
21
|
* Gets a quote to fund a Solana account.
|
|
22
22
|
*
|
|
23
|
+
* @deprecated This method will be removed in a future version. Consider using our Onramp API instead. See https://docs.cdp.coinbase.com/api-reference/v2/rest-api/onramp/create-an-onramp-order.
|
|
23
24
|
* @param apiClient - The API client.
|
|
24
25
|
* @param options - The options for getting a quote to fund a Solana account.
|
|
25
26
|
*
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createSolanaRpc } from "@solana/kit";
|
|
2
|
+
|
|
3
|
+
import type { Network } from "./utils.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Create a Solana RPC client for the given network
|
|
7
|
+
*
|
|
8
|
+
* @param network - The network to connect to
|
|
9
|
+
*
|
|
10
|
+
* @returns The RPC client
|
|
11
|
+
*/
|
|
12
|
+
export function createRpcClient(network: Network) {
|
|
13
|
+
const endpoint =
|
|
14
|
+
network === "mainnet" ? "https://api.mainnet-beta.solana.com" : "https://api.devnet.solana.com";
|
|
15
|
+
|
|
16
|
+
return createSolanaRpc(endpoint);
|
|
17
|
+
}
|