@effect-blockchain/solana 0.1.0 → 0.2.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.
@@ -0,0 +1,377 @@
1
+ /**
2
+ * Solana transaction relaying on top of {@link SolanaRpc.SolanaRpc}: signing a transaction, broadcasting it and
3
+ * following it until it is final.
4
+ *
5
+ * A relayer here sends an account's own transactions and manages their fees, as OpenZeppelin Relayer does. It is not
6
+ * a meta-transaction relayer paying for someone else's transaction. It keeps no state: storing signatures and their
7
+ * `lastValidBlockHeight`, deciding when to resend and holding keys belong to the application. Solana has no nonce:
8
+ * the recent blockhash plays that role, so concurrent senders from one address need no coordination, but two
9
+ * transactions with the same instructions, signers, fees and blockhash are one transaction and land once.
10
+ *
11
+ * Only v0 transactions with a recent blockhash are sent: address lookup tables and durable nonces are not. `sign`
12
+ * returns the transaction's signature before anything is broadcast, so it can be stored first, and `broadcast` can be
13
+ * repeated with the same bytes.
14
+ *
15
+ * Every transaction starts with the two Compute Budget instructions. Unless `sign` receives them, the compute unit
16
+ * limit is what a simulation consumed times the layer's `computeUnitMultiplier`, and the compute unit price comes from
17
+ * `getRecentPrioritizationFees` for the accounts the transaction writes to (see {@link defaultFees}). The price sets
18
+ * the priority fee only: the base fee of 5000 lamports per signature is charged on top.
19
+ *
20
+ * A transaction is in one {@link SolanaTransactionStatus}:
21
+ *
22
+ * | status | meaning | final |
23
+ * |---|---|---|
24
+ * | `Pending` | never reported: a node does not expose the transactions it has not processed | no |
25
+ * | `Included` | in `block`, not finalized or above the last confirmed slot: a fork can still drop it | no |
26
+ * | `Confirmed` | succeeded in `block`, finalized, at or below the last confirmed slot | yes |
27
+ * | `Failed` | failed in `block`, finalized, at or below the last confirmed slot: it paid its fee | yes |
28
+ * | `Expired` | unknown to the node, and its blockhash expired: it can no longer land | yes |
29
+ * | `NotFound` | unknown to the node: not processed yet, dropped, or never sent | no |
30
+ *
31
+ * A node reports a transaction as soon as it has processed its block, then the block reaches the `confirmed`
32
+ * commitment (voted by a supermajority) and the `finalized` one. `processed` and `confirmed` are both `Included`:
33
+ * the `Confirmed` status is not the `confirmed` commitment. A `finalized` transaction is `Confirmed` or `Failed` once
34
+ * its slot is at or below the last confirmed slot, the finalized slot minus `confirmations` (0 by default), as
35
+ * `SolanaIndexer.lastConfirmedBlock`.
36
+ *
37
+ * A transaction can land only while the block height is at most the `lastValidBlockHeight` returned with its recent
38
+ * blockhash. `Expired` is reported when the caller passes that height and the `finalized` block height is above it,
39
+ * so a transaction that can still land is never `Expired`. A durable-nonce transaction does not expire: leave
40
+ * `lastValidBlockHeight` out.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * import { type SolanaInstruction, SolanaRelayer } from "@effect-blockchain/solana/SolanaRelayer"
45
+ * import type { SolanaSigner } from "@effect-blockchain/solana/SolanaSigner"
46
+ * import type { SolanaTransactionHash } from "@effect-blockchain/solana/SolanaTransactionHash"
47
+ * import * as Effect from "effect/Effect"
48
+ *
49
+ * declare const feePayer: SolanaSigner
50
+ * declare const instructions: ReadonlyArray<SolanaInstruction>
51
+ * declare const store: (hash: SolanaTransactionHash, lastValidBlockHeight: bigint) => Effect.Effect<void>
52
+ *
53
+ * const program = Effect.gen(function*() {
54
+ * const relayer = yield* SolanaRelayer
55
+ * const { hash, lastValidBlockHeight, signed } = yield* relayer.sign({ feePayer, instructions })
56
+ * // stored before the broadcast: a crash in between leaves a signature to look up, never an unknown transaction
57
+ * yield* store(hash, lastValidBlockHeight)
58
+ * yield* relayer.broadcast({ signed })
59
+ * // a lagging endpoint can answer `NotFound` for a while: the timeout bounds the wait
60
+ * const status = yield* relayer.awaitConfirmation({ hash, lastValidBlockHeight }).pipe(Effect.timeout("5 minutes"))
61
+ * if (status._tag === "Failed") {
62
+ * yield* Effect.logError(`failed in slot ${status.block}`, status.reason)
63
+ * }
64
+ * if (status._tag === "Expired") {
65
+ * yield* Effect.logError("never landed: sign it again with a new blockhash")
66
+ * }
67
+ * })
68
+ * ```
69
+ *
70
+ * @since 0.2.0
71
+ */
72
+ import { AccountRole, address, appendTransactionMessageInstructions, assertIsSignatureBytes, blockhash, compileTransaction, createTransactionMessage, getBase64EncodedWireTransaction, getBase64Encoder, getSignatureFromTransaction, getTransactionDecoder, pipe, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE } from "@solana/kit";
73
+ import * as Arr from "effect/Array";
74
+ import * as BigInt_ from "effect/BigInt";
75
+ import * as Context from "effect/Context";
76
+ import * as Effect from "effect/Effect";
77
+ import * as Layer from "effect/Layer";
78
+ import * as Order from "effect/Order";
79
+ import * as Schedule from "effect/Schedule";
80
+ import * as Schema from "effect/Schema";
81
+ import * as Confirmations from "./internal/confirmations.js";
82
+ import * as RpcMethods from "./internal/rpcMethods.js";
83
+ import { SolanaAddress } from "./SolanaAddress.js";
84
+ import { DEFAULT_POLL_INTERVAL } from "./SolanaIndexer.js";
85
+ import * as SolanaRpc from "./SolanaRpc.js";
86
+ import { SolanaSignerError } from "./SolanaSigner.js";
87
+ import { SolanaTransactionHash } from "./SolanaTransactionHash.js";
88
+ /**
89
+ * The node does not know the transaction's blockhash: it has expired, or the node is behind the one that returned
90
+ * it. Past `lastValidBlockHeight`, sign the transaction again.
91
+ *
92
+ * @since 0.2.0
93
+ * @category reasons
94
+ */
95
+ export class BlockhashNotFound extends /*#__PURE__*/Schema.TaggedError()("BlockhashNotFound", {}) {}
96
+ /**
97
+ * The fee payer cannot pay the transaction fee: its balance is too low, or it holds no account.
98
+ *
99
+ * @since 0.2.0
100
+ * @category reasons
101
+ */
102
+ export class InsufficientFundsForFee extends /*#__PURE__*/Schema.TaggedError()("InsufficientFundsForFee", {}) {}
103
+ const TransactionError = /*#__PURE__*/Schema.toType(RpcMethods.TransactionError);
104
+ /**
105
+ * The node simulated the transaction and it failed: `error` is the transaction error and `logs` the program logs up
106
+ * to it. {@link SolanaRelayer.sign} fails with it when it estimates the compute unit limit.
107
+ *
108
+ * @since 0.2.0
109
+ * @category reasons
110
+ */
111
+ export class SimulationFailed extends /*#__PURE__*/Schema.TaggedError()("SimulationFailed", {
112
+ error: TransactionError,
113
+ logs: /*#__PURE__*/Schema.Array(Schema.String)
114
+ }) {}
115
+ /**
116
+ * Why a node refused a transaction, the `reason` of a {@link SolanaBroadcastError}, matched with `Effect.catchReason`.
117
+ *
118
+ * @since 0.2.0
119
+ * @category reasons
120
+ */
121
+ export const SolanaBroadcastReason = /*#__PURE__*/Schema.Union([BlockhashNotFound, InsufficientFundsForFee, SimulationFailed]);
122
+ /**
123
+ * A node refused the transaction at its preflight simulation for a `reason` the sender can act on: `cause` is the
124
+ * {@link SolanaRpc.SolanaRpcError} holding the node's message. Any other refusal stays a `SolanaRpcError`.
125
+ *
126
+ * @since 0.2.0
127
+ * @category errors
128
+ */
129
+ export class SolanaBroadcastError extends /*#__PURE__*/Schema.TaggedError()("SolanaBroadcastError", {
130
+ reason: SolanaBroadcastReason,
131
+ cause: /*#__PURE__*/Schema.Defect()
132
+ }) {}
133
+ /**
134
+ * @since 0.2.0
135
+ * @category services
136
+ */
137
+ export class SolanaRelayer extends /*#__PURE__*/Context.Service()("@effect-blockchain/solana/SolanaRelayer") {}
138
+ // a slot reports the lowest price that landed in it, 0 as soon as one transaction paid none: any price above 0 is
139
+ // ordered before those transactions
140
+ const PRIORITY_FEE_FLOOR = /*#__PURE__*/BigInt(1);
141
+ /**
142
+ * The library's fee strategy: the compute unit price is the 75th percentile of the recent slots' prioritization fees,
143
+ * at least 1 micro-lamport.
144
+ *
145
+ * @since 0.2.0
146
+ * @category fees
147
+ */
148
+ export const defaultFees = fees => {
149
+ const sorted = Arr.sort(fees.map(({
150
+ prioritizationFee
151
+ }) => prioritizationFee), Order.BigInt);
152
+ return BigInt_.max(sorted[Math.floor(sorted.length * 0.75)] ?? PRIORITY_FEE_FLOOR, PRIORITY_FEE_FLOOR);
153
+ };
154
+ const COMPUTE_BUDGET_PROGRAM = /*#__PURE__*/SolanaAddress.make("ComputeBudget111111111111111111111111111111");
155
+ // the most a transaction can ask for, and what the simulation runs with
156
+ const MAX_COMPUTE_UNITS = 1_400_000;
157
+ // `getRecentPrioritizationFees` takes at most 128 addresses
158
+ const MAX_FEE_ADDRESSES = 128;
159
+ // `SetComputeUnitLimit` (discriminator 2, u32) and `SetComputeUnitPrice` (discriminator 3, u64), little-endian
160
+ const computeBudget = (limit, price) => {
161
+ const unitLimit = new DataView(new ArrayBuffer(5));
162
+ unitLimit.setUint8(0, 2);
163
+ unitLimit.setUint32(1, limit, true);
164
+ const unitPrice = new DataView(new ArrayBuffer(9));
165
+ unitPrice.setUint8(0, 3);
166
+ unitPrice.setBigUint64(1, price, true);
167
+ return [{
168
+ programAddress: COMPUTE_BUDGET_PROGRAM,
169
+ data: new Uint8Array(unitLimit.buffer)
170
+ }, {
171
+ programAddress: COMPUTE_BUDGET_PROGRAM,
172
+ data: new Uint8Array(unitPrice.buffer)
173
+ }];
174
+ };
175
+ const roleOf = ({
176
+ signer = false,
177
+ writable = false
178
+ }) => signer ? writable ? AccountRole.WRITABLE_SIGNER : AccountRole.READONLY_SIGNER : writable ? AccountRole.WRITABLE : AccountRole.READONLY;
179
+ const compile = (feePayer, lifetime, instructions) => Effect.try({
180
+ try: () => compileTransaction(pipe(createTransactionMessage({
181
+ version: 0
182
+ }), message => setTransactionMessageFeePayer(address(feePayer), message), message => setTransactionMessageLifetimeUsingBlockhash({
183
+ blockhash: blockhash(lifetime.blockhash),
184
+ lastValidBlockHeight: lifetime.lastValidBlockHeight
185
+ }, message), message => appendTransactionMessageInstructions(instructions.map(({
186
+ accounts = [],
187
+ data,
188
+ programAddress
189
+ }) => ({
190
+ programAddress: address(programAddress),
191
+ accounts: accounts.map(account => ({
192
+ address: address(account.address),
193
+ role: roleOf(account)
194
+ })),
195
+ ...(data === undefined ? {} : {
196
+ data
197
+ })
198
+ })), message))),
199
+ catch: cause => new SolanaSignerError({
200
+ cause
201
+ })
202
+ });
203
+ /**
204
+ * Builds a {@link SolanaRelayer} over the provided {@link SolanaRpc.SolanaRpc}. `confirmations` overrides the
205
+ * network's default, as in `SolanaIndexer.layer`: both agree on the last confirmed slot. `fees` (default
206
+ * {@link defaultFees}) prices the transactions signed without a compute unit price, and `computeUnitMultiplier`
207
+ * (default 1.2) is the margin applied to a simulated compute unit limit.
208
+ *
209
+ * @since 0.2.0
210
+ * @category layers
211
+ */
212
+ export const layer = (options = {}) => Layer.effect(SolanaRelayer, Effect.gen(function* () {
213
+ const rpc = yield* SolanaRpc.SolanaRpc;
214
+ const sign = Effect.fn("SolanaRelayer.sign")(function* ({
215
+ feePayer,
216
+ instructions,
217
+ signers = [],
218
+ ...given
219
+ }) {
220
+ const writable = Arr.dedupe([feePayer.address, ...instructions.flatMap(({
221
+ accounts = []
222
+ }) => accounts.filter(account => account.writable === true).map(account => account.address))]);
223
+ const {
224
+ lifetime,
225
+ price
226
+ } = yield* Effect.all({
227
+ lifetime: given.blockhash === undefined ? rpc.getLatestBlockhash({
228
+ commitment: "confirmed"
229
+ }) : Effect.succeed(given.blockhash),
230
+ price: given.computeUnitPrice === undefined ? Effect.map(rpc.getRecentPrioritizationFees({
231
+ addresses: writable.slice(0, MAX_FEE_ADDRESSES)
232
+ }), options.fees ?? defaultFees) : Effect.succeed(given.computeUnitPrice)
233
+ }, {
234
+ concurrency: "unbounded"
235
+ });
236
+ const build = limit => compile(feePayer.address, lifetime, [...computeBudget(limit, price), ...instructions]);
237
+ const estimate = Effect.gen(function* () {
238
+ const simulation = yield* rpc.simulateTransaction({
239
+ transaction: getBase64EncodedWireTransaction(yield* build(MAX_COMPUTE_UNITS)),
240
+ commitment: "confirmed",
241
+ sigVerify: false,
242
+ replaceRecentBlockhash: true
243
+ });
244
+ if (simulation.err !== null) {
245
+ return yield* new SimulationFailed({
246
+ error: simulation.err,
247
+ logs: simulation.logs ?? []
248
+ });
249
+ }
250
+ const units = Number(simulation.unitsConsumed ?? MAX_COMPUTE_UNITS);
251
+ return Math.min(MAX_COMPUTE_UNITS, Math.ceil(units * (options.computeUnitMultiplier ?? 1.2)));
252
+ });
253
+ const compiled = yield* build(given.computeUnitLimit ?? (yield* estimate));
254
+ const message = Uint8Array.from(compiled.messageBytes);
255
+ const required = Object.keys(compiled.signatures);
256
+ const signatures = yield* Effect.forEach(required, account => {
257
+ const signer = [feePayer, ...signers].find(signer => signer.address === account);
258
+ return signer === undefined ? Effect.fail(new SolanaSignerError({
259
+ cause: new Error(`no signer for ${account}`)
260
+ })) : Effect.flatMap(signer.signTransactionMessage(message), signature => Effect.try({
261
+ try: () => {
262
+ assertIsSignatureBytes(signature);
263
+ return signature;
264
+ },
265
+ catch: cause => new SolanaSignerError({
266
+ cause
267
+ })
268
+ }));
269
+ }, {
270
+ concurrency: "unbounded"
271
+ });
272
+ const transaction = {
273
+ ...compiled,
274
+ signatures: Object.fromEntries(Arr.zip(required, signatures))
275
+ };
276
+ return {
277
+ hash: SolanaTransactionHash.make(getSignatureFromTransaction(transaction)),
278
+ signed: getBase64EncodedWireTransaction(transaction),
279
+ lastValidBlockHeight: lifetime.lastValidBlockHeight
280
+ };
281
+ });
282
+ const broadcast = Effect.fn("SolanaRelayer.broadcast")(function* ({
283
+ signed
284
+ }) {
285
+ // the blockhash is read at `confirmed`: a preflight at the default `finalized` would not know it yet
286
+ const sent = yield* Effect.result(rpc.sendTransaction({
287
+ transaction: signed,
288
+ preflightCommitment: "confirmed"
289
+ }));
290
+ if (sent._tag === "Success") return sent.success;
291
+ const cause = sent.failure;
292
+ if (cause.code !== SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE) {
293
+ return yield* cause;
294
+ }
295
+ // the JSON-RPC error only carries a message: the simulation run again returns the transaction error
296
+ const {
297
+ err,
298
+ logs
299
+ } = yield* rpc.simulateTransaction({
300
+ transaction: signed,
301
+ commitment: "confirmed",
302
+ sigVerify: true
303
+ });
304
+ if (err === null) return yield* cause;
305
+ if (err === "AlreadyProcessed") {
306
+ return SolanaTransactionHash.make(getSignatureFromTransaction(getTransactionDecoder().decode(getBase64Encoder().encode(signed))));
307
+ }
308
+ const reason = err === "BlockhashNotFound" ? new BlockhashNotFound()
309
+ // `AccountNotFound` is the fee payer's: the only account a transaction needs to exist
310
+ : err === "InsufficientFundsForFee" || err === "AccountNotFound" ? new InsufficientFundsForFee() : new SimulationFailed({
311
+ error: err,
312
+ logs: logs ?? []
313
+ });
314
+ return yield* new SolanaBroadcastError({
315
+ reason,
316
+ cause
317
+ });
318
+ });
319
+ const fetchTransactionStatus = Effect.fn("SolanaRelayer.fetchTransactionStatus")(function* ({
320
+ hash,
321
+ lastValidBlockHeight
322
+ }) {
323
+ // read before the status: once the finalized height has passed `lastValidBlockHeight`, a block holding the
324
+ // transaction is finalized too, and the status read that follows finds it
325
+ const expired = lastValidBlockHeight !== undefined && (yield* rpc.getBlockHeight({
326
+ commitment: "finalized"
327
+ })) > lastValidBlockHeight;
328
+ // the node's status cache only covers recent slots: without the history, an old transaction would be unknown
329
+ const {
330
+ value
331
+ } = yield* rpc.getSignatureStatuses({
332
+ signatures: [hash],
333
+ searchTransactionHistory: true
334
+ });
335
+ const status = value[0] ?? null;
336
+ if (status === null) return expired ? {
337
+ _tag: "Expired"
338
+ } : {
339
+ _tag: "NotFound"
340
+ };
341
+ const block = status.slot;
342
+ if (status.confirmationStatus !== "finalized") return {
343
+ _tag: "Included",
344
+ block
345
+ };
346
+ // read after the status: a finalized slot older than the transaction's could only delay `Confirmed`
347
+ if (block > (yield* Confirmations.lastConfirmedBlock(rpc, options.confirmations))) {
348
+ return {
349
+ _tag: "Included",
350
+ block
351
+ };
352
+ }
353
+ return status.err === null ? {
354
+ _tag: "Confirmed",
355
+ block
356
+ } : {
357
+ _tag: "Failed",
358
+ block,
359
+ reason: status.err
360
+ };
361
+ });
362
+ return SolanaRelayer.of({
363
+ sign,
364
+ broadcast,
365
+ fetchTransactionStatus,
366
+ awaitConfirmation: ({
367
+ poll = Schedule.spaced(DEFAULT_POLL_INTERVAL),
368
+ ...transaction
369
+ }) => fetchTransactionStatus(transaction).pipe(Effect.repeat({
370
+ schedule: poll,
371
+ until: ({
372
+ _tag
373
+ }) => _tag === "Confirmed" || _tag === "Failed" || _tag === "Expired"
374
+ }), Effect.withSpan("SolanaRelayer.awaitConfirmation"))
375
+ });
376
+ }));
377
+ //# sourceMappingURL=SolanaRelayer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolanaRelayer.js","names":[],"sources":["../src/SolanaRelayer.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,SACE,WAAW,EACX,OAAO,EACP,oCAAoC,EACpC,sBAAsB,EACtB,SAAS,EACT,kBAAkB,EAClB,wBAAwB,EACxB,+BAA+B,EAC/B,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,IAAI,EACJ,6BAA6B,EAC7B,2CAA2C,EAC3C,uEAAuE,QAClE,aAAa;AACpB,OAAO,KAAK,GAAG,MAAM,cAAc;AACnC,OAAO,KAAK,OAAO,MAAM,eAAe;AACxC,OAAO,KAAK,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc;AACrC,OAAO,KAAK,KAAK,MAAM,cAAc;AACrC,OAAO,KAAK,QAAQ,MAAM,iBAAiB;AAC3C,OAAO,KAAK,MAAM,MAAM,eAAe;AACvC,OAAO,KAAK,aAAa,MAAM,6BAA6B;AAC5D,OAAO,KAAK,UAAU,MAAM,0BAA0B;AACtD,SAAS,aAAa,QAAQ,oBAAoB;AAClD,SAAS,qBAAqB,QAAQ,oBAAoB;AAC1D,OAAO,KAAK,SAAS,MAAM,gBAAgB;AAC3C,SAA4B,iBAAiB,QAAQ,mBAAmB;AACxE,SAAS,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I,KAAK,IAAI,OAAO,aAAa,CAAC,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC,EAAE;MACjF,OAAO;QAAE,IAAI,EAAE,UAAU;QAAE;MAAK,CAAW;IAC7C;IACA,OAAO,MAAM,CAAC,GAAG,KAAK,IAAI,GACtB;MAAE,IAAI,EAAE,WAAW;MAAE;IAAK,CAAW,GACrC;MAAE,IAAI,EAAE,QAAQ;MAAE,KAAK;MAAE,MAAM,EAAE,MAAM,CAAC;IAAG,CAAW;EAC5D,CAAC,CACF;EACD,OAAO,aAAa,CAAC,EAAE,CAAC;IACtB,IAAI;IACJ,SAAS;IACT,sBAAsB;IACtB,iBAAiB,EAAE,CAAC;MAAE,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,qBAAqB,CAAC;MAAE,GAAG;IAAW,CAAE,KACnF,sBAAsB,CAAC,WAAW,CAAC,CAAC,IAAI,CACtC,MAAM,CAAC,MAAM,CAAC;MACZ,QAAQ,EAAE,IAAI;MACd,KAAK,EAAE,CAAC;QAAE;MAAI,CAAE,KAAK,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK;KAC5E,CAAC,EACF,MAAM,CAAC,QAAQ,CAAC,iCAAiC,CAAC;GAEvD,CAAC;AACJ,CAAC,CAAC,CACH","ignoreList":[]}
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Typed, read-only Solana JSON-RPC methods over an ordered list of endpoints with fallback.
2
+ * Typed Solana JSON-RPC methods over an ordered list of endpoints with fallback.
3
3
  *
