@solana/rpc-types 2.0.0-experimental.4f33613 → 2.0.0-experimental.4ff4425
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.browser.cjs +36 -0
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +33 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.native.js +33 -1
- package/dist/index.native.js.map +1 -1
- package/dist/index.node.cjs +36 -0
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +33 -1
- package/dist/index.node.js.map +1 -1
- package/dist/types/account-filters.d.ts +14 -0
- package/dist/types/account-filters.d.ts.map +1 -0
- package/dist/types/account-info.d.ts +43 -0
- package/dist/types/account-info.d.ts.map +1 -0
- package/dist/types/cluster-url.d.ts +14 -0
- package/dist/types/cluster-url.d.ts.map +1 -0
- package/dist/types/index.d.ts +8 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/rpc-api.d.ts +6 -75
- package/dist/types/rpc-api.d.ts.map +1 -1
- package/dist/types/rpc-errors.d.ts +21 -0
- package/dist/types/rpc-errors.d.ts.map +1 -0
- package/dist/types/token-balance.d.ts +14 -0
- package/dist/types/token-balance.d.ts.map +1 -0
- package/dist/types/transaction-error.d.ts +23 -0
- package/dist/types/transaction-error.d.ts.map +1 -0
- package/dist/types/transaction.d.ts +251 -0
- package/dist/types/transaction.d.ts.map +1 -0
- package/dist/types/typed-numbers.d.ts +14 -0
- package/dist/types/typed-numbers.d.ts.map +1 -0
- package/package.json +12 -34
- package/dist/types/overloads.d.ts +0 -655
- package/dist/types/overloads.d.ts.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
export * from './account-filters.js';
|
|
2
|
+
export * from './account-info.js';
|
|
1
3
|
export * from './blockhash.js';
|
|
4
|
+
export * from './cluster-url.js';
|
|
2
5
|
export * from './commitment.js';
|
|
3
6
|
export * from './encoded-bytes.js';
|
|
4
7
|
export * from './lamports.js';
|
|
5
8
|
export * from './rpc-api.js';
|
|
9
|
+
export * from './rpc-errors.js';
|
|
6
10
|
export * from './stringified-bigint.js';
|
|
7
11
|
export * from './stringified-number.js';
|
|
8
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';
|
|
9
17
|
export * from './unix-timestamp.js';
|
|
10
|
-
export type U64UnsafeBeyond2Pow53Minus1 = bigint;
|
|
11
|
-
export type Slot = U64UnsafeBeyond2Pow53Minus1;
|
|
12
|
-
export type Epoch = U64UnsafeBeyond2Pow53Minus1;
|
|
13
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,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"}
|
package/dist/types/rpc-api.d.ts
CHANGED
|
@@ -1,77 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
export type IRpcSubscriptionsApi<TRpcSubscriptionMethods> = {
|
|
9
|
-
[MethodName in keyof TRpcSubscriptionMethods]: RpcSubscriptionReturnTypeMapper<TRpcSubscriptionMethods[MethodName]>;
|
|
10
|
-
};
|
|
11
|
-
export type Rpc<TRpcMethods> = RpcMethods<TRpcMethods>;
|
|
12
|
-
export type RpcSubscriptions<TRpcSubscriptionMethods> = RpcSubscriptionMethods<TRpcSubscriptionMethods>;
|
|
13
|
-
/**
|
|
14
|
-
* Public RPC API methods.
|
|
15
|
-
*/
|
|
16
|
-
type RpcApiMethod = (...args: any) => any;
|
|
17
|
-
export interface IRpcApiMethods {
|
|
18
|
-
[methodName: string]: RpcApiMethod;
|
|
19
|
-
}
|
|
20
|
-
type RpcApiSubscription = (...args: any) => any;
|
|
21
|
-
export interface IRpcApiSubscriptions {
|
|
22
|
-
[notificationName: string]: RpcApiSubscription;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Public pending RPC request API.
|
|
26
|
-
*/
|
|
27
|
-
export type RpcRequest<TResponse> = {
|
|
28
|
-
methodName: string;
|
|
29
|
-
params: unknown[];
|
|
30
|
-
responseTransformer?: (response: unknown, methodName: string) => TResponse;
|
|
31
|
-
};
|
|
32
|
-
export type RpcSubscription<TResponse> = {
|
|
33
|
-
params: unknown[];
|
|
34
|
-
responseTransformer?: (response: unknown, notificationName: string) => TResponse;
|
|
35
|
-
subscribeMethodName: string;
|
|
36
|
-
unsubscribeMethodName: string;
|
|
37
|
-
};
|
|
38
|
-
export type PendingRpcRequest<TResponse> = {
|
|
39
|
-
send(options?: SendOptions): Promise<TResponse>;
|
|
40
|
-
};
|
|
41
|
-
export type PendingRpcSubscription<TNotification> = {
|
|
42
|
-
subscribe(options: SubscribeOptions): Promise<AsyncIterable<TNotification>>;
|
|
43
|
-
};
|
|
44
|
-
export type SendOptions = Readonly<{
|
|
45
|
-
abortSignal?: AbortSignal;
|
|
1
|
+
import type { Slot } from './typed-numbers.js';
|
|
2
|
+
export type SolanaRpcResponse<TValue> = Readonly<{
|
|
3
|
+
context: Readonly<{
|
|
4
|
+
slot: Slot;
|
|
5
|
+
}>;
|
|
6
|
+
value: TValue;
|
|
46
7
|
}>;
|
|
47
|
-
export type SubscribeOptions = Readonly<{
|
|
48
|
-
abortSignal: AbortSignal;
|
|
49
|
-
}>;
|
|
50
|
-
/**
|
|
51
|
-
* Private RPC-building types.
|
|
52
|
-
*/
|
|
53
|
-
type RpcReturnTypeMapper<TRpcMethod> = TRpcMethod extends Callable ? (...rawParams: unknown[]) => RpcRequest<ReturnType<TRpcMethod>> : never;
|
|
54
|
-
type RpcSubscriptionReturnTypeMapper<TRpcMethod> = TRpcMethod extends Callable ? (...rawParams: unknown[]) => RpcSubscription<ReturnType<TRpcMethod>> : never;
|
|
55
|
-
type RpcMethods<TRpcMethods> = {
|
|
56
|
-
[TMethodName in keyof TRpcMethods]: PendingRpcRequestBuilder<ApiMethodImplementations<TRpcMethods, TMethodName>>;
|
|
57
|
-
};
|
|
58
|
-
type RpcSubscriptionMethods<TRpcSubscriptionMethods> = {
|
|
59
|
-
[TMethodName in keyof TRpcSubscriptionMethods]: PendingRpcSubscriptionBuilder<ApiMethodImplementations<TRpcSubscriptionMethods, TMethodName>>;
|
|
60
|
-
};
|
|
61
|
-
type ApiMethodImplementations<TRpcMethods, TMethod extends keyof TRpcMethods> = Overloads<TRpcMethods[TMethod]>;
|
|
62
|
-
type PendingRpcRequestReturnTypeMapper<TMethodImplementation> = TMethodImplementation extends Callable ? (...args: Parameters<TMethodImplementation>) => PendingRpcRequest<ReturnType<TMethodImplementation>> : never;
|
|
63
|
-
type PendingRpcRequestBuilder<TMethodImplementations> = UnionToIntersection<Flatten<{
|
|
64
|
-
[P in keyof TMethodImplementations]: PendingRpcRequestReturnTypeMapper<TMethodImplementations[P]>;
|
|
65
|
-
}>>;
|
|
66
|
-
type PendingRpcSubscriptionReturnTypeMapper<TSubscriptionMethodImplementation> = TSubscriptionMethodImplementation extends Callable ? (...args: Parameters<TSubscriptionMethodImplementation>) => PendingRpcSubscription<ReturnType<TSubscriptionMethodImplementation>> : never;
|
|
67
|
-
type PendingRpcSubscriptionBuilder<TSubscriptionMethodImplementations> = UnionToIntersection<Flatten<{
|
|
68
|
-
[P in keyof TSubscriptionMethodImplementations]: PendingRpcSubscriptionReturnTypeMapper<TSubscriptionMethodImplementations[P]>;
|
|
69
|
-
}>>;
|
|
70
|
-
/**
|
|
71
|
-
* Utility types that do terrible, awful things.
|
|
72
|
-
*/
|
|
73
|
-
type Callable = (...args: any[]) => any;
|
|
74
|
-
type Flatten<T> = T extends (infer Item)[] ? Item : never;
|
|
75
|
-
type UnionToIntersection<T> = (T extends unknown ? (x: T) => unknown : never) extends (x: infer R) => unknown ? R : never;
|
|
76
|
-
export {};
|
|
77
8
|
//# sourceMappingURL=rpc-api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-api.d.ts","sourceRoot":"","sources":["../../src/rpc-api.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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,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,23 @@
|
|
|
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' | 'ResanitizationNeeded' | {
|
|
18
|
+
ProgramExecutionTemporarilyRestricted: {
|
|
19
|
+
account_index: AccountIndex;
|
|
20
|
+
};
|
|
21
|
+
} | 'UnbalancedTransaction';
|
|
22
|
+
export {};
|
|
23
|
+
//# 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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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,GACpC,sBAAsB,GACtB;IAAE,qCAAqC,EAAE;QAAE,aAAa,EAAE,YAAY,CAAA;KAAE,CAAA;CAAE,GAC1E,uBAAuB,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":"transaction.d.ts","sourceRoot":"","sources":["../../src/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,yBAAyB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,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/rpc-types",
|
|
3
|
-
"version": "2.0.0-experimental.
|
|
3
|
+
"version": "2.0.0-experimental.4ff4425",
|
|
4
4
|
"description": "Type definitions for values used in the Solana RPC, and helper functions for working with them",
|
|
5
5
|
"exports": {
|
|
6
6
|
"browser": {
|
|
@@ -45,29 +45,9 @@
|
|
|
45
45
|
"supports bigint and not dead",
|
|
46
46
|
"maintained node versions"
|
|
47
47
|
],
|
|
48
|
-
"
|
|
49
|
-
"@solana/
|
|
50
|
-
"@
|
|
51
|
-
"@types/jest": "^29.5.11",
|
|
52
|
-
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
|
53
|
-
"@typescript-eslint/parser": "^6.3.0",
|
|
54
|
-
"agadoo": "^3.0.0",
|
|
55
|
-
"eslint": "^8.45.0",
|
|
56
|
-
"eslint-plugin-jest": "^27.4.2",
|
|
57
|
-
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
58
|
-
"jest": "^29.7.0",
|
|
59
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
60
|
-
"jest-fetch-mock-fork": "^3.0.4",
|
|
61
|
-
"jest-runner-eslint": "^2.1.2",
|
|
62
|
-
"jest-runner-prettier": "^1.0.0",
|
|
63
|
-
"prettier": "^3.1",
|
|
64
|
-
"tsup": "^8.0.1",
|
|
65
|
-
"typescript": "^5.2.2",
|
|
66
|
-
"version-from-git": "^1.1.1",
|
|
67
|
-
"@solana/codecs-core": "2.0.0-experimental.4f33613",
|
|
68
|
-
"build-scripts": "0.0.0",
|
|
69
|
-
"test-config": "0.0.0",
|
|
70
|
-
"tsconfig": "0.0.0"
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@solana/addresses": "2.0.0-experimental.4ff4425",
|
|
50
|
+
"@solana/codecs-strings": "2.0.0-experimental.4ff4425"
|
|
71
51
|
},
|
|
72
52
|
"bundlewatch": {
|
|
73
53
|
"defaultCompression": "gzip",
|
|
@@ -77,22 +57,20 @@
|
|
|
77
57
|
}
|
|
78
58
|
]
|
|
79
59
|
},
|
|
80
|
-
"dependencies": {
|
|
81
|
-
"@solana/codecs-strings": "2.0.0-experimental.4f33613"
|
|
82
|
-
},
|
|
83
60
|
"scripts": {
|
|
84
61
|
"compile:js": "tsup --config build-scripts/tsup.config.package.ts",
|
|
85
|
-
"compile:typedefs": "tsc -p ./tsconfig.declarations.json && node node_modules/build-scripts/add-js-extension-to-types.mjs",
|
|
86
|
-
"dev": "jest -c node_modules/test-config/jest-dev.config.ts --globalSetup test-config/test-validator-setup.js --globalTeardown test-config/test-validator-teardown.js --rootDir . --watch",
|
|
87
|
-
"publish-
|
|
62
|
+
"compile:typedefs": "tsc -p ./tsconfig.declarations.json && node node_modules/@solana/build-scripts/add-js-extension-to-types.mjs",
|
|
63
|
+
"dev": "jest -c node_modules/@solana/test-config/jest-dev.config.ts --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --rootDir . --watch",
|
|
64
|
+
"publish-impl": "npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || pnpm publish --tag experimental --access public --no-git-checks",
|
|
65
|
+
"publish-packages": "pnpm prepublishOnly && pnpm publish-impl",
|
|
88
66
|
"style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/* package.json",
|
|
89
|
-
"test:lint": "jest -c node_modules/test-config/jest-lint.config.ts --rootDir . --silent",
|
|
90
|
-
"test:prettier": "jest -c node_modules/test-config/jest-prettier.config.ts --rootDir . --silent",
|
|
67
|
+
"test:lint": "jest -c node_modules/@solana/test-config/jest-lint.config.ts --rootDir . --silent",
|
|
68
|
+
"test:prettier": "jest -c node_modules/@solana/test-config/jest-prettier.config.ts --rootDir . --silent",
|
|
91
69
|
"test:treeshakability:browser": "agadoo dist/index.browser.js",
|
|
92
70
|
"test:treeshakability:native": "agadoo dist/index.native.js",
|
|
93
71
|
"test:treeshakability:node": "agadoo dist/index.node.js",
|
|
94
72
|
"test:typecheck": "tsc --noEmit",
|
|
95
|
-
"test:unit:browser": "jest -c node_modules/test-config/jest-unit.config.browser.ts --globalSetup test-config/test-validator-setup.js --globalTeardown test-config/test-validator-teardown.js --rootDir . --silent",
|
|
96
|
-
"test:unit:node": "jest -c node_modules/test-config/jest-unit.config.node.ts --globalSetup test-config/test-validator-setup.js --globalTeardown test-config/test-validator-teardown.js --rootDir . --silent"
|
|
73
|
+
"test:unit:browser": "jest -c node_modules/@solana/test-config/jest-unit.config.browser.ts --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --rootDir . --silent",
|
|
74
|
+
"test:unit:node": "jest -c node_modules/@solana/test-config/jest-unit.config.node.ts --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --rootDir . --silent"
|
|
97
75
|
}
|
|
98
76
|
}
|