@intent-engine/client 0.1.22 → 0.1.26
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/src/budget.d.ts +6 -4
- package/dist/src/budget.js +24 -9
- package/dist/src/budget.js.map +1 -1
- package/dist/src/client-errors.d.ts +28 -0
- package/dist/src/client-errors.js +55 -0
- package/dist/src/client-errors.js.map +1 -0
- package/dist/src/client-intents.d.ts +12 -0
- package/dist/src/client-intents.js +133 -0
- package/dist/src/client-intents.js.map +1 -0
- package/dist/src/client-reads.d.ts +7 -0
- package/dist/src/client-reads.js +61 -0
- package/dist/src/client-reads.js.map +1 -0
- package/dist/src/client-settle.d.ts +2 -0
- package/dist/src/client-settle.js +84 -0
- package/dist/src/client-settle.js.map +1 -0
- package/dist/src/client-types.d.ts +145 -0
- package/dist/src/client-types.js +9 -0
- package/dist/src/client-types.js.map +1 -0
- package/dist/src/client-watch.d.ts +4 -0
- package/dist/src/client-watch.js +97 -0
- package/dist/src/client-watch.js.map +1 -0
- package/dist/src/client.d.ts +4 -126
- package/dist/src/client.js +20 -299
- package/dist/src/client.js.map +1 -1
- package/dist/src/confirmation.d.ts +11 -0
- package/dist/src/confirmation.js +94 -0
- package/dist/src/confirmation.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/intent-notifications.d.ts +13 -0
- package/dist/src/intent-notifications.js +106 -0
- package/dist/src/intent-notifications.js.map +1 -0
- package/dist/src/job-deliveries.d.ts +40 -0
- package/dist/src/job-deliveries.js +92 -0
- package/dist/src/job-deliveries.js.map +1 -0
- package/dist/src/job-memos.d.ts +16 -0
- package/dist/src/job-memos.js +51 -0
- package/dist/src/job-memos.js.map +1 -0
- package/dist/src/job-origins.d.ts +30 -0
- package/dist/src/job-origins.js +53 -0
- package/dist/src/job-origins.js.map +1 -0
- package/dist/src/job-proofs.d.ts +17 -0
- package/dist/src/job-proofs.js +54 -0
- package/dist/src/job-proofs.js.map +1 -0
- package/dist/src/job-scan.d.ts +20 -0
- package/dist/src/job-scan.js +70 -0
- package/dist/src/job-scan.js.map +1 -0
- package/dist/src/job-specs.d.ts +40 -0
- package/dist/src/job-specs.js +107 -0
- package/dist/src/job-specs.js.map +1 -0
- package/dist/src/jobs.d.ts +6 -0
- package/dist/src/jobs.js +7 -0
- package/dist/src/jobs.js.map +1 -0
- package/dist/src/memoized-transport.d.ts +4 -0
- package/dist/src/memoized-transport.js +66 -0
- package/dist/src/memoized-transport.js.map +1 -0
- package/dist/src/rpc-retry.d.ts +16 -0
- package/dist/src/rpc-retry.js +62 -0
- package/dist/src/rpc-retry.js.map +1 -0
- package/dist/src/rpc-shapes.d.ts +230 -0
- package/dist/src/rpc-shapes.js +2 -0
- package/dist/src/rpc-shapes.js.map +1 -0
- package/dist/src/rpc-transport.d.ts +6 -0
- package/dist/src/rpc-transport.js +236 -0
- package/dist/src/rpc-transport.js.map +1 -0
- package/dist/src/svm.d.ts +1 -1
- package/dist/src/svm.js +89 -21
- package/dist/src/svm.js.map +1 -1
- package/dist/src/transaction-keys.d.ts +6 -0
- package/dist/src/transaction-keys.js +19 -0
- package/dist/src/transaction-keys.js.map +1 -0
- package/dist/src/transport.d.ts +7 -221
- package/dist/src/transport.js +6 -464
- package/dist/src/transport.js.map +1 -1
- package/package.json +16 -5
package/dist/src/transport.d.ts
CHANGED
|
@@ -1,221 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
export type ProgramAccount = {
|
|
9
|
-
address: Address;
|
|
10
|
-
data: Uint8Array;
|
|
11
|
-
};
|
|
12
|
-
export type EngineTransaction = {
|
|
13
|
-
signature: string;
|
|
14
|
-
slot: bigint;
|
|
15
|
-
blockTime: bigint | null;
|
|
16
|
-
failed: boolean;
|
|
17
|
-
emitted: Uint8Array[];
|
|
18
|
-
memos?: string[];
|
|
19
|
-
unread?: true;
|
|
20
|
-
};
|
|
21
|
-
export type Latest = {
|
|
22
|
-
blockhash: Blockhash;
|
|
23
|
-
lastValidBlockHeight: bigint;
|
|
24
|
-
};
|
|
25
|
-
export type Simulation = {
|
|
26
|
-
err: string | null;
|
|
27
|
-
logs: string[];
|
|
28
|
-
unitsConsumed: bigint | null;
|
|
29
|
-
accounts: (Uint8Array | null)[];
|
|
30
|
-
};
|
|
31
|
-
export interface Transport {
|
|
32
|
-
getAccount(address: Address): Promise<AccountView | null>;
|
|
33
|
-
getAccounts(addresses: readonly Address[]): Promise<(AccountView | null)[]>;
|
|
34
|
-
warm?(addresses: readonly Address[]): Promise<void>;
|
|
35
|
-
send(instructions: readonly Instruction[], payer: TransactionSigner): Promise<string>;
|
|
36
|
-
latestBlockhash(): Promise<Latest>;
|
|
37
|
-
sendWire(wire: Base64EncodedWireTransaction, latest: Latest): Promise<string>;
|
|
38
|
-
submitWire(wire: Base64EncodedWireTransaction): Promise<string>;
|
|
39
|
-
simulate(wire: Base64EncodedWireTransaction, watch?: readonly Address[]): Promise<Simulation>;
|
|
40
|
-
genesisHash(): Promise<string>;
|
|
41
|
-
intents(owner?: Address): Promise<ProgramAccount[]>;
|
|
42
|
-
engineTransactions(limit: number, of?: Address): Promise<EngineTransaction[]>;
|
|
43
|
-
recentFees(accounts: readonly Address[]): Promise<bigint[]>;
|
|
44
|
-
budget(instructions: readonly Instruction[], feePayer: Address): Promise<Instruction[]>;
|
|
45
|
-
airdrop(address: Address, lamports: bigint): Promise<string>;
|
|
46
|
-
}
|
|
47
|
-
type Pending<T> = {
|
|
48
|
-
send(): Promise<T>;
|
|
49
|
-
};
|
|
50
|
-
type RawAccount = {
|
|
51
|
-
owner: Address;
|
|
52
|
-
data: readonly [string, string];
|
|
53
|
-
lamports: bigint;
|
|
54
|
-
executable: boolean;
|
|
55
|
-
};
|
|
56
|
-
type AtLeast = {
|
|
57
|
-
minContextSlot?: bigint;
|
|
58
|
-
};
|
|
59
|
-
type Status = {
|
|
60
|
-
err: unknown;
|
|
61
|
-
confirmationStatus: string | null;
|
|
62
|
-
slot?: bigint;
|
|
63
|
-
};
|
|
64
|
-
export type RpcLike = {
|
|
65
|
-
getMultipleAccounts(addresses: Address[], config: {
|
|
66
|
-
encoding: "base64";
|
|
67
|
-
} & AtLeast): Pending<{
|
|
68
|
-
value: (RawAccount | null)[];
|
|
69
|
-
}>;
|
|
70
|
-
getAccountInfo(address: Address, config: {
|
|
71
|
-
encoding: "base64";
|
|
72
|
-
} & AtLeast): Pending<{
|
|
73
|
-
value: {
|
|
74
|
-
owner: Address;
|
|
75
|
-
data: readonly [string, string];
|
|
76
|
-
lamports: bigint;
|
|
77
|
-
executable: boolean;
|
|
78
|
-
} | null;
|
|
79
|
-
}>;
|
|
80
|
-
getLatestBlockhash(): Pending<{
|
|
81
|
-
value: {
|
|
82
|
-
blockhash: Blockhash;
|
|
83
|
-
lastValidBlockHeight: bigint;
|
|
84
|
-
};
|
|
85
|
-
}>;
|
|
86
|
-
sendTransaction(wire: Base64EncodedWireTransaction, config: {
|
|
87
|
-
encoding: "base64";
|
|
88
|
-
skipPreflight?: boolean;
|
|
89
|
-
}): Pending<Signature>;
|
|
90
|
-
simulateTransaction(wire: Base64EncodedWireTransaction, config: {
|
|
91
|
-
encoding: "base64";
|
|
92
|
-
sigVerify: false;
|
|
93
|
-
replaceRecentBlockhash: true;
|
|
94
|
-
accounts?: {
|
|
95
|
-
addresses: Address[];
|
|
96
|
-
encoding: "base64";
|
|
97
|
-
};
|
|
98
|
-
}): Pending<{
|
|
99
|
-
value: {
|
|
100
|
-
err: unknown;
|
|
101
|
-
logs: readonly string[] | null;
|
|
102
|
-
unitsConsumed?: bigint | undefined;
|
|
103
|
-
accounts?: readonly ({
|
|
104
|
-
data: readonly [string, string];
|
|
105
|
-
} | null)[] | null;
|
|
106
|
-
};
|
|
107
|
-
}>;
|
|
108
|
-
getSignatureStatuses(signatures: Signature[], config?: {
|
|
109
|
-
searchTransactionHistory: boolean;
|
|
110
|
-
}): Pending<{
|
|
111
|
-
context: {
|
|
112
|
-
slot: bigint;
|
|
113
|
-
};
|
|
114
|
-
value: readonly (Status | null)[];
|
|
115
|
-
}>;
|
|
116
|
-
getEpochInfo(): Pending<{
|
|
117
|
-
blockHeight: bigint;
|
|
118
|
-
absoluteSlot: bigint;
|
|
119
|
-
}>;
|
|
120
|
-
requestAirdrop(address: Address, lamports: bigint): Pending<Signature>;
|
|
121
|
-
getRecentPrioritizationFees(addresses: readonly Address[]): Pending<readonly {
|
|
122
|
-
prioritizationFee: bigint;
|
|
123
|
-
}[]>;
|
|
124
|
-
getGenesisHash(): Pending<string>;
|
|
125
|
-
getProgramAccounts(program: Address, config: {
|
|
126
|
-
encoding: "base64";
|
|
127
|
-
commitment: "confirmed";
|
|
128
|
-
filters: readonly ({
|
|
129
|
-
dataSize: bigint;
|
|
130
|
-
} | {
|
|
131
|
-
memcmp: {
|
|
132
|
-
offset: bigint;
|
|
133
|
-
bytes: string;
|
|
134
|
-
encoding: "base58";
|
|
135
|
-
};
|
|
136
|
-
})[];
|
|
137
|
-
} & AtLeast): Pending<readonly {
|
|
138
|
-
pubkey: Address;
|
|
139
|
-
account: {
|
|
140
|
-
data: readonly [string, string];
|
|
141
|
-
};
|
|
142
|
-
}[]>;
|
|
143
|
-
getSignaturesForAddress(address: Address, config: {
|
|
144
|
-
limit: number;
|
|
145
|
-
} & AtLeast): Pending<readonly {
|
|
146
|
-
signature: Signature;
|
|
147
|
-
slot: bigint;
|
|
148
|
-
blockTime: bigint | null;
|
|
149
|
-
err: unknown;
|
|
150
|
-
}[]>;
|
|
151
|
-
getTransaction(signature: Signature, config: {
|
|
152
|
-
encoding: "json";
|
|
153
|
-
maxSupportedTransactionVersion: 0;
|
|
154
|
-
commitment: "confirmed";
|
|
155
|
-
}): Pending<{
|
|
156
|
-
transaction: {
|
|
157
|
-
message: {
|
|
158
|
-
accountKeys: readonly Address[];
|
|
159
|
-
instructions?: readonly {
|
|
160
|
-
programIdIndex: number;
|
|
161
|
-
data: string;
|
|
162
|
-
}[];
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
meta: {
|
|
166
|
-
loadedAddresses?: {
|
|
167
|
-
writable: readonly Address[];
|
|
168
|
-
readonly: readonly Address[];
|
|
169
|
-
};
|
|
170
|
-
innerInstructions?: readonly {
|
|
171
|
-
instructions: readonly {
|
|
172
|
-
programIdIndex: number;
|
|
173
|
-
data: string;
|
|
174
|
-
}[];
|
|
175
|
-
}[] | null;
|
|
176
|
-
} | null;
|
|
177
|
-
} | null>;
|
|
178
|
-
};
|
|
179
|
-
export declare const MEMO_PROGRAM_ADDRESS: Address;
|
|
180
|
-
export declare const POLL_MS = 500;
|
|
181
|
-
export declare const CONFIRM_POLLS = 360;
|
|
182
|
-
export declare const RATE_LIMIT_ATTEMPTS = 6;
|
|
183
|
-
export declare function rateLimited(error: unknown): boolean;
|
|
184
|
-
export declare const MIN_CONTEXT_SLOT_NOT_REACHED = -32016;
|
|
185
|
-
export declare function behindMinSlot(error: unknown): boolean;
|
|
186
|
-
export declare function patiently<T>(call: () => Promise<T>, wait?: (ms: number) => Promise<void>): Promise<T>;
|
|
187
|
-
export declare class Charged extends Error {
|
|
188
|
-
constructor(message: string);
|
|
189
|
-
}
|
|
190
|
-
export declare class FailedOnChain extends Charged {
|
|
191
|
-
}
|
|
192
|
-
export declare class BlockhashExpired extends Error {
|
|
193
|
-
constructor(message: string);
|
|
194
|
-
}
|
|
195
|
-
export declare const neverLanded: (error: unknown) => boolean;
|
|
196
|
-
export type Confirmed = {
|
|
197
|
-
slot?: bigint;
|
|
198
|
-
};
|
|
199
|
-
export type SignatureWatch = (signature: Signature, signal: AbortSignal) => Promise<Confirmed | void>;
|
|
200
|
-
export declare function signatureWatch(url: string): SignatureWatch;
|
|
201
|
-
export declare function heardSlot(signature: Signature, note: unknown): Confirmed;
|
|
202
|
-
export declare function confirm(rpc: RpcLike, signature: Signature, lastValidBlockHeight: bigint, wait?: (ms: number) => Promise<void>, watch?: SignatureWatch): Promise<Confirmed>;
|
|
203
|
-
export declare function confirmSent(rpc: RpcLike, signature: Signature, lastValidBlockHeight: bigint, wait?: (ms: number) => Promise<void>, watch?: SignatureWatch): Promise<Confirmed>;
|
|
204
|
-
export declare const MULTIPLE_ACCOUNTS_LIMIT = 100;
|
|
205
|
-
export declare const TRANSACTION_FETCHES = 4;
|
|
206
|
-
export declare const KEPT_TRANSACTIONS = 256;
|
|
207
|
-
export declare const unmemoized: (transport: Transport) => Transport;
|
|
208
|
-
export declare function memoized(inner: Transport): Transport;
|
|
209
|
-
export declare function rpcTransport(rpc: RpcLike, wait?: (ms: number) => Promise<void>, watch?: SignatureWatch): Transport;
|
|
210
|
-
export type IntentChanges = {
|
|
211
|
-
wait(seconds: number): Promise<ProgramAccount[] | null>;
|
|
212
|
-
close(): void;
|
|
213
|
-
};
|
|
214
|
-
export type Notifications = (signal: AbortSignal) => Promise<AsyncIterable<unknown>>;
|
|
215
|
-
export declare function socketUrl(url: string): string;
|
|
216
|
-
export declare function intentNotifications(url: string): Notifications;
|
|
217
|
-
export declare function changedAccount(note: unknown): ProgramAccount | null;
|
|
218
|
-
export declare const RECONNECT_MS: readonly number[];
|
|
219
|
-
export declare function pause(ms: number, signal: AbortSignal): Promise<void>;
|
|
220
|
-
export declare function changesFrom(notifications: Notifications, reconnect?: readonly number[]): IntentChanges;
|
|
221
|
-
export {};
|
|
1
|
+
export type { AccountView, EngineTransaction, IntentRead, Latest, ListedSignature, LookupTables, ProgramAccount, RpcLike, Simulation, TokenHolding, Transport, } from "./rpc-shapes.js";
|
|
2
|
+
export { holdingsOf, keysAt, MEMO_PROGRAM_ADDRESS, signersAmong } from "./transaction-keys.js";
|
|
3
|
+
export { behindMinSlot, BlockhashExpired, Charged, FailedOnChain, MIN_CONTEXT_SLOT_NOT_REACHED, neverLanded, patiently, POLL_MS, RATE_LIMIT_ATTEMPTS, rateLimited, } from "./rpc-retry.js";
|
|
4
|
+
export { confirm, CONFIRM_POLLS, type Confirmed, confirmSent, heardSlot, type SignatureWatch, signatureWatch, } from "./confirmation.js";
|
|
5
|
+
export { boundMembers, memoized, unmemoized } from "./memoized-transport.js";
|
|
6
|
+
export { KEPT_TRANSACTIONS, MULTIPLE_ACCOUNTS_LIMIT, rpcTransport, TRANSACTION_FETCHES } from "./rpc-transport.js";
|
|
7
|
+
export { changedAccount, changesFrom, type IntentChanges, intentNotifications, type Notifications, pause, RECONNECT_MS, socketUrl, } from "./intent-notifications.js";
|