@effect-blockchain/solana 0.0.0-stage → 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.
Files changed (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +12 -2
  3. package/dist/SolanaAddress.d.ts +21 -0
  4. package/dist/SolanaAddress.d.ts.map +1 -0
  5. package/dist/SolanaAddress.js +33 -0
  6. package/dist/SolanaAddress.js.map +1 -0
  7. package/dist/SolanaIndexer.d.ts +198 -0
  8. package/dist/SolanaIndexer.d.ts.map +1 -0
  9. package/dist/SolanaIndexer.js +344 -0
  10. package/dist/SolanaIndexer.js.map +1 -0
  11. package/dist/SolanaNetwork.d.ts +64 -0
  12. package/dist/SolanaNetwork.d.ts.map +1 -0
  13. package/dist/SolanaNetwork.js +84 -0
  14. package/dist/SolanaNetwork.js.map +1 -0
  15. package/dist/SolanaRelayer.d.ts +207 -0
  16. package/dist/SolanaRelayer.d.ts.map +1 -0
  17. package/dist/SolanaRelayer.js +377 -0
  18. package/dist/SolanaRelayer.js.map +1 -0
  19. package/dist/SolanaRpc.d.ts +427 -0
  20. package/dist/SolanaRpc.d.ts.map +1 -0
  21. package/dist/SolanaRpc.js +216 -0
  22. package/dist/SolanaRpc.js.map +1 -0
  23. package/dist/SolanaSigner.d.ts +49 -0
  24. package/dist/SolanaSigner.d.ts.map +1 -0
  25. package/dist/SolanaSigner.js +82 -0
  26. package/dist/SolanaSigner.js.map +1 -0
  27. package/dist/SolanaTransactionHash.d.ts +14 -0
  28. package/dist/SolanaTransactionHash.d.ts.map +1 -0
  29. package/dist/SolanaTransactionHash.js +34 -0
  30. package/dist/SolanaTransactionHash.js.map +1 -0
  31. package/dist/index.d.ts +32 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +33 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/internal/bigIntJson.d.ts +2 -0
  36. package/dist/internal/bigIntJson.d.ts.map +1 -0
  37. package/dist/internal/bigIntJson.js +9 -0
  38. package/dist/internal/bigIntJson.js.map +1 -0
  39. package/dist/internal/confirmations.d.ts +2 -0
  40. package/dist/internal/confirmations.d.ts.map +1 -0
  41. package/dist/internal/confirmations.js +15 -0
  42. package/dist/internal/confirmations.js.map +1 -0
  43. package/dist/internal/rpcMethods.d.ts +2 -0
  44. package/dist/internal/rpcMethods.d.ts.map +1 -0
  45. package/dist/internal/rpcMethods.js +223 -0
  46. package/dist/internal/rpcMethods.js.map +1 -0
  47. package/package.json +66 -3
  48. package/src/SolanaAddress.ts +40 -0
  49. package/src/SolanaIndexer.ts +552 -0
  50. package/src/SolanaNetwork.ts +105 -0
  51. package/src/SolanaRelayer.ts +493 -0
  52. package/src/SolanaRpc.ts +595 -0
  53. package/src/SolanaSigner.ts +98 -0
  54. package/src/SolanaTransactionHash.ts +41 -0
  55. package/src/index.ts +40 -0
  56. package/src/internal/bigIntJson.ts +18 -0
  57. package/src/internal/confirmations.ts +17 -0
  58. package/src/internal/rpcMethods.ts +260 -0
@@ -0,0 +1,49 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Redacted from "effect/Redacted";
3
+ import * as Schema from "effect/Schema";
4
+ import { SolanaAddress } from "./SolanaAddress.ts";
5
+ declare const SolanaSignerError_base: Schema.Class<SolanaSignerError, Schema.TaggedStruct<"SolanaSignerError", {
6
+ readonly cause: Schema.Defect;
7
+ }>, import("effect/Cause").YieldableError>;
8
+ /**
9
+ * A signature could not be produced: `cause` is the signer's own failure, or why its signature was refused. It never
10
+ * holds a private key.
11
+ *
12
+ * @since 0.2.0
13
+ * @category errors
14
+ */
15
+ export declare class SolanaSignerError extends SolanaSignerError_base {
16
+ }
17
+ /**
18
+ * Signs transactions as `address`. `signTransactionMessage` receives the serialized transaction message and returns
19
+ * the 64-byte ed25519 signature of these bytes.
20
+ *
21
+ * @since 0.2.0
22
+ * @category models
23
+ */
24
+ export interface SolanaSigner {
25
+ readonly address: SolanaAddress;
26
+ readonly signTransactionMessage: (message: Uint8Array) => Effect.Effect<Uint8Array, SolanaSignerError>;
27
+ }
28
+ /**
29
+ * A signer holding an ed25519 key in memory: the 64-byte secret key (the private key followed by its public key) in
30
+ * base58, as wallets export it. An invalid key fails with a {@link SolanaSignerError} that does not repeat it.
31
+ *
32
+ * @since 0.2.0
33
+ * @category constructors
34
+ */
35
+ export declare const fromPrivateKey: (key: Redacted.Redacted<string>) => Effect.Effect<SolanaSigner, SolanaSignerError>;
36
+ /**
37
+ * A signer for a key held elsewhere (a custody API, an HSM) that signs raw bytes. `signMessage` receives the
38
+ * serialized transaction message and returns its 64-byte ed25519 signature. A failure of `signMessage`, a malformed
39
+ * signature or one that `address` did not make fails with a {@link SolanaSignerError}.
40
+ *
41
+ * @since 0.2.0
42
+ * @category constructors
43
+ */
44
+ export declare const fromMessageSigner: <E>(options: {
45
+ readonly address: SolanaAddress;
46
+ readonly signMessage: (message: Uint8Array) => Effect.Effect<Uint8Array, E>;
47
+ }) => SolanaSigner;
48
+ export {};
49
+ //# sourceMappingURL=SolanaSigner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolanaSigner.d.ts","sourceRoot":"","sources":["../src/SolanaSigner.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;;;;AAElD;;;;;;GAMG;AACH,qBAAa,iBAAkB,SAAQ,sBAErC;CAAG;AAEL;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAA;IAC/B,QAAQ,CAAC,sBAAsB,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAA;CACvG;AAID;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,QAAS,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,iBAAiB,CAYvG,CAAA;AAEN;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,WAAW;IAC5C,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAA;IAC/B,QAAQ,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAA;CAC5E,KAAG,YAgBF,CAAA"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Signers of Solana transactions: a local private key, or a custody API that signs raw bytes.
3
+ *
4
+ * A signer is a value and receives the whole serialized transaction message. Solana signs these bytes themselves,
5
+ * without hashing them first, so what is being authorised can always be decoded from them. A transaction carries one
6
+ * signature per signer account of its message, the fee payer's first.
7
+ *
8
+ * @since 0.2.0
9
+ */
10
+ import { address, assertIsSignatureBytes, createKeyPairFromBytes, getAddressFromPublicKey, getBase58Encoder, getPublicKeyFromAddress, signBytes, verifySignature } from "@solana/kit";
11
+ import * as Effect from "effect/Effect";
12
+ import * as Redacted from "effect/Redacted";
13
+ import * as Schema from "effect/Schema";
14
+ import { SolanaAddress } from "./SolanaAddress.js";
15
+ /**
16
+ * A signature could not be produced: `cause` is the signer's own failure, or why its signature was refused. It never
17
+ * holds a private key.
18
+ *
19
+ * @since 0.2.0
20
+ * @category errors
21
+ */
22
+ export class SolanaSignerError extends /*#__PURE__*/Schema.TaggedError()("SolanaSignerError", {
23
+ cause: /*#__PURE__*/Schema.Defect()
24
+ }) {}
25
+ const toError = cause => new SolanaSignerError({
26
+ cause
27
+ });
28
+ /**
29
+ * A signer holding an ed25519 key in memory: the 64-byte secret key (the private key followed by its public key) in
30
+ * base58, as wallets export it. An invalid key fails with a {@link SolanaSignerError} that does not repeat it.
31
+ *
32
+ * @since 0.2.0
33
+ * @category constructors
34
+ */
35
+ export const fromPrivateKey = key => Effect.tryPromise({
36
+ try: async () => {
37
+ const keyPair = await createKeyPairFromBytes(getBase58Encoder().encode(Redacted.value(key)));
38
+ return {
39
+ keyPair,
40
+ address: SolanaAddress.make(await getAddressFromPublicKey(keyPair.publicKey))
41
+ };
42
+ },
43
+ // the thrown error can quote the key
44
+ catch: () => new SolanaSignerError({
45
+ cause: new Error("invalid private key")
46
+ })
47
+ }).pipe(Effect.map(({
48
+ address,
49
+ keyPair
50
+ }) => ({
51
+ address,
52
+ signTransactionMessage: message => Effect.tryPromise({
53
+ try: () => signBytes(keyPair.privateKey, message),
54
+ catch: toError
55
+ })
56
+ })));
57
+ /**
58
+ * A signer for a key held elsewhere (a custody API, an HSM) that signs raw bytes. `signMessage` receives the
59
+ * serialized transaction message and returns its 64-byte ed25519 signature. A failure of `signMessage`, a malformed
60
+ * signature or one that `address` did not make fails with a {@link SolanaSignerError}.
61
+ *
62
+ * @since 0.2.0
63
+ * @category constructors
64
+ */
65
+ export const fromMessageSigner = options => ({
66
+ address: options.address,
67
+ signTransactionMessage: Effect.fnUntraced(function* (message) {
68
+ const signature = yield* Effect.mapError(options.signMessage(message), toError);
69
+ return yield* Effect.tryPromise({
70
+ try: async () => {
71
+ assertIsSignatureBytes(signature);
72
+ const publicKey = await getPublicKeyFromAddress(address(options.address));
73
+ if (!(await verifySignature(publicKey, signature, message))) {
74
+ throw new Error(`not a signature of ${options.address}`);
75
+ }
76
+ return signature;
77
+ },
78
+ catch: toError
79
+ });
80
+ })
81
+ });
82
+ //# sourceMappingURL=SolanaSigner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolanaSigner.js","names":[],"sources":["../src/SolanaSigner.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;AASA,SACE,OAAO,EACP,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EACT,eAAe,QACV,aAAa;AACpB,OAAO,KAAK,MAAM,MA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M,CAAC,UAAU,CAAC,WAAU,OAAO;IACzD,MAAM,SAAS,GAAG,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC/E,OAAO,OAAO,MAAM,CAAC,UAAU,CAAC;MAC9B,GAAG,EAAE,YAAW;QACd,sBAAsB,CAAC,SAAS,CAAC;QACjC,MAAM,SAAS,GAAG,MAAM,uBAAuB,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACzE,IAAI,EAAE,MAAM,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,EAAE;UAC3D,MAAM,IAAI,KAAK,CAAC,sBAAsB,OAAO,CAAC,OAAO,EAAE,CAAC;QAC1D;QACA,OAAO,SAAS;MAClB,CAAC;MACD,KAAK,EAAE;KACR,CAAC;EACJ,CAAC;CACF,CAAC","ignoreList":[]}
@@ -0,0 +1,14 @@
1
+ import * as Schema from "effect/Schema";
2
+ /**
3
+ * A Solana transaction hash: a base58-encoded Ed25519 signature, validated with `@solana/kit`.
4
+ *
5
+ * @since 0.1.0
6
+ * @category schemas
7
+ */
8
+ export declare const SolanaTransactionHash: Schema.brand<Schema.String, "SolanaTransactionHash">;
9
+ /**
10
+ * @since 0.1.0
11
+ * @category models
12
+ */
13
+ export type SolanaTransactionHash = typeof SolanaTransactionHash.Type;
14
+ //# sourceMappingURL=SolanaTransactionHash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolanaTransactionHash.d.ts","sourceRoot":"","sources":["../src/SolanaTransactionHash.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAavC;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,sDAWjC,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,OAAO,qBAAqB,CAAC,IAAI,CAAA"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @since 0.1.0
3
+ */
4
+ import { isSignature } from "@solana/kit";
5
+ import * as Schema from "effect/Schema";
6
+ const solanaTransactionHashPattern = "^[1-9A-HJ-NP-Za-km-z]{87}$";
7
+ // `isSignature` from @solana/kit throws on non-base58 characters instead of returning false.
8
+ const isSolanaSignature = value => {
9
+ try {
10
+ return isSignature(value);
11
+ } catch {
12
+ return false;
13
+ }
14
+ };
15
+ /**
16
+ * A Solana transaction hash: a base58-encoded Ed25519 signature, validated with `@solana/kit`.
17
+ *
18
+ * @since 0.1.0
19
+ * @category schemas
20
+ */
21
+ export const SolanaTransactionHash = /*#__PURE__*/Schema.String.annotate({
22
+ title: "Solana transaction hash",
23
+ description: "a valid Solana transaction hash (base58-encoded Ed25519 signature)"
24
+ }).pipe(/*#__PURE__*/Schema.check(/*#__PURE__*/Schema.makeFilter(s => isSolanaSignature(s) || `${s} is not a valid Solana transaction hash`, {
25
+ arbitraryConstraint: {
26
+ patterns: [{
27
+ source: solanaTransactionHashPattern,
28
+ flags: ""
29
+ }]
30
+ }
31
+ })), /*#__PURE__*/Schema.brand("SolanaTransactionHash"), /*#__PURE__*/Schema.annotate({
32
+ identifier: "SolanaTransactionHash"
33
+ }));
34
+ //# sourceMappingURL=SolanaTransactionHash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolanaTransactionHash.js","names":[],"sources":["../src/SolanaTransactionHash.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,SAAS,WAAW,QAAQ,aAAa;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe;AAEvC,MAAM,4BAA4B,GAAG,4BAA4B;AAEjE;AACA,MAAM,iBAAiB,GAAI,KAAa,IAAa;EACnD,IAAI;IACF,OAAO,WAAW,CAAC,KAAK,CAAC;EAC3B,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF,CAAC;AAED;;;;;;AAMA,OAAO,MAAM,qBAAqB,gBAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;EAC1D,KAAK,EAAE,yBAAyB;EAChC,WAAW,EAAE;CACd,CAAC,CAAC,IAAI,cACL,MAAM,CAAC,KAAK,cACV,MAAM,CAAC,UAAU,CAAE,CAAS,IAAK,iBAAiB,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,yCAAyC,EAAE;EACtG,mBAAmB,EAAE;IAAE,QAAQ,EAAE,CAAC;MAAE,MAAM,EAAE,4BAA4B;MAAE,KAAK,EAAE;IAAE,CAAE;EAAC;CACvF,CAAC,CACH,eACD,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,eACrC,MAAM,CAAC,QAAQ,CAAC;EAAE,UAAU,EAAE;AAAuB,CAAE,CAAC,CACzD","ignoreList":[]}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @since 0.1.0
3
+ */
4
+ /**
5
+ * @since 0.1.0
6
+ */
7
+ export * as SolanaAddress from "./SolanaAddress.ts";
8
+ /**
9
+ * @since 0.1.0
10
+ */
11
+ export * as SolanaIndexer from "./SolanaIndexer.ts";
12
+ /**
13
+ * @since 0.1.0
14
+ */
15
+ export * as SolanaNetwork from "./SolanaNetwork.ts";
16
+ /**
17
+ * @since 0.2.0
18
+ */
19
+ export * as SolanaRelayer from "./SolanaRelayer.ts";
20
+ /**
21
+ * @since 0.1.0
22
+ */
23
+ export * as SolanaRpc from "./SolanaRpc.ts";
24
+ /**
25
+ * @since 0.2.0
26
+ */
27
+ export * as SolanaSigner from "./SolanaSigner.ts";
28
+ /**
29
+ * @since 0.1.0
30
+ */
31
+ export * as SolanaTransactionHash from "./SolanaTransactionHash.ts";
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;GAEG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;GAEG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;GAEG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;GAEG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;GAEG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;GAEG;AACH,OAAO,KAAK,qBAAqB,MAAM,4BAA4B,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @since 0.1.0
3
+ */
4
+ // @barrel: Auto-generated exports. Do not edit manually.
5
+ /**
6
+ * @since 0.1.0
7
+ */
8
+ export * as SolanaAddress from "./SolanaAddress.js";
9
+ /**
10
+ * @since 0.1.0
11
+ */
12
+ export * as SolanaIndexer from "./SolanaIndexer.js";
13
+ /**
14
+ * @since 0.1.0
15
+ */
16
+ export * as SolanaNetwork from "./SolanaNetwork.js";
17
+ /**
18
+ * @since 0.2.0
19
+ */
20
+ export * as SolanaRelayer from "./SolanaRelayer.js";
21
+ /**
22
+ * @since 0.1.0
23
+ */
24
+ export * as SolanaRpc from "./SolanaRpc.js";
25
+ /**
26
+ * @since 0.2.0
27
+ */
28
+ export * as SolanaSigner from "./SolanaSigner.js";
29
+ /**
30
+ * @since 0.1.0
31
+ */
32
+ export * as SolanaTransactionHash from "./SolanaTransactionHash.js";
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;AAGA,OAAO,KAAK,aAAa,MAAM,oBAAoB;AAEnD;;;AAGA,OAAO,KAAK,aAAa,MAAM,oBAAoB;AAEnD;;;AAGA,OAAO,KAAK,aAAa,MAAM,oBAAoB;AAEnD;;;AAGA,OAAO,KAAK,aAAa,MAAM,oBAAoB;AAEnD;;;AAGA,OAAO,KAAK,SAAS,MAAM,gBAAgB;AAE3C;;;AAGA,OAAO,KAAK,YAAY,MAAM,mBAAmB;AAEjD;;;AAGA,OAAO,KAAK,qBAAqB,MAAM,4BAA4B","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=bigIntJson.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bigIntJson.d.ts","sourceRoot":"","sources":["../../src/internal/bigIntJson.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ const integer = /^-?\d+$/;
2
+ /**
3
+ * Parses JSON with every integer literal as an exact `bigint`, like `@solana/kit` does: u64 values above 2^53 are
4
+ * never rounded. Reads the literal's source text through the reviver's third argument (Node >= 24).
5
+ *
6
+ * @internal
7
+ */
8
+ export const parse = text => JSON.parse(text, (_key, value, context) => typeof value === "number" && context?.source !== undefined && integer.test(context.source) ? BigInt(context.source) : value);
9
+ //# sourceMappingURL=bigIntJson.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bigIntJson.js","names":[],"sources":["../../src/internal/bigIntJson.ts"],"sourcesContent":[null],"mappings":"AAEA,MAAM,OAAO,GAAG,SAAS;AAEzB;;;;;;AAMA,OAAO,MAAM,KAAK,GAAI,IAAY,IAChC,IAAI,CAAC,KAAK,CACR,IAAI,EACJ,CAAC,IAAI,EAAE,KAAc,EAAE,OAAsC,KAC3D,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,EAAE,MAAM,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GACtF,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GACtB,KAAK,CACZ","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=confirmations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirmations.d.ts","sourceRoot":"","sources":["../../src/internal/confirmations.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import * as BigInt_ from "effect/BigInt";
2
+ import * as Effect from "effect/Effect";
3
+ import * as SolanaNetwork from "../SolanaNetwork.js";
4
+ /**
5
+ * The `finalized` slot minus `confirmations` (the network's default when unset), never below 0.
6
+ *
7
+ * @internal
8
+ */
9
+ export const lastConfirmedBlock = (rpc, confirmations) => {
10
+ const depth = BigInt(confirmations ?? SolanaNetwork.defaultConfirmations(rpc.network));
11
+ return Effect.map(rpc.getSlot({
12
+ commitment: "finalized"
13
+ }), slot => BigInt_.max(slot - depth, BigInt(0)));
14
+ };
15
+ //# sourceMappingURL=confirmations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirmations.js","names":[],"sources":["../../src/internal/confirmations.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,eAAe;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe;AACvC,OAAO,KAAK,aAAa,MAAM,qBAAqB;AAGpD;;;;;AAKA,OAAO,MAAM,kBAAkB,GAAG,CAChC,GAAyB,EACzB,aAAiC,KACQ;EACzC,MAAM,KAAK,GAAG,MAAM,CAAC,aAAa,IAAI,aAAa,CAAC,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;EACtF,OAAO,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC;IAAE,UAAU,EAAE;EAAW,CAAE,CAAC,EAAG,IAAI,IAAK,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7G,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=rpcMethods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rpcMethods.d.ts","sourceRoot":"","sources":["../../src/internal/rpcMethods.ts"],"names":[],"mappings":""}
@@ -0,0 +1,223 @@
1
+ import * as JsonRpc from "@effect-blockchain/core/JsonRpc";
2
+ import * as Schema from "effect/Schema";
3
+ import * as SchemaTransformation from "effect/SchemaTransformation";
4
+ import { SolanaAddress } from "../SolanaAddress.js";
5
+ import { SolanaTransactionHash } from "../SolanaTransactionHash.js";
6
+ const make = method => method;
7
+ const RpcJson = /*#__PURE__*/Schema.Union([Schema.Null, Schema.Boolean, Schema.String, Schema.Number, Schema.BigInt, /*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.suspend(() => RpcJson)), /*#__PURE__*/Schema.Record(Schema.String, /*#__PURE__*/Schema.suspend(() => RpcJson))]);
8
+ const toJson = value => {
9
+ if (typeof value === "bigint") return value.toString();
10
+ if (value === null || typeof value !== "object") return value;
11
+ if (Array.isArray(value)) return value.map(toJson);
12
+ return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, toJson(item)]));
13
+ };
14
+ // raw RPC data kept as JSON, every integer as a decimal string: exact, and storable as is
15
+ const JsonFromRpc = /*#__PURE__*/RpcJson.pipe(/*#__PURE__*/Schema.decodeTo(Schema.Json, /*#__PURE__*/SchemaTransformation.transform({
16
+ decode: toJson,
17
+ encode: json => json
18
+ })));
19
+ // a small JSON integer read as a `number`, e.g. an account index
20
+ const NumberFromBigInt = /*#__PURE__*/Schema.BigInt.pipe(/*#__PURE__*/Schema.decodeTo(Schema.Int, /*#__PURE__*/SchemaTransformation.transform({
21
+ decode: Number,
22
+ encode: BigInt
23
+ })));
24
+ const Indexes = /*#__PURE__*/Schema.Array(NumberFromBigInt);
25
+ // the `transaction` codec by encoding, checked against `SolanaEncodedTransaction` where `SolanaRpc.ts` uses it
26
+ const transactions = {
27
+ base64: /*#__PURE__*/Schema.Tuple([Schema.String, Schema.Literal("base64")]).pipe(/*#__PURE__*/Schema.decodeTo(Schema.String, /*#__PURE__*/SchemaTransformation.transform({
28
+ decode: ([data]) => data,
29
+ encode: data => [data, "base64"]
30
+ }))),
31
+ json: /*#__PURE__*/Schema.Struct({
32
+ signatures: /*#__PURE__*/Schema.Array(SolanaTransactionHash),
33
+ message: /*#__PURE__*/Schema.Struct({
34
+ accountKeys: /*#__PURE__*/Schema.Array(SolanaAddress),
35
+ header: /*#__PURE__*/Schema.Struct({
36
+ numRequiredSignatures: NumberFromBigInt,
37
+ numReadonlySignedAccounts: NumberFromBigInt,
38
+ numReadonlyUnsignedAccounts: NumberFromBigInt
39
+ }),
40
+ recentBlockhash: Schema.String,
41
+ instructions: /*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.Struct({
42
+ programIdIndex: NumberFromBigInt,
43
+ accounts: Indexes,
44
+ data: Schema.String
45
+ })),
46
+ // absent from legacy transactions
47
+ addressTableLookups: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.Struct({
48
+ accountKey: SolanaAddress,
49
+ writableIndexes: Indexes,
50
+ readonlyIndexes: Indexes
51
+ })))
52
+ })
53
+ })
54
+ };
55
+ const Lamports = /*#__PURE__*/Schema.Array(Schema.BigInt);
56
+ // the fields the balance helpers read, any other field of the status meta dropped
57
+ const Meta = /*#__PURE__*/Schema.Struct({
58
+ err: JsonFromRpc,
59
+ fee: Schema.BigInt,
60
+ preBalances: Lamports,
61
+ postBalances: Lamports,
62
+ // absent from transactions older than versioned transactions
63
+ loadedAddresses: /*#__PURE__*/Schema.optionalKey(/*#__PURE__*/Schema.Struct({
64
+ writable: /*#__PURE__*/Schema.Array(SolanaAddress),
65
+ readonly: /*#__PURE__*/Schema.Array(SolanaAddress)
66
+ }))
67
+ });
68
+ // the node's `InstructionError` and `TransactionError` as serde writes them: a variant without data is its name, one
69
+ // with data an object keyed by its name. Only the variants below are decoded, any other one is kept as raw JSON
70
+ const InstructionError = /*#__PURE__*/Schema.Union([Schema.String, /*#__PURE__*/Schema.Struct({
71
+ Custom: NumberFromBigInt
72
+ }), /*#__PURE__*/Schema.Record(Schema.String, JsonFromRpc)]);
73
+ /** @internal */
74
+ export const TransactionError = /*#__PURE__*/Schema.Union([Schema.String, /*#__PURE__*/Schema.Struct({
75
+ InstructionError: /*#__PURE__*/Schema.Tuple([NumberFromBigInt, InstructionError])
76
+ }), /*#__PURE__*/Schema.Record(Schema.String, JsonFromRpc)]);
77
+ const NoParams = /*#__PURE__*/Schema.Tuple([]);
78
+ const Commitment = /*#__PURE__*/Schema.Literals(["confirmed", "finalized"]);
79
+ /** @internal */
80
+ export const getGenesisHash = /*#__PURE__*/make({
81
+ name: "getGenesisHash",
82
+ params: NoParams,
83
+ result: Schema.String
84
+ });
85
+ /** @internal */
86
+ export const getSlot = /*#__PURE__*/make({
87
+ name: "getSlot",
88
+ params: /*#__PURE__*/Schema.Tuple([/*#__PURE__*/Schema.Struct({
89
+ commitment: Commitment
90
+ })]),
91
+ result: Schema.BigInt
92
+ });
93
+ /** @internal */
94
+ export const getBlockHeight = /*#__PURE__*/make({
95
+ name: "getBlockHeight",
96
+ params: /*#__PURE__*/Schema.Tuple([/*#__PURE__*/Schema.Struct({
97
+ commitment: Commitment
98
+ })]),
99
+ result: Schema.BigInt
100
+ });
101
+ /** @internal */
102
+ export const getSignatureStatuses = /*#__PURE__*/make({
103
+ name: "getSignatureStatuses",
104
+ params: /*#__PURE__*/Schema.Tuple([/*#__PURE__*/Schema.Array(SolanaTransactionHash), /*#__PURE__*/Schema.Struct({
105
+ searchTransactionHistory: /*#__PURE__*/JsonRpc.optionalOmitted(Schema.Boolean)
106
+ })]),
107
+ result: /*#__PURE__*/Schema.Struct({
108
+ context: /*#__PURE__*/Schema.Struct({
109
+ slot: Schema.BigInt
110
+ }),
111
+ // `null` for a signature the endpoint does not know
112
+ value: /*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Struct({
113
+ slot: Schema.BigInt,
114
+ confirmations: /*#__PURE__*/Schema.NullOr(NumberFromBigInt),
115
+ err: /*#__PURE__*/Schema.NullOr(TransactionError),
116
+ confirmationStatus: /*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Literals(["processed", "confirmed", "finalized"]))
117
+ })))
118
+ })
119
+ });
120
+ /** @internal */
121
+ export const getBalance = /*#__PURE__*/make({
122
+ name: "getBalance",
123
+ params: /*#__PURE__*/Schema.Tuple([SolanaAddress, /*#__PURE__*/Schema.Struct({
124
+ commitment: Commitment
125
+ })]),
126
+ result: /*#__PURE__*/Schema.Struct({
127
+ context: /*#__PURE__*/Schema.Struct({
128
+ slot: Schema.BigInt
129
+ }),
130
+ value: Schema.BigInt
131
+ })
132
+ });
133
+ /** @internal */
134
+ export const getSignaturesForAddress = /*#__PURE__*/make({
135
+ name: "getSignaturesForAddress",
136
+ params: /*#__PURE__*/Schema.Tuple([SolanaAddress, /*#__PURE__*/Schema.Struct({
137
+ before: /*#__PURE__*/JsonRpc.optionalOmitted(SolanaTransactionHash),
138
+ until: /*#__PURE__*/JsonRpc.optionalOmitted(SolanaTransactionHash),
139
+ limit: /*#__PURE__*/JsonRpc.optionalOmitted(Schema.Int),
140
+ commitment: Commitment,
141
+ minContextSlot: /*#__PURE__*/JsonRpc.optionalOmitted(JsonRpc.BigIntFromInt)
142
+ })]),
143
+ result: /*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.Struct({
144
+ signature: SolanaTransactionHash,
145
+ slot: Schema.BigInt,
146
+ blockTime: /*#__PURE__*/Schema.NullOr(Schema.BigInt),
147
+ err: JsonFromRpc,
148
+ memo: /*#__PURE__*/Schema.NullOr(Schema.String)
149
+ }))
150
+ });
151
+ /** @internal */
152
+ export const getTransaction = encoding => make({
153
+ name: "getTransaction",
154
+ params: Schema.Tuple([SolanaTransactionHash, Schema.Struct({
155
+ commitment: Commitment,
156
+ encoding: Schema.Literal(encoding),
157
+ maxSupportedTransactionVersion: Schema.Literal(0)
158
+ })]),
159
+ // `null` when the endpoint does not have the transaction
160
+ result: Schema.NullOr(Schema.Struct({
161
+ slot: Schema.BigInt,
162
+ blockTime: Schema.NullOr(Schema.BigInt),
163
+ transaction: transactions[encoding],
164
+ meta: Schema.NullOr(Meta)
165
+ }))
166
+ });
167
+ /** @internal */
168
+ export const getLatestBlockhash = /*#__PURE__*/make({
169
+ name: "getLatestBlockhash",
170
+ params: /*#__PURE__*/Schema.Tuple([/*#__PURE__*/Schema.Struct({
171
+ commitment: Commitment
172
+ })]),
173
+ result: /*#__PURE__*/Schema.Struct({
174
+ context: /*#__PURE__*/Schema.Struct({
175
+ slot: Schema.BigInt
176
+ }),
177
+ value: /*#__PURE__*/Schema.Struct({
178
+ blockhash: Schema.String,
179
+ lastValidBlockHeight: Schema.BigInt
180
+ })
181
+ })
182
+ });
183
+ /** @internal */
184
+ export const simulateTransaction = /*#__PURE__*/make({
185
+ name: "simulateTransaction",
186
+ params: /*#__PURE__*/Schema.Tuple([Schema.String, /*#__PURE__*/Schema.Struct({
187
+ encoding: /*#__PURE__*/Schema.Literal("base64"),
188
+ commitment: Commitment,
189
+ sigVerify: /*#__PURE__*/JsonRpc.optionalOmitted(Schema.Boolean),
190
+ replaceRecentBlockhash: /*#__PURE__*/JsonRpc.optionalOmitted(Schema.Boolean)
191
+ })]),
192
+ result: /*#__PURE__*/Schema.Struct({
193
+ context: /*#__PURE__*/Schema.Struct({
194
+ slot: Schema.BigInt
195
+ }),
196
+ value: /*#__PURE__*/Schema.Struct({
197
+ err: /*#__PURE__*/Schema.NullOr(TransactionError),
198
+ logs: /*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(Schema.String)),
199
+ unitsConsumed: /*#__PURE__*/Schema.NullOr(Schema.BigInt)
200
+ })
201
+ })
202
+ });
203
+ /** @internal */
204
+ export const getRecentPrioritizationFees = /*#__PURE__*/make({
205
+ name: "getRecentPrioritizationFees",
206
+ params: /*#__PURE__*/Schema.Tuple([/*#__PURE__*/Schema.Array(SolanaAddress)]),
207
+ result: /*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.Struct({
208
+ slot: Schema.BigInt,
209
+ prioritizationFee: Schema.BigInt
210
+ }))
211
+ });
212
+ /** @internal */
213
+ export const sendTransaction = /*#__PURE__*/make({
214
+ name: "sendTransaction",
215
+ params: /*#__PURE__*/Schema.Tuple([Schema.String, /*#__PURE__*/Schema.Struct({
216
+ encoding: /*#__PURE__*/Schema.Literal("base64"),
217
+ skipPreflight: /*#__PURE__*/JsonRpc.optionalOmitted(Schema.Boolean),
218
+ preflightCommitment: /*#__PURE__*/JsonRpc.optionalOmitted(Commitment),
219
+ maxRetries: /*#__PURE__*/JsonRpc.optionalOmitted(Schema.Int)
220
+ })]),
221
+ result: SolanaTransactionHash
222
+ });
223
+ //# sourceMappingURL=rpcMethods.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rpcMethods.js","names":[],"sources":["../../src/internal/rpcMethods.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iCAAiC;AAC1D,OAAO,KAAK,MAAM,MAAM,eAAe;AACvC,OAAO,KAAK,oBAAoB,MAAM,6BAA6B;AACnE,SAAS,aAAa,QAAQ,qBAAqB;AACnD,SAAS,qBAAqB,QAAQ,6BAA6B;AAgBnE,MAAM,IAAI,GAAoB,MAA+C,IAAK,MAAM;AAExF,MAAM,OAAO,gBAA0B,MAAM,CAAC,KAAK,CAAC,CAClD,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,eACb,MAAM,CAAC,KAAK,cAAC,MAAM,CAAC,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC,eAC3C,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,eAAE,MAAM,CAAC,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC,CAC5D,CAAC;AAEF,MAAM,MAAM,GAAI,KAAc,IAAiB;EAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,OAAO,KAAK,CAAC,QAAQ,EAAE;EACtD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,OAAO,KAAK;EAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC;EAClD,OAAO,MAA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AAEF;AACA,OAAO,MAAM,2BAA2B,gBAAG,IAAI,CAAC;EAC9C,IAAI,EAAE,6BAA6B;EACnC,MAAM,eAAE,MAAM,CAAC,KAAK,CAAC,cAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;EACnD,MAAM,eAAE,MAAM,CAAC,KAAK,cAAC,MAAM,CAAC,MAAM,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC,MAAM;IAAE,iBAAiB,EAAE,MAAM,CAAC;EAAM,CAAE,CAAC;CAC9F,CAAC;AAEF;AACA,OAAO,MAAM,eAAe,gBAAG,IAAI,CAAC;EAClC,IAAI,EAAE,iBAAiB;EACvB,MAAM,eAAE,MAAM,CAAC,KAAK,CAAC,CACnB,MAAM,CAAC,MAAM,eACb,MAAM,CAAC,MAAM,CAAC;IACZ,QAAQ,eAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;IAClC,aAAa,eAAE,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC;IACtD,mBAAmB,eAAE,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC;IACxD,UAAU,eAAE,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG;GAC/C,CAAC,CACH,CAAC;EACF,MAAM,EAAE;CACT,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,69 @@
1
1
  {
2
2
  "name": "@effect-blockchain/solana",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0",
4
+ "description": "Solana blockchain toolkit for Effect",
5
+ "keywords": [
6
+ "typescript",
7
+ "effect",
8
+ "blockchain",
9
+ "solana"
10
+ ],
11
+ "homepage": "https://github.com/spiko-tech/effect-blockchain",
12
+ "bugs": {
13
+ "url": "https://github.com/spiko-tech/effect-blockchain/issues"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/spiko-tech/effect-blockchain.git",
18
+ "directory": "packages/solana"
19
+ },
20
+ "license": "MIT",
21
+ "sideEffects": [],
22
+ "type": "module",
23
+ "exports": {
24
+ "./package.json": "./package.json",
25
+ ".": "./dist/index.js",
26
+ "./*": "./dist/*.js",
27
+ "./internal/*": null,
28
+ "./index": null,
29
+ "./*/index": null
30
+ },
31
+ "files": [
32
+ "src/**/*.ts",
33
+ "dist/**/*.js",
34
+ "dist/**/*.js.map",
35
+ "dist/**/*.d.ts",
36
+ "dist/**/*.d.ts.map"
37
+ ],
38
+ "dependencies": {
39
+ "@effect-blockchain/core": "^0.1.0"
40
+ },
41
+ "devDependencies": {
42
+ "@effect/vitest": "4.1.0",
43
+ "@solana/kit": "^8.5.0",
44
+ "effect": "4.1.0"
45
+ },
46
+ "peerDependencies": {
47
+ "@solana/kit": "^8.5.0",
48
+ "effect": "^4.0.0"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public",
52
+ "provenance": true
53
+ },
54
+ "tags": [
55
+ "typescript",
56
+ "effect",
57
+ "blockchain",
58
+ "solana"
59
+ ],
60
+ "scripts": {
61
+ "codegen": "node ../../scripts/codegen.mjs . 'src/**/index.ts'",
62
+ "build": "tsc -b tsconfig.json tsconfig.release.json && pnpm babel",
63
+ "babel": "babel dist --plugins annotate-pure-calls --out-dir dist --source-maps",
64
+ "check": "tsc -b tsconfig.json",
65
+ "test": "vitest",
66
+ "coverage": "vitest --coverage",
67
+ "record-fixtures": "node --env-file-if-exists=../../.env scripts/record-fixtures.ts"
68
+ }
6
69
  }