@solana/rpc-api 2.0.0-experimental.12ae1c6
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/LICENSE +20 -0
- package/README.md +17 -0
- package/dist/index.browser.cjs +199 -0
- package/dist/index.browser.cjs.map +1 -0
- package/dist/index.browser.js +197 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/index.native.js +197 -0
- package/dist/index.native.js.map +1 -0
- package/dist/index.node.cjs +199 -0
- package/dist/index.node.cjs.map +1 -0
- package/dist/index.node.js +197 -0
- package/dist/index.node.js.map +1 -0
- package/dist/types/common-transactions.d.ts +247 -0
- package/dist/types/common-transactions.d.ts.map +1 -0
- package/dist/types/common.d.ts +69 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/getAccountInfo.d.ts +35 -0
- package/dist/types/getAccountInfo.d.ts.map +1 -0
- package/dist/types/getBalance.d.ts +15 -0
- package/dist/types/getBalance.d.ts.map +1 -0
- package/dist/types/getBlock.d.ts +174 -0
- package/dist/types/getBlock.d.ts.map +1 -0
- package/dist/types/getBlockCommitment.d.ts +15 -0
- package/dist/types/getBlockCommitment.d.ts.map +1 -0
- package/dist/types/getBlockHeight.d.ts +14 -0
- package/dist/types/getBlockHeight.d.ts.map +1 -0
- package/dist/types/getBlockProduction.d.ts +39 -0
- package/dist/types/getBlockProduction.d.ts.map +1 -0
- package/dist/types/getBlockTime.d.ts +14 -0
- package/dist/types/getBlockTime.d.ts.map +1 -0
- package/dist/types/getBlocks.d.ts +13 -0
- package/dist/types/getBlocks.d.ts.map +1 -0
- package/dist/types/getBlocksWithLimit.d.ts +14 -0
- package/dist/types/getBlocksWithLimit.d.ts.map +1 -0
- package/dist/types/getClusterNodes.d.ts +34 -0
- package/dist/types/getClusterNodes.d.ts.map +1 -0
- package/dist/types/getEpochInfo.d.ts +27 -0
- package/dist/types/getEpochInfo.d.ts.map +1 -0
- package/dist/types/getEpochSchedule.d.ts +23 -0
- package/dist/types/getEpochSchedule.d.ts.map +1 -0
- package/dist/types/getFeeForMessage.d.ts +16 -0
- package/dist/types/getFeeForMessage.d.ts.map +1 -0
- package/dist/types/getFirstAvailableBlock.d.ts +12 -0
- package/dist/types/getFirstAvailableBlock.d.ts.map +1 -0
- package/dist/types/getGenesisHash.d.ts +11 -0
- package/dist/types/getGenesisHash.d.ts.map +1 -0
- package/dist/types/getHealth.d.ts +10 -0
- package/dist/types/getHealth.d.ts.map +1 -0
- package/dist/types/getHighestSnapshotSlot.d.ts +18 -0
- package/dist/types/getHighestSnapshotSlot.d.ts.map +1 -0
- package/dist/types/getIdentity.d.ts +13 -0
- package/dist/types/getIdentity.d.ts.map +1 -0
- package/dist/types/getInflationGovernor.d.ts +29 -0
- package/dist/types/getInflationGovernor.d.ts.map +1 -0
- package/dist/types/getInflationRate.d.ts +21 -0
- package/dist/types/getInflationRate.d.ts.map +1 -0
- package/dist/types/getInflationReward.d.ts +22 -0
- package/dist/types/getInflationReward.d.ts.map +1 -0
- package/dist/types/getLargestAccounts.d.ts +23 -0
- package/dist/types/getLargestAccounts.d.ts.map +1 -0
- package/dist/types/getLatestBlockhash.d.ts +19 -0
- package/dist/types/getLatestBlockhash.d.ts.map +1 -0
- package/dist/types/getLeaderSchedule.d.ts +51 -0
- package/dist/types/getLeaderSchedule.d.ts.map +1 -0
- package/dist/types/getMaxRetransmitSlot.d.ts +12 -0
- package/dist/types/getMaxRetransmitSlot.d.ts.map +1 -0
- package/dist/types/getMaxShredInsertSlot.d.ts +12 -0
- package/dist/types/getMaxShredInsertSlot.d.ts.map +1 -0
- package/dist/types/getMinimumBalanceForRentExemption.d.ts +13 -0
- package/dist/types/getMinimumBalanceForRentExemption.d.ts.map +1 -0
- package/dist/types/getMultipleAccounts.d.ts +45 -0
- package/dist/types/getMultipleAccounts.d.ts.map +1 -0
- package/dist/types/getProgramAccounts.d.ts +61 -0
- package/dist/types/getProgramAccounts.d.ts.map +1 -0
- package/dist/types/getRecentPerformanceSamples.d.ts +25 -0
- package/dist/types/getRecentPerformanceSamples.d.ts.map +1 -0
- package/dist/types/getRecentPrioritizationFees.d.ts +31 -0
- package/dist/types/getRecentPrioritizationFees.d.ts.map +1 -0
- package/dist/types/getSignatureStatuses.d.ts +58 -0
- package/dist/types/getSignatureStatuses.d.ts.map +1 -0
- package/dist/types/getSignaturesForAddress.d.ts +40 -0
- package/dist/types/getSignaturesForAddress.d.ts.map +1 -0
- package/dist/types/getSlot.d.ts +14 -0
- package/dist/types/getSlot.d.ts.map +1 -0
- package/dist/types/getSlotLeader.d.ts +13 -0
- package/dist/types/getSlotLeader.d.ts.map +1 -0
- package/dist/types/getSlotLeaders.d.ts +17 -0
- package/dist/types/getSlotLeaders.d.ts.map +1 -0
- package/dist/types/getStakeActivation.d.ts +24 -0
- package/dist/types/getStakeActivation.d.ts.map +1 -0
- package/dist/types/getStakeMinimumDelegation.d.ts +13 -0
- package/dist/types/getStakeMinimumDelegation.d.ts.map +1 -0
- package/dist/types/getSupply.d.ts +42 -0
- package/dist/types/getSupply.d.ts.map +1 -0
- package/dist/types/getTokenAccountBalance.d.ts +16 -0
- package/dist/types/getTokenAccountBalance.d.ts.map +1 -0
- package/dist/types/getTokenAccountsByDelegate.d.ts +55 -0
- package/dist/types/getTokenAccountsByDelegate.d.ts.map +1 -0
- package/dist/types/getTokenAccountsByOwner.d.ts +55 -0
- package/dist/types/getTokenAccountsByOwner.d.ts.map +1 -0
- package/dist/types/getTokenLargestAccounts.d.ts +16 -0
- package/dist/types/getTokenLargestAccounts.d.ts.map +1 -0
- package/dist/types/getTokenSupply.d.ts +16 -0
- package/dist/types/getTokenSupply.d.ts.map +1 -0
- package/dist/types/getTransaction.d.ts +166 -0
- package/dist/types/getTransaction.d.ts.map +1 -0
- package/dist/types/getTransactionCount.d.ts +14 -0
- package/dist/types/getTransactionCount.d.ts.map +1 -0
- package/dist/types/getVersion.d.ts +15 -0
- package/dist/types/getVersion.d.ts.map +1 -0
- package/dist/types/getVoteAccounts.d.ts +44 -0
- package/dist/types/getVoteAccounts.d.ts.map +1 -0
- package/dist/types/index.d.ts +64 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/isBlockhashValid.d.ts +18 -0
- package/dist/types/isBlockhashValid.d.ts.map +1 -0
- package/dist/types/minimumLedgerSlot.d.ts +12 -0
- package/dist/types/minimumLedgerSlot.d.ts.map +1 -0
- package/dist/types/requestAirdrop.d.ts +16 -0
- package/dist/types/requestAirdrop.d.ts.map +1 -0
- package/dist/types/sendTransaction.d.ts +49 -0
- package/dist/types/sendTransaction.d.ts.map +1 -0
- package/dist/types/simulateTransaction.d.ts +105 -0
- package/dist/types/simulateTransaction.d.ts.map +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { createRpcApi } from '@solana/rpc-spec';
|
|
2
|
+
import { getDefaultParamsTransformerForSolanaRpc, getDefaultResponseTransformerForSolanaRpc, jsonParsedAccountsConfigs, KEYPATH_WILDCARD, jsonParsedTokenAccountsConfigs } from '@solana/rpc-transformers';
|
|
3
|
+
|
|
4
|
+
// src/index.ts
|
|
5
|
+
function createSolanaRpcApi(config) {
|
|
6
|
+
return createRpcApi({
|
|
7
|
+
parametersTransformer: getDefaultParamsTransformerForSolanaRpc(config),
|
|
8
|
+
responseTransformer: getDefaultResponseTransformerForSolanaRpc({
|
|
9
|
+
allowedNumericKeyPaths: getAllowedNumericKeypaths()
|
|
10
|
+
})
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
var memoizedKeypaths;
|
|
14
|
+
function getAllowedNumericKeypaths() {
|
|
15
|
+
if (!memoizedKeypaths) {
|
|
16
|
+
memoizedKeypaths = {
|
|
17
|
+
getAccountInfo: jsonParsedAccountsConfigs.map((c) => ["value", ...c]),
|
|
18
|
+
getBlock: [
|
|
19
|
+
["blockTime"],
|
|
20
|
+
["transactions", KEYPATH_WILDCARD, "meta", "preTokenBalances", KEYPATH_WILDCARD, "accountIndex"],
|
|
21
|
+
[
|
|
22
|
+
"transactions",
|
|
23
|
+
KEYPATH_WILDCARD,
|
|
24
|
+
"meta",
|
|
25
|
+
"preTokenBalances",
|
|
26
|
+
KEYPATH_WILDCARD,
|
|
27
|
+
"uiTokenAmount",
|
|
28
|
+
"decimals"
|
|
29
|
+
],
|
|
30
|
+
["transactions", KEYPATH_WILDCARD, "meta", "postTokenBalances", KEYPATH_WILDCARD, "accountIndex"],
|
|
31
|
+
[
|
|
32
|
+
"transactions",
|
|
33
|
+
KEYPATH_WILDCARD,
|
|
34
|
+
"meta",
|
|
35
|
+
"postTokenBalances",
|
|
36
|
+
KEYPATH_WILDCARD,
|
|
37
|
+
"uiTokenAmount",
|
|
38
|
+
"decimals"
|
|
39
|
+
],
|
|
40
|
+
["transactions", KEYPATH_WILDCARD, "meta", "rewards", KEYPATH_WILDCARD, "commission"],
|
|
41
|
+
["transactions", KEYPATH_WILDCARD, "meta", "innerInstructions", KEYPATH_WILDCARD, "index"],
|
|
42
|
+
[
|
|
43
|
+
"transactions",
|
|
44
|
+
KEYPATH_WILDCARD,
|
|
45
|
+
"meta",
|
|
46
|
+
"innerInstructions",
|
|
47
|
+
KEYPATH_WILDCARD,
|
|
48
|
+
"instructions",
|
|
49
|
+
KEYPATH_WILDCARD,
|
|
50
|
+
"programIdIndex"
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"transactions",
|
|
54
|
+
KEYPATH_WILDCARD,
|
|
55
|
+
"meta",
|
|
56
|
+
"innerInstructions",
|
|
57
|
+
KEYPATH_WILDCARD,
|
|
58
|
+
"instructions",
|
|
59
|
+
KEYPATH_WILDCARD,
|
|
60
|
+
"accounts",
|
|
61
|
+
KEYPATH_WILDCARD
|
|
62
|
+
],
|
|
63
|
+
[
|
|
64
|
+
"transactions",
|
|
65
|
+
KEYPATH_WILDCARD,
|
|
66
|
+
"transaction",
|
|
67
|
+
"message",
|
|
68
|
+
"addressTableLookups",
|
|
69
|
+
KEYPATH_WILDCARD,
|
|
70
|
+
"writableIndexes",
|
|
71
|
+
KEYPATH_WILDCARD
|
|
72
|
+
],
|
|
73
|
+
[
|
|
74
|
+
"transactions",
|
|
75
|
+
KEYPATH_WILDCARD,
|
|
76
|
+
"transaction",
|
|
77
|
+
"message",
|
|
78
|
+
"addressTableLookups",
|
|
79
|
+
KEYPATH_WILDCARD,
|
|
80
|
+
"readonlyIndexes",
|
|
81
|
+
KEYPATH_WILDCARD
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
"transactions",
|
|
85
|
+
KEYPATH_WILDCARD,
|
|
86
|
+
"transaction",
|
|
87
|
+
"message",
|
|
88
|
+
"instructions",
|
|
89
|
+
KEYPATH_WILDCARD,
|
|
90
|
+
"programIdIndex"
|
|
91
|
+
],
|
|
92
|
+
[
|
|
93
|
+
"transactions",
|
|
94
|
+
KEYPATH_WILDCARD,
|
|
95
|
+
"transaction",
|
|
96
|
+
"message",
|
|
97
|
+
"instructions",
|
|
98
|
+
KEYPATH_WILDCARD,
|
|
99
|
+
"accounts",
|
|
100
|
+
KEYPATH_WILDCARD
|
|
101
|
+
],
|
|
102
|
+
["transactions", KEYPATH_WILDCARD, "transaction", "message", "header", "numReadonlySignedAccounts"],
|
|
103
|
+
["transactions", KEYPATH_WILDCARD, "transaction", "message", "header", "numReadonlyUnsignedAccounts"],
|
|
104
|
+
["transactions", KEYPATH_WILDCARD, "transaction", "message", "header", "numRequiredSignatures"],
|
|
105
|
+
["rewards", KEYPATH_WILDCARD, "commission"]
|
|
106
|
+
],
|
|
107
|
+
getBlockTime: [[]],
|
|
108
|
+
getClusterNodes: [
|
|
109
|
+
[KEYPATH_WILDCARD, "featureSet"],
|
|
110
|
+
[KEYPATH_WILDCARD, "shredVersion"]
|
|
111
|
+
],
|
|
112
|
+
getInflationGovernor: [["initial"], ["foundation"], ["foundationTerm"], ["taper"], ["terminal"]],
|
|
113
|
+
getInflationRate: [["foundation"], ["total"], ["validator"]],
|
|
114
|
+
getInflationReward: [[KEYPATH_WILDCARD, "commission"]],
|
|
115
|
+
getMultipleAccounts: jsonParsedAccountsConfigs.map((c) => ["value", KEYPATH_WILDCARD, ...c]),
|
|
116
|
+
getProgramAccounts: jsonParsedAccountsConfigs.flatMap((c) => [
|
|
117
|
+
["value", KEYPATH_WILDCARD, "account", ...c],
|
|
118
|
+
[KEYPATH_WILDCARD, "account", ...c]
|
|
119
|
+
]),
|
|
120
|
+
getRecentPerformanceSamples: [[KEYPATH_WILDCARD, "samplePeriodSecs"]],
|
|
121
|
+
getTokenAccountBalance: [
|
|
122
|
+
["value", "decimals"],
|
|
123
|
+
["value", "uiAmount"]
|
|
124
|
+
],
|
|
125
|
+
getTokenAccountsByDelegate: jsonParsedTokenAccountsConfigs.map((c) => [
|
|
126
|
+
"value",
|
|
127
|
+
KEYPATH_WILDCARD,
|
|
128
|
+
"account",
|
|
129
|
+
...c
|
|
130
|
+
]),
|
|
131
|
+
getTokenAccountsByOwner: jsonParsedTokenAccountsConfigs.map((c) => [
|
|
132
|
+
"value",
|
|
133
|
+
KEYPATH_WILDCARD,
|
|
134
|
+
"account",
|
|
135
|
+
...c
|
|
136
|
+
]),
|
|
137
|
+
getTokenLargestAccounts: [
|
|
138
|
+
["value", KEYPATH_WILDCARD, "decimals"],
|
|
139
|
+
["value", KEYPATH_WILDCARD, "uiAmount"]
|
|
140
|
+
],
|
|
141
|
+
getTokenSupply: [
|
|
142
|
+
["value", "decimals"],
|
|
143
|
+
["value", "uiAmount"]
|
|
144
|
+
],
|
|
145
|
+
getTransaction: [
|
|
146
|
+
["meta", "preTokenBalances", KEYPATH_WILDCARD, "accountIndex"],
|
|
147
|
+
["meta", "preTokenBalances", KEYPATH_WILDCARD, "uiTokenAmount", "decimals"],
|
|
148
|
+
["meta", "postTokenBalances", KEYPATH_WILDCARD, "accountIndex"],
|
|
149
|
+
["meta", "postTokenBalances", KEYPATH_WILDCARD, "uiTokenAmount", "decimals"],
|
|
150
|
+
["meta", "rewards", KEYPATH_WILDCARD, "commission"],
|
|
151
|
+
["meta", "innerInstructions", KEYPATH_WILDCARD, "index"],
|
|
152
|
+
["meta", "innerInstructions", KEYPATH_WILDCARD, "instructions", KEYPATH_WILDCARD, "programIdIndex"],
|
|
153
|
+
[
|
|
154
|
+
"meta",
|
|
155
|
+
"innerInstructions",
|
|
156
|
+
KEYPATH_WILDCARD,
|
|
157
|
+
"instructions",
|
|
158
|
+
KEYPATH_WILDCARD,
|
|
159
|
+
"accounts",
|
|
160
|
+
KEYPATH_WILDCARD
|
|
161
|
+
],
|
|
162
|
+
[
|
|
163
|
+
"transaction",
|
|
164
|
+
"message",
|
|
165
|
+
"addressTableLookups",
|
|
166
|
+
KEYPATH_WILDCARD,
|
|
167
|
+
"writableIndexes",
|
|
168
|
+
KEYPATH_WILDCARD
|
|
169
|
+
],
|
|
170
|
+
[
|
|
171
|
+
"transaction",
|
|
172
|
+
"message",
|
|
173
|
+
"addressTableLookups",
|
|
174
|
+
KEYPATH_WILDCARD,
|
|
175
|
+
"readonlyIndexes",
|
|
176
|
+
KEYPATH_WILDCARD
|
|
177
|
+
],
|
|
178
|
+
["transaction", "message", "instructions", KEYPATH_WILDCARD, "programIdIndex"],
|
|
179
|
+
["transaction", "message", "instructions", KEYPATH_WILDCARD, "accounts", KEYPATH_WILDCARD],
|
|
180
|
+
["transaction", "message", "header", "numReadonlySignedAccounts"],
|
|
181
|
+
["transaction", "message", "header", "numReadonlyUnsignedAccounts"],
|
|
182
|
+
["transaction", "message", "header", "numRequiredSignatures"]
|
|
183
|
+
],
|
|
184
|
+
getVersion: [["feature-set"]],
|
|
185
|
+
getVoteAccounts: [
|
|
186
|
+
["current", KEYPATH_WILDCARD, "commission"],
|
|
187
|
+
["delinquent", KEYPATH_WILDCARD, "commission"]
|
|
188
|
+
],
|
|
189
|
+
simulateTransaction: jsonParsedAccountsConfigs.map((c) => ["value", "accounts", KEYPATH_WILDCARD, ...c])
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
return memoizedKeypaths;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export { createSolanaRpcApi };
|
|
196
|
+
//# sourceMappingURL=out.js.map
|
|
197
|
+
//# sourceMappingURL=index.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";AAAA,SAAS,oBAA4B;AACrC;AAAA,EAEI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEG;AA2KA,SAAS,mBAEd,QAAsC;AACpC,SAAO,aAA0B;AAAA,IAC7B,uBAAuB,wCAAwC,MAAM;AAAA,IACrE,qBAAqB,0CAA0C;AAAA,MAC3D,wBAAwB,0BAA0B;AAAA,IACtD,CAAC;AAAA,EACL,CAAC;AACL;AAEA,IAAI;AAMJ,SAAS,4BAA0E;AAC/E,MAAI,CAAC,kBAAkB;AACnB,uBAAmB;AAAA,MACf,gBAAgB,0BAA0B,IAAI,OAAK,CAAC,SAAS,GAAG,CAAC,CAAC;AAAA,MAClE,UAAU;AAAA,QACN,CAAC,WAAW;AAAA,QACZ,CAAC,gBAAgB,kBAAkB,QAAQ,oBAAoB,kBAAkB,cAAc;AAAA,QAC/F;AAAA,UACI;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACJ;AAAA,QACA,CAAC,gBAAgB,kBAAkB,QAAQ,qBAAqB,kBAAkB,cAAc;AAAA,QAChG;AAAA,UACI;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACJ;AAAA,QACA,CAAC,gBAAgB,kBAAkB,QAAQ,WAAW,kBAAkB,YAAY;AAAA,QACpF,CAAC,gBAAgB,kBAAkB,QAAQ,qBAAqB,kBAAkB,OAAO;AAAA,QACzF;AAAA,UACI;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACJ;AAAA,QACA;AAAA,UACI;AAA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,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACJ;AAAA,QACA;AAAA,UACI;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACJ;AAAA,QACA,CAAC,eAAe,WAAW,gBAAgB,kBAAkB,gBAAgB;AAAA,QAC7E,CAAC,eAAe,WAAW,gBAAgB,kBAAkB,YAAY,gBAAgB;AAAA,QACzF,CAAC,eAAe,WAAW,UAAU,2BAA2B;AAAA,QAChE,CAAC,eAAe,WAAW,UAAU,6BAA6B;AAAA,QAClE,CAAC,eAAe,WAAW,UAAU,uBAAuB;AAAA,MAChE;AAAA,MACA,YAAY,CAAC,CAAC,aAAa,CAAC;AAAA,MAC5B,iBAAiB;AAAA,QACb,CAAC,WAAW,kBAAkB,YAAY;AAAA,QAC1C,CAAC,cAAc,kBAAkB,YAAY;AAAA,MACjD;AAAA,MACA,qBAAqB,0BAA0B,IAAI,OAAK,CAAC,SAAS,YAAY,kBAAkB,GAAG,CAAC,CAAC;AAAA,IACzG;AAAA,EACJ;AACA,SAAO;AACX","sourcesContent":["import { createRpcApi, RpcApi } from '@solana/rpc-spec';\nimport {\n AllowedNumericKeypaths,\n getDefaultParamsTransformerForSolanaRpc,\n getDefaultResponseTransformerForSolanaRpc,\n jsonParsedAccountsConfigs,\n jsonParsedTokenAccountsConfigs,\n KEYPATH_WILDCARD,\n ParamsTransformerConfig,\n} from '@solana/rpc-transformers';\n\nimport { GetAccountInfoApi } from './getAccountInfo';\nimport { GetBalanceApi } from './getBalance';\nimport { GetBlockApi } from './getBlock';\nimport { GetBlockCommitmentApi } from './getBlockCommitment';\nimport { GetBlockHeightApi } from './getBlockHeight';\nimport { GetBlockProductionApi } from './getBlockProduction';\nimport { GetBlocksApi } from './getBlocks';\nimport { GetBlocksWithLimitApi } from './getBlocksWithLimit';\nimport { GetBlockTimeApi } from './getBlockTime';\nimport { GetClusterNodesApi } from './getClusterNodes';\nimport { GetEpochInfoApi } from './getEpochInfo';\nimport { GetEpochScheduleApi } from './getEpochSchedule';\nimport { GetFeeForMessageApi } from './getFeeForMessage';\nimport { GetFirstAvailableBlockApi } from './getFirstAvailableBlock';\nimport { GetGenesisHashApi } from './getGenesisHash';\nimport { GetHealthApi } from './getHealth';\nimport { GetHighestSnapshotSlotApi } from './getHighestSnapshotSlot';\nimport { GetIdentityApi } from './getIdentity';\nimport { GetInflationGovernorApi } from './getInflationGovernor';\nimport { GetInflationRateApi } from './getInflationRate';\nimport { GetInflationRewardApi } from './getInflationReward';\nimport { GetLargestAccountsApi } from './getLargestAccounts';\nimport { GetLatestBlockhashApi } from './getLatestBlockhash';\nimport { GetLeaderScheduleApi } from './getLeaderSchedule';\nimport { GetMaxRetransmitSlotApi } from './getMaxRetransmitSlot';\nimport { GetMaxShredInsertSlotApi } from './getMaxShredInsertSlot';\nimport { GetMinimumBalanceForRentExemptionApi } from './getMinimumBalanceForRentExemption';\nimport { GetMultipleAccountsApi } from './getMultipleAccounts';\nimport { GetProgramAccountsApi } from './getProgramAccounts';\nimport { GetRecentPerformanceSamplesApi } from './getRecentPerformanceSamples';\nimport { GetRecentPrioritizationFeesApi } from './getRecentPrioritizationFees';\nimport { GetSignaturesForAddressApi } from './getSignaturesForAddress';\nimport { GetSignatureStatusesApi } from './getSignatureStatuses';\nimport { GetSlotApi } from './getSlot';\nimport { GetSlotLeaderApi } from './getSlotLeader';\nimport { GetSlotLeadersApi } from './getSlotLeaders';\nimport { GetStakeActivationApi } from './getStakeActivation';\nimport { GetStakeMinimumDelegationApi } from './getStakeMinimumDelegation';\nimport { GetSupplyApi } from './getSupply';\nimport { GetTokenAccountBalanceApi } from './getTokenAccountBalance';\nimport { GetTokenAccountsByDelegateApi } from './getTokenAccountsByDelegate';\nimport { GetTokenAccountsByOwnerApi } from './getTokenAccountsByOwner';\nimport { GetTokenLargestAccountsApi } from './getTokenLargestAccounts';\nimport { GetTokenSupplyApi } from './getTokenSupply';\nimport { GetTransactionApi } from './getTransaction';\nimport { GetTransactionCountApi } from './getTransactionCount';\nimport { GetVersionApi } from './getVersion';\nimport { GetVoteAccountsApi } from './getVoteAccounts';\nimport { IsBlockhashValidApi } from './isBlockhashValid';\nimport { MinimumLedgerSlotApi } from './minimumLedgerSlot';\nimport { RequestAirdropApi } from './requestAirdrop';\nimport { SendTransactionApi } from './sendTransaction';\nimport { SimulateTransactionApi } from './simulateTransaction';\n\nexport type SolanaRpcApi = GetAccountInfoApi &\n GetBalanceApi &\n GetBlockApi &\n GetBlockCommitmentApi &\n GetBlockHeightApi &\n GetBlockProductionApi &\n GetBlocksApi &\n GetBlocksWithLimitApi &\n GetBlockTimeApi &\n GetClusterNodesApi &\n GetEpochInfoApi &\n GetEpochScheduleApi &\n GetFeeForMessageApi &\n GetFirstAvailableBlockApi &\n GetGenesisHashApi &\n GetHealthApi &\n GetHighestSnapshotSlotApi &\n GetIdentityApi &\n GetInflationGovernorApi &\n GetInflationRateApi &\n GetInflationRewardApi &\n GetLargestAccountsApi &\n GetLatestBlockhashApi &\n GetLeaderScheduleApi &\n GetMaxRetransmitSlotApi &\n GetMaxShredInsertSlotApi &\n GetMinimumBalanceForRentExemptionApi &\n GetMultipleAccountsApi &\n GetProgramAccountsApi &\n GetRecentPerformanceSamplesApi &\n GetRecentPrioritizationFeesApi &\n GetSignaturesForAddressApi &\n GetSignatureStatusesApi &\n GetSlotApi &\n GetSlotLeaderApi &\n GetSlotLeadersApi &\n GetStakeActivationApi &\n GetStakeMinimumDelegationApi &\n GetSupplyApi &\n GetTokenAccountBalanceApi &\n GetTokenAccountsByDelegateApi &\n GetTokenAccountsByOwnerApi &\n GetTokenLargestAccountsApi &\n GetTokenSupplyApi &\n GetTransactionApi &\n GetTransactionCountApi &\n GetVersionApi &\n GetVoteAccountsApi &\n IsBlockhashValidApi &\n MinimumLedgerSlotApi &\n RequestAirdropApi &\n SendTransactionApi &\n SimulateTransactionApi;\nexport type SolanaRpcApiDevnet = SolanaRpcApi;\nexport type SolanaRpcApiTestnet = SolanaRpcApi;\nexport type SolanaRpcApiMainnet = Omit<SolanaRpcApi, 'requestAirdrop'>;\n\nexport type {\n GetAccountInfoApi,\n GetBalanceApi,\n GetBlockApi,\n GetBlockCommitmentApi,\n GetBlockHeightApi,\n GetBlockProductionApi,\n GetBlocksApi,\n GetBlocksWithLimitApi,\n GetBlockTimeApi,\n GetClusterNodesApi,\n GetEpochInfoApi,\n GetEpochScheduleApi,\n GetFeeForMessageApi,\n GetFirstAvailableBlockApi,\n GetGenesisHashApi,\n GetHealthApi,\n GetHighestSnapshotSlotApi,\n GetIdentityApi,\n GetInflationGovernorApi,\n GetInflationRateApi,\n GetInflationRewardApi,\n GetLargestAccountsApi,\n GetLatestBlockhashApi,\n GetLeaderScheduleApi,\n GetMaxRetransmitSlotApi,\n GetMaxShredInsertSlotApi,\n GetMinimumBalanceForRentExemptionApi,\n GetMultipleAccountsApi,\n GetProgramAccountsApi,\n GetRecentPerformanceSamplesApi,\n GetRecentPrioritizationFeesApi,\n GetSignaturesForAddressApi,\n GetSignatureStatusesApi,\n GetSlotApi,\n GetSlotLeaderApi,\n GetSlotLeadersApi,\n GetStakeActivationApi,\n GetStakeMinimumDelegationApi,\n GetSupplyApi,\n GetTokenAccountBalanceApi,\n GetTokenAccountsByDelegateApi,\n GetTokenAccountsByOwnerApi,\n GetTokenLargestAccountsApi,\n GetTokenSupplyApi,\n GetTransactionApi,\n GetTransactionCountApi,\n GetVersionApi,\n GetVoteAccountsApi,\n IsBlockhashValidApi,\n MinimumLedgerSlotApi,\n RequestAirdropApi,\n SendTransactionApi,\n SimulateTransactionApi,\n};\n\ntype Config = ParamsTransformerConfig;\n\nexport function createSolanaRpcApi<\n TRpcMethods extends SolanaRpcApi | SolanaRpcApiDevnet | SolanaRpcApiTestnet | SolanaRpcApiMainnet = SolanaRpcApi,\n>(config?: Config): RpcApi<TRpcMethods> {\n return createRpcApi<TRpcMethods>({\n parametersTransformer: getDefaultParamsTransformerForSolanaRpc(config) as (params: unknown[]) => unknown[],\n responseTransformer: getDefaultResponseTransformerForSolanaRpc({\n allowedNumericKeyPaths: getAllowedNumericKeypaths(),\n }),\n });\n}\n\nlet memoizedKeypaths: AllowedNumericKeypaths<RpcApi<SolanaRpcApi>>;\n\n/**\n * These are keypaths at the end of which you will find a numeric value that should *not* be upcast\n * to a `bigint`. These are values that are legitimately defined as `u8` or `usize` on the backend.\n */\nfunction getAllowedNumericKeypaths(): AllowedNumericKeypaths<RpcApi<SolanaRpcApi>> {\n if (!memoizedKeypaths) {\n memoizedKeypaths = {\n getAccountInfo: jsonParsedAccountsConfigs.map(c => ['value', ...c]),\n getBlock: [\n ['blockTime'],\n ['transactions', KEYPATH_WILDCARD, 'meta', 'preTokenBalances', KEYPATH_WILDCARD, 'accountIndex'],\n [\n 'transactions',\n KEYPATH_WILDCARD,\n 'meta',\n 'preTokenBalances',\n KEYPATH_WILDCARD,\n 'uiTokenAmount',\n 'decimals',\n ],\n ['transactions', KEYPATH_WILDCARD, 'meta', 'postTokenBalances', KEYPATH_WILDCARD, 'accountIndex'],\n [\n 'transactions',\n KEYPATH_WILDCARD,\n 'meta',\n 'postTokenBalances',\n KEYPATH_WILDCARD,\n 'uiTokenAmount',\n 'decimals',\n ],\n ['transactions', KEYPATH_WILDCARD, 'meta', 'rewards', KEYPATH_WILDCARD, 'commission'],\n ['transactions', KEYPATH_WILDCARD, 'meta', 'innerInstructions', KEYPATH_WILDCARD, 'index'],\n [\n 'transactions',\n KEYPATH_WILDCARD,\n 'meta',\n 'innerInstructions',\n KEYPATH_WILDCARD,\n 'instructions',\n KEYPATH_WILDCARD,\n 'programIdIndex',\n ],\n [\n 'transactions',\n KEYPATH_WILDCARD,\n 'meta',\n 'innerInstructions',\n KEYPATH_WILDCARD,\n 'instructions',\n KEYPATH_WILDCARD,\n 'accounts',\n KEYPATH_WILDCARD,\n ],\n [\n 'transactions',\n KEYPATH_WILDCARD,\n 'transaction',\n 'message',\n 'addressTableLookups',\n KEYPATH_WILDCARD,\n 'writableIndexes',\n KEYPATH_WILDCARD,\n ],\n [\n 'transactions',\n KEYPATH_WILDCARD,\n 'transaction',\n 'message',\n 'addressTableLookups',\n KEYPATH_WILDCARD,\n 'readonlyIndexes',\n KEYPATH_WILDCARD,\n ],\n [\n 'transactions',\n KEYPATH_WILDCARD,\n 'transaction',\n 'message',\n 'instructions',\n KEYPATH_WILDCARD,\n 'programIdIndex',\n ],\n [\n 'transactions',\n KEYPATH_WILDCARD,\n 'transaction',\n 'message',\n 'instructions',\n KEYPATH_WILDCARD,\n 'accounts',\n KEYPATH_WILDCARD,\n ],\n ['transactions', KEYPATH_WILDCARD, 'transaction', 'message', 'header', 'numReadonlySignedAccounts'],\n ['transactions', KEYPATH_WILDCARD, 'transaction', 'message', 'header', 'numReadonlyUnsignedAccounts'],\n ['transactions', KEYPATH_WILDCARD, 'transaction', 'message', 'header', 'numRequiredSignatures'],\n ['rewards', KEYPATH_WILDCARD, 'commission'],\n ],\n getBlockTime: [[]],\n getClusterNodes: [\n [KEYPATH_WILDCARD, 'featureSet'],\n [KEYPATH_WILDCARD, 'shredVersion'],\n ],\n getInflationGovernor: [['initial'], ['foundation'], ['foundationTerm'], ['taper'], ['terminal']],\n getInflationRate: [['foundation'], ['total'], ['validator']],\n getInflationReward: [[KEYPATH_WILDCARD, 'commission']],\n getMultipleAccounts: jsonParsedAccountsConfigs.map(c => ['value', KEYPATH_WILDCARD, ...c]),\n getProgramAccounts: jsonParsedAccountsConfigs.flatMap(c => [\n ['value', KEYPATH_WILDCARD, 'account', ...c],\n [KEYPATH_WILDCARD, 'account', ...c],\n ]),\n getRecentPerformanceSamples: [[KEYPATH_WILDCARD, 'samplePeriodSecs']],\n getTokenAccountBalance: [\n ['value', 'decimals'],\n ['value', 'uiAmount'],\n ],\n getTokenAccountsByDelegate: jsonParsedTokenAccountsConfigs.map(c => [\n 'value',\n KEYPATH_WILDCARD,\n 'account',\n ...c,\n ]),\n getTokenAccountsByOwner: jsonParsedTokenAccountsConfigs.map(c => [\n 'value',\n KEYPATH_WILDCARD,\n 'account',\n ...c,\n ]),\n getTokenLargestAccounts: [\n ['value', KEYPATH_WILDCARD, 'decimals'],\n ['value', KEYPATH_WILDCARD, 'uiAmount'],\n ],\n getTokenSupply: [\n ['value', 'decimals'],\n ['value', 'uiAmount'],\n ],\n getTransaction: [\n ['meta', 'preTokenBalances', KEYPATH_WILDCARD, 'accountIndex'],\n ['meta', 'preTokenBalances', KEYPATH_WILDCARD, 'uiTokenAmount', 'decimals'],\n ['meta', 'postTokenBalances', KEYPATH_WILDCARD, 'accountIndex'],\n ['meta', 'postTokenBalances', KEYPATH_WILDCARD, 'uiTokenAmount', 'decimals'],\n ['meta', 'rewards', KEYPATH_WILDCARD, 'commission'],\n ['meta', 'innerInstructions', KEYPATH_WILDCARD, 'index'],\n ['meta', 'innerInstructions', KEYPATH_WILDCARD, 'instructions', KEYPATH_WILDCARD, 'programIdIndex'],\n [\n 'meta',\n 'innerInstructions',\n KEYPATH_WILDCARD,\n 'instructions',\n KEYPATH_WILDCARD,\n 'accounts',\n KEYPATH_WILDCARD,\n ],\n [\n 'transaction',\n 'message',\n 'addressTableLookups',\n KEYPATH_WILDCARD,\n 'writableIndexes',\n KEYPATH_WILDCARD,\n ],\n [\n 'transaction',\n 'message',\n 'addressTableLookups',\n KEYPATH_WILDCARD,\n 'readonlyIndexes',\n KEYPATH_WILDCARD,\n ],\n ['transaction', 'message', 'instructions', KEYPATH_WILDCARD, 'programIdIndex'],\n ['transaction', 'message', 'instructions', KEYPATH_WILDCARD, 'accounts', KEYPATH_WILDCARD],\n ['transaction', 'message', 'header', 'numReadonlySignedAccounts'],\n ['transaction', 'message', 'header', 'numReadonlyUnsignedAccounts'],\n ['transaction', 'message', 'header', 'numRequiredSignatures'],\n ],\n getVersion: [['feature-set']],\n getVoteAccounts: [\n ['current', KEYPATH_WILDCARD, 'commission'],\n ['delinquent', KEYPATH_WILDCARD, 'commission'],\n ],\n simulateTransaction: jsonParsedAccountsConfigs.map(c => ['value', 'accounts', KEYPATH_WILDCARD, ...c]),\n };\n }\n return memoizedKeypaths;\n}\n"]}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { Address } from '@solana/addresses';
|
|
2
|
+
import { Base58EncodedBytes, Base58EncodedDataResponse, Base64EncodedDataResponse, Blockhash, LamportsUnsafeBeyond2Pow53Minus1, TransactionError, U64UnsafeBeyond2Pow53Minus1 } from '@solana/rpc-types';
|
|
3
|
+
import { TransactionVersion } from '@solana/transactions';
|
|
4
|
+
import { SignedLamportsAsI64Unsafe, TokenBalance } from './common.js';
|
|
5
|
+
type AddressTableLookup = Readonly<{
|
|
6
|
+
/** public key for an address lookup table account. */
|
|
7
|
+
accountKey: Address;
|
|
8
|
+
/** List of indices used to load addresses of writable accounts from a lookup table. */
|
|
9
|
+
writableIndexes: readonly number[];
|
|
10
|
+
/** List of indices used to load addresses of readonly accounts from a lookup table. */
|
|
11
|
+
readableIndexes: readonly number[];
|
|
12
|
+
}>;
|
|
13
|
+
type ParsedTransactionInstruction = Readonly<{
|
|
14
|
+
parsed: {
|
|
15
|
+
info?: object;
|
|
16
|
+
type: string;
|
|
17
|
+
};
|
|
18
|
+
program: string;
|
|
19
|
+
programId: Address;
|
|
20
|
+
}>;
|
|
21
|
+
type PartiallyDecodedTransactionInstruction = Readonly<{
|
|
22
|
+
accounts: readonly Address[];
|
|
23
|
+
data: Base58EncodedBytes;
|
|
24
|
+
programId: Address;
|
|
25
|
+
}>;
|
|
26
|
+
type ReturnData = {
|
|
27
|
+
/** the program that generated the return data */
|
|
28
|
+
programId: Address;
|
|
29
|
+
/** the return data itself */
|
|
30
|
+
data: Base64EncodedDataResponse;
|
|
31
|
+
};
|
|
32
|
+
type TransactionInstruction = Readonly<{
|
|
33
|
+
accounts: readonly number[];
|
|
34
|
+
data: Base58EncodedBytes;
|
|
35
|
+
programIdIndex: number;
|
|
36
|
+
}>;
|
|
37
|
+
type TransactionParsedAccountLegacy = Readonly<{
|
|
38
|
+
pubkey: Address;
|
|
39
|
+
signer: boolean;
|
|
40
|
+
source: 'transaction';
|
|
41
|
+
writable: boolean;
|
|
42
|
+
}>;
|
|
43
|
+
type TransactionParsedAccountVersioned = Readonly<{
|
|
44
|
+
pubkey: Address;
|
|
45
|
+
signer: boolean;
|
|
46
|
+
source: 'lookupTable' | 'transaction';
|
|
47
|
+
writable: boolean;
|
|
48
|
+
}>;
|
|
49
|
+
type TransactionForAccountsMetaBase = Readonly<{
|
|
50
|
+
/** Error if transaction failed, null if transaction succeeded. */
|
|
51
|
+
err: TransactionError | null;
|
|
52
|
+
/** fee this transaction was charged */
|
|
53
|
+
fee: LamportsUnsafeBeyond2Pow53Minus1;
|
|
54
|
+
/** array of account balances from before the transaction was processed */
|
|
55
|
+
preBalances: readonly LamportsUnsafeBeyond2Pow53Minus1[];
|
|
56
|
+
/** array of account balances after the transaction was processed */
|
|
57
|
+
postBalances: readonly LamportsUnsafeBeyond2Pow53Minus1[];
|
|
58
|
+
/** List of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction */
|
|
59
|
+
preTokenBalances?: readonly TokenBalance[];
|
|
60
|
+
/** List of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction */
|
|
61
|
+
postTokenBalances?: readonly TokenBalance[];
|
|
62
|
+
/**
|
|
63
|
+
* Transaction status
|
|
64
|
+
* @deprecated
|
|
65
|
+
*/
|
|
66
|
+
status: TransactionStatus;
|
|
67
|
+
}>;
|
|
68
|
+
export type TransactionForAccounts<TMaxSupportedTransactionVersion extends TransactionVersion | void> = TMaxSupportedTransactionVersion extends void ? Readonly<{
|
|
69
|
+
/** Transaction partial meta */
|
|
70
|
+
meta: TransactionForAccountsMetaBase | null;
|
|
71
|
+
/** Partial transactions */
|
|
72
|
+
transaction: Readonly<{
|
|
73
|
+
/** Parsed accounts */
|
|
74
|
+
accountKeys: readonly TransactionParsedAccountLegacy[];
|
|
75
|
+
/** Account signatures */
|
|
76
|
+
signatures: readonly Base58EncodedBytes[];
|
|
77
|
+
}>;
|
|
78
|
+
}> : Readonly<{
|
|
79
|
+
/** Transaction partial meta */
|
|
80
|
+
meta: TransactionForAccountsMetaBase | null;
|
|
81
|
+
/** Partial transactions */
|
|
82
|
+
transaction: Readonly<{
|
|
83
|
+
/** Parsed accounts */
|
|
84
|
+
accountKeys: readonly TransactionParsedAccountVersioned[];
|
|
85
|
+
/** Account signatures */
|
|
86
|
+
signatures: readonly Base58EncodedBytes[];
|
|
87
|
+
}>;
|
|
88
|
+
/** The transaction version */
|
|
89
|
+
version: TransactionVersion;
|
|
90
|
+
}>;
|
|
91
|
+
type TransactionForFullMetaBase = Readonly<{
|
|
92
|
+
/** number of compute units consumed by the transaction */
|
|
93
|
+
computeUnitsConsumed?: U64UnsafeBeyond2Pow53Minus1;
|
|
94
|
+
/** Error if transaction failed, null if transaction succeeded. */
|
|
95
|
+
err: TransactionError | null;
|
|
96
|
+
/** fee this transaction was charged */
|
|
97
|
+
fee: LamportsUnsafeBeyond2Pow53Minus1;
|
|
98
|
+
/** array of string log messages or null if log message recording was not enabled during this transaction */
|
|
99
|
+
logMessages: readonly string[] | null;
|
|
100
|
+
/** array of account balances from before the transaction was processed */
|
|
101
|
+
preBalances: readonly LamportsUnsafeBeyond2Pow53Minus1[];
|
|
102
|
+
/** array of account balances after the transaction was processed */
|
|
103
|
+
postBalances: readonly LamportsUnsafeBeyond2Pow53Minus1[];
|
|
104
|
+
/** List of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction */
|
|
105
|
+
preTokenBalances?: readonly TokenBalance[];
|
|
106
|
+
/** List of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction */
|
|
107
|
+
postTokenBalances?: readonly TokenBalance[];
|
|
108
|
+
/** the most-recent return data generated by an instruction in the transaction */
|
|
109
|
+
returnData?: ReturnData;
|
|
110
|
+
/** transaction-level rewards */
|
|
111
|
+
rewards: readonly Reward[] | null;
|
|
112
|
+
/**
|
|
113
|
+
* Transaction status
|
|
114
|
+
* @deprecated
|
|
115
|
+
*/
|
|
116
|
+
status: TransactionStatus;
|
|
117
|
+
}>;
|
|
118
|
+
type TransactionForFullMetaInnerInstructionsUnparsed = Readonly<{
|
|
119
|
+
innerInstructions: readonly Readonly<{
|
|
120
|
+
/** The index of the instruction in the transaction */
|
|
121
|
+
index: number;
|
|
122
|
+
/** The instruction */
|
|
123
|
+
instructions: readonly TransactionInstruction[];
|
|
124
|
+
}>[];
|
|
125
|
+
}>;
|
|
126
|
+
type TransactionForFullMetaInnerInstructionsParsed = Readonly<{
|
|
127
|
+
innerInstructions: readonly Readonly<{
|
|
128
|
+
/** The index of the instruction in the transaction */
|
|
129
|
+
index: number;
|
|
130
|
+
/** The instruction */
|
|
131
|
+
instructions: readonly (ParsedTransactionInstruction | PartiallyDecodedTransactionInstruction)[];
|
|
132
|
+
}>[];
|
|
133
|
+
}>;
|
|
134
|
+
type TransactionForFullMetaLoadedAddresses = Readonly<{
|
|
135
|
+
/** Addresses loaded from lookup tables */
|
|
136
|
+
loadedAddresses: {
|
|
137
|
+
writable: readonly Address[];
|
|
138
|
+
readonly: readonly Address[];
|
|
139
|
+
};
|
|
140
|
+
}>;
|
|
141
|
+
type TransactionForFullTransactionAddressTableLookups = Readonly<{
|
|
142
|
+
message: {
|
|
143
|
+
addressTableLookups?: readonly AddressTableLookup[] | null;
|
|
144
|
+
};
|
|
145
|
+
}>;
|
|
146
|
+
export type TransactionForFullBase58<TMaxSupportedTransactionVersion extends TransactionVersion | void> = TMaxSupportedTransactionVersion extends void ? Readonly<{
|
|
147
|
+
/** Transaction meta */
|
|
148
|
+
meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsUnparsed) | null;
|
|
149
|
+
/** Partial transactions */
|
|
150
|
+
transaction: Base58EncodedDataResponse;
|
|
151
|
+
}> : Readonly<{
|
|
152
|
+
/** Transaction meta */
|
|
153
|
+
meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsUnparsed & TransactionForFullMetaLoadedAddresses) | null;
|
|
154
|
+
/** Partial transactions */
|
|
155
|
+
transaction: Base58EncodedDataResponse;
|
|
156
|
+
/** The transaction version */
|
|
157
|
+
version: TransactionVersion;
|
|
158
|
+
}>;
|
|
159
|
+
export type TransactionForFullBase64<TMaxSupportedTransactionVersion extends TransactionVersion | void> = TMaxSupportedTransactionVersion extends void ? Readonly<{
|
|
160
|
+
/** Transaction meta */
|
|
161
|
+
meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsUnparsed) | null;
|
|
162
|
+
/** Partial transactions */
|
|
163
|
+
transaction: Base64EncodedDataResponse;
|
|
164
|
+
}> : Readonly<{
|
|
165
|
+
/** Transaction meta */
|
|
166
|
+
meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsUnparsed & TransactionForFullMetaLoadedAddresses) | null;
|
|
167
|
+
/** Partial transactions */
|
|
168
|
+
transaction: Base64EncodedDataResponse;
|
|
169
|
+
/** The transaction version */
|
|
170
|
+
version: TransactionVersion;
|
|
171
|
+
}>;
|
|
172
|
+
type TransactionForFullTransactionJsonParsedBase = Readonly<{
|
|
173
|
+
message: {
|
|
174
|
+
header: {
|
|
175
|
+
numReadonlySignedAccounts: number;
|
|
176
|
+
numReadonlyUnsignedAccounts: number;
|
|
177
|
+
numRequiredSignatures: number;
|
|
178
|
+
};
|
|
179
|
+
instructions: readonly (ParsedTransactionInstruction | PartiallyDecodedTransactionInstruction)[];
|
|
180
|
+
recentBlockhash: Blockhash;
|
|
181
|
+
};
|
|
182
|
+
signatures: readonly Base58EncodedBytes[];
|
|
183
|
+
}>;
|
|
184
|
+
export type TransactionForFullJsonParsed<TMaxSupportedTransactionVersion extends TransactionVersion | void> = TMaxSupportedTransactionVersion extends void ? Readonly<{
|
|
185
|
+
meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsParsed) | null;
|
|
186
|
+
transaction: TransactionForFullTransactionJsonParsedBase & {
|
|
187
|
+
message: Readonly<{
|
|
188
|
+
accountKeys: readonly TransactionParsedAccountLegacy[];
|
|
189
|
+
}>;
|
|
190
|
+
};
|
|
191
|
+
}> : Readonly<{
|
|
192
|
+
meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsParsed & TransactionForFullMetaLoadedAddresses) | null;
|
|
193
|
+
transaction: TransactionForFullTransactionJsonParsedBase & {
|
|
194
|
+
message: Readonly<{
|
|
195
|
+
accountKeys: readonly TransactionParsedAccountLegacy[];
|
|
196
|
+
}>;
|
|
197
|
+
};
|
|
198
|
+
version: TransactionVersion;
|
|
199
|
+
}>;
|
|
200
|
+
type TransactionForFullTransactionJsonBase = Readonly<{
|
|
201
|
+
message: {
|
|
202
|
+
accountKeys: readonly Address[];
|
|
203
|
+
header: {
|
|
204
|
+
numReadonlySignedAccounts: number;
|
|
205
|
+
numReadonlyUnsignedAccounts: number;
|
|
206
|
+
numRequiredSignatures: number;
|
|
207
|
+
};
|
|
208
|
+
instructions: readonly TransactionInstruction[];
|
|
209
|
+
recentBlockhash: Blockhash;
|
|
210
|
+
};
|
|
211
|
+
signatures: readonly Base58EncodedBytes[];
|
|
212
|
+
}>;
|
|
213
|
+
export type TransactionForFullJson<TMaxSupportedTransactionVersion extends TransactionVersion | void> = TMaxSupportedTransactionVersion extends void ? Readonly<{
|
|
214
|
+
meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsUnparsed) | null;
|
|
215
|
+
transaction: TransactionForFullTransactionJsonBase;
|
|
216
|
+
}> : Readonly<{
|
|
217
|
+
meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsUnparsed & TransactionForFullMetaLoadedAddresses) | null;
|
|
218
|
+
transaction: TransactionForFullTransactionJsonBase & TransactionForFullTransactionAddressTableLookups;
|
|
219
|
+
version: TransactionVersion;
|
|
220
|
+
}>;
|
|
221
|
+
type RewardBase = Readonly<{
|
|
222
|
+
/** The public key of the account that received the reward */
|
|
223
|
+
pubkey: Address;
|
|
224
|
+
/** number of reward lamports credited or debited by the account */
|
|
225
|
+
lamports: SignedLamportsAsI64Unsafe;
|
|
226
|
+
/** account balance in lamports after the reward was applied */
|
|
227
|
+
postBalance: LamportsUnsafeBeyond2Pow53Minus1;
|
|
228
|
+
}>;
|
|
229
|
+
export type Reward = (RewardBase & Readonly<{
|
|
230
|
+
/** type of reward */
|
|
231
|
+
rewardType: 'fee' | 'rent';
|
|
232
|
+
}>)
|
|
233
|
+
/** Commission is present only for voting and staking rewards */
|
|
234
|
+
| (RewardBase & Readonly<{
|
|
235
|
+
/** type of reward */
|
|
236
|
+
rewardType: 'voting' | 'staking';
|
|
237
|
+
/** vote account commission when the reward was credited */
|
|
238
|
+
commission: number;
|
|
239
|
+
}>);
|
|
240
|
+
/** @deprecated */
|
|
241
|
+
export type TransactionStatus = {
|
|
242
|
+
Ok: null;
|
|
243
|
+
} | {
|
|
244
|
+
Err: TransactionError;
|
|
245
|
+
};
|
|
246
|
+
export {};
|
|
247
|
+
//# sourceMappingURL=common-transactions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-transactions.d.ts","sourceRoot":"","sources":["../../src/common-transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACH,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,SAAS,EACT,gCAAgC,EAChC,gBAAgB,EAChB,2BAA2B,EAC9B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEnE,KAAK,kBAAkB,GAAG,QAAQ,CAAC;IAC/B,sDAAsD;IACtD,UAAU,EAAE,OAAO,CAAC;IACpB,uFAAuF;IACvF,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,uFAAuF;IACvF,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC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I,IAChG,+BAA+B,SAAS,IAAI,GACtC,QAAQ,CAAC;IACL,IAAI,EAAE,CAAC,0BAA0B,GAAG,+CAA+C,CAAC,GAAG,IAAI,CAAC;IAC5F,WAAW,EAAE,qCAAqC,CAAC;CACtD,CAAC,GACF,QAAQ,CAAC;IACL,IAAI,EACE,CAAC,0BAA0B,GACvB,+CAA+C,GAC/C,qCAAqC,CAAC,GAC1C,IAAI,CAAC;IACX,WAAW,EAAE,qCAAqC,GAAG,gDAAgD,CAAC;IACtG,OAAO,EAAE,kBAAkB,CAAC;CAC/B,CAAC,CAAC;AAEb,KAAK,UAAU,GAAG,QAAQ,CAAC;IACvB,6DAA6D;IAC7D,MAAM,EAAE,OAAO,CAAC;IAChB,mEAAmE;IACnE,QAAQ,EAAE,yBAAyB,CAAC;IACpC,+DAA+D;IAC/D,WAAW,EAAE,gCAAgC,CAAC;CACjD,CAAC,CAAC;AAEH,MAAM,MAAM,MAAM,GACZ,CAAC,UAAU,GACP,QAAQ,CAAC;IACL,qBAAqB;IACrB,UAAU,EAAE,KAAK,GAAG,MAAM,CAAC;CAC9B,CAAC,CAAC;AACT,gEAAgE;GAC9D,CAAC,UAAU,GACP,QAAQ,CAAC;IACL,qBAAqB;IACrB,UAAU,EAAE,QAAQ,GAAG,SAAS,CAAC;IACjC,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;CACtB,CAAC,CAAC,CAAC;AAEd,kBAAkB;AAClB,MAAM,MAAM,iBAAiB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,GAAG,EAAE,gBAAgB,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Address } from '@solana/addresses';
|
|
2
|
+
import type { Base58EncodedBytes, Base58EncodedDataResponse, Base64EncodedDataResponse, Base64EncodedZStdCompressedDataResponse, LamportsUnsafeBeyond2Pow53Minus1, TokenAmount, U64UnsafeBeyond2Pow53Minus1 } from '@solana/rpc-types';
|
|
3
|
+
export type DataSlice = Readonly<{
|
|
4
|
+
offset: number;
|
|
5
|
+
length: number;
|
|
6
|
+
}>;
|
|
7
|
+
export type MicroLamportsUnsafeBeyond2Pow53Minus1 = bigint & {
|
|
8
|
+
readonly __brand: unique symbol;
|
|
9
|
+
};
|
|
10
|
+
export type SignedLamportsAsI64Unsafe = bigint;
|
|
11
|
+
export type F64UnsafeSeeDocumentation = number;
|
|
12
|
+
export type AccountInfoBase = Readonly<{
|
|
13
|
+
/** indicates if the account contains a program (and is strictly read-only) */
|
|
14
|
+
executable: boolean;
|
|
15
|
+
/** number of lamports assigned to this account */
|
|
16
|
+
lamports: LamportsUnsafeBeyond2Pow53Minus1;
|
|
17
|
+
/** pubkey of the program this account has been assigned to */
|
|
18
|
+
owner: Address;
|
|
19
|
+
/** the epoch at which this account will next owe rent */
|
|
20
|
+
rentEpoch: U64UnsafeBeyond2Pow53Minus1;
|
|
21
|
+
}>;
|
|
22
|
+
/** @deprecated */
|
|
23
|
+
export type AccountInfoWithBase58Bytes = Readonly<{
|
|
24
|
+
data: Base58EncodedBytes;
|
|
25
|
+
}>;
|
|
26
|
+
/** @deprecated */
|
|
27
|
+
export type AccountInfoWithBase58EncodedData = Readonly<{
|
|
28
|
+
data: Base58EncodedDataResponse;
|
|
29
|
+
}>;
|
|
30
|
+
export type AccountInfoWithBase64EncodedData = Readonly<{
|
|
31
|
+
data: Base64EncodedDataResponse;
|
|
32
|
+
}>;
|
|
33
|
+
export type AccountInfoWithBase64EncodedZStdCompressedData = Readonly<{
|
|
34
|
+
data: Base64EncodedZStdCompressedDataResponse;
|
|
35
|
+
}>;
|
|
36
|
+
export type AccountInfoWithJsonData = Readonly<{
|
|
37
|
+
data: Readonly<{
|
|
38
|
+
program: string;
|
|
39
|
+
parsed: {
|
|
40
|
+
info?: object;
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
space: U64UnsafeBeyond2Pow53Minus1;
|
|
44
|
+
}> | Base64EncodedDataResponse;
|
|
45
|
+
}>;
|
|
46
|
+
export type AccountInfoWithPubkey<TAccount extends AccountInfoBase> = Readonly<{
|
|
47
|
+
account: TAccount;
|
|
48
|
+
pubkey: Address;
|
|
49
|
+
}>;
|
|
50
|
+
export type TokenBalance = Readonly<{
|
|
51
|
+
/** Index of the account in which the token balance is provided for. */
|
|
52
|
+
accountIndex: number;
|
|
53
|
+
/** Pubkey of the token's mint. */
|
|
54
|
+
mint: Address;
|
|
55
|
+
/** Pubkey of token balance's owner. */
|
|
56
|
+
owner?: Address;
|
|
57
|
+
/** Pubkey of the Token program that owns the account. */
|
|
58
|
+
programId?: Address;
|
|
59
|
+
uiTokenAmount: TokenAmount;
|
|
60
|
+
}>;
|
|
61
|
+
export type GetProgramAccountsMemcmpFilter = Readonly<{
|
|
62
|
+
offset: U64UnsafeBeyond2Pow53Minus1;
|
|
63
|
+
bytes: string;
|
|
64
|
+
encoding: 'base58' | 'base64';
|
|
65
|
+
}>;
|
|
66
|
+
export type GetProgramAccountsDatasizeFilter = Readonly<{
|
|
67
|
+
dataSize: U64UnsafeBeyond2Pow53Minus1;
|
|
68
|
+
}>;
|
|
69
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,EACR,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,uCAAuC,EACvC,gCAAgC,EAChC,WAAW,EACX,2BAA2B,EAC9B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAOH,MAAM,MAAM,qCAAqC,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,M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M,YAAY,GAAG,QAAQ,CAAC;IAChC,uEAAuE;IACvE,YAAY,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,uCAAuC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,WAAW,CAAC;CAC9B,CAAC,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,QAAQ,CAAC;IAClD,MAAM,EAAE,2BAA2B,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACjC,CAAC,CAAC;AAEH,MAAM,MAAM,gCAAgC,GAAG,QAAQ,CAAC;IACpD,QAAQ,EAAE,2BAA2B,CAAC;CACzC,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Address } from '@solana/addresses';
|
|
2
|
+
import type { RpcApiMethods } from '@solana/rpc-spec';
|
|
3
|
+
import type { Commitment, Slot, SolanaRpcResponse } from '@solana/rpc-types';
|
|
4
|
+
import { AccountInfoBase, AccountInfoWithBase58Bytes, AccountInfoWithBase58EncodedData, AccountInfoWithBase64EncodedData, AccountInfoWithBase64EncodedZStdCompressedData, AccountInfoWithJsonData, DataSlice } from './common.js';
|
|
5
|
+
type GetAccountInfoApiResponseBase = SolanaRpcResponse<AccountInfoBase | null>;
|
|
6
|
+
type NestInRpcResponseOrNull<T> = Readonly<{
|
|
7
|
+
value: T | null;
|
|
8
|
+
}>;
|
|
9
|
+
type GetAccountInfoApiCommonConfig = Readonly<{
|
|
10
|
+
commitment?: Commitment;
|
|
11
|
+
minContextSlot?: Slot;
|
|
12
|
+
}>;
|
|
13
|
+
type GetAccountInfoApiSliceableCommonConfig = Readonly<{
|
|
14
|
+
dataSlice?: DataSlice;
|
|
15
|
+
}>;
|
|
16
|
+
export interface GetAccountInfoApi extends RpcApiMethods {
|
|
17
|
+
/**
|
|
18
|
+
* Returns all information associated with the account of provided public key
|
|
19
|
+
*/
|
|
20
|
+
getAccountInfo(address: Address, config: GetAccountInfoApiCommonConfig & GetAccountInfoApiSliceableCommonConfig & Readonly<{
|
|
21
|
+
encoding: 'base64';
|
|
22
|
+
}>): GetAccountInfoApiResponseBase & NestInRpcResponseOrNull<AccountInfoWithBase64EncodedData>;
|
|
23
|
+
getAccountInfo(address: Address, config: GetAccountInfoApiCommonConfig & GetAccountInfoApiSliceableCommonConfig & Readonly<{
|
|
24
|
+
encoding: 'base64+zstd';
|
|
25
|
+
}>): GetAccountInfoApiResponseBase & NestInRpcResponseOrNull<AccountInfoWithBase64EncodedZStdCompressedData>;
|
|
26
|
+
getAccountInfo(address: Address, config: GetAccountInfoApiCommonConfig & Readonly<{
|
|
27
|
+
encoding: 'jsonParsed';
|
|
28
|
+
}>): GetAccountInfoApiResponseBase & NestInRpcResponseOrNull<AccountInfoWithJsonData>;
|
|
29
|
+
getAccountInfo(address: Address, config: GetAccountInfoApiCommonConfig & GetAccountInfoApiSliceableCommonConfig & Readonly<{
|
|
30
|
+
encoding: 'base58';
|
|
31
|
+
}>): GetAccountInfoApiResponseBase & NestInRpcResponseOrNull<AccountInfoWithBase58EncodedData>;
|
|
32
|
+
getAccountInfo(address: Address, config?: GetAccountInfoApiCommonConfig): GetAccountInfoApiResponseBase & NestInRpcResponseOrNull<AccountInfoWithBase58Bytes>;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=getAccountInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAccountInfo.d.ts","sourceRoot":"","sources":["../../src/getAccountInfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EA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O,EAChB,MAAM,EAAE,6BAA6B,GACjC,sCAAsC,GACtC,QAAQ,CAAC;QACL,QAAQ,EAAE,QAAQ,CAAC;KACtB,CAAC,GACP,6BAA6B,GAAG,uBAAuB,CAAC,gCAAgC,CAAC,CAAC;IAC7F,cAAc,CACV,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,6BAA6B,GACvC,6BAA6B,GAAG,uBAAuB,CAAC,0BAA0B,CAAC,CAAC;CAC1F"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Address } from '@solana/addresses';
|
|
2
|
+
import type { RpcApiMethods } from '@solana/rpc-spec';
|
|
3
|
+
import type { Commitment, LamportsUnsafeBeyond2Pow53Minus1, Slot, SolanaRpcResponse } from '@solana/rpc-types';
|
|
4
|
+
type GetBalanceApiResponse = SolanaRpcResponse<LamportsUnsafeBeyond2Pow53Minus1>;
|
|
5
|
+
export interface GetBalanceApi extends RpcApiMethods {
|
|
6
|
+
/**
|
|
7
|
+
* Returns the balance of the account of provided Pubkey
|
|
8
|
+
*/
|
|
9
|
+
getBalance(address: Address, config?: Readonly<{
|
|
10
|
+
commitment?: Commitment;
|
|
11
|
+
minContextSlot?: Slot;
|
|
12
|
+
}>): GetBalanceApiResponse;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=getBalance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBalance.d.ts","sourceRoot":"","sources":["../../src/getBalance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,gCAAgC,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE/G,KAAK,qBAAqB,GAAG,iBAAiB,CAAC,gCAAgC,CAAC,CAAC;AAEjF,MAAM,WAAW,aAAc,SAAQ,aAAa;IAChD;;OAEG;IACH,UAAU,CACN,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,QAAQ,CAAC;QACd,UAAU,CAAC,EAAE,UAAU,CAAC;QACxB,cAAc,CAAC,EAAE,IAAI,CAAC;KACzB,CAAC,GACH,qBAAqB,CAAC;CAC5B"}
|