@usearete/adapter-kit 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Arete
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # @usearete/adapter-kit
2
+
3
+ A [`WalletAdapter`](https://github.com/AreteA4/arete/blob/main/typescript/core/src/wallet/types.ts) for the Arete SDK backed by [`@solana/kit`](https://github.com/anza-xyz/kit).
4
+
5
+ The adapter owns v0 transaction construction, signing, submission, confirmation, and unsigned RPC inspection. It supports `@solana/kit` 2.3 and requires Node.js 20.18 or newer for Node consumers.
6
+
7
+ `transport: 'auto'` uses the connected Arete client's authenticated HTTP transaction transport per invocation. Standalone auto mode uses configured `rpc` and `rpcSubscriptions`; `transport: 'direct'` requires both. A custom `TransactionTransport` can be supplied instead. The Arete path performs no subscription calls and never falls back or resubmits.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install @usearete/adapter-kit @solana/kit @usearete/sdk
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```ts
18
+ import { Arete } from '@usearete/sdk';
19
+ import { createWalletAdapter } from '@usearete/adapter-kit';
20
+ import {
21
+ createSolanaRpc,
22
+ createSolanaRpcSubscriptions,
23
+ createKeyPairSignerFromBytes,
24
+ } from '@solana/kit';
25
+ import { MY_STACK } from './generated/my-stack';
26
+
27
+ const rpc = createSolanaRpc('https://api.devnet.solana.com');
28
+ const rpcSubscriptions = createSolanaRpcSubscriptions('wss://api.devnet.solana.com');
29
+ const signer = await createKeyPairSignerFromBytes(secretKeyBytes);
30
+
31
+ const wallet = createWalletAdapter({ rpc, rpcSubscriptions, signer });
32
+ const client = await Arete.connect(MY_STACK, { wallet });
33
+
34
+ const prepared = await client.programs.myProgram.instructions.buy.prepare({
35
+ amount: 1_000_000n,
36
+ maxSolCost: 100_000_000n,
37
+ mint: 'So11111111111111111111111111111111111111112',
38
+ });
39
+
40
+ const inspection = await client.inspectOperation(prepared);
41
+ console.log(inspection.transaction.feeLamports, inspection.transaction.logs);
42
+
43
+ const receipt = await client.execute(prepared);
44
+ console.log(receipt.signature, receipt.slot);
45
+ ```
46
+
47
+ ## Signers
48
+
49
+ `signer` and `additionalSigners` must be `@solana/kit` `TransactionSigner` implementations. The primary signer is the default fee payer. Configured additional signers are published through `wallet.signerAddresses` so Arete can validate prepared operations before execution.
50
+
51
+ Per-send `signers`, `additionalSigners`, and `feePayer` values can satisfy transaction-specific signer requirements. A fee-payer override is itself a `TransactionSigner`. The adapter invokes signers only from `signAndSend`; `inspectTransaction` compiles an unsigned transaction and never calls a signer or submits to the network.
52
+
53
+ ## Outcomes
54
+
55
+ Submission failures throw `KitTransactionExecutionError` with an Arete-compatible `outcome`:
56
+
57
+ - `not-submitted` for build, signer, and known preflight failures.
58
+ - `submitted-unknown` when confirmation fails and one signature-status query cannot prove the result.
59
+ - `chain-failed` when that status query reports an on-chain error.
60
+
61
+ The adapter never rebuilds, retries, or resubmits a transaction. Known signatures and landed slots are preserved on results and errors.
package/dist/index.cjs ADDED
@@ -0,0 +1,426 @@
1
+ 'use strict';
2
+
3
+ var kit = require('@solana/kit');
4
+ var sdk = require('@usearete/sdk');
5
+
6
+ /**
7
+ * @usearete/adapter-kit
8
+ *
9
+ * A reference {@link WalletAdapter} implementation backed by @solana/kit
10
+ * (the functional successor to @solana/web3.js).
11
+ *
12
+ * The Arete core SDK is RPC-free: it only builds `BuiltInstruction` objects.
13
+ * This adapter owns blockhash fetching, message construction, signing,
14
+ * sending, and confirmation.
15
+ */
16
+ /** Structured adapter error consumed by the Arete transaction outcome APIs. */
17
+ class KitTransactionExecutionError extends Error {
18
+ constructor(outcome) {
19
+ super(outcomeMessage(outcome));
20
+ this.name = 'KitTransactionExecutionError';
21
+ this.outcome = outcome;
22
+ this.cause = outcome.cause;
23
+ this.signature = 'signature' in outcome ? outcome.signature : undefined;
24
+ this.slot = 'slot' in outcome ? outcome.slot : undefined;
25
+ }
26
+ }
27
+ function outcomeMessage(outcome) {
28
+ if (outcome.cause instanceof Error && outcome.cause.message) {
29
+ return outcome.cause.message;
30
+ }
31
+ switch (outcome.status) {
32
+ case 'not-submitted':
33
+ return `Transaction was not submitted during ${outcome.phase}`;
34
+ case 'submitted-unknown':
35
+ return `Transaction ${outcome.signature} was submitted but its status is unknown`;
36
+ case 'chain-failed':
37
+ return outcome.signature
38
+ ? `Transaction ${outcome.signature} failed on chain`
39
+ : 'Transaction failed on chain';
40
+ }
41
+ }
42
+ function chainFailureCause(confirmationError, transactionError) {
43
+ const cause = new Error('Transaction failed on chain');
44
+ Object.assign(cause, { cause: confirmationError, transactionError });
45
+ return cause;
46
+ }
47
+ function toNumber(value) {
48
+ return Number(value);
49
+ }
50
+ function slotFromError(error) {
51
+ const seen = new Set();
52
+ let current = error;
53
+ while (typeof current === 'object' && current !== null && !seen.has(current)) {
54
+ seen.add(current);
55
+ const candidate = current;
56
+ const slot = candidate.slot ?? candidate.context?.slot;
57
+ if (typeof slot === 'number' || typeof slot === 'bigint') {
58
+ return Number(slot);
59
+ }
60
+ current = candidate.cause;
61
+ }
62
+ return undefined;
63
+ }
64
+ function hasReachedCommitment(actual, required) {
65
+ if (actual === null)
66
+ return false;
67
+ const rank = {
68
+ processed: 0,
69
+ confirmed: 1,
70
+ finalized: 2,
71
+ };
72
+ return rank[actual] >= rank[required];
73
+ }
74
+ function resolveTransport(selection, rpc, rpcSubscriptions, context) {
75
+ if (typeof selection === 'object')
76
+ return { kind: 'arete', transport: selection };
77
+ if (selection === 'direct') {
78
+ if (!rpc || !rpcSubscriptions)
79
+ throw new Error('Kit direct transport requires RPC and RPC subscriptions');
80
+ return { kind: 'direct', rpc, rpcSubscriptions };
81
+ }
82
+ if (context?.transactionTransport)
83
+ return { kind: 'arete', transport: context.transactionTransport };
84
+ if (rpc && rpcSubscriptions)
85
+ return { kind: 'direct', rpc, rpcSubscriptions };
86
+ throw new Error('No transaction transport is available; connect through Arete or configure direct RPC');
87
+ }
88
+ async function pollAreteStatus(transport, signature, commitment, lastValidBlockHeight, options) {
89
+ const deadline = Date.now() + (options?.confirmationTimeoutMs ?? 60000);
90
+ const interval = options?.statusPollIntervalMs ?? 500;
91
+ let emptyStatusPolls = 0;
92
+ while (Date.now() <= deadline) {
93
+ const status = await transport.getSignatureStatus(signature, {
94
+ commitment, searchTransactionHistory: true,
95
+ });
96
+ if (status?.err) {
97
+ throw new KitTransactionExecutionError({
98
+ status: 'chain-failed', phase: 'confirmation', signature,
99
+ slot: status.slot === null ? undefined : Number(status.slot), cause: status.err,
100
+ });
101
+ }
102
+ if (status && hasReachedCommitment(status.confirmationStatus, commitment)) {
103
+ return { signature, slot: status.slot === null ? undefined : Number(status.slot) };
104
+ }
105
+ if (await transport.getBlockHeight({ commitment }) > lastValidBlockHeight) {
106
+ throw new KitTransactionExecutionError({
107
+ status: 'submitted-unknown', phase: 'confirmation', signature,
108
+ slot: status?.slot === null ? undefined : Number(status?.slot),
109
+ cause: new Error('Transaction blockhash expired before confirmation'),
110
+ });
111
+ }
112
+ emptyStatusPolls = status ? 0 : emptyStatusPolls + 1;
113
+ const delayMs = Math.min(interval * (2 ** Math.min(emptyStatusPolls, 3)), 4000);
114
+ await new Promise((resolve) => setTimeout(resolve, delayMs));
115
+ }
116
+ throw new KitTransactionExecutionError({
117
+ status: 'submitted-unknown', phase: 'confirmation', signature,
118
+ cause: new Error('Transaction confirmation timed out'),
119
+ });
120
+ }
121
+ async function getSignatureStatus(rpc, signature, searchTransactionHistory) {
122
+ const { value } = await rpc
123
+ .getSignatureStatuses([signature], { searchTransactionHistory })
124
+ .send();
125
+ return value[0];
126
+ }
127
+ function toCommitment(level, fallback) {
128
+ return level ?? fallback;
129
+ }
130
+ function collectRequiredSignerAddresses(instructions, feePayerAddress) {
131
+ const required = new Set([feePayerAddress]);
132
+ for (const instruction of instructions) {
133
+ for (const key of instruction.keys) {
134
+ if (key.isSigner) {
135
+ required.add(key.pubkey);
136
+ }
137
+ }
138
+ }
139
+ return required;
140
+ }
141
+ function indexLocalSigners(signers) {
142
+ const indexed = new Map();
143
+ for (const signer of signers) {
144
+ indexed.set(signer.address, signer);
145
+ }
146
+ return indexed;
147
+ }
148
+ /** Map an Arete account meta to a kit AccountRole. */
149
+ function toAccountRole(meta) {
150
+ if (meta.isSigner && meta.isWritable)
151
+ return kit.AccountRole.WRITABLE_SIGNER;
152
+ if (meta.isSigner && !meta.isWritable)
153
+ return kit.AccountRole.READONLY_SIGNER;
154
+ if (!meta.isSigner && meta.isWritable)
155
+ return kit.AccountRole.WRITABLE;
156
+ return kit.AccountRole.READONLY;
157
+ }
158
+ /** Map a kit AccountRole back to Arete signer/writable flags. */
159
+ function fromAccountRole(role) {
160
+ switch (role) {
161
+ case kit.AccountRole.WRITABLE_SIGNER:
162
+ return { isSigner: true, isWritable: true };
163
+ case kit.AccountRole.READONLY_SIGNER:
164
+ return { isSigner: true, isWritable: false };
165
+ case kit.AccountRole.WRITABLE:
166
+ return { isSigner: false, isWritable: true };
167
+ default:
168
+ return { isSigner: false, isWritable: false };
169
+ }
170
+ }
171
+ /** Convert an Arete BuiltInstruction to a kit IInstruction. */
172
+ function toKitInstruction(ix) {
173
+ const accounts = ix.keys.map((k) => ({
174
+ address: kit.address(k.pubkey),
175
+ role: toAccountRole(k),
176
+ }));
177
+ return {
178
+ programAddress: kit.address(ix.programId),
179
+ accounts,
180
+ data: ix.data,
181
+ };
182
+ }
183
+ /** Convert a kit IInstruction to an Arete BuiltInstruction. */
184
+ function fromKitInstruction(ix) {
185
+ return {
186
+ programId: ix.programAddress,
187
+ keys: (ix.accounts ?? []).map((account) => ({
188
+ pubkey: account.address,
189
+ ...fromAccountRole(account.role),
190
+ })),
191
+ data: ix.data ? new Uint8Array(ix.data) : new Uint8Array(0),
192
+ };
193
+ }
194
+ /**
195
+ * Create a {@link WalletAdapter} from a kit RPC pair and a signer.
196
+ */
197
+ function createWalletAdapter(config) {
198
+ const { rpc, rpcSubscriptions, signer } = config;
199
+ const configuredLocalSigners = config.additionalSigners ?? [];
200
+ const fallbackCommitment = config.defaultCommitment ?? 'confirmed';
201
+ const signerAddresses = [signer.address, ...configuredLocalSigners.map(({ address }) => address)];
202
+ return {
203
+ publicKey: signer.address,
204
+ signerAddresses: [...new Set(signerAddresses)],
205
+ async signAndSend(instructions, options, context) {
206
+ if (instructions.length === 0) {
207
+ const cause = new Error('signAndSend requires at least one instruction');
208
+ throw new KitTransactionExecutionError({
209
+ status: 'not-submitted',
210
+ phase: 'build',
211
+ cause,
212
+ });
213
+ }
214
+ const sendOptions = options;
215
+ const feePayer = sendOptions?.feePayer ?? signer;
216
+ const commitment = toCommitment(options?.confirmationLevel, fallbackCommitment);
217
+ let resolved;
218
+ try {
219
+ resolved = resolveTransport(config.transport, rpc, rpcSubscriptions, context);
220
+ }
221
+ catch (cause) {
222
+ throw new KitTransactionExecutionError({ status: 'not-submitted', phase: 'build', cause });
223
+ }
224
+ let message;
225
+ let lastValidBlockHeight;
226
+ try {
227
+ const requiredSignerAddresses = collectRequiredSignerAddresses(instructions, feePayer.address);
228
+ const localSignerMap = indexLocalSigners([
229
+ signer,
230
+ ...configuredLocalSigners,
231
+ ...(sendOptions?.signers ?? []),
232
+ ...(sendOptions?.additionalSigners ?? []),
233
+ ...(sendOptions?.feePayer ? [sendOptions.feePayer] : []),
234
+ ]);
235
+ const missingSignerAddresses = [...requiredSignerAddresses].filter((requiredAddress) => !localSignerMap.has(requiredAddress));
236
+ if (missingSignerAddresses.length > 0) {
237
+ throw new Error(`Missing signer(s) for transaction: ${missingSignerAddresses.join(', ')}`);
238
+ }
239
+ const attachedSigners = [...requiredSignerAddresses]
240
+ .filter((requiredAddress) => requiredAddress !== feePayer.address)
241
+ .map((requiredAddress) => localSignerMap.get(requiredAddress));
242
+ const latestBlockhash = resolved.kind === 'arete'
243
+ ? await resolved.transport.getLatestBlockhash({ commitment })
244
+ : (await resolved.rpc.getLatestBlockhash({ commitment }).send()).value;
245
+ lastValidBlockHeight = BigInt(latestBlockhash.lastValidBlockHeight);
246
+ const messageWithFeePayer = kit.pipe(kit.createTransactionMessage({ version: 0 }), (m) => kit.setTransactionMessageFeePayerSigner(feePayer, m), (m) => kit.setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, m), (m) => kit.appendTransactionMessageInstructions(instructions.map(toKitInstruction), m));
247
+ message = kit.addSignersToTransactionMessage(attachedSigners, messageWithFeePayer);
248
+ }
249
+ catch (cause) {
250
+ throw new KitTransactionExecutionError({
251
+ status: 'not-submitted',
252
+ phase: 'build',
253
+ cause,
254
+ });
255
+ }
256
+ let signedTransaction;
257
+ let signature;
258
+ try {
259
+ signedTransaction = await kit.signTransactionMessageWithSigners(message);
260
+ signature = kit.getSignatureFromTransaction(signedTransaction);
261
+ }
262
+ catch (cause) {
263
+ throw new KitTransactionExecutionError({
264
+ status: 'not-submitted',
265
+ phase: 'wallet',
266
+ cause,
267
+ });
268
+ }
269
+ if (resolved.kind === 'arete') {
270
+ let submittedSignature;
271
+ try {
272
+ const sent = await resolved.transport.sendTransaction(kit.getBase64EncodedWireTransaction(signedTransaction), { skipPreflight: options?.skipPreflight ?? false, preflightCommitment: commitment });
273
+ submittedSignature = sent.signature;
274
+ }
275
+ catch (cause) {
276
+ if (cause instanceof sdk.TransactionTransportError && cause.submissionState === 'not_submitted') {
277
+ throw new KitTransactionExecutionError({ status: 'not-submitted', phase: 'send', cause });
278
+ }
279
+ throw new KitTransactionExecutionError({
280
+ status: 'submitted-unknown', phase: 'send',
281
+ signature: cause instanceof sdk.TransactionTransportError && cause.signature
282
+ ? cause.signature : signature,
283
+ cause,
284
+ });
285
+ }
286
+ try {
287
+ return await pollAreteStatus(resolved.transport, submittedSignature, commitment, lastValidBlockHeight, sendOptions);
288
+ }
289
+ catch (cause) {
290
+ if (cause instanceof KitTransactionExecutionError)
291
+ throw cause;
292
+ throw new KitTransactionExecutionError({
293
+ status: 'submitted-unknown', phase: 'confirmation',
294
+ signature: submittedSignature, cause,
295
+ });
296
+ }
297
+ }
298
+ const directRpc = resolved.rpc;
299
+ try {
300
+ const sendAndConfirm = kit.sendAndConfirmTransactionFactory({
301
+ rpc: resolved.rpc,
302
+ rpcSubscriptions: resolved.rpcSubscriptions,
303
+ });
304
+ await sendAndConfirm(signedTransaction, {
305
+ commitment,
306
+ skipPreflight: options?.skipPreflight ?? false,
307
+ });
308
+ }
309
+ catch (cause) {
310
+ if (kit.isSolanaError(cause, kit.SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE)) {
311
+ throw new KitTransactionExecutionError({
312
+ status: 'not-submitted',
313
+ phase: 'send',
314
+ cause,
315
+ });
316
+ }
317
+ let status = null;
318
+ try {
319
+ status = await getSignatureStatus(directRpc, signature, true);
320
+ }
321
+ catch {
322
+ // The confirmation error remains the authoritative cause.
323
+ }
324
+ const slot = status ? toNumber(status.slot) : slotFromError(cause);
325
+ if (status?.err) {
326
+ throw new KitTransactionExecutionError({
327
+ status: 'chain-failed',
328
+ phase: 'confirmation',
329
+ signature,
330
+ slot,
331
+ cause: chainFailureCause(cause, status.err),
332
+ });
333
+ }
334
+ if (status && hasReachedCommitment(status.confirmationStatus, commitment)) {
335
+ return { signature, slot };
336
+ }
337
+ throw new KitTransactionExecutionError({
338
+ status: 'submitted-unknown',
339
+ phase: 'confirmation',
340
+ signature,
341
+ slot,
342
+ cause,
343
+ });
344
+ }
345
+ try {
346
+ const status = await getSignatureStatus(directRpc, signature, false);
347
+ if (status?.err) {
348
+ throw new KitTransactionExecutionError({
349
+ status: 'chain-failed',
350
+ phase: 'confirmation',
351
+ signature,
352
+ slot: toNumber(status.slot),
353
+ cause: status.err,
354
+ });
355
+ }
356
+ return {
357
+ signature,
358
+ slot: status ? toNumber(status.slot) : undefined,
359
+ };
360
+ }
361
+ catch (cause) {
362
+ if (cause instanceof KitTransactionExecutionError)
363
+ throw cause;
364
+ return { signature };
365
+ }
366
+ },
367
+ async inspectTransaction(instructions, options, context) {
368
+ if (instructions.length === 0) {
369
+ throw new Error('inspectTransaction requires at least one instruction');
370
+ }
371
+ const inspectionOptions = options;
372
+ const commitment = inspectionOptions?.commitment ?? fallbackCommitment;
373
+ const minContextSlot = inspectionOptions?.minContextSlot;
374
+ const resolved = resolveTransport(config.transport, rpc, rpcSubscriptions, context);
375
+ const latestBlockhash = resolved.kind === 'arete'
376
+ ? await resolved.transport.getLatestBlockhash({ commitment, minContextSlot })
377
+ : (await resolved.rpc.getLatestBlockhash({ commitment, minContextSlot }).send()).value;
378
+ const message = kit.pipe(kit.createTransactionMessage({ version: 0 }), (m) => kit.setTransactionMessageFeePayer(kit.address(inspectionOptions?.feePayer ?? signer.address), m), (m) => kit.setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, m), (m) => kit.appendTransactionMessageInstructions(instructions.map(toKitInstruction), m));
379
+ const unsignedTransaction = kit.compileTransaction(message);
380
+ const wireTransaction = kit.getBase64EncodedWireTransaction(unsignedTransaction);
381
+ const encodedMessage = kit.getBase64Decoder().decode(unsignedTransaction.messageBytes);
382
+ if (resolved.kind === 'arete') {
383
+ const [fee, simulation] = await Promise.all([
384
+ resolved.transport.getFeeForMessage(encodedMessage, { commitment, minContextSlot }),
385
+ resolved.transport.simulateTransaction(wireTransaction, { commitment, minContextSlot }),
386
+ ]);
387
+ return {
388
+ feeLamports: fee.feeLamports === null ? undefined : toNumber(fee.feeLamports),
389
+ logs: simulation.logs ?? undefined,
390
+ computeUnitsConsumed: simulation.unitsConsumed === undefined
391
+ ? undefined : toNumber(simulation.unitsConsumed),
392
+ contextSlot: toNumber(simulation.contextSlot),
393
+ error: simulation.err ?? undefined,
394
+ feeContextSlot: toNumber(fee.contextSlot),
395
+ };
396
+ }
397
+ const [fee, simulation] = await Promise.all([
398
+ resolved.rpc.getFeeForMessage(encodedMessage, { commitment, minContextSlot }).send(),
399
+ resolved.rpc.simulateTransaction(wireTransaction, {
400
+ commitment,
401
+ encoding: 'base64',
402
+ minContextSlot,
403
+ sigVerify: false,
404
+ }).send(),
405
+ ]);
406
+ return {
407
+ feeLamports: fee.value === null ? undefined : toNumber(fee.value),
408
+ logs: simulation.value.logs ?? undefined,
409
+ computeUnitsConsumed: simulation.value.unitsConsumed === undefined
410
+ ? undefined
411
+ : toNumber(simulation.value.unitsConsumed),
412
+ contextSlot: toNumber(simulation.context.slot),
413
+ error: simulation.value.err ?? undefined,
414
+ feeContextSlot: toNumber(fee.context.slot),
415
+ };
416
+ },
417
+ };
418
+ }
419
+
420
+ exports.KitTransactionExecutionError = KitTransactionExecutionError;
421
+ exports.createWalletAdapter = createWalletAdapter;
422
+ exports.fromAccountRole = fromAccountRole;
423
+ exports.fromKitInstruction = fromKitInstruction;
424
+ exports.toAccountRole = toAccountRole;
425
+ exports.toKitInstruction = toKitInstruction;
426
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":[null],"names":["AccountRole","address","pipe","createTransactionMessage","setTransactionMessageFeePayerSigner","setTransactionMessageLifetimeUsingBlockhash","appendTransactionMessageInstructions","addSignersToTransactionMessage","signTransactionMessageWithSigners","getSignatureFromTransaction","getBase64EncodedWireTransaction","TransactionTransportError","sendAndConfirmTransactionFactory","isSolanaError","SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE","setTransactionMessageFeePayer","compileTransaction","getBase64Decoder"],"mappings":";;;;;AAAA;;;;;;;;;AASG;AAoGH;AACM,MAAO,4BAA6B,SAAQ,KAAK,CAAA;AAMrD,IAAA,WAAA,CAAY,OAAkC,EAAA;AAC5C,QAAA,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/B,QAAA,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;AAC3C,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACvB,QAAA,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;AAC3B,QAAA,IAAI,CAAC,SAAS,GAAG,WAAW,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;AACxE,QAAA,IAAI,CAAC,IAAI,GAAG,MAAM,IAAI,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC;KAC1D;AACF,CAAA;AAQD,SAAS,cAAc,CAAC,OAAkC,EAAA;AACxD,IAAA,IAAI,OAAO,CAAC,KAAK,YAAY,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE;AAC3D,QAAA,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;KAC9B;AACD,IAAA,QAAQ,OAAO,CAAC,MAAM;AACpB,QAAA,KAAK,eAAe;AAClB,YAAA,OAAO,CAAwC,qCAAA,EAAA,OAAO,CAAC,KAAK,EAAE,CAAC;AACjE,QAAA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AAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;aAC3C,CAAC;SACH;KACF,CAAC;AACJ;;;;;;;;;"}
@@ -0,0 +1,79 @@
1
+ import { Rpc, SolanaRpcApi, RpcSubscriptions, SolanaRpcSubscriptionsApi, TransactionSigner, Commitment, Slot, AccountRole, IInstruction } from '@solana/kit';
2
+ import { TransactionTransport, SendOptions, TransactionInspectionOptions, TransactionInspectionResult, WalletAdapter, BuiltInstruction, WalletExecutionContext, SendResult, TransactionFailureOutcome, BuiltAccountMeta } from '@usearete/sdk';
3
+
4
+ /**
5
+ * @usearete/adapter-kit
6
+ *
7
+ * A reference {@link WalletAdapter} implementation backed by @solana/kit
8
+ * (the functional successor to @solana/web3.js).
9
+ *
10
+ * The Arete core SDK is RPC-free: it only builds `BuiltInstruction` objects.
11
+ * This adapter owns blockhash fetching, message construction, signing,
12
+ * sending, and confirmation.
13
+ */
14
+
15
+ type AdapterTransportSelection = 'auto' | 'direct' | TransactionTransport;
16
+ interface KitAdapterConfig {
17
+ /** A Solana RPC client (from `createSolanaRpc`). */
18
+ rpc?: Rpc<SolanaRpcApi>;
19
+ /** A Solana RPC subscriptions client (from `createSolanaRpcSubscriptions`). */
20
+ rpcSubscriptions?: RpcSubscriptions<SolanaRpcSubscriptionsApi>;
21
+ transport?: AdapterTransportSelection;
22
+ /** The fee-payer / signer for transactions. */
23
+ signer: TransactionSigner;
24
+ /** Optional local signers that can satisfy additional required signatures. */
25
+ additionalSigners?: readonly TransactionSigner[];
26
+ /** Default commitment used when the caller does not specify one. */
27
+ defaultCommitment?: Commitment;
28
+ }
29
+ interface KitSendOptions extends SendOptions {
30
+ /** Extra local signers for this send only. */
31
+ additionalSigners?: readonly TransactionSigner[];
32
+ /** Override the fee payer for this send. */
33
+ feePayer?: TransactionSigner;
34
+ confirmationTimeoutMs?: number;
35
+ statusPollIntervalMs?: number;
36
+ }
37
+ interface KitTransactionInspectionOptions extends TransactionInspectionOptions {
38
+ /** Commitment used to fetch the blockhash, fee, and simulation context. */
39
+ commitment?: Commitment;
40
+ /** Reject RPC responses evaluated before this slot. */
41
+ minContextSlot?: Slot;
42
+ /** Fee payer address used to compile the unsigned transaction. */
43
+ feePayer?: string;
44
+ }
45
+ interface KitTransactionInspectionResult extends TransactionInspectionResult {
46
+ /** RPC context used for the fee estimate. */
47
+ feeContextSlot?: number;
48
+ }
49
+ interface KitWalletAdapter extends WalletAdapter {
50
+ readonly signerAddresses: readonly string[];
51
+ signAndSend(instructions: readonly BuiltInstruction[], options?: KitSendOptions, context?: WalletExecutionContext): Promise<SendResult>;
52
+ inspectTransaction(instructions: readonly BuiltInstruction[], options?: KitTransactionInspectionOptions, context?: WalletExecutionContext): Promise<KitTransactionInspectionResult>;
53
+ }
54
+ /** Structured adapter error consumed by the Arete transaction outcome APIs. */
55
+ declare class KitTransactionExecutionError extends Error {
56
+ readonly outcome: TransactionFailureOutcome;
57
+ readonly cause: unknown;
58
+ readonly signature?: string;
59
+ readonly slot?: number;
60
+ constructor(outcome: TransactionFailureOutcome);
61
+ }
62
+ /** Map an Arete account meta to a kit AccountRole. */
63
+ declare function toAccountRole(meta: BuiltAccountMeta): AccountRole;
64
+ /** Map a kit AccountRole back to Arete signer/writable flags. */
65
+ declare function fromAccountRole(role: AccountRole): {
66
+ isSigner: boolean;
67
+ isWritable: boolean;
68
+ };
69
+ /** Convert an Arete BuiltInstruction to a kit IInstruction. */
70
+ declare function toKitInstruction(ix: BuiltInstruction): IInstruction;
71
+ /** Convert a kit IInstruction to an Arete BuiltInstruction. */
72
+ declare function fromKitInstruction(ix: IInstruction): BuiltInstruction;
73
+ /**
74
+ * Create a {@link WalletAdapter} from a kit RPC pair and a signer.
75
+ */
76
+ declare function createWalletAdapter(config: KitAdapterConfig): KitWalletAdapter;
77
+
78
+ export { KitTransactionExecutionError, createWalletAdapter, fromAccountRole, fromKitInstruction, toAccountRole, toKitInstruction };
79
+ export type { AdapterTransportSelection, KitAdapterConfig, KitSendOptions, KitTransactionInspectionOptions, KitTransactionInspectionResult, KitWalletAdapter };
package/dist/index.js ADDED
@@ -0,0 +1,419 @@
1
+ import { AccountRole, address, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, addSignersToTransactionMessage, signTransactionMessageWithSigners, getSignatureFromTransaction, getBase64EncodedWireTransaction, sendAndConfirmTransactionFactory, isSolanaError, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE, setTransactionMessageFeePayer, compileTransaction, getBase64Decoder } from '@solana/kit';
2
+ import { TransactionTransportError } from '@usearete/sdk';
3
+
4
+ /**
5
+ * @usearete/adapter-kit
6
+ *
7
+ * A reference {@link WalletAdapter} implementation backed by @solana/kit
8
+ * (the functional successor to @solana/web3.js).
9
+ *
10
+ * The Arete core SDK is RPC-free: it only builds `BuiltInstruction` objects.
11
+ * This adapter owns blockhash fetching, message construction, signing,
12
+ * sending, and confirmation.
13
+ */
14
+ /** Structured adapter error consumed by the Arete transaction outcome APIs. */
15
+ class KitTransactionExecutionError extends Error {
16
+ constructor(outcome) {
17
+ super(outcomeMessage(outcome));
18
+ this.name = 'KitTransactionExecutionError';
19
+ this.outcome = outcome;
20
+ this.cause = outcome.cause;
21
+ this.signature = 'signature' in outcome ? outcome.signature : undefined;
22
+ this.slot = 'slot' in outcome ? outcome.slot : undefined;
23
+ }
24
+ }
25
+ function outcomeMessage(outcome) {
26
+ if (outcome.cause instanceof Error && outcome.cause.message) {
27
+ return outcome.cause.message;
28
+ }
29
+ switch (outcome.status) {
30
+ case 'not-submitted':
31
+ return `Transaction was not submitted during ${outcome.phase}`;
32
+ case 'submitted-unknown':
33
+ return `Transaction ${outcome.signature} was submitted but its status is unknown`;
34
+ case 'chain-failed':
35
+ return outcome.signature
36
+ ? `Transaction ${outcome.signature} failed on chain`
37
+ : 'Transaction failed on chain';
38
+ }
39
+ }
40
+ function chainFailureCause(confirmationError, transactionError) {
41
+ const cause = new Error('Transaction failed on chain');
42
+ Object.assign(cause, { cause: confirmationError, transactionError });
43
+ return cause;
44
+ }
45
+ function toNumber(value) {
46
+ return Number(value);
47
+ }
48
+ function slotFromError(error) {
49
+ const seen = new Set();
50
+ let current = error;
51
+ while (typeof current === 'object' && current !== null && !seen.has(current)) {
52
+ seen.add(current);
53
+ const candidate = current;
54
+ const slot = candidate.slot ?? candidate.context?.slot;
55
+ if (typeof slot === 'number' || typeof slot === 'bigint') {
56
+ return Number(slot);
57
+ }
58
+ current = candidate.cause;
59
+ }
60
+ return undefined;
61
+ }
62
+ function hasReachedCommitment(actual, required) {
63
+ if (actual === null)
64
+ return false;
65
+ const rank = {
66
+ processed: 0,
67
+ confirmed: 1,
68
+ finalized: 2,
69
+ };
70
+ return rank[actual] >= rank[required];
71
+ }
72
+ function resolveTransport(selection, rpc, rpcSubscriptions, context) {
73
+ if (typeof selection === 'object')
74
+ return { kind: 'arete', transport: selection };
75
+ if (selection === 'direct') {
76
+ if (!rpc || !rpcSubscriptions)
77
+ throw new Error('Kit direct transport requires RPC and RPC subscriptions');
78
+ return { kind: 'direct', rpc, rpcSubscriptions };
79
+ }
80
+ if (context?.transactionTransport)
81
+ return { kind: 'arete', transport: context.transactionTransport };
82
+ if (rpc && rpcSubscriptions)
83
+ return { kind: 'direct', rpc, rpcSubscriptions };
84
+ throw new Error('No transaction transport is available; connect through Arete or configure direct RPC');
85
+ }
86
+ async function pollAreteStatus(transport, signature, commitment, lastValidBlockHeight, options) {
87
+ const deadline = Date.now() + (options?.confirmationTimeoutMs ?? 60000);
88
+ const interval = options?.statusPollIntervalMs ?? 500;
89
+ let emptyStatusPolls = 0;
90
+ while (Date.now() <= deadline) {
91
+ const status = await transport.getSignatureStatus(signature, {
92
+ commitment, searchTransactionHistory: true,
93
+ });
94
+ if (status?.err) {
95
+ throw new KitTransactionExecutionError({
96
+ status: 'chain-failed', phase: 'confirmation', signature,
97
+ slot: status.slot === null ? undefined : Number(status.slot), cause: status.err,
98
+ });
99
+ }
100
+ if (status && hasReachedCommitment(status.confirmationStatus, commitment)) {
101
+ return { signature, slot: status.slot === null ? undefined : Number(status.slot) };
102
+ }
103
+ if (await transport.getBlockHeight({ commitment }) > lastValidBlockHeight) {
104
+ throw new KitTransactionExecutionError({
105
+ status: 'submitted-unknown', phase: 'confirmation', signature,
106
+ slot: status?.slot === null ? undefined : Number(status?.slot),
107
+ cause: new Error('Transaction blockhash expired before confirmation'),
108
+ });
109
+ }
110
+ emptyStatusPolls = status ? 0 : emptyStatusPolls + 1;
111
+ const delayMs = Math.min(interval * (2 ** Math.min(emptyStatusPolls, 3)), 4000);
112
+ await new Promise((resolve) => setTimeout(resolve, delayMs));
113
+ }
114
+ throw new KitTransactionExecutionError({
115
+ status: 'submitted-unknown', phase: 'confirmation', signature,
116
+ cause: new Error('Transaction confirmation timed out'),
117
+ });
118
+ }
119
+ async function getSignatureStatus(rpc, signature, searchTransactionHistory) {
120
+ const { value } = await rpc
121
+ .getSignatureStatuses([signature], { searchTransactionHistory })
122
+ .send();
123
+ return value[0];
124
+ }
125
+ function toCommitment(level, fallback) {
126
+ return level ?? fallback;
127
+ }
128
+ function collectRequiredSignerAddresses(instructions, feePayerAddress) {
129
+ const required = new Set([feePayerAddress]);
130
+ for (const instruction of instructions) {
131
+ for (const key of instruction.keys) {
132
+ if (key.isSigner) {
133
+ required.add(key.pubkey);
134
+ }
135
+ }
136
+ }
137
+ return required;
138
+ }
139
+ function indexLocalSigners(signers) {
140
+ const indexed = new Map();
141
+ for (const signer of signers) {
142
+ indexed.set(signer.address, signer);
143
+ }
144
+ return indexed;
145
+ }
146
+ /** Map an Arete account meta to a kit AccountRole. */
147
+ function toAccountRole(meta) {
148
+ if (meta.isSigner && meta.isWritable)
149
+ return AccountRole.WRITABLE_SIGNER;
150
+ if (meta.isSigner && !meta.isWritable)
151
+ return AccountRole.READONLY_SIGNER;
152
+ if (!meta.isSigner && meta.isWritable)
153
+ return AccountRole.WRITABLE;
154
+ return AccountRole.READONLY;
155
+ }
156
+ /** Map a kit AccountRole back to Arete signer/writable flags. */
157
+ function fromAccountRole(role) {
158
+ switch (role) {
159
+ case AccountRole.WRITABLE_SIGNER:
160
+ return { isSigner: true, isWritable: true };
161
+ case AccountRole.READONLY_SIGNER:
162
+ return { isSigner: true, isWritable: false };
163
+ case AccountRole.WRITABLE:
164
+ return { isSigner: false, isWritable: true };
165
+ default:
166
+ return { isSigner: false, isWritable: false };
167
+ }
168
+ }
169
+ /** Convert an Arete BuiltInstruction to a kit IInstruction. */
170
+ function toKitInstruction(ix) {
171
+ const accounts = ix.keys.map((k) => ({
172
+ address: address(k.pubkey),
173
+ role: toAccountRole(k),
174
+ }));
175
+ return {
176
+ programAddress: address(ix.programId),
177
+ accounts,
178
+ data: ix.data,
179
+ };
180
+ }
181
+ /** Convert a kit IInstruction to an Arete BuiltInstruction. */
182
+ function fromKitInstruction(ix) {
183
+ return {
184
+ programId: ix.programAddress,
185
+ keys: (ix.accounts ?? []).map((account) => ({
186
+ pubkey: account.address,
187
+ ...fromAccountRole(account.role),
188
+ })),
189
+ data: ix.data ? new Uint8Array(ix.data) : new Uint8Array(0),
190
+ };
191
+ }
192
+ /**
193
+ * Create a {@link WalletAdapter} from a kit RPC pair and a signer.
194
+ */
195
+ function createWalletAdapter(config) {
196
+ const { rpc, rpcSubscriptions, signer } = config;
197
+ const configuredLocalSigners = config.additionalSigners ?? [];
198
+ const fallbackCommitment = config.defaultCommitment ?? 'confirmed';
199
+ const signerAddresses = [signer.address, ...configuredLocalSigners.map(({ address }) => address)];
200
+ return {
201
+ publicKey: signer.address,
202
+ signerAddresses: [...new Set(signerAddresses)],
203
+ async signAndSend(instructions, options, context) {
204
+ if (instructions.length === 0) {
205
+ const cause = new Error('signAndSend requires at least one instruction');
206
+ throw new KitTransactionExecutionError({
207
+ status: 'not-submitted',
208
+ phase: 'build',
209
+ cause,
210
+ });
211
+ }
212
+ const sendOptions = options;
213
+ const feePayer = sendOptions?.feePayer ?? signer;
214
+ const commitment = toCommitment(options?.confirmationLevel, fallbackCommitment);
215
+ let resolved;
216
+ try {
217
+ resolved = resolveTransport(config.transport, rpc, rpcSubscriptions, context);
218
+ }
219
+ catch (cause) {
220
+ throw new KitTransactionExecutionError({ status: 'not-submitted', phase: 'build', cause });
221
+ }
222
+ let message;
223
+ let lastValidBlockHeight;
224
+ try {
225
+ const requiredSignerAddresses = collectRequiredSignerAddresses(instructions, feePayer.address);
226
+ const localSignerMap = indexLocalSigners([
227
+ signer,
228
+ ...configuredLocalSigners,
229
+ ...(sendOptions?.signers ?? []),
230
+ ...(sendOptions?.additionalSigners ?? []),
231
+ ...(sendOptions?.feePayer ? [sendOptions.feePayer] : []),
232
+ ]);
233
+ const missingSignerAddresses = [...requiredSignerAddresses].filter((requiredAddress) => !localSignerMap.has(requiredAddress));
234
+ if (missingSignerAddresses.length > 0) {
235
+ throw new Error(`Missing signer(s) for transaction: ${missingSignerAddresses.join(', ')}`);
236
+ }
237
+ const attachedSigners = [...requiredSignerAddresses]
238
+ .filter((requiredAddress) => requiredAddress !== feePayer.address)
239
+ .map((requiredAddress) => localSignerMap.get(requiredAddress));
240
+ const latestBlockhash = resolved.kind === 'arete'
241
+ ? await resolved.transport.getLatestBlockhash({ commitment })
242
+ : (await resolved.rpc.getLatestBlockhash({ commitment }).send()).value;
243
+ lastValidBlockHeight = BigInt(latestBlockhash.lastValidBlockHeight);
244
+ const messageWithFeePayer = pipe(createTransactionMessage({ version: 0 }), (m) => setTransactionMessageFeePayerSigner(feePayer, m), (m) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, m), (m) => appendTransactionMessageInstructions(instructions.map(toKitInstruction), m));
245
+ message = addSignersToTransactionMessage(attachedSigners, messageWithFeePayer);
246
+ }
247
+ catch (cause) {
248
+ throw new KitTransactionExecutionError({
249
+ status: 'not-submitted',
250
+ phase: 'build',
251
+ cause,
252
+ });
253
+ }
254
+ let signedTransaction;
255
+ let signature;
256
+ try {
257
+ signedTransaction = await signTransactionMessageWithSigners(message);
258
+ signature = getSignatureFromTransaction(signedTransaction);
259
+ }
260
+ catch (cause) {
261
+ throw new KitTransactionExecutionError({
262
+ status: 'not-submitted',
263
+ phase: 'wallet',
264
+ cause,
265
+ });
266
+ }
267
+ if (resolved.kind === 'arete') {
268
+ let submittedSignature;
269
+ try {
270
+ const sent = await resolved.transport.sendTransaction(getBase64EncodedWireTransaction(signedTransaction), { skipPreflight: options?.skipPreflight ?? false, preflightCommitment: commitment });
271
+ submittedSignature = sent.signature;
272
+ }
273
+ catch (cause) {
274
+ if (cause instanceof TransactionTransportError && cause.submissionState === 'not_submitted') {
275
+ throw new KitTransactionExecutionError({ status: 'not-submitted', phase: 'send', cause });
276
+ }
277
+ throw new KitTransactionExecutionError({
278
+ status: 'submitted-unknown', phase: 'send',
279
+ signature: cause instanceof TransactionTransportError && cause.signature
280
+ ? cause.signature : signature,
281
+ cause,
282
+ });
283
+ }
284
+ try {
285
+ return await pollAreteStatus(resolved.transport, submittedSignature, commitment, lastValidBlockHeight, sendOptions);
286
+ }
287
+ catch (cause) {
288
+ if (cause instanceof KitTransactionExecutionError)
289
+ throw cause;
290
+ throw new KitTransactionExecutionError({
291
+ status: 'submitted-unknown', phase: 'confirmation',
292
+ signature: submittedSignature, cause,
293
+ });
294
+ }
295
+ }
296
+ const directRpc = resolved.rpc;
297
+ try {
298
+ const sendAndConfirm = sendAndConfirmTransactionFactory({
299
+ rpc: resolved.rpc,
300
+ rpcSubscriptions: resolved.rpcSubscriptions,
301
+ });
302
+ await sendAndConfirm(signedTransaction, {
303
+ commitment,
304
+ skipPreflight: options?.skipPreflight ?? false,
305
+ });
306
+ }
307
+ catch (cause) {
308
+ if (isSolanaError(cause, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE)) {
309
+ throw new KitTransactionExecutionError({
310
+ status: 'not-submitted',
311
+ phase: 'send',
312
+ cause,
313
+ });
314
+ }
315
+ let status = null;
316
+ try {
317
+ status = await getSignatureStatus(directRpc, signature, true);
318
+ }
319
+ catch {
320
+ // The confirmation error remains the authoritative cause.
321
+ }
322
+ const slot = status ? toNumber(status.slot) : slotFromError(cause);
323
+ if (status?.err) {
324
+ throw new KitTransactionExecutionError({
325
+ status: 'chain-failed',
326
+ phase: 'confirmation',
327
+ signature,
328
+ slot,
329
+ cause: chainFailureCause(cause, status.err),
330
+ });
331
+ }
332
+ if (status && hasReachedCommitment(status.confirmationStatus, commitment)) {
333
+ return { signature, slot };
334
+ }
335
+ throw new KitTransactionExecutionError({
336
+ status: 'submitted-unknown',
337
+ phase: 'confirmation',
338
+ signature,
339
+ slot,
340
+ cause,
341
+ });
342
+ }
343
+ try {
344
+ const status = await getSignatureStatus(directRpc, signature, false);
345
+ if (status?.err) {
346
+ throw new KitTransactionExecutionError({
347
+ status: 'chain-failed',
348
+ phase: 'confirmation',
349
+ signature,
350
+ slot: toNumber(status.slot),
351
+ cause: status.err,
352
+ });
353
+ }
354
+ return {
355
+ signature,
356
+ slot: status ? toNumber(status.slot) : undefined,
357
+ };
358
+ }
359
+ catch (cause) {
360
+ if (cause instanceof KitTransactionExecutionError)
361
+ throw cause;
362
+ return { signature };
363
+ }
364
+ },
365
+ async inspectTransaction(instructions, options, context) {
366
+ if (instructions.length === 0) {
367
+ throw new Error('inspectTransaction requires at least one instruction');
368
+ }
369
+ const inspectionOptions = options;
370
+ const commitment = inspectionOptions?.commitment ?? fallbackCommitment;
371
+ const minContextSlot = inspectionOptions?.minContextSlot;
372
+ const resolved = resolveTransport(config.transport, rpc, rpcSubscriptions, context);
373
+ const latestBlockhash = resolved.kind === 'arete'
374
+ ? await resolved.transport.getLatestBlockhash({ commitment, minContextSlot })
375
+ : (await resolved.rpc.getLatestBlockhash({ commitment, minContextSlot }).send()).value;
376
+ const message = pipe(createTransactionMessage({ version: 0 }), (m) => setTransactionMessageFeePayer(address(inspectionOptions?.feePayer ?? signer.address), m), (m) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, m), (m) => appendTransactionMessageInstructions(instructions.map(toKitInstruction), m));
377
+ const unsignedTransaction = compileTransaction(message);
378
+ const wireTransaction = getBase64EncodedWireTransaction(unsignedTransaction);
379
+ const encodedMessage = getBase64Decoder().decode(unsignedTransaction.messageBytes);
380
+ if (resolved.kind === 'arete') {
381
+ const [fee, simulation] = await Promise.all([
382
+ resolved.transport.getFeeForMessage(encodedMessage, { commitment, minContextSlot }),
383
+ resolved.transport.simulateTransaction(wireTransaction, { commitment, minContextSlot }),
384
+ ]);
385
+ return {
386
+ feeLamports: fee.feeLamports === null ? undefined : toNumber(fee.feeLamports),
387
+ logs: simulation.logs ?? undefined,
388
+ computeUnitsConsumed: simulation.unitsConsumed === undefined
389
+ ? undefined : toNumber(simulation.unitsConsumed),
390
+ contextSlot: toNumber(simulation.contextSlot),
391
+ error: simulation.err ?? undefined,
392
+ feeContextSlot: toNumber(fee.contextSlot),
393
+ };
394
+ }
395
+ const [fee, simulation] = await Promise.all([
396
+ resolved.rpc.getFeeForMessage(encodedMessage, { commitment, minContextSlot }).send(),
397
+ resolved.rpc.simulateTransaction(wireTransaction, {
398
+ commitment,
399
+ encoding: 'base64',
400
+ minContextSlot,
401
+ sigVerify: false,
402
+ }).send(),
403
+ ]);
404
+ return {
405
+ feeLamports: fee.value === null ? undefined : toNumber(fee.value),
406
+ logs: simulation.value.logs ?? undefined,
407
+ computeUnitsConsumed: simulation.value.unitsConsumed === undefined
408
+ ? undefined
409
+ : toNumber(simulation.value.unitsConsumed),
410
+ contextSlot: toNumber(simulation.context.slot),
411
+ error: simulation.value.err ?? undefined,
412
+ feeContextSlot: toNumber(fee.context.slot),
413
+ };
414
+ },
415
+ };
416
+ }
417
+
418
+ export { KitTransactionExecutionError, createWalletAdapter, fromAccountRole, fromKitInstruction, toAccountRole, toKitInstruction };
419
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":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,CAAC,GAAG,CAAC;AAC1C,gBAAA,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,cAAc,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC,CAAC,IAAI,EAAE;AACpF,gBAAA,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,eAAe,EAAE;oBAChD,UAAU;AACV,oBAAA,QAAQ,EAAE,QAAQ;oBAClB,cAAc;AACd,oBAAA,SAAS,EAAE,KAAK;iBACjB,CAAC,CAAC,IAAI,EAAE;AACV,aAAA,CAAC,CAAC;YAEH,OAAO;AACL,gBAAA,WAAW,EAAE,GAAG,CAAC,KAAK,KAAK,IAAI,GAAG,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;AACjE,gBAAA,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,IAAI,SAAS;AACxC,gBAAA,oBAAoB,EAAE,UAAU,CAAC,KAAK,CAAC,aAAa,KAAK,SAAS;AAChE,sBAAE,SAAS;sBACT,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC;gBAC5C,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC;AAC9C,gBAAA,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,GAAG,IAAI,SAAS;gBACxC,cAAc,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;aAC3C,CAAC;SACH;KACF,CAAC;AACJ;;;;"}
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@usearete/adapter-kit",
3
+ "version": "0.3.0",
4
+ "type": "module",
5
+ "description": "@solana/kit wallet adapter for the Arete SDK instruction boundary",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ }
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/AreteA4/arete.git",
19
+ "directory": "typescript/adapters/kit"
20
+ },
21
+ "scripts": {
22
+ "build": "rollup -c",
23
+ "dev": "rollup -c -w",
24
+ "lint": "eslint src/**/*.ts",
25
+ "typecheck": "tsc --noEmit",
26
+ "prepublishOnly": "npm run build",
27
+ "test": "vitest run",
28
+ "test:pack": "npm run build && node pack-smoke.mjs"
29
+ },
30
+ "keywords": [
31
+ "solana",
32
+ "kit",
33
+ "wallet",
34
+ "arete"
35
+ ],
36
+ "author": "Arete Team",
37
+ "license": "MIT",
38
+ "sideEffects": false,
39
+ "publishConfig": {
40
+ "access": "public"
41
+ },
42
+ "engines": {
43
+ "node": ">=20.18.0"
44
+ },
45
+ "peerDependencies": {
46
+ "@solana/kit": "^2.3.0",
47
+ "@usearete/sdk": "^0.3.0"
48
+ },
49
+ "devDependencies": {
50
+ "@rollup/plugin-typescript": "^11.0.0",
51
+ "@solana/kit": "2.3.0",
52
+ "@types/node": "^20.0.0",
53
+ "@usearete/sdk": "^0.3.0",
54
+ "rollup": "^3.0.0",
55
+ "rollup-plugin-dts": "^6.0.0",
56
+ "tslib": "^2.8.1",
57
+ "typescript": "^5.3.3",
58
+ "vite": "^6.4.3",
59
+ "vitest": "^1.0.0"
60
+ },
61
+ "files": [
62
+ "dist",
63
+ "README.md",
64
+ "LICENSE"
65
+ ]
66
+ }