@solana/rpc-types 2.0.0-experimental.aa4a701 → 2.0.0-experimental.ac2c1c8

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 (38) hide show
  1. package/README.md +1 -1
  2. package/dist/index.browser.cjs +64 -0
  3. package/dist/index.browser.cjs.map +1 -1
  4. package/dist/index.browser.js +60 -1
  5. package/dist/index.browser.js.map +1 -1
  6. package/dist/index.native.js +60 -1
  7. package/dist/index.native.js.map +1 -1
  8. package/dist/index.node.cjs +64 -0
  9. package/dist/index.node.cjs.map +1 -1
  10. package/dist/index.node.js +60 -1
  11. package/dist/index.node.js.map +1 -1
  12. package/dist/types/account-filters.d.ts +14 -0
  13. package/dist/types/account-filters.d.ts.map +1 -0
  14. package/dist/types/account-info.d.ts +43 -0
  15. package/dist/types/account-info.d.ts.map +1 -0
  16. package/dist/types/blockhash.d.ts +5 -0
  17. package/dist/types/blockhash.d.ts.map +1 -0
  18. package/dist/types/cluster-url.d.ts +14 -0
  19. package/dist/types/cluster-url.d.ts.map +1 -0
  20. package/dist/types/encoded-bytes.d.ts +13 -0
  21. package/dist/types/encoded-bytes.d.ts.map +1 -0
  22. package/dist/types/index.d.ts +17 -5
  23. package/dist/types/index.d.ts.map +1 -1
  24. package/dist/types/rpc-api.d.ts +8 -0
  25. package/dist/types/rpc-api.d.ts.map +1 -0
  26. package/dist/types/rpc-errors.d.ts +21 -0
  27. package/dist/types/rpc-errors.d.ts.map +1 -0
  28. package/dist/types/token-amount.d.ts +9 -0
  29. package/dist/types/token-amount.d.ts.map +1 -0
  30. package/dist/types/token-balance.d.ts +14 -0
  31. package/dist/types/token-balance.d.ts.map +1 -0
  32. package/dist/types/transaction-error.d.ts +19 -0
  33. package/dist/types/transaction-error.d.ts.map +1 -0
  34. package/dist/types/transaction.d.ts +251 -0
  35. package/dist/types/transaction.d.ts.map +1 -0
  36. package/dist/types/typed-numbers.d.ts +14 -0
  37. package/dist/types/typed-numbers.d.ts.map +1 -0
  38. package/package.json +12 -31
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/commitment.ts","../src/lamports.ts","../src/stringified-bigint.ts","../src/stringified-number.ts","../src/unix-timestamp.ts"],"names":[],"mappings":";AAEA,SAAS,mBAAmB,YAAgC;AACxD,UAAQ,YAAY;AAAA,IAChB,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX;AACI,cAAQ,CAAC,MAAa;AAClB,cAAM,IAAI,MAAM,6BAA6B,UAAU,KAAK;AAAA,MAChE,GAAG,UAAU;AAAA,EACrB;AACJ;AAEO,SAAS,qBAAqB,GAAe,GAA2B;AAC3E,MAAI,MAAM,GAAG;AACT,WAAO;AAAA,EACX;AACA,SAAO,mBAAmB,CAAC,IAAI,mBAAmB,CAAC,IAAI,KAAK;AAChE;;;AChBA,IAAM,cAAc;AAEb,SAAS,WAAW,kBAAgF;AACvG,SAAO,oBAAoB,KAAK,oBAAoB;AACxD;AAEO,SAAS,iBACZ,kBAC4D;AAC5D,MAAI,mBAAmB,GAAG;AAEtB,UAAM,IAAI,MAAM,sDAAsD;AAAA,EAC1E;AAEA,MAAI,mBAAmB,aAAa;AAEhC,UAAM,IAAI,MAAM,0EAA0E;AAAA,EAC9F;AACJ;AAEO,SAAS,SAAS,kBAA4D;AACjF,mBAAiB,gBAAgB;AACjC,SAAO;AACX;;;AC3BO,SAAS,oBAAoB,gBAA6D;AAC7F,MAAI;AACA,WAAO,cAAc;AACrB,WAAO;AAAA,EACX,SAAS,GAAG;AACR,WAAO;AAAA,EACX;AACJ;AAEO,SAAS,0BAA0B,gBAAqE;AAC3G,MAAI;AACA,WAAO,cAAc;AAAA,EACzB,SAAS,GAAG;AACR,UAAM,IAAI,MAAM,KAAK,cAAc,mCAAmC;AAAA,MAClE,OAAO;AAAA,IACX,CAAC;AAAA,EACL;AACJ;AAEO,SAAS,kBAAkB,gBAA2C;AACzE,4BAA0B,cAAc;AACxC,SAAO;AACX;;;ACtBO,SAAS,oBAAoB,gBAA6D;AAC7F,SAAO,CAAC,OAAO,MAAM,OAAO,cAAc,CAAC;AAC/C;AAEO,SAAS,0BAA0B,gBAAqE;AAC3G,MAAI,OAAO,MAAM,OAAO,cAAc,CAAC,GAAG;AACtC,UAAM,IAAI,MAAM,KAAK,cAAc,iCAAiC;AAAA,EACxE;AACJ;AAEO,SAAS,kBAAkB,gBAA2C;AACzE,4BAA0B,cAAc;AACxC,SAAO;AACX;;;ACbO,SAAS,gBAAgB,mBAA+D;AAE3F,MAAI,oBAAoB,UAAW,oBAAoB,SAAU;AAC7D,WAAO;AAAA,EACX;AACA,SAAO;AACX;AAEO,SAAS,sBAAsB,mBAAuE;AAEzG,MAAI;AACA,QAAI,oBAAoB,UAAW,oBAAoB,SAAU;AAC7D,YAAM,IAAI,MAAM,8DAA8D;AAAA,IAClF;AAAA,EACJ,SAAS,GAAG;AACR,UAAM,IAAI,MAAM,KAAK,iBAAiB,yBAAyB;AAAA,MAC3D,OAAO;AAAA,IACX,CAAC;AAAA,EACL;AACJ;AAEO,SAAS,cAAc,mBAA0C;AACpE,wBAAsB,iBAAiB;AACvC,SAAO;AACX","sourcesContent":["export type Commitment = 'confirmed' | 'finalized' | 'processed';\n\nfunction getCommitmentScore(commitment: Commitment): number {\n switch (commitment) {\n case 'finalized':\n return 2;\n case 'confirmed':\n return 1;\n case 'processed':\n return 0;\n default:\n return ((_: never) => {\n throw new Error(`Unrecognized commitment \\`${commitment}\\`.`);\n })(commitment);\n }\n}\n\nexport function commitmentComparator(a: Commitment, b: Commitment): -1 | 0 | 1 {\n if (a === b) {\n return 0;\n }\n return getCommitmentScore(a) < getCommitmentScore(b) ? -1 : 1;\n}\n","// FIXME(solana-labs/solana/issues/30341) Beware that any value above 9007199254740991 may be\n// truncated or rounded because of a downcast to JavaScript `number` between your calling code and\n// the JSON-RPC transport.\nexport type LamportsUnsafeBeyond2Pow53Minus1 = bigint & { readonly __brand: unique symbol };\n\n// Largest possible value to be represented by a u64\nconst maxU64Value = 18446744073709551615n; // 2n ** 64n - 1n\n\nexport function isLamports(putativeLamports: bigint): putativeLamports is LamportsUnsafeBeyond2Pow53Minus1 {\n return putativeLamports >= 0 && putativeLamports <= maxU64Value;\n}\n\nexport function assertIsLamports(\n putativeLamports: bigint\n): asserts putativeLamports is LamportsUnsafeBeyond2Pow53Minus1 {\n if (putativeLamports < 0) {\n // TODO: Coded error.\n throw new Error('Input for 64-bit unsigned integer cannot be negative');\n }\n\n if (putativeLamports > maxU64Value) {\n // TODO: Coded error.\n throw new Error('Input number is too large to be represented as a 64-bit unsigned integer');\n }\n}\n\nexport function lamports(putativeLamports: bigint): LamportsUnsafeBeyond2Pow53Minus1 {\n assertIsLamports(putativeLamports);\n return putativeLamports;\n}\n","export type StringifiedBigInt = string & { readonly __brand: unique symbol };\n\nexport function isStringifiedBigInt(putativeBigInt: string): putativeBigInt is StringifiedBigInt {\n try {\n BigInt(putativeBigInt);\n return true;\n } catch (_) {\n return false;\n }\n}\n\nexport function assertIsStringifiedBigInt(putativeBigInt: string): asserts putativeBigInt is StringifiedBigInt {\n try {\n BigInt(putativeBigInt);\n } catch (e) {\n throw new Error(`\\`${putativeBigInt}\\` cannot be parsed as a BigInt`, {\n cause: e,\n });\n }\n}\n\nexport function stringifiedBigInt(putativeBigInt: string): StringifiedBigInt {\n assertIsStringifiedBigInt(putativeBigInt);\n return putativeBigInt;\n}\n","export type StringifiedNumber = string & { readonly __brand: unique symbol };\n\nexport function isStringifiedNumber(putativeNumber: string): putativeNumber is StringifiedNumber {\n return !Number.isNaN(Number(putativeNumber));\n}\n\nexport function assertIsStringifiedNumber(putativeNumber: string): asserts putativeNumber is StringifiedNumber {\n if (Number.isNaN(Number(putativeNumber))) {\n throw new Error(`\\`${putativeNumber}\\` cannot be parsed as a Number`);\n }\n}\n\nexport function stringifiedNumber(putativeNumber: string): StringifiedNumber {\n assertIsStringifiedNumber(putativeNumber);\n return putativeNumber;\n}\n","export type UnixTimestamp = number & { readonly __brand: unique symbol };\n\nexport function isUnixTimestamp(putativeTimestamp: number): putativeTimestamp is UnixTimestamp {\n // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date\n if (putativeTimestamp > 8.64e15 || putativeTimestamp < -8.64e15) {\n return false;\n }\n return true;\n}\n\nexport function assertIsUnixTimestamp(putativeTimestamp: number): asserts putativeTimestamp is UnixTimestamp {\n // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date\n try {\n if (putativeTimestamp > 8.64e15 || putativeTimestamp < -8.64e15) {\n throw new Error('Expected input number to be in the range [-8.64e15, 8.64e15]');\n }\n } catch (e) {\n throw new Error(`\\`${putativeTimestamp}\\` is not a timestamp`, {\n cause: e,\n });\n }\n}\n\nexport function unixTimestamp(putativeTimestamp: number): UnixTimestamp {\n assertIsUnixTimestamp(putativeTimestamp);\n return putativeTimestamp;\n}\n"]}
1
+ {"version":3,"sources":["../src/blockhash.ts","../src/cluster-url.ts","../src/commitment.ts","../src/lamports.ts","../src/rpc-errors.ts","../src/stringified-bigint.ts","../src/stringified-number.ts","../src/unix-timestamp.ts"],"names":[],"mappings":";AACA,SAAS,wBAAwB;AAIjC,IAAI;AAEG,SAAS,kBAAkB,mBAAmE;AACjG,MAAI,CAAC;AAAe,oBAAgB,iBAAiB;AACrD,MAAI;AAEA;AAAA;AAAA,MAEI,kBAAkB,SAAS;AAAA,MAE3B,kBAAkB,SAAS;AAAA,MAC7B;AACE,YAAM,IAAI,MAAM,+DAA+D;AAAA,IACnF;AAEA,UAAM,QAAQ,cAAc,OAAO,iBAAiB;AACpD,UAAM,WAAW,MAAM;AACvB,QAAI,aAAa,IAAI;AACjB,YAAM,IAAI,MAAM,gFAAgF,QAAQ,EAAE;AAAA,IAC9G;AAAA,EACJ,SAAS,GAAG;AACR,UAAM,IAAI,MAAM,KAAK,iBAAiB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ana/codecs-strings';\n\nexport type Blockhash = string & { readonly __brand: unique symbol };\n\nlet base58Encoder: Encoder<string> | undefined;\n\nexport function assertIsBlockhash(putativeBlockhash: string): asserts putativeBlockhash is Blockhash {\n if (!base58Encoder) base58Encoder = getBase58Encoder();\n try {\n // Fast-path; see if the input string is of an acceptable length.\n if (\n // Lowest value (32 bytes of zeroes)\n putativeBlockhash.length < 32 ||\n // Highest value (32 bytes of 255)\n putativeBlockhash.length > 44\n ) {\n throw new Error('Expected input string to decode to a byte array of length 32.');\n }\n // Slow-path; actually attempt to decode the input string.\n const bytes = base58Encoder.encode(putativeBlockhash);\n const numBytes = bytes.byteLength;\n if (numBytes !== 32) {\n throw new Error(`Expected input string to decode to a byte array of length 32. Actual length: ${numBytes}`);\n }\n } catch (e) {\n throw new Error(`\\`${putativeBlockhash}\\` is not a blockhash`, {\n cause: e,\n });\n }\n}\n","export type MainnetUrl = string & { '~cluster': 'mainnet' };\nexport type DevnetUrl = string & { '~cluster': 'devnet' };\nexport type TestnetUrl = string & { '~cluster': 'testnet' };\nexport type ClusterUrl = string | MainnetUrl | DevnetUrl | TestnetUrl;\n\nexport function mainnet(putativeString: string): MainnetUrl {\n return putativeString as MainnetUrl;\n}\nexport function devnet(putativeString: string): DevnetUrl {\n return putativeString as DevnetUrl;\n}\nexport function testnet(putativeString: string): TestnetUrl {\n return putativeString as TestnetUrl;\n}\n","export type Commitment = 'confirmed' | 'finalized' | 'processed';\n\nfunction getCommitmentScore(commitment: Commitment): number {\n switch (commitment) {\n case 'finalized':\n return 2;\n case 'confirmed':\n return 1;\n case 'processed':\n return 0;\n default:\n return ((_: never) => {\n throw new Error(`Unrecognized commitment \\`${commitment}\\`.`);\n })(commitment);\n }\n}\n\nexport function commitmentComparator(a: Commitment, b: Commitment): -1 | 0 | 1 {\n if (a === b) {\n return 0;\n }\n return getCommitmentScore(a) < getCommitmentScore(b) ? -1 : 1;\n}\n","// FIXME(solana-labs/solana/issues/30341) Beware that any value above 9007199254740991 may be\n// truncated or rounded because of a downcast to JavaScript `number` between your calling code and\n// the JSON-RPC transport.\nexport type LamportsUnsafeBeyond2Pow53Minus1 = bigint & { readonly __brand: unique symbol };\n\n// Largest possible value to be represented by a u64\nconst maxU64Value = 18446744073709551615n; // 2n ** 64n - 1n\n\nexport function isLamports(putativeLamports: bigint): putativeLamports is LamportsUnsafeBeyond2Pow53Minus1 {\n return putativeLamports >= 0 && putativeLamports <= maxU64Value;\n}\n\nexport function assertIsLamports(\n putativeLamports: bigint,\n): asserts putativeLamports is LamportsUnsafeBeyond2Pow53Minus1 {\n if (putativeLamports < 0) {\n // TODO: Coded error.\n throw new Error('Input for 64-bit unsigned integer cannot be negative');\n }\n\n if (putativeLamports > maxU64Value) {\n // TODO: Coded error.\n throw new Error('Input number is too large to be represented as a 64-bit unsigned integer');\n }\n}\n\nexport function lamports(putativeLamports: bigint): LamportsUnsafeBeyond2Pow53Minus1 {\n assertIsLamports(putativeLamports);\n return putativeLamports;\n}\n","// Keep in sync with https://github.com/solana-labs/solana/blob/master/rpc-client-api/src/custom_error.rs\n// Typescript `enums` thwart tree-shaking. See https://bargsten.org/jsts/enums/\nexport const SolanaRpcErrorCode = {\n JSON_RPC_INVALID_PARAMS: -32602,\n JSON_RPC_SCAN_ERROR: -32012,\n JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP: -32001,\n JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE: -32004,\n JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET: -32014,\n JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX: -32010,\n JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED: -32009,\n JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED: -32016,\n JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY: -32005,\n JSON_RPC_SERVER_ERROR_NO_SNAPSHOT: -32008,\n JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE: -32002,\n JSON_RPC_SERVER_ERROR_SLOT_SKIPPED: -32007,\n JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE: -32011,\n JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE: -32006,\n JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH: -32013,\n JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE: -32003,\n JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION: -32015,\n} as const;\n\nexport type SolanaRpcErrorCodeEnum = (typeof SolanaRpcErrorCode)[keyof typeof SolanaRpcErrorCode];\n","export type StringifiedBigInt = string & { readonly __brand: unique symbol };\n\nexport function isStringifiedBigInt(putativeBigInt: string): putativeBigInt is StringifiedBigInt {\n try {\n BigInt(putativeBigInt);\n return true;\n } catch (_) {\n return false;\n }\n}\n\nexport function assertIsStringifiedBigInt(putativeBigInt: string): asserts putativeBigInt is StringifiedBigInt {\n try {\n BigInt(putativeBigInt);\n } catch (e) {\n throw new Error(`\\`${putativeBigInt}\\` cannot be parsed as a BigInt`, {\n cause: e,\n });\n }\n}\n\nexport function stringifiedBigInt(putativeBigInt: string): StringifiedBigInt {\n assertIsStringifiedBigInt(putativeBigInt);\n return putativeBigInt;\n}\n","export type StringifiedNumber = string & { readonly __brand: unique symbol };\n\nexport function isStringifiedNumber(putativeNumber: string): putativeNumber is StringifiedNumber {\n return !Number.isNaN(Number(putativeNumber));\n}\n\nexport function assertIsStringifiedNumber(putativeNumber: string): asserts putativeNumber is StringifiedNumber {\n if (Number.isNaN(Number(putativeNumber))) {\n throw new Error(`\\`${putativeNumber}\\` cannot be parsed as a Number`);\n }\n}\n\nexport function stringifiedNumber(putativeNumber: string): StringifiedNumber {\n assertIsStringifiedNumber(putativeNumber);\n return putativeNumber;\n}\n","export type UnixTimestamp = number & { readonly __brand: unique symbol };\n\nexport function isUnixTimestamp(putativeTimestamp: number): putativeTimestamp is UnixTimestamp {\n // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date\n if (putativeTimestamp > 8.64e15 || putativeTimestamp < -8.64e15) {\n return false;\n }\n return true;\n}\n\nexport function assertIsUnixTimestamp(putativeTimestamp: number): asserts putativeTimestamp is UnixTimestamp {\n // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date\n try {\n if (putativeTimestamp > 8.64e15 || putativeTimestamp < -8.64e15) {\n throw new Error('Expected input number to be in the range [-8.64e15, 8.64e15]');\n }\n } catch (e) {\n throw new Error(`\\`${putativeTimestamp}\\` is not a timestamp`, {\n cause: e,\n });\n }\n}\n\nexport function unixTimestamp(putativeTimestamp: number): UnixTimestamp {\n assertIsUnixTimestamp(putativeTimestamp);\n return putativeTimestamp;\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import type { U64UnsafeBeyond2Pow53Minus1 } from './typed-numbers.js';
2
+ export type DataSlice = Readonly<{
3
+ offset: number;
4
+ length: number;
5
+ }>;
6
+ export type GetProgramAccountsMemcmpFilter = Readonly<{
7
+ offset: U64UnsafeBeyond2Pow53Minus1;
8
+ bytes: string;
9
+ encoding: 'base58' | 'base64';
10
+ }>;
11
+ export type GetProgramAccountsDatasizeFilter = Readonly<{
12
+ dataSize: U64UnsafeBeyond2Pow53Minus1;
13
+ }>;
14
+ //# sourceMappingURL=account-filters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-filters.d.ts","sourceRoot":"","sources":["../../src/account-filters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAEnE,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAClB,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,43 @@
1
+ import type { Address } from '@solana/addresses';
2
+ import type { Base58EncodedBytes, Base58EncodedDataResponse, Base64EncodedDataResponse, Base64EncodedZStdCompressedDataResponse } from './encoded-bytes.js';
3
+ import type { LamportsUnsafeBeyond2Pow53Minus1 } from './lamports.js';
4
+ import type { U64UnsafeBeyond2Pow53Minus1 } from './typed-numbers.js';
5
+ export type AccountInfoBase = Readonly<{
6
+ /** indicates if the account contains a program (and is strictly read-only) */
7
+ executable: boolean;
8
+ /** number of lamports assigned to this account */
9
+ lamports: LamportsUnsafeBeyond2Pow53Minus1;
10
+ /** pubkey of the program this account has been assigned to */
11
+ owner: Address;
12
+ /** the epoch at which this account will next owe rent */
13
+ rentEpoch: U64UnsafeBeyond2Pow53Minus1;
14
+ }>;
15
+ /** @deprecated */
16
+ export type AccountInfoWithBase58Bytes = Readonly<{
17
+ data: Base58EncodedBytes;
18
+ }>;
19
+ /** @deprecated */
20
+ export type AccountInfoWithBase58EncodedData = Readonly<{
21
+ data: Base58EncodedDataResponse;
22
+ }>;
23
+ export type AccountInfoWithBase64EncodedData = Readonly<{
24
+ data: Base64EncodedDataResponse;
25
+ }>;
26
+ export type AccountInfoWithBase64EncodedZStdCompressedData = Readonly<{
27
+ data: Base64EncodedZStdCompressedDataResponse;
28
+ }>;
29
+ export type AccountInfoWithJsonData = Readonly<{
30
+ data: Readonly<{
31
+ program: string;
32
+ parsed: {
33
+ info?: object;
34
+ type: string;
35
+ };
36
+ space: U64UnsafeBeyond2Pow53Minus1;
37
+ }> | Base64EncodedDataResponse;
38
+ }>;
39
+ export type AccountInfoWithPubkey<TAccount extends AccountInfoBase> = Readonly<{
40
+ account: TAccount;
41
+ pubkey: Address;
42
+ }>;
43
+ //# sourceMappingURL=account-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-info.d.ts","sourceRoot":"","sources":["../../src/account-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,KAAK,EACR,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,uCAAuC,EAC1C,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAEnE,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACnC,8EAA8E;IAC9E,UAAU,EAAE,OAAO,CAAC;IACpB,kDAAkD;IAClD,QAAQ,EAAE,gCAAgC,CAAC;IAC3C,8DAA8D;IAC9D,KAAK,EAAE,OAAO,CAAC;IACf,yDAAyD;IACzD,SAAS,EAAE,2BAA2B,CAAC;CAC1C,CAAC,CAAC;AAEH,kBAAkB;AAClB,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;IAC9C,IAAI,EAAE,kBAAkB,CAAC;CAC5B,CAAC,CAAC;AAEH,kBAAkB;AAClB,MAAM,MAAM,gCAAgC,GAAG,QAAQ,CAAC;IACpD,IAAI,EAAE,yBAAyB,CAAC;CACnC,CAAC,CAAC;AAEH,MAAM,MAAM,gCAAgC,GAAG,QAAQ,CAAC;IACpD,IAAI,EAAE,yBAAyB,CAAC;CACnC,CAAC,CAAC;AAEH,MAAM,MAAM,8CAA8C,GAAG,QAAQ,CAAC;IAClE,IAAI,EAAE,uCAAuC,CAAC;CACjD,CAAC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC3C,IAAI,EACE,QAAQ,CAAC;QAEL,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE;YACJ,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;SAChB,CAAC;QACF,KAAK,EAAE,2BAA2B,CAAC;KACtC,CAAC,GAGF,yBAAyB,CAAC;CACnC,CAAC,CAAC;AAEH,MAAM,MAAM,qBAAqB,CAAC,QAAQ,SAAS,eAAe,IAAI,QAAQ,CAAC;IAC3E,OAAO,EAAE,QAAQ,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACnB,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type Blockhash = string & {
2
+ readonly __brand: unique symbol;
3
+ };
4
+ export declare function assertIsBlockhash(putativeBlockhash: string): asserts putativeBlockhash is Blockhash;
5
+ //# sourceMappingURL=blockhash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockhash.d.ts","sourceRoot":"","sources":["../../src/blockhash.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC;AAIrE,wBAAgB,iBAAiB,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,IAAI,SAAS,CAuBnG"}
@@ -0,0 +1,14 @@
1
+ export type MainnetUrl = string & {
2
+ '~cluster': 'mainnet';
3
+ };
4
+ export type DevnetUrl = string & {
5
+ '~cluster': 'devnet';
6
+ };
7
+ export type TestnetUrl = string & {
8
+ '~cluster': 'testnet';
9
+ };
10
+ export type ClusterUrl = string | MainnetUrl | DevnetUrl | TestnetUrl;
11
+ export declare function mainnet(putativeString: string): MainnetUrl;
12
+ export declare function devnet(putativeString: string): DevnetUrl;
13
+ export declare function testnet(putativeString: string): TestnetUrl;
14
+ //# sourceMappingURL=cluster-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cluster-url.d.ts","sourceRoot":"","sources":["../../src/cluster-url.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IAAE,UAAU,EAAE,SAAS,CAAA;CAAE,CAAC;AAC5D,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,UAAU,EAAE,QAAQ,CAAA;CAAE,CAAC;AAC1D,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IAAE,UAAU,EAAE,SAAS,CAAA;CAAE,CAAC;AAC5D,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AAEtE,wBAAgB,OAAO,CAAC,cAAc,EAAE,MAAM,GAAG,UAAU,CAE1D;AACD,wBAAgB,MAAM,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAExD;AACD,wBAAgB,OAAO,CAAC,cAAc,EAAE,MAAM,GAAG,UAAU,CAE1D"}
@@ -0,0 +1,13 @@
1
+ export type Base58EncodedBytes = string & {
2
+ readonly __brand: unique symbol;
3
+ };
4
+ export type Base64EncodedBytes = string & {
5
+ readonly __brand: unique symbol;
6
+ };
7
+ export type Base64EncodedZStdCompressedBytes = string & {
8
+ readonly __brand: unique symbol;
9
+ };
10
+ export type Base58EncodedDataResponse = [Base58EncodedBytes, 'base58'];
11
+ export type Base64EncodedDataResponse = [Base64EncodedBytes, 'base64'];
12
+ export type Base64EncodedZStdCompressedDataResponse = [Base64EncodedZStdCompressedBytes, 'base64+zstd'];
13
+ //# sourceMappingURL=encoded-bytes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encoded-bytes.d.ts","sourceRoot":"","sources":["../../src/encoded-bytes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC;AAC9E,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC;AAC9E,MAAM,MAAM,gCAAgC,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC;AAE5F,MAAM,MAAM,yBAAyB,GAAG,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;AACvE,MAAM,MAAM,yBAAyB,GAAG,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;AACvE,MAAM,MAAM,uCAAuC,GAAG,CAAC,gCAAgC,EAAE,aAAa,CAAC,CAAC"}
@@ -1,6 +1,18 @@
1
- export * from './commitment';
2
- export * from './lamports';
3
- export * from './stringified-bigint';
4
- export * from './stringified-number';
5
- export * from './unix-timestamp';
1
+ export * from './account-filters.js';
2
+ export * from './account-info.js';
3
+ export * from './blockhash.js';
4
+ export * from './cluster-url.js';
5
+ export * from './commitment.js';
6
+ export * from './encoded-bytes.js';
7
+ export * from './lamports.js';
8
+ export * from './rpc-api.js';
9
+ export * from './rpc-errors.js';
10
+ export * from './stringified-bigint.js';
11
+ export * from './stringified-number.js';
12
+ export * from './token-amount.js';
13
+ export * from './token-balance.js';
14
+ export * from './transaction.js';
15
+ export * from './transaction-error.js';
16
+ export * from './typed-numbers.js';
17
+ export * from './unix-timestamp.js';
6
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Slot } from './typed-numbers.js';
2
+ export type SolanaRpcResponse<TValue> = Readonly<{
3
+ context: Readonly<{
4
+ slot: Slot;
5
+ }>;
6
+ value: TValue;
7
+ }>;
8
+ //# sourceMappingURL=rpc-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rpc-api.d.ts","sourceRoot":"","sources":["../../src/rpc-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,iBAAiB,CAAC,MAAM,IAAI,QAAQ,CAAC;IAC7C,OAAO,EAAE,QAAQ,CAAC;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ export declare const SolanaRpcErrorCode: {
2
+ readonly JSON_RPC_INVALID_PARAMS: -32602;
3
+ readonly JSON_RPC_SCAN_ERROR: -32012;
4
+ readonly JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP: -32001;
5
+ readonly JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE: -32004;
6
+ readonly JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET: -32014;
7
+ readonly JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX: -32010;
8
+ readonly JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED: -32009;
9
+ readonly JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED: -32016;
10
+ readonly JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY: -32005;
11
+ readonly JSON_RPC_SERVER_ERROR_NO_SNAPSHOT: -32008;
12
+ readonly JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE: -32002;
13
+ readonly JSON_RPC_SERVER_ERROR_SLOT_SKIPPED: -32007;
14
+ readonly JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE: -32011;
15
+ readonly JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE: -32006;
16
+ readonly JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH: -32013;
17
+ readonly JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE: -32003;
18
+ readonly JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION: -32015;
19
+ };
20
+ export type SolanaRpcErrorCodeEnum = (typeof SolanaRpcErrorCode)[keyof typeof SolanaRpcErrorCode];
21
+ //# sourceMappingURL=rpc-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rpc-errors.d.ts","sourceRoot":"","sources":["../../src/rpc-errors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;CAkBrB,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { StringifiedBigInt } from './stringified-bigint.js';
2
+ import { StringifiedNumber } from './stringified-number.js';
3
+ export type TokenAmount = Readonly<{
4
+ amount: StringifiedBigInt;
5
+ decimals: number;
6
+ uiAmount: number | null;
7
+ uiAmountString: StringifiedNumber;
8
+ }>;
9
+ //# sourceMappingURL=token-amount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-amount.d.ts","sourceRoot":"","sources":["../../src/token-amount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IAC/B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,cAAc,EAAE,iBAAiB,CAAC;CACrC,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Address } from '@solana/addresses';
2
+ import type { TokenAmount } from './token-amount.js';
3
+ export type TokenBalance = Readonly<{
4
+ /** Index of the account in which the token balance is provided for. */
5
+ accountIndex: number;
6
+ /** Pubkey of the token's mint. */
7
+ mint: Address;
8
+ /** Pubkey of token balance's owner. */
9
+ owner?: Address;
10
+ /** Pubkey of the Token program that owns the account. */
11
+ programId?: Address;
12
+ uiTokenAmount: TokenAmount;
13
+ }>;
14
+ //# sourceMappingURL=token-balance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-balance.d.ts","sourceRoot":"","sources":["../../src/token-balance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,MAAM,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"}
@@ -0,0 +1,19 @@
1
+ type CustomProgramError = number;
2
+ type InstructionError = 'GenericError' | 'InvalidArgument' | 'InvalidInstructionData' | 'InvalidAccountData' | 'AccountDataTooSmall' | 'InsufficientFunds' | 'IncorrectProgramId' | 'MissingRequiredSignature' | 'AccountAlreadyInitialized' | 'UninitializedAccount' | 'UnbalancedInstruction' | 'ModifiedProgramId' | 'ExternalAccountLamportSpend' | 'ExternalAccountDataModified' | 'ReadonlyLamportChange' | 'ReadonlyDataModified' | 'DuplicateAccountIndex' | 'ExecutableModified' | 'RentEpochModified' | 'NotEnoughAccountKeys' | 'AccountNotExecutable' | 'AccountBorrowFailed' | 'AccountBorrowOutstanding' | 'DuplicateAccountOutOfSync' | {
3
+ Custom: CustomProgramError;
4
+ } | 'InvalidError' | 'ExecutableDataModified' | 'ExecutableLamportChange' | 'ExecutableAccountNotRentExempt' | 'UnsupportedProgramId' | 'CallDepth' | 'MissingAccount' | 'ReentrancyNotAllowed' | 'MaxSeedLengthExceeded' | 'InvalidSeeds' | 'InvalidRealloc' | 'ComputationalBudgetExceeded' | 'PrivilegeEscalation' | 'ProgramEnvironmentSetupFailure' | 'ProgramFailedToComplete' | 'ProgramFailedToCompile' | 'Immutable' | 'IncorrectAuthority' | {
5
+ BorshIoError: string;
6
+ } | 'AccountNotRentExempt' | 'InvalidAccountOwner' | 'ArithmeticOverflow' | 'UnsupportedSysvar' | 'IllegalOwner' | 'MaxAccountsDataAllocationsExceeded' | 'MaxAccountsExceeded' | 'MaxInstructionTraceLengthExceeded' | 'BuiltinProgramsMustConsumeComputeUnits';
7
+ type InstructionIndex = number;
8
+ type AccountIndex = number;
9
+ export type TransactionError = 'AccountInUse' | 'AccountLoadedTwice' | 'AccountNotFound' | 'ProgramAccountNotFound' | 'InsufficientFundsForFee' | 'InvalidAccountForFee' | 'AlreadyProcessed' | 'BlockhashNotFound' | {
10
+ InstructionError: [InstructionIndex, InstructionError];
11
+ } | 'CallChainTooDeep' | 'MissingSignatureForFee' | 'InvalidAccountIndex' | 'SignatureFailure' | 'InvalidProgramForExecution' | 'SanitizeFailure' | 'ClusterMaintenance' | 'AccountBorrowOutstanding' | 'WouldExceedMaxBlockCostLimit' | 'UnsupportedVersion' | 'InvalidWritableAccount' | 'WouldExceedMaxAccountCostLimit' | 'WouldExceedAccountDataBlockLimit' | 'TooManyAccountLocks' | 'AddressLookupTableNotFound' | 'InvalidAddressLookupTableOwner' | 'InvalidAddressLookupTableData' | 'InvalidAddressLookupTableIndex' | 'InvalidRentPayingAccount' | 'WouldExceedMaxVoteCostLimit' | 'WouldExceedAccountDataTotalLimit' | {
12
+ DuplicateInstruction: InstructionIndex;
13
+ } | {
14
+ InsufficientFundsForRent: {
15
+ account_index: AccountIndex;
16
+ };
17
+ } | 'MaxLoadedAccountsDataSizeExceeded' | 'InvalidLoadedAccountsDataSizeLimit';
18
+ export {};
19
+ //# sourceMappingURL=transaction-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction-error.d.ts","sourceRoot":"","sources":["../../src/transaction-error.ts"],"names":[],"mappings":"AAAA,KAAK,kBAAkB,GAAG,MAAM,CAAC;AAGjC,KAAK,gBAAgB,GACf,cAAc,GACd,iBAAiB,GACjB,wBAAwB,GACxB,oBAAoB,GACpB,qBAAqB,GACrB,mBAAmB,GACnB,oBAAoB,GACpB,0BAA0B,GAC1B,2BAA2B,GAC3B,sBAAsB,GACtB,uBAAuB,GACvB,mBAAmB,GACnB,6BAA6B,GAC7B,6BAA6B,GAC7B,uBAAuB,GACvB,sBAAsB,GACtB,uBAAuB,GACvB,oBAAoB,GACpB,mBAAmB,GACnB,sBAAsB,GACtB,sBAAsB,GACtB,qBAAqB,GACrB,0BAA0B,GAC1B,2BAA2B,GAC3B;IAAE,MAAM,EAAE,kBAAkB,CAAA;CAAE,GAC9B,cAAc,GACd,wBAAwB,GACxB,yBAAyB,GACzB,gCAAgC,GAChC,sBAAsB,GACtB,WAAW,GACX,gBAAgB,GAChB,sBAAsB,GACtB,uBAAuB,GACvB,cAAc,GACd,gBAAgB,GAChB,6BAA6B,GAC7B,qBAAqB,GACrB,gCAAgC,GAChC,yBAAyB,GACzB,wBAAwB,GACxB,WAAW,GACX,oBAAoB,GACpB;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,GACxB,sBAAsB,GACtB,qBAAqB,GACrB,oBAAoB,GACpB,mBAAmB,GACnB,cAAc,GACd,oCAAoC,GACpC,qBAAqB,GACrB,mCAAmC,GACnC,wCAAwC,CAAC;AAE/C,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAC/B,KAAK,YAAY,GAAG,MAAM,CAAC;AAG3B,MAAM,MAAM,gBAAgB,GACtB,cAAc,GACd,oBAAoB,GACpB,iBAAiB,GACjB,wBAAwB,GACxB,yBAAyB,GACzB,sBAAsB,GACtB,kBAAkB,GAClB,mBAAmB,GACnB;IAAE,gBAAgB,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAA;CAAE,GAC1D,kBAAkB,GAClB,wBAAwB,GACxB,qBAAqB,GACrB,kBAAkB,GAClB,4BAA4B,GAC5B,iBAAiB,GACjB,oBAAoB,GACpB,0BAA0B,GAC1B,8BAA8B,GAC9B,oBAAoB,GACpB,wBAAwB,GACxB,gCAAgC,GAChC,kCAAkC,GAClC,qBAAqB,GACrB,4BAA4B,GAC5B,gCAAgC,GAChC,+BAA+B,GAC/B,gCAAgC,GAChC,0BAA0B,GAC1B,6BAA6B,GAC7B,kCAAkC,GAClC;IAAE,oBAAoB,EAAE,gBAAgB,CAAA;CAAE,GAC1C;IAAE,wBAAwB,EAAE;QAAE,aAAa,EAAE,YAAY,CAAA;KAAE,CAAA;CAAE,GAC7D,mCAAmC,GACnC,oCAAoC,CAAC"}
@@ -0,0 +1,251 @@
1
+ import type { Address } from '@solana/addresses';
2
+ import type { Blockhash } from './blockhash.js';
3
+ import type { Base58EncodedBytes, Base58EncodedDataResponse, Base64EncodedDataResponse } from './encoded-bytes.js';
4
+ import type { LamportsUnsafeBeyond2Pow53Minus1 } from './lamports.js';
5
+ import type { TokenBalance } from './token-balance.js';
6
+ import type { TransactionError } from './transaction-error.js';
7
+ import type { SignedLamportsAsI64Unsafe, U64UnsafeBeyond2Pow53Minus1 } from './typed-numbers.js';
8
+ type TransactionVersion = 'legacy' | 0;
9
+ type AddressTableLookup = Readonly<{
10
+ /** public key for an address lookup table account. */
11
+ accountKey: Address;
12
+ /** List of indices used to load addresses of writable accounts from a lookup table. */
13
+ writableIndexes: readonly number[];
14
+ /** List of indices used to load addresses of readonly accounts from a lookup table. */
15
+ readableIndexes: readonly number[];
16
+ }>;
17
+ type ParsedTransactionInstruction = Readonly<{
18
+ parsed: {
19
+ info?: object;
20
+ type: string;
21
+ };
22
+ program: string;
23
+ programId: Address;
24
+ }>;
25
+ type PartiallyDecodedTransactionInstruction = Readonly<{
26
+ accounts: readonly Address[];
27
+ data: Base58EncodedBytes;
28
+ programId: Address;
29
+ }>;
30
+ type ReturnData = {
31
+ /** the program that generated the return data */
32
+ programId: Address;
33
+ /** the return data itself */
34
+ data: Base64EncodedDataResponse;
35
+ };
36
+ type TransactionInstruction = Readonly<{
37
+ accounts: readonly number[];
38
+ data: Base58EncodedBytes;
39
+ programIdIndex: number;
40
+ }>;
41
+ type TransactionParsedAccountLegacy = Readonly<{
42
+ pubkey: Address;
43
+ signer: boolean;
44
+ source: 'transaction';
45
+ writable: boolean;
46
+ }>;
47
+ type TransactionParsedAccountVersioned = Readonly<{
48
+ pubkey: Address;
49
+ signer: boolean;
50
+ source: 'lookupTable' | 'transaction';
51
+ writable: boolean;
52
+ }>;
53
+ type TransactionForAccountsMetaBase = Readonly<{
54
+ /** Error if transaction failed, null if transaction succeeded. */
55
+ err: TransactionError | null;
56
+ /** fee this transaction was charged */
57
+ fee: LamportsUnsafeBeyond2Pow53Minus1;
58
+ /** array of account balances from before the transaction was processed */
59
+ preBalances: readonly LamportsUnsafeBeyond2Pow53Minus1[];
60
+ /** array of account balances after the transaction was processed */
61
+ postBalances: readonly LamportsUnsafeBeyond2Pow53Minus1[];
62
+ /** List of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction */
63
+ preTokenBalances?: readonly TokenBalance[];
64
+ /** List of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction */
65
+ postTokenBalances?: readonly TokenBalance[];
66
+ /**
67
+ * Transaction status
68
+ * @deprecated
69
+ */
70
+ status: TransactionStatus;
71
+ }>;
72
+ export type TransactionForAccounts<TMaxSupportedTransactionVersion extends TransactionVersion | void> = TMaxSupportedTransactionVersion extends void ? Readonly<{
73
+ /** Transaction partial meta */
74
+ meta: TransactionForAccountsMetaBase | null;
75
+ /** Partial transactions */
76
+ transaction: Readonly<{
77
+ /** Parsed accounts */
78
+ accountKeys: readonly TransactionParsedAccountLegacy[];
79
+ /** Account signatures */
80
+ signatures: readonly Base58EncodedBytes[];
81
+ }>;
82
+ }> : Readonly<{
83
+ /** Transaction partial meta */
84
+ meta: TransactionForAccountsMetaBase | null;
85
+ /** Partial transactions */
86
+ transaction: Readonly<{
87
+ /** Parsed accounts */
88
+ accountKeys: readonly TransactionParsedAccountVersioned[];
89
+ /** Account signatures */
90
+ signatures: readonly Base58EncodedBytes[];
91
+ }>;
92
+ /** The transaction version */
93
+ version: TransactionVersion;
94
+ }>;
95
+ type TransactionForFullMetaBase = Readonly<{
96
+ /** number of compute units consumed by the transaction */
97
+ computeUnitsConsumed?: U64UnsafeBeyond2Pow53Minus1;
98
+ /** Error if transaction failed, null if transaction succeeded. */
99
+ err: TransactionError | null;
100
+ /** fee this transaction was charged */
101
+ fee: LamportsUnsafeBeyond2Pow53Minus1;
102
+ /** array of string log messages or null if log message recording was not enabled during this transaction */
103
+ logMessages: readonly string[] | null;
104
+ /** array of account balances from before the transaction was processed */
105
+ preBalances: readonly LamportsUnsafeBeyond2Pow53Minus1[];
106
+ /** array of account balances after the transaction was processed */
107
+ postBalances: readonly LamportsUnsafeBeyond2Pow53Minus1[];
108
+ /** List of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction */
109
+ preTokenBalances?: readonly TokenBalance[];
110
+ /** List of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction */
111
+ postTokenBalances?: readonly TokenBalance[];
112
+ /** the most-recent return data generated by an instruction in the transaction */
113
+ returnData?: ReturnData;
114
+ /** transaction-level rewards */
115
+ rewards: readonly Reward[] | null;
116
+ /**
117
+ * Transaction status
118
+ * @deprecated
119
+ */
120
+ status: TransactionStatus;
121
+ }>;
122
+ type TransactionForFullMetaInnerInstructionsUnparsed = Readonly<{
123
+ innerInstructions: readonly Readonly<{
124
+ /** The index of the instruction in the transaction */
125
+ index: number;
126
+ /** The instruction */
127
+ instructions: readonly TransactionInstruction[];
128
+ }>[];
129
+ }>;
130
+ type TransactionForFullMetaInnerInstructionsParsed = Readonly<{
131
+ innerInstructions: readonly Readonly<{
132
+ /** The index of the instruction in the transaction */
133
+ index: number;
134
+ /** The instruction */
135
+ instructions: readonly (ParsedTransactionInstruction | PartiallyDecodedTransactionInstruction)[];
136
+ }>[];
137
+ }>;
138
+ type TransactionForFullMetaLoadedAddresses = Readonly<{
139
+ /** Addresses loaded from lookup tables */
140
+ loadedAddresses: {
141
+ writable: readonly Address[];
142
+ readonly: readonly Address[];
143
+ };
144
+ }>;
145
+ type TransactionForFullTransactionAddressTableLookups = Readonly<{
146
+ message: {
147
+ addressTableLookups?: readonly AddressTableLookup[] | null;
148
+ };
149
+ }>;
150
+ export type TransactionForFullBase58<TMaxSupportedTransactionVersion extends TransactionVersion | void> = TMaxSupportedTransactionVersion extends void ? Readonly<{
151
+ /** Transaction meta */
152
+ meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsUnparsed) | null;
153
+ /** Partial transactions */
154
+ transaction: Base58EncodedDataResponse;
155
+ }> : Readonly<{
156
+ /** Transaction meta */
157
+ meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsUnparsed & TransactionForFullMetaLoadedAddresses) | null;
158
+ /** Partial transactions */
159
+ transaction: Base58EncodedDataResponse;
160
+ /** The transaction version */
161
+ version: TransactionVersion;
162
+ }>;
163
+ export type TransactionForFullBase64<TMaxSupportedTransactionVersion extends TransactionVersion | void> = TMaxSupportedTransactionVersion extends void ? Readonly<{
164
+ /** Transaction meta */
165
+ meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsUnparsed) | null;
166
+ /** Partial transactions */
167
+ transaction: Base64EncodedDataResponse;
168
+ }> : Readonly<{
169
+ /** Transaction meta */
170
+ meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsUnparsed & TransactionForFullMetaLoadedAddresses) | null;
171
+ /** Partial transactions */
172
+ transaction: Base64EncodedDataResponse;
173
+ /** The transaction version */
174
+ version: TransactionVersion;
175
+ }>;
176
+ type TransactionForFullTransactionJsonParsedBase = Readonly<{
177
+ message: {
178
+ header: {
179
+ numReadonlySignedAccounts: number;
180
+ numReadonlyUnsignedAccounts: number;
181
+ numRequiredSignatures: number;
182
+ };
183
+ instructions: readonly (ParsedTransactionInstruction | PartiallyDecodedTransactionInstruction)[];
184
+ recentBlockhash: Blockhash;
185
+ };
186
+ signatures: readonly Base58EncodedBytes[];
187
+ }>;
188
+ export type TransactionForFullJsonParsed<TMaxSupportedTransactionVersion extends TransactionVersion | void> = TMaxSupportedTransactionVersion extends void ? Readonly<{
189
+ meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsParsed) | null;
190
+ transaction: TransactionForFullTransactionJsonParsedBase & {
191
+ message: Readonly<{
192
+ accountKeys: readonly TransactionParsedAccountLegacy[];
193
+ }>;
194
+ };
195
+ }> : Readonly<{
196
+ meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsParsed & TransactionForFullMetaLoadedAddresses) | null;
197
+ transaction: TransactionForFullTransactionJsonParsedBase & {
198
+ message: Readonly<{
199
+ accountKeys: readonly TransactionParsedAccountLegacy[];
200
+ }>;
201
+ };
202
+ version: TransactionVersion;
203
+ }>;
204
+ type TransactionForFullTransactionJsonBase = Readonly<{
205
+ message: {
206
+ accountKeys: readonly Address[];
207
+ header: {
208
+ numReadonlySignedAccounts: number;
209
+ numReadonlyUnsignedAccounts: number;
210
+ numRequiredSignatures: number;
211
+ };
212
+ instructions: readonly TransactionInstruction[];
213
+ recentBlockhash: Blockhash;
214
+ };
215
+ signatures: readonly Base58EncodedBytes[];
216
+ }>;
217
+ export type TransactionForFullJson<TMaxSupportedTransactionVersion extends TransactionVersion | void> = TMaxSupportedTransactionVersion extends void ? Readonly<{
218
+ meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsUnparsed) | null;
219
+ transaction: TransactionForFullTransactionJsonBase;
220
+ }> : Readonly<{
221
+ meta: (TransactionForFullMetaBase & TransactionForFullMetaInnerInstructionsUnparsed & TransactionForFullMetaLoadedAddresses) | null;
222
+ transaction: TransactionForFullTransactionJsonBase & TransactionForFullTransactionAddressTableLookups;
223
+ version: TransactionVersion;
224
+ }>;
225
+ type RewardBase = Readonly<{
226
+ /** The public key of the account that received the reward */
227
+ pubkey: Address;
228
+ /** number of reward lamports credited or debited by the account */
229
+ lamports: SignedLamportsAsI64Unsafe;
230
+ /** account balance in lamports after the reward was applied */
231
+ postBalance: LamportsUnsafeBeyond2Pow53Minus1;
232
+ }>;
233
+ export type Reward = (RewardBase & Readonly<{
234
+ /** type of reward */
235
+ rewardType: 'fee' | 'rent';
236
+ }>)
237
+ /** Commission is present only for voting and staking rewards */
238
+ | (RewardBase & Readonly<{
239
+ /** type of reward */
240
+ rewardType: 'voting' | 'staking';
241
+ /** vote account commission when the reward was credited */
242
+ commission: number;
243
+ }>);
244
+ /** @deprecated */
245
+ export type TransactionStatus = {
246
+ Ok: null;
247
+ } | {
248
+ Err: TransactionError;
249
+ };
250
+ export {};
251
+ //# sourceMappingURL=transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transa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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,14 @@
1
+ /**
2
+ * FIXME(solana-labs/solana/issues/30341) Beware that any value above 9007199254740991 may be
3
+ * truncated or rounded because of a downcast to JavaScript `number` between your calling code and
4
+ * the JSON-RPC transport.
5
+ */
6
+ export type U64UnsafeBeyond2Pow53Minus1 = bigint;
7
+ export type Slot = U64UnsafeBeyond2Pow53Minus1;
8
+ export type Epoch = U64UnsafeBeyond2Pow53Minus1;
9
+ export type MicroLamportsUnsafeBeyond2Pow53Minus1 = bigint & {
10
+ readonly __brand: unique symbol;
11
+ };
12
+ export type SignedLamportsAsI64Unsafe = bigint;
13
+ export type F64UnsafeSeeDocumentation = number;
14
+ //# sourceMappingURL=typed-numbers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typed-numbers.d.ts","sourceRoot":"","sources":["../../src/typed-numbers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC;AAEjD,MAAM,MAAM,IAAI,GAAG,2BAA2B,CAAC;AAC/C,MAAM,MAAM,KAAK,GAAG,2BAA2B,CAAC;AAOhD,MAAM,MAAM,qCAAqC,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC;AAKjG,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAS/C,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC"}