4
4
  * A call starts at the first endpoint and moves to the next one on failure, except on `WrongNetwork`. Each endpoint
5
- * is checked once to serve the configured network (`getGenesisHash`). Every method is a read, so retries and fallback
6
- * are safe. Methods are named after the JSON-RPC method. Every JSON integer in a reply is read as an exact `bigint`,
7
- * so lamport amounts above 2^53 are never rounded.
5
+ * is checked once to serve the configured network (`getGenesisHash`). Every method but `sendTransaction` is a read,
6
+ * so retries and fallback are safe; `sendTransaction` documents its own case. Methods are named after the JSON-RPC
7
+ * method. Every JSON integer in a reply is read as an exact `bigint`, so lamport amounts above 2^53 are never rounded.
8
8
  *
9
9
  * @example
10
10
  * ```ts
@@ -168,10 +168,27 @@ export interface SolanaEncodedTransaction {
168
168
  readonly base64: string;
169
169
  readonly json: SolanaJsonTransaction;
170
170
  }
171
+ /**
172
+ * The status meta of a transaction, reduced to its outcome and lamport balances. `err` is the raw transaction error as
173
+ * JSON (integers as decimal strings), `null` when it succeeded. `preBalances` and `postBalances` follow the account
174
+ * keys, then `loadedAddresses` (absent from transactions older than versioned transactions).
175
+ *
176
+ * @since 0.2.0
177
+ * @category models
178
+ */
179
+ export interface SolanaTransactionMeta {
180
+ readonly err: Schema.Json;
181
+ readonly fee: bigint;
182
+ readonly preBalances: ReadonlyArray<bigint>;
183
+ readonly postBalances: ReadonlyArray<bigint>;
184
+ readonly loadedAddresses?: {
185
+ readonly writable: ReadonlyArray<SolanaAddress>;
186
+ readonly readonly: ReadonlyArray<SolanaAddress>;
187
+ };
188
+ }
171
189
  /**
172
190
  * A `getTransaction` result. `transaction` follows the requested encoding (see {@link SolanaEncodedTransaction}).
173
- * `meta` is the raw status meta (fee, balances, logs, inner instructions...) as JSON with every integer as a decimal
174
- * string, so u64 values are exact and the value can be stored as is. It is `null` when the node does not have it.
191
+ * `meta` is `null` when the node does not have it.
175
192
  *
176
193
  * @since 0.1.0
177
194
  * @category models
@@ -180,7 +197,102 @@ export interface SolanaTransactionInfo<Encoding extends SolanaTransactionEncodin
180
197
  readonly slot: bigint;
181
198
  readonly blockTime: bigint | null;
182
199
  readonly transaction: SolanaEncodedTransaction[Encoding];
183
- readonly meta: Schema.Json;
200
+ readonly meta: SolanaTransactionMeta | null;
201
+ }
202
+ /**
203
+ * A `getBalance` result: the lamports of the account (`value`) at the context `slot`.
204
+ *
205
+ * @since 0.2.0
206
+ * @category models
207
+ */
208
+ export interface SolanaBalance {
209
+ readonly slot: bigint;
210
+ readonly value: bigint;
211
+ }
212
+ /**
213
+ * Why an instruction failed, as the node returns it: the variant's name (`"ProgramFailedToComplete"`), the program's
214
+ * own error code (`{ Custom: 6001 }`), or any other variant carrying data as raw JSON (integers as decimal strings).
215
+ *
216
+ * @since 0.2.0
217
+ * @category models
218
+ */
219
+ export type SolanaInstructionError = string | {
220
+ readonly Custom: number;
221
+ } | {
222
+ readonly [variant: string]: Schema.Json;
223
+ };
224
+ /**
225
+ * Why a transaction failed, as the node returns it: the variant's name (`"BlockhashNotFound"`), the failing
226
+ * instruction's index and error (`{ InstructionError: [2, { Custom: 6001 }] }`), or any other variant carrying data
227
+ * as raw JSON (integers as decimal strings).
228
+ *
229
+ * @since 0.2.0
230
+ * @category models
231
+ */
232
+ export type SolanaTransactionError = string | {
233
+ readonly InstructionError: readonly [index: number, error: SolanaInstructionError];
234
+ } | {
235
+ readonly [variant: string]: Schema.Json;
236
+ };
237
+ /**
238
+ * A `getSignatureStatuses` entry: the `slot` holding the transaction, its `err` (`null` when it succeeded) and the
239
+ * commitment its block has reached. `confirmations` counts the blocks built on it, `null` once it is finalized.
240
+ *
241
+ * @since 0.2.0
242
+ * @category models
243
+ */
244
+ export interface SolanaSignatureStatus {
245
+ readonly slot: bigint;
246
+ readonly confirmations: number | null;
247
+ readonly err: SolanaTransactionError | null;
248
+ readonly confirmationStatus: "processed" | "confirmed" | "finalized" | null;
249
+ }
250
+ /**
251
+ * A `getSignatureStatuses` result: one entry of `value` per signature, in order, `null` for a signature the endpoint
252
+ * does not know, as seen at the context `slot`.
253
+ *
254
+ * @since 0.2.0
255
+ * @category models
256
+ */
257
+ export interface SolanaSignatureStatuses {
258
+ readonly slot: bigint;
259
+ readonly value: ReadonlyArray<SolanaSignatureStatus | null>;
260
+ }
261
+ /**
262
+ * A `getLatestBlockhash` result at the context `slot`: a transaction signed with `blockhash` can land while the block
263
+ * height is at most `lastValidBlockHeight`.
264
+ *
265
+ * @since 0.2.0
266
+ * @category models
267
+ */
268
+ export interface SolanaLatestBlockhash {
269
+ readonly slot: bigint;
270
+ readonly blockhash: string;
271
+ readonly lastValidBlockHeight: bigint;
272
+ }
273
+ /**
274
+ * A `simulateTransaction` result at the context `slot`: `err` is `null` when the transaction would succeed, `logs` the
275
+ * program logs and `unitsConsumed` the compute units used, both `null` when the simulation did not run.
276
+ *
277
+ * @since 0.2.0
278
+ * @category models
279
+ */
280
+ export interface SolanaSimulation {
281
+ readonly slot: bigint;
282
+ readonly err: SolanaTransactionError | null;
283
+ readonly logs: ReadonlyArray<string> | null;
284
+ readonly unitsConsumed: bigint | null;
285
+ }
286
+ /**
287
+ * A `getRecentPrioritizationFees` entry: the lowest compute unit price, in micro-lamports, of a transaction that
288
+ * landed in `slot` and locked the queried accounts. It is 0 for a slot where such a transaction paid none.
289
+ *
290
+ * @since 0.2.0
291
+ * @category models
292
+ */
293
+ export interface SolanaPrioritizationFee {
294
+ readonly slot: bigint;
295
+ readonly prioritizationFee: bigint;
184
296
  }
185
297
  /**
186
298
  * The `getTransaction` options.
@@ -200,6 +312,23 @@ declare const SolanaRpc_base: Context.ServiceClass<SolanaRpc, "@effect-blockchai
200
312
  readonly getSlot: (options: {
201
313
  readonly commitment: SolanaCommitment;
202
314
  }) => Effect.Effect<bigint, SolanaRpcError>;
315
+ /** `getBlockHeight`: the number of blocks below the head, lower than its slot as skipped slots hold no block. */
316
+ readonly getBlockHeight: (options: {
317
+ readonly commitment: SolanaCommitment;
318
+ }) => Effect.Effect<bigint, SolanaRpcError>;
319
+ /**
320
+ * `getSignatureStatuses` of at most 256 `signatures`, read from the blocks the node has processed, whatever their
321
+ * commitment. Without `searchTransactionHistory`, only the node's cache of recent slots is searched: an older
322
+ * transaction is `null`.
323
+ */
324
+ readonly getSignatureStatuses: (options: {
325
+ readonly signatures: ReadonlyArray<SolanaTransactionHash>;
326
+ readonly searchTransactionHistory?: boolean | undefined;
327
+ }) => Effect.Effect<SolanaSignatureStatuses, SolanaRpcError>;
328
+ /** `getBalance` at `finalized` commitment. */
329
+ readonly getBalance: (options: {
330
+ readonly address: SolanaAddress;
331
+ }) => Effect.Effect<SolanaBalance, SolanaRpcError>;
203
332
  /** `getSignaturesForAddress`, one page. */
204
333
  readonly getSignaturesForAddress: (query: SolanaSignaturesQuery) => Effect.Effect<ReadonlyArray<SolanaSignatureInfo>, SolanaRpcError>;
205
334
  /**
@@ -214,6 +343,43 @@ declare const SolanaRpc_base: Context.ServiceClass<SolanaRpc, "@effect-blockchai
214
343
  readonly encoding: Encoding;
215
344
  }): Effect.Effect<SolanaTransactionInfo<Encoding>, SolanaRpcError>;
216
345
  };
346
+ /** `getLatestBlockhash` */
347
+ readonly getLatestBlockhash: (options: {
348
+ readonly commitment: SolanaCommitment;
349
+ }) => Effect.Effect<SolanaLatestBlockhash, SolanaRpcError>;
350
+ /**
351
+ * `simulateTransaction` of a base64 wire `transaction`, run against the bank at `commitment` without being sent. A
352
+ * transaction that would fail is a success whose `err` says why. `sigVerify` checks the signatures, and
353
+ * `replaceRecentBlockhash` swaps the blockhash for the latest one, which unsigned transactions need: the node
354
+ * refuses both together.
355
+ */
356
+ readonly simulateTransaction: (options: {
357
+ readonly transaction: string;
358
+ readonly commitment: SolanaCommitment;
359
+ readonly sigVerify?: boolean | undefined;
360
+ readonly replaceRecentBlockhash?: boolean | undefined;
361
+ }) => Effect.Effect<SolanaSimulation, SolanaRpcError>;
362
+ /**
363
+ * `getRecentPrioritizationFees` over the node's cache of recent slots (up to 150) for the transactions locking every
364
+ * one of `addresses` as writable, at most 128 of them. Without `addresses`, any transaction counts.
365
+ */
366
+ readonly getRecentPrioritizationFees: (options: {
367
+ readonly addresses: ReadonlyArray<SolanaAddress>;
368
+ }) => Effect.Effect<ReadonlyArray<SolanaPrioritizationFee>, SolanaRpcError>;
369
+ /**
370
+ * `sendTransaction`: submits a signed base64 wire `transaction` and returns its first signature. The node simulates
371
+ * it first at `preflightCommitment` (`finalized` by default) unless `skipPreflight`, then forwards it to the leader
372
+ * and rebroadcasts it `maxRetries` times, or until its blockhash expires when left out. A retry or a fallback sends
373
+ * the same bytes, so it never creates a second transaction, but a node that has processed them refuses the second
374
+ * copy. A refusal (a failed preflight, `BlockhashNotFound`, `AlreadyProcessed`...) is `Rejected`, with the node's
375
+ * message in `cause`.
376
+ */
377
+ readonly sendTransaction: (options: {
378
+ readonly transaction: string;
379
+ readonly skipPreflight?: boolean | undefined;
380
+ readonly preflightCommitment?: SolanaCommitment | undefined;
381
+ readonly maxRetries?: number | undefined;
382
+ }) => Effect.Effect<SolanaTransactionHash, SolanaRpcError>;
217
383
  }>;
218
384
  /**
219
385
  * @since 0.1.0
@@ -225,12 +391,15 @@ export declare class SolanaRpc extends SolanaRpc_base {
225
391
  * Builds a {@link SolanaRpc} over `endpoints`, tried in order, sending requests with the provided `HttpClient`
226
392
  * (e.g. `FetchHttpClient.layer`). `timeout` (default 30 seconds) bounds each attempt, `retries` (default 3) and
227
393
  * `retryDelay` (default 500 millis) set the backoff before falling back: see {@link JsonRpc.Unavailable}.
394
+ * `genesisHash` replaces the genesis hash of `network`, for a local validator or a private cluster, which have their
395
+ * own.
228
396
  *
229
397
  * @since 0.1.0
230
398
  * @category layers
231
399
  */
232
400
  export declare const layer: (options: {
233
401
  readonly network: SolanaNetwork;
402
+ readonly genesisHash?: SolanaGenesisHash | undefined;
234
403
  readonly endpoints: Arr.NonEmptyReadonlyArray<SolanaRpcEndpoint>;
235
404
  readonly timeout?: Duration.Input | undefined;
236
405
  readonly retries?: number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"SolanaRpc.d.ts","sourceRoot":"","sources":["../src/SolanaRpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAA;AAc1D,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAA;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAC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