@prb/effect-solana 1.0.0-beta.3 → 1.0.0-beta.5
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/README.md +48 -3
- package/dist/balance/index.js.map +1 -1
- package/dist/balance/service.d.ts +2 -2
- package/dist/balance/service.d.ts.map +1 -1
- package/dist/balance/service.js +3 -3
- package/dist/balance/service.js.map +1 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/core/errors/account.js.map +1 -1
- package/dist/core/errors/index.js.map +1 -1
- package/dist/core/errors/predicates.js.map +1 -1
- package/dist/core/errors/rpc.js.map +1 -1
- package/dist/core/errors/transaction.js.map +1 -1
- package/dist/core/errors/wallet.js.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/kit-effect.d.ts +2 -2
- package/dist/internal/kit-effect.d.ts.map +1 -1
- package/dist/internal/kit-effect.js +1 -1
- package/dist/internal/kit-effect.js.map +1 -1
- package/dist/pda/index.js.map +1 -1
- package/dist/pda/service.js +1 -1
- package/dist/pda/service.js.map +1 -1
- package/dist/pda/types.js.map +1 -1
- package/dist/presets/index.js.map +1 -1
- package/dist/presets/layers.d.ts +10 -10
- package/dist/presets/layers.d.ts.map +1 -1
- package/dist/presets/layers.js +8 -8
- package/dist/presets/layers.js.map +1 -1
- package/dist/program/index.d.ts +1 -0
- package/dist/program/index.d.ts.map +1 -1
- package/dist/program/index.js +1 -0
- package/dist/program/index.js.map +1 -1
- package/dist/program/internal/anchor-helpers.d.ts +20 -0
- package/dist/program/internal/anchor-helpers.d.ts.map +1 -0
- package/dist/program/internal/anchor-helpers.js +64 -0
- package/dist/program/internal/anchor-helpers.js.map +1 -0
- package/dist/program/reader.d.ts +19 -0
- package/dist/program/reader.d.ts.map +1 -0
- package/dist/program/reader.js +288 -0
- package/dist/program/reader.js.map +1 -0
- package/dist/program/service.d.ts +1 -1
- package/dist/program/service.d.ts.map +1 -1
- package/dist/program/service.js +18 -37
- package/dist/program/service.js.map +1 -1
- package/dist/program/types.d.ts +48 -13
- package/dist/program/types.d.ts.map +1 -1
- package/dist/program/types.js +27 -28
- package/dist/program/types.js.map +1 -1
- package/dist/react-hooks/index.js.map +1 -1
- package/dist/react-hooks/internal/error.js.map +1 -1
- package/dist/react-hooks/internal/is-dev.js.map +1 -1
- package/dist/react-hooks/internal/runtime.js.map +1 -1
- package/dist/react-hooks/internal/scoped-run.js.map +1 -1
- package/dist/react-hooks/internal/stable.js.map +1 -1
- package/dist/react-hooks/primitives/use-effect-memo-factory.js.map +1 -1
- package/dist/react-hooks/primitives/use-effect.js.map +1 -1
- package/dist/react-hooks/primitives/use-fork-effect.js.map +1 -1
- package/dist/react-hooks/primitives/use-stream.js.map +1 -1
- package/dist/react-hooks/primitives.js.map +1 -1
- package/dist/react-hooks/provider.js.map +1 -1
- package/dist/rpc/index.js.map +1 -1
- package/dist/rpc/service.d.ts +2 -2
- package/dist/rpc/service.d.ts.map +1 -1
- package/dist/rpc/service.js +1 -1
- package/dist/rpc/service.js.map +1 -1
- package/dist/signer/index.js.map +1 -1
- package/dist/signer/service.d.ts +1 -1
- package/dist/signer/service.d.ts.map +1 -1
- package/dist/signer/service.js +2 -2
- package/dist/signer/service.js.map +1 -1
- package/dist/telemetry/index.js.map +1 -1
- package/dist/telemetry/logger.js.map +1 -1
- package/dist/telemetry/tracer.d.ts +3 -0
- package/dist/telemetry/tracer.d.ts.map +1 -1
- package/dist/telemetry/tracer.js +3 -0
- package/dist/telemetry/tracer.js.map +1 -1
- package/dist/testing-kit/_fixtures/addresses.js.map +1 -1
- package/dist/testing-kit/helpers.js.map +1 -1
- package/dist/testing-kit/index.js.map +1 -1
- package/dist/testing-kit/mock-balance-service.d.ts +2 -2
- package/dist/testing-kit/mock-balance-service.d.ts.map +1 -1
- package/dist/testing-kit/mock-balance-service.js +1 -1
- package/dist/testing-kit/mock-balance-service.js.map +1 -1
- package/dist/testing-kit/mock-pda-service.d.ts +2 -2
- package/dist/testing-kit/mock-pda-service.d.ts.map +1 -1
- package/dist/testing-kit/mock-pda-service.js +1 -1
- package/dist/testing-kit/mock-pda-service.js.map +1 -1
- package/dist/testing-kit/mock-rpc-service.d.ts +3 -3
- package/dist/testing-kit/mock-rpc-service.d.ts.map +1 -1
- package/dist/testing-kit/mock-rpc-service.js +2 -2
- package/dist/testing-kit/mock-rpc-service.js.map +1 -1
- package/dist/testing-kit/mock-signer-service.d.ts +3 -3
- package/dist/testing-kit/mock-signer-service.d.ts.map +1 -1
- package/dist/testing-kit/mock-signer-service.js +2 -2
- package/dist/testing-kit/mock-signer-service.js.map +1 -1
- package/dist/testing-kit/mock-token-service.d.ts +3 -3
- package/dist/testing-kit/mock-token-service.d.ts.map +1 -1
- package/dist/testing-kit/mock-token-service.js +1 -1
- package/dist/testing-kit/mock-token-service.js.map +1 -1
- package/dist/testing-kit/mock-transaction-service.d.ts +7 -8
- package/dist/testing-kit/mock-transaction-service.d.ts.map +1 -1
- package/dist/testing-kit/mock-transaction-service.js +1 -1
- package/dist/testing-kit/mock-transaction-service.js.map +1 -1
- package/dist/testing-kit/test-layer.d.ts +11 -7
- package/dist/testing-kit/test-layer.d.ts.map +1 -1
- package/dist/testing-kit/test-layer.js +12 -5
- package/dist/testing-kit/test-layer.js.map +1 -1
- package/dist/token/index.js.map +1 -1
- package/dist/token/service.d.ts +2 -2
- package/dist/token/service.d.ts.map +1 -1
- package/dist/token/service.js +4 -4
- package/dist/token/service.js.map +1 -1
- package/dist/tx/index.js.map +1 -1
- package/dist/tx/service.d.ts +9 -10
- package/dist/tx/service.d.ts.map +1 -1
- package/dist/tx/service.js +4 -4
- package/dist/tx/service.js.map +1 -1
- package/dist/tx/types.d.ts +2 -0
- package/dist/tx/types.d.ts.map +1 -1
- package/dist/tx/types.js.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/web3.js/_fixtures.js.map +1 -1
- package/dist/web3.js/index.js.map +1 -1
- package/dist/web3.js/layers.d.ts +9 -9
- package/dist/web3.js/layers.d.ts.map +1 -1
- package/dist/web3.js/layers.js +1 -1
- package/dist/web3.js/layers.js.map +1 -1
- package/dist/web3.js/legacy-signer.d.ts +1 -1
- package/dist/web3.js/legacy-signer.d.ts.map +1 -1
- package/dist/web3.js/legacy-signer.js +3 -3
- package/dist/web3.js/legacy-signer.js.map +1 -1
- package/dist/web3.js/transaction-bridge.js.map +1 -1
- package/dist/web3.js/types.js.map +1 -1
- package/package.json +38 -22
package/dist/tx/service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/tx/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAI1C,OAAO,EACL,oCAAoC,EACpC,wBAAwB,EACxB,6BAA6B,EAC7B,2CAA2C,GAC5C,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,kBAAkB,EAClB,+BAA+B,EAC/B,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iCAAiC,EACjC,iCAAiC,GAClC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEpE,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AA4GrD,MAAM,OAAO,kBAAmB,SAAQ,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,EAG9E;CAAG;AAKN,MAAM,sBAAsB,GAAG,CAC7B,MAEC,EACD,UAAmD,EAC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SAAS,CAAC,WAAW,CAAC,CAAC;KAClD,CAAC;IAEF,OAAO,kBAAkB,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC,CAAC,CACH,CAAC","sourcesContent":["import { pipe } from \"@solana/functional\";\nimport type { Instruction } from \"@solana/instructions\";\nimport type { Signature } from \"@solana/keys\";\nimport {\n appendTransactionMessageInstructions,\n createTransactionMessage,\n setTransactionMessageFeePayer,\n setTransactionMessageLifetimeUsingBlockhash,\n} from \"@solana/transaction-messages\";\nimport type { Transaction, TransactionWithLifetime } from \"@solana/transactions\";\nimport {\n compileTransaction,\n getBase64EncodedWireTransaction,\n getSignatureFromTransaction,\n} from \"@solana/transactions\";\nimport {\n getSetComputeUnitLimitInstruction,\n getSetComputeUnitPriceInstruction,\n} from \"@solana-program/compute-budget\";\nimport { Context, Duration, Effect, Layer, Schedule } from \"effect\";\nimport type { WalletNotConnectedError } from \"#src/core/errors/index.js\";\nimport {\n SignatureError,\n SimulationFailedError,\n TransactionFailedError,\n TransactionSendError,\n TransactionTimeoutError,\n} from \"#src/core/errors/index.js\";\nimport type { RpcServiceShape } from \"#src/rpc/index.js\";\nimport { RpcService } from \"#src/rpc/index.js\";\nimport { SignerService } from \"#src/signer/index.js\";\nimport { SpanNames } from \"#src/telemetry/index.js\";\nimport type {\n ComputeBudgetConfig,\n ConfirmOpts,\n SignableTransactionMessage,\n TransactionBatchItem,\n TransactionBatchOpts,\n TransactionBuildOpts,\n TransactionReceipt,\n} from \"./types.js\";\n\n/**\n * Shape of the TransactionService for type inference.\n *\n * @category Services\n */\nexport type TransactionServiceShape = {\n /**\n * Build a transaction from instructions.\n */\n readonly build: (\n instructions: readonly Instruction[],\n opts?: TransactionBuildOpts\n ) => Effect.Effect<SignableTransactionMessage, TransactionSendError | WalletNotConnectedError>;\n\n /**\n * Sign multiple transactions in a batch.\n */\n readonly signAll: (\n txs: readonly SignableTransactionMessage[]\n ) => Effect.Effect<\n readonly (Transaction & TransactionWithLifetime)[],\n TransactionSendError | WalletNotConnectedError\n >;\n\n /**\n * Sign a transaction.\n */\n readonly sign: <T extends SignableTransactionMessage>(\n tx: T\n ) => Effect.Effect<\n Transaction & TransactionWithLifetime,\n TransactionSendError | WalletNotConnectedError\n >;\n\n /**\n * Send multiple signed transactions.\n */\n readonly sendAll: (\n txs: readonly (Transaction & TransactionWithLifetime)[],\n opts?: TransactionBatchOpts\n ) => Effect.Effect<readonly Signature[], TransactionSendError>;\n\n /**\n * Send a signed transaction.\n */\n readonly send: (\n tx: Transaction & TransactionWithLifetime\n ) => Effect.Effect<Signature, TransactionSendError>;\n\n /**\n * Confirm a transaction by signature.\n */\n readonly confirm: (\n signature: Signature,\n opts?: ConfirmOpts\n ) => Effect.Effect<TransactionReceipt, TransactionTimeoutError | TransactionFailedError>;\n\n /**\n * Build, sign, send, and confirm a transaction.\n */\n readonly sendAndConfirm: (\n instructions: readonly Instruction[],\n opts?: ConfirmOpts & { computeBudget?: ComputeBudgetConfig }\n ) => Effect.Effect<\n TransactionReceipt,\n | TransactionSendError\n | WalletNotConnectedError\n | TransactionTimeoutError\n | TransactionFailedError\n >;\n\n /**\n * Build, sign, send, and confirm a batch of transactions.\n */\n readonly sendAndConfirmBatch: (\n items: readonly TransactionBatchItem[],\n opts?: TransactionBatchOpts\n ) => Effect.Effect<\n readonly TransactionReceipt[],\n | TransactionSendError\n | WalletNotConnectedError\n | TransactionTimeoutError\n | TransactionFailedError\n >;\n\n /**\n * Simulate a transaction.\n */\n readonly simulate: <T extends SignableTransactionMessage>(\n tx: T\n ) => Effect.Effect<void, SimulationFailedError | TransactionSendError | WalletNotConnectedError>;\n};\n\n/**\n * Service tag for transaction operations.\n *\n * @category Services\n */\nexport class TransactionService extends Context.Tag(\"esolana/TransactionService\")<\n TransactionService,\n TransactionServiceShape\n>() {}\n\n/**\n * Check if a transaction has reached the desired confirmation level.\n */\nconst hasReachedConfirmation = (\n status: {\n confirmationStatus?: \"processed\" | \"confirmed\" | \"finalized\" | null;\n },\n commitment: \"processed\" | \"confirmed\" | \"finalized\"\n): boolean => {\n if (commitment === \"processed\") {\n return true;\n }\n if (commitment === \"confirmed\") {\n return status.confirmationStatus === \"confirmed\" || status.confirmationStatus === \"finalized\";\n }\n return status.confirmationStatus === \"finalized\";\n};\n\n/**\n * Check signature status and return receipt if confirmed.\n */\nconst checkSignatureStatus = (\n rpc: Effect.Effect.Success<ReturnType<RpcServiceShape[\"getRpc\"]>>,\n signature: Signature,\n commitment: \"processed\" | \"confirmed\" | \"finalized\"\n): Effect.Effect<TransactionReceipt | null, TransactionFailedError> =>\n Effect.gen(function* () {\n const response = yield* Effect.tryPromise({\n catch: (cause) =>\n new TransactionFailedError({\n cause,\n logs: [],\n message: \"Failed to get signature status\",\n signature,\n }),\n try: () => rpc.getSignatureStatuses([signature]).send(),\n });\n\n const status = response?.value?.[0];\n if (!status) {\n return null;\n }\n\n if (status.err) {\n return yield* Effect.fail(\n new TransactionFailedError({\n logs: [],\n message: \"Transaction failed on-chain\",\n signature,\n })\n );\n }\n\n if (hasReachedConfirmation(status, commitment)) {\n return {\n confirmations: status.confirmations !== null ? BigInt(status.confirmations) : null,\n signature,\n slot: BigInt(status.slot),\n };\n }\n\n return null;\n });\n\nconst buildComputeBudgetInstructions = (config?: ComputeBudgetConfig): readonly Instruction[] => {\n if (!config) {\n return [];\n }\n\n const instructions: Instruction[] = [];\n\n if (config.unitLimit !== undefined) {\n instructions.push(getSetComputeUnitLimitInstruction({ units: config.unitLimit }));\n }\n\n if (config.microLamports !== undefined) {\n instructions.push(getSetComputeUnitPriceInstruction({ microLamports: config.microLamports }));\n }\n\n return instructions;\n};\n\n/**\n * Create a TransactionService layer.\n *\n * @category Layers\n */\nexport const TransactionServiceLive = Layer.effect(\n TransactionService,\n Effect.gen(function* () {\n const rpcService = yield* RpcService;\n const signerService = yield* SignerService;\n\n const service: TransactionServiceShape = {\n build: (instructions, opts) =>\n Effect.gen(function* () {\n const rpc = yield* rpcService.getRpc();\n const address = yield* signerService.getAddress();\n const computeBudgetInstructions = buildComputeBudgetInstructions(opts?.computeBudget);\n\n // Get latest blockhash\n const { value: latestBlockhash } = yield* Effect.tryPromise({\n catch: (cause) =>\n new TransactionSendError({\n cause,\n message: \"Failed to get latest blockhash\",\n }),\n try: () => rpc.getLatestBlockhash().send(),\n });\n\n // Build transaction message\n const message = pipe(\n createTransactionMessage({ version: 0 }),\n (m) => setTransactionMessageFeePayer(address, m),\n (m) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, m),\n (m) =>\n appendTransactionMessageInstructions(\n [...computeBudgetInstructions, ...instructions],\n m\n )\n );\n\n return message;\n }).pipe(Effect.withSpan(SpanNames.TX_BUILD)),\n\n confirm: (signature, opts) =>\n Effect.gen(function* () {\n const rpc = yield* rpcService.getRpc();\n const commitment = opts?.commitment ?? \"confirmed\";\n const timeout = opts?.timeout ?? 60_000;\n\n // Poll for confirmation with retry logic\n const pollEffect = checkSignatureStatus(rpc, signature, commitment).pipe(\n Effect.flatMap((receipt) =>\n receipt ? Effect.succeed(receipt) : Effect.fail(\"not-confirmed\")\n )\n );\n\n // Retry with spaced intervals until timeout\n const retrySchedule = Schedule.spaced(\"2 seconds\");\n\n return yield* pollEffect.pipe(\n Effect.retry(retrySchedule),\n Effect.timeout(`${timeout} millis`),\n Effect.catchTag(\"TimeoutException\", () =>\n Effect.fail(\n new TransactionTimeoutError({\n message: `Transaction confirmation timed out after ${timeout}ms`,\n signature,\n })\n )\n ),\n Effect.catchAll(\n (error): Effect.Effect<never, TransactionFailedError | TransactionTimeoutError> => {\n // Let TransactionFailedError propagate\n if (error instanceof TransactionFailedError) {\n return Effect.fail(error);\n }\n // Convert \"not-confirmed\" string to TransactionTimeoutError\n return Effect.fail(\n new TransactionTimeoutError({\n message: `Transaction confirmation timed out after ${timeout}ms`,\n signature,\n })\n );\n }\n )\n );\n }).pipe(Effect.withSpan(SpanNames.TX_CONFIRM)),\n\n send: (tx) =>\n Effect.gen(function* () {\n const rpc = yield* rpcService.getRpc();\n const signature = getSignatureFromTransaction(tx);\n\n const wireTransaction = getBase64EncodedWireTransaction(tx);\n\n yield* Effect.tryPromise({\n catch: (cause) =>\n new TransactionSendError({\n cause,\n message: \"Failed to send transaction\",\n signature,\n }),\n try: () =>\n rpc\n .sendTransaction(wireTransaction, { encoding: \"base64\", skipPreflight: false })\n .send(),\n });\n\n return signature;\n }).pipe(Effect.withSpan(SpanNames.TX_SEND)),\n\n sendAll: (txs, opts) =>\n Effect.gen(function* () {\n const retries = opts?.sendRetries ?? 0;\n const retryDelay = opts?.sendRetryDelay ?? 500;\n\n const sendWithRetry = (tx: Transaction & TransactionWithLifetime) => {\n const sendEffect = service.send(tx);\n\n if (retries <= 0) {\n return sendEffect;\n }\n\n const retrySchedule = pipe(\n Schedule.recurs(retries),\n Schedule.addDelay(() => Duration.millis(retryDelay))\n );\n\n return sendEffect.pipe(Effect.retry(retrySchedule));\n };\n\n return yield* Effect.forEach(\n txs,\n (tx) => sendWithRetry(tx),\n opts?.concurrency ? { concurrency: opts.concurrency } : undefined\n );\n }).pipe(Effect.withSpan(SpanNames.TX_SEND)),\n\n sendAndConfirm: (instructions, opts) =>\n Effect.gen(function* () {\n const tx = yield* service.build(instructions, {\n computeBudget: opts?.computeBudget,\n });\n const signed = yield* service.sign(tx);\n const signature = yield* service.send(signed);\n return yield* service.confirm(signature, opts);\n }).pipe(Effect.withSpan(SpanNames.TX_SEND_AND_CONFIRM)),\n\n sendAndConfirmBatch: (items, opts) =>\n Effect.gen(function* () {\n const built = yield* Effect.forEach(\n items,\n (item) => service.build(item.instructions, { computeBudget: item.computeBudget }),\n opts?.concurrency ? { concurrency: opts.concurrency } : undefined\n );\n\n const signed = yield* service.signAll(built);\n const signatures = yield* service.sendAll(signed, opts);\n\n return yield* Effect.forEach(\n signatures,\n (signature) => service.confirm(signature, opts?.confirm),\n opts?.concurrency ? { concurrency: opts.concurrency } : undefined\n );\n }).pipe(Effect.withSpan(SpanNames.TX_SEND_AND_CONFIRM)),\n\n sign: (tx) =>\n Effect.gen(function* () {\n const compiled = compileTransaction(tx);\n // Cast to the expected type for signTransaction\n const typed = compiled as unknown as Transaction & TransactionWithLifetime;\n return yield* signerService\n .signTransaction(typed)\n .pipe(\n Effect.mapError((error) =>\n error instanceof SignatureError\n ? new TransactionSendError({ cause: error, message: error.message })\n : error\n )\n );\n }).pipe(Effect.withSpan(SpanNames.TX_SIGN)),\n\n signAll: (txs) =>\n Effect.gen(function* () {\n const compiled = txs.map(\n (tx) => compileTransaction(tx) as Transaction & TransactionWithLifetime\n );\n return (yield* signerService\n .signAllTransactions(compiled)\n .pipe(\n Effect.mapError((error) =>\n error instanceof SignatureError\n ? new TransactionSendError({ cause: error, message: error.message })\n : error\n )\n )) as readonly (Transaction & TransactionWithLifetime)[];\n }).pipe(Effect.withSpan(SpanNames.TX_SIGN)),\n\n simulate: (tx) =>\n Effect.gen(function* () {\n const rpc = yield* rpcService.getRpc();\n const compiled = compileTransaction(tx);\n // Cast to the expected type for signTransaction\n const typed = compiled as unknown as Transaction & TransactionWithLifetime;\n const signed = yield* signerService\n .signTransaction(typed)\n .pipe(\n Effect.mapError((error) =>\n error instanceof SignatureError\n ? new TransactionSendError({ cause: error, message: error.message })\n : error\n )\n );\n\n const wireTransaction = getBase64EncodedWireTransaction(signed);\n\n const result = yield* Effect.tryPromise({\n catch: (cause) =>\n new SimulationFailedError({\n cause,\n message: \"Simulation failed\",\n }),\n try: () => rpc.simulateTransaction(wireTransaction, { encoding: \"base64\" }).send(),\n });\n\n if (result.value.err) {\n return yield* Effect.fail(\n new SimulationFailedError({\n logs: result.value.logs ?? [],\n message: \"Simulation failed with error\",\n })\n );\n }\n }).pipe(Effect.withSpan(SpanNames.TX_SIMULATE)),\n };\n\n return TransactionService.of(service);\n })\n);\n"]}
|
package/dist/tx/types.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Instruction } from "@solana/instructions";
|
|
2
2
|
import type { Signature } from "@solana/keys";
|
|
3
|
+
import type { TransactionMessage, TransactionMessageWithFeePayer, TransactionMessageWithLifetime } from "@solana/transaction-messages";
|
|
4
|
+
export type SignableTransactionMessage = TransactionMessage & TransactionMessageWithFeePayer & TransactionMessageWithLifetime;
|
|
3
5
|
export type ConfirmOpts = {
|
|
4
6
|
readonly commitment?: "processed" | "confirmed" | "finalized";
|
|
5
7
|
readonly timeout?: number;
|
package/dist/tx/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tx/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tx/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EACV,kBAAkB,EAClB,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,8BAA8B,CAAC;AAOtC,MAAM,MAAM,0BAA0B,GAAG,kBAAkB,GACzD,8BAA8B,GAC9B,8BAA8B,CAAC;AAOjC,MAAM,MAAM,WAAW,GAAG;IAKxB,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;IAM9D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAOF,MAAM,MAAM,mBAAmB,GAAG;IAIhC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAK5B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1C,CAAC;AAOF,MAAM,MAAM,oBAAoB,GAAG;IAIjC,QAAQ,CAAC,aAAa,CAAC,EAAE,mBAAmB,CAAC;CAC9C,CAAC;AAOF,MAAM,MAAM,oBAAoB,GAAG;IAIjC,QAAQ,CAAC,YAAY,EAAE,SAAS,WAAW,EAAE,CAAC;IAK9C,QAAQ,CAAC,aAAa,CAAC,EAAE,mBAAmB,CAAC;CAC9C,CAAC;AAOF,MAAM,MAAM,oBAAoB,GAAG;IAKjC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAM9B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAM9B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAKjC,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;CAChC,CAAC;AAOF,MAAM,MAAM,kBAAkB,GAAG;IAI/B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAK9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAKtB,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC,CAAC"}
|
package/dist/tx/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tx/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tx/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Instruction } from \"@solana/instructions\";\nimport type { Signature } from \"@solana/keys\";\nimport type {\n TransactionMessage,\n TransactionMessageWithFeePayer,\n TransactionMessageWithLifetime,\n} from \"@solana/transaction-messages\";\n\n/**\n * A transaction message shape that is ready to compile/sign/send.\n *\n * @category Types\n */\nexport type SignableTransactionMessage = TransactionMessage &\n TransactionMessageWithFeePayer &\n TransactionMessageWithLifetime;\n\n/**\n * Options for confirming a transaction.\n *\n * @category Types\n */\nexport type ConfirmOpts = {\n /**\n * Commitment level for confirmation.\n * @default \"confirmed\"\n */\n readonly commitment?: \"processed\" | \"confirmed\" | \"finalized\";\n\n /**\n * Timeout in milliseconds for confirmation.\n * @default 60000 (60 seconds)\n */\n readonly timeout?: number;\n};\n\n/**\n * Compute budget configuration for transactions.\n *\n * @category Types\n */\nexport type ComputeBudgetConfig = {\n /**\n * Compute unit limit.\n */\n readonly unitLimit?: number;\n\n /**\n * Compute unit price in micro-lamports.\n */\n readonly microLamports?: number | bigint;\n};\n\n/**\n * Options for building a transaction.\n *\n * @category Types\n */\nexport type TransactionBuildOpts = {\n /**\n * Optional compute budget settings.\n */\n readonly computeBudget?: ComputeBudgetConfig;\n};\n\n/**\n * A batch item representing a transaction to build.\n *\n * @category Types\n */\nexport type TransactionBatchItem = {\n /**\n * Transaction instructions.\n */\n readonly instructions: readonly Instruction[];\n\n /**\n * Optional compute budget settings.\n */\n readonly computeBudget?: ComputeBudgetConfig;\n};\n\n/**\n * Options for batch transaction orchestration.\n *\n * @category Types\n */\nexport type TransactionBatchOpts = {\n /**\n * Concurrency for sending/confirming transactions.\n * @default 1 (sequential)\n */\n readonly concurrency?: number;\n\n /**\n * Retry count for send failures.\n * @default 0\n */\n readonly sendRetries?: number;\n\n /**\n * Delay between send retries in milliseconds.\n * @default 500\n */\n readonly sendRetryDelay?: number;\n\n /**\n * Confirmation options for each transaction.\n */\n readonly confirm?: ConfirmOpts;\n};\n\n/**\n * Receipt returned after a transaction is confirmed.\n *\n * @category Types\n */\nexport type TransactionReceipt = {\n /**\n * The transaction signature.\n */\n readonly signature: Signature;\n\n /**\n * The slot at which the transaction was confirmed.\n */\n readonly slot: bigint;\n\n /**\n * Number of confirmations. Null if not yet finalized.\n */\n readonly confirmations: bigint | null;\n};\n"]}
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type definitions for Solana integration.\n *\n * Re-exports key types from @solana/kit and defines custom types.\n *\n * @module\n */\n\n// =============================================================================\n// Re-exports from @solana/kit\n// =============================================================================\n\nexport type {\n Address,\n Commitment,\n Lamports,\n Signature,\n TransactionError,\n} from \"@solana/kit\";\nexport type { TransactionSigner } from \"@solana/signers\";\n\n// =============================================================================\n// Cluster Configuration\n// =============================================================================\n\n/**\n * Solana cluster environments.\n */\nexport type Cluster = \"mainnet-beta\" | \"devnet\" | \"testnet\" | \"localnet\";\n\n/**\n * Configuration for a Solana cluster connection.\n */\nexport type ClusterConfig = {\n readonly cluster: Cluster;\n readonly rpcUrl: string;\n readonly wsUrl?: string;\n};\n\n// =============================================================================\n// Custom Branded Types\n// =============================================================================\n\n/**\n * Microlamports (1 lamport = 1,000,000 microlamports).\n * Used for priority fees in compute budget instructions.\n */\nexport type Microlamports = bigint & { readonly _brand: \"Microlamports\" };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_fixtures.js","sourceRoot":"","sources":["../../src/web3.js/_fixtures.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,OAAO,EACP,WAAW,IAAI,iBAAiB,EAChC,SAAS,EACT,aAAa,EACb,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAKzB,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAC1C,IAAI,UAAU,CAAC;IACb,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IAC7F,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE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G,IAAI,kBAAkB,CAAC;QACvC,YAAY,EAAE,CAAC,WAAW,CAAC;QAC3B,QAAQ,EAAE,YAAY,CAAC,SAAS;QAChC,eAAe,EAAE,8CAA8C;KAChE,CAAC,CAAC,kBAAkB,EAAE,CAAC;IAExB,OAAO,IAAI,oBAAoB,CAAC,SAAS,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["/**\n * Shared test fixtures for web3.js compatibility tests.\n *\n * @module\n * @internal\n */\n\nimport {\n Keypair,\n Transaction as LegacyTransaction,\n PublicKey,\n SystemProgram,\n TransactionInstruction,\n TransactionMessage,\n VersionedTransaction,\n} from \"@solana/web3.js\";\n\n/**\n * Deterministic test keypair for signing transactions.\n */\nexport const TEST_KEYPAIR = Keypair.fromSeed(\n new Uint8Array([\n 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,\n 27, 28, 29, 30, 31, 32,\n ])\n);\n\n/**\n * Creates a basic legacy Transaction with a single instruction.\n *\n * @returns A Legacy Transaction ready for testing\n *\n * @example\n * ```typescript\n * const tx = createLegacyTransaction();\n * const kitTx = fromWeb3Transaction(tx);\n * ```\n */\nexport function createLegacyTransaction(): LegacyTransaction {\n const tx = new LegacyTransaction();\n tx.add(\n new TransactionInstruction({\n data: Buffer.from([0, 0, 0, 0]),\n keys: [],\n programId: SystemProgram.programId,\n })\n );\n tx.recentBlockhash = \"GH7ome3EiwEr7tu9JuTh2dpYWBJK3z69Xm1ZE3MEE6JC\";\n tx.feePayer = new PublicKey(\"11111111111111111111111111111111\");\n return tx;\n}\n\n/**\n * Creates a VersionedTransaction with a v0 message.\n *\n * @returns A VersionedTransaction ready for testing\n *\n * @example\n * ```typescript\n * const versionedTx = createVersionedTransaction();\n * const kitTx = fromWeb3Transaction(versionedTx);\n * ```\n */\nexport function createVersionedTransaction(): VersionedTransaction {\n const instruction = new TransactionInstruction({\n data: Buffer.from([0, 0, 0, 0]),\n keys: [],\n programId: SystemProgram.programId,\n });\n\n const messageV0 = new TransactionMessage({\n instructions: [instruction],\n payerKey: TEST_KEYPAIR.publicKey,\n recentBlockhash: \"GH7ome3EiwEr7tu9JuTh2dpYWBJK3z69Xm1ZE3MEE6JC\",\n }).compileToV0Message();\n\n return new VersionedTransaction(messageV0);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web3.js/index.ts"],"names":[],"mappings":"AA2BA,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web3.js/index.ts"],"names":[],"mappings":"AA2BA,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC","sourcesContent":["/**\n * Legacy @solana/web3.js compatibility layer.\n *\n * This module provides utilities for bridging between legacy @solana/web3.js v1.x\n * wallet adapters and the modern @solana/kit v2.x types used by @prb/effect-solana.\n *\n * @module @prb/effect-solana/compat\n *\n * @remarks\n * Requires `@solana/web3.js` v1.95.0+ to be installed as a peer dependency.\n *\n * @example\n * ```typescript\n * import { makeSolanaLayerWithLegacyAdapter } from \"@prb/effect-solana/compat\";\n *\n * const layer = makeSolanaLayerWithLegacyAdapter(\n * { cluster: \"devnet\" },\n * () => ({\n * publicKey: walletProvider?.publicKey ?? null,\n * connected: !!walletProvider?.publicKey,\n * signTransaction: walletProvider.signTransaction.bind(walletProvider),\n * signAllTransactions: walletProvider.signAllTransactions.bind(walletProvider),\n * })\n * );\n * ```\n */\n\nexport * from \"./layers.js\";\nexport * from \"./legacy-signer.js\";\nexport * from \"./transaction-bridge.js\";\nexport * from \"./types.js\";\n"]}
|
package/dist/web3.js/layers.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Layer } from "effect";
|
|
2
|
-
import type { BalanceService } from "
|
|
3
|
-
import type { PdaService } from "
|
|
4
|
-
import type { SolanaClusterConfig } from "
|
|
5
|
-
import type { ProgramWriter } from "
|
|
6
|
-
import type { RpcService } from "
|
|
7
|
-
import type { SignerService } from "
|
|
8
|
-
import type { TokenService } from "
|
|
9
|
-
import type { TransactionService } from "
|
|
2
|
+
import type { BalanceService } from "#src/balance/index.js";
|
|
3
|
+
import type { PdaService } from "#src/pda/index.js";
|
|
4
|
+
import type { SolanaClusterConfig } from "#src/presets/index.js";
|
|
5
|
+
import type { ProgramReader, ProgramWriter } from "#src/program/index.js";
|
|
6
|
+
import type { RpcService } from "#src/rpc/index.js";
|
|
7
|
+
import type { SignerService } from "#src/signer/index.js";
|
|
8
|
+
import type { TokenService } from "#src/token/index.js";
|
|
9
|
+
import type { TransactionService } from "#src/tx/index.js";
|
|
10
10
|
import type { LegacyWalletAdapter } from "./types.js";
|
|
11
|
-
export declare function makeSolanaLayerWithLegacyAdapter(config: SolanaClusterConfig, getAdapter: () => LegacyWalletAdapter): Layer.Layer<RpcService | SignerService | BalanceService | TokenService | TransactionService | PdaService | ProgramWriter>;
|
|
11
|
+
export declare function makeSolanaLayerWithLegacyAdapter(config: SolanaClusterConfig, getAdapter: () => LegacyWalletAdapter): Layer.Layer<RpcService | SignerService | BalanceService | TokenService | TransactionService | PdaService | ProgramReader | ProgramWriter>;
|
|
12
12
|
//# sourceMappingURL=layers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layers.d.ts","sourceRoot":"","sources":["../../src/web3.js/layers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"layers.d.ts","sourceRoot":"","sources":["../../src/web3.js/layers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AA6BtD,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,mBAAmB,EAC3B,UAAU,EAAE,MAAM,mBAAmB,GACpC,KAAK,CAAC,KAAK,CACV,UAAU,GACV,aAAa,GACb,cAAc,GACd,YAAY,GACZ,kBAAkB,GAClB,UAAU,GACV,aAAa,GACb,aAAa,CAChB,CAOA"}
|
package/dist/web3.js/layers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Layer } from "effect";
|
|
2
|
-
import { effectSolanaServices, makeRpcLayer } from "
|
|
2
|
+
import { effectSolanaServices, makeRpcLayer } from "#src/presets/index.js";
|
|
3
3
|
import { makeSignerServiceFromLegacyAdapter } from "./legacy-signer.js";
|
|
4
4
|
export function makeSolanaLayerWithLegacyAdapter(config, getAdapter) {
|
|
5
5
|
const rpcLayer = makeRpcLayer(config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layers.js","sourceRoot":"","sources":["../../src/web3.js/layers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAI/B,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"layers.js","sourceRoot":"","sources":["../../src/web3.js/layers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAI/B,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAM3E,OAAO,EAAE,kCAAkC,EAAE,MAAM,oBAAoB,CAAC;AA8BxE,MAAM,UAAU,gCAAgC,CAC9C,MAA2B,EAC3B,UAAqC;IAWrC,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,WAAW,GAAG,kCAAkC,CAAC,UAAU,CAAC,CAAC;IAEnE,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAEzD,OAAO,KAAK,CAAC,YAAY,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["import { Layer } from \"effect\";\nimport type { BalanceService } from \"#src/balance/index.js\";\nimport type { PdaService } from \"#src/pda/index.js\";\nimport type { SolanaClusterConfig } from \"#src/presets/index.js\";\nimport { effectSolanaServices, makeRpcLayer } from \"#src/presets/index.js\";\nimport type { ProgramReader, ProgramWriter } from \"#src/program/index.js\";\nimport type { RpcService } from \"#src/rpc/index.js\";\nimport type { SignerService } from \"#src/signer/index.js\";\nimport type { TokenService } from \"#src/token/index.js\";\nimport type { TransactionService } from \"#src/tx/index.js\";\nimport { makeSignerServiceFromLegacyAdapter } from \"./legacy-signer.js\";\nimport type { LegacyWalletAdapter } from \"./types.js\";\n\n/**\n * Create a complete Solana layer using a legacy wallet adapter.\n *\n * This is a convenience factory that combines RPC, signer, and all service layers\n * for use with legacy @solana/web3.js wallet adapters (like @reown/appkit-adapter-solana).\n *\n * @param config - Cluster configuration\n * @param getAdapter - Function that returns the current wallet adapter\n * @returns A Layer providing all Solana services\n *\n * @category Compatibility\n *\n * @example\n * ```typescript\n * import { makeSolanaLayerWithLegacyAdapter } from \"@prb/effect-solana/compat\";\n *\n * const layer = makeSolanaLayerWithLegacyAdapter(\n * { cluster: \"devnet\" },\n * () => ({\n * publicKey: walletProvider?.publicKey ?? null,\n * connected: !!walletProvider?.publicKey,\n * signTransaction: walletProvider.signTransaction.bind(walletProvider),\n * signAllTransactions: walletProvider.signAllTransactions.bind(walletProvider),\n * })\n * );\n * ```\n */\nexport function makeSolanaLayerWithLegacyAdapter(\n config: SolanaClusterConfig,\n getAdapter: () => LegacyWalletAdapter\n): Layer.Layer<\n | RpcService\n | SignerService\n | BalanceService\n | TokenService\n | TransactionService\n | PdaService\n | ProgramReader\n | ProgramWriter\n> {\n const rpcLayer = makeRpcLayer(config);\n const signerLayer = makeSignerServiceFromLegacyAdapter(getAdapter);\n\n const baseLayers = Layer.mergeAll(rpcLayer, signerLayer);\n\n return Layer.provideMerge(effectSolanaServices, baseLayers);\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Layer } from "effect";
|
|
2
|
-
import { SignerService } from "
|
|
2
|
+
import { SignerService } from "#src/signer/index.js";
|
|
3
3
|
import type { LegacyWalletAdapter } from "./types.js";
|
|
4
4
|
export declare function makeSignerServiceFromLegacyAdapter(getAdapter: () => LegacyWalletAdapter): Layer.Layer<SignerService>;
|
|
5
5
|
//# sourceMappingURL=legacy-signer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-signer.d.ts","sourceRoot":"","sources":["../../src/web3.js/legacy-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"legacy-signer.d.ts","sourceRoot":"","sources":["../../src/web3.js/legacy-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AA2BtD,wBAAgB,kCAAkC,CAChD,UAAU,EAAE,MAAM,mBAAmB,GACpC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,CAkH5B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Layer } from "effect";
|
|
2
|
-
import { SignatureError, WalletNotConnectedError } from "
|
|
3
|
-
import { SignerService } from "
|
|
4
|
-
import { SpanNames } from "
|
|
2
|
+
import { SignatureError, WalletNotConnectedError } from "#src/core/errors/index.js";
|
|
3
|
+
import { SignerService } from "#src/signer/index.js";
|
|
4
|
+
import { SpanNames } from "#src/telemetry/index.js";
|
|
5
5
|
import { fromWeb3Transaction, toWeb3Transaction } from "./transaction-bridge.js";
|
|
6
6
|
import { publicKeyToAddress } from "./types.js";
|
|
7
7
|
export function makeSignerServiceFromLegacyAdapter(getAdapter) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-signer.js","sourceRoot":"","sources":["../../src/web3.js/legacy-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"legacy-signer.js","sourceRoot":"","sources":["../../src/web3.js/legacy-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,yBAA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Error } from \"#src/core/errors/index.js\";\nimport { SignerService } from \"#src/signer/index.js\";\nimport { SpanNames } from \"#src/telemetry/index.js\";\nimport { fromWeb3Transaction, toWeb3Transaction } from \"./transaction-bridge.js\";\nimport type { LegacyWalletAdapter } from \"./types.js\";\nimport { publicKeyToAddress } from \"./types.js\";\n\n/**\n * Create a SignerService layer from a legacy wallet adapter.\n *\n * This factory bridges the gap between legacy @solana/web3.js wallet adapters\n * (like @reown/appkit-adapter-solana) and the modern @solana/kit types used\n * by @prb/effect-solana.\n *\n * @param getAdapter - Function that returns the current wallet adapter\n * @returns A Layer providing SignerService\n *\n * @category Compatibility\n *\n * @example\n * ```typescript\n * import { makeSignerServiceFromLegacyAdapter } from \"@prb/effect-solana/compat\";\n *\n * const signerLayer = makeSignerServiceFromLegacyAdapter(() => ({\n * publicKey: walletProvider?.publicKey ?? null,\n * connected: !!walletProvider?.publicKey,\n * signTransaction: walletProvider.signTransaction.bind(walletProvider),\n * signAllTransactions: walletProvider.signAllTransactions.bind(walletProvider),\n * }));\n * ```\n */\nexport function makeSignerServiceFromLegacyAdapter(\n getAdapter: () => LegacyWalletAdapter\n): Layer.Layer<SignerService> {\n return Layer.succeed(\n SignerService,\n SignerService.of({\n getAddress: () =>\n Effect.gen(function* () {\n const adapter = getAdapter();\n if (!(adapter.connected && adapter.publicKey)) {\n return yield* Effect.fail(\n new WalletNotConnectedError({ message: \"Wallet not connected\" })\n );\n }\n\n // Runtime validation before type assertion\n if (\n typeof adapter.publicKey !== \"object\" ||\n adapter.publicKey === null ||\n typeof (adapter.publicKey as { toBase58?: unknown }).toBase58 !== \"function\"\n ) {\n return yield* Effect.fail(\n new WalletNotConnectedError({\n message: \"Invalid publicKey: missing toBase58 method\",\n })\n );\n }\n\n return publicKeyToAddress(adapter.publicKey as { toBase58(): string });\n }).pipe(Effect.withSpan(SpanNames.SIGNER_GET_ADDRESS)),\n\n isConnected: () => Effect.sync(() => getAdapter().connected),\n\n signAllTransactions: (txs) =>\n Effect.gen(function* () {\n // Early return for empty arrays\n if (txs.length === 0) {\n return [] as typeof txs;\n }\n\n const adapter = getAdapter();\n if (!adapter.connected) {\n return yield* Effect.fail(\n new WalletNotConnectedError({ message: \"Wallet not connected\" })\n );\n }\n\n // Convert all kit → web3.js\n const legacyTxs = yield* Effect.all(\n txs.map((tx) =>\n Effect.tryPromise({\n catch: (cause) =>\n new SignatureError({\n cause,\n message:\n cause instanceof Error ? cause.message : \"Failed to convert transaction\",\n }),\n try: () => toWeb3Transaction(tx),\n })\n )\n );\n\n // Sign all with legacy adapter\n const signedAll = yield* Effect.tryPromise({\n catch: (cause) =>\n new SignatureError({\n cause,\n message: cause instanceof Error ? cause.message : \"Failed to sign transactions\",\n }),\n try: () => adapter.signAllTransactions(legacyTxs),\n });\n\n // Convert all web3.js → kit\n // Cast is necessary because we can't preserve the generic T through web3.js conversion\n return signedAll.map((signed) =>\n fromWeb3Transaction(signed as Parameters<typeof fromWeb3Transaction>[0])\n ) as typeof txs;\n }).pipe(Effect.withSpan(SpanNames.TX_SIGN)),\n\n signTransaction: (tx) =>\n Effect.gen(function* () {\n const adapter = getAdapter();\n if (!adapter.connected) {\n return yield* Effect.fail(\n new WalletNotConnectedError({ message: \"Wallet not connected\" })\n );\n }\n\n // Convert kit → web3.js\n const legacyTx = yield* Effect.tryPromise({\n catch: (cause) =>\n new SignatureError({\n cause,\n message: cause instanceof Error ? cause.message : \"Failed to convert transaction\",\n }),\n try: () => toWeb3Transaction(tx),\n });\n\n // Sign with legacy adapter\n const signed = yield* Effect.tryPromise({\n catch: (cause) =>\n new SignatureError({\n cause,\n message: cause instanceof Error ? cause.message : \"Failed to sign transaction\",\n }),\n try: () => adapter.signTransaction(legacyTx),\n });\n\n // Convert web3.js → kit\n // Cast is necessary because we can't preserve the generic T through web3.js conversion\n return fromWeb3Transaction(\n signed as Parameters<typeof fromWeb3Transaction>[0]\n ) as typeof tx;\n }).pipe(Effect.withSpan(SpanNames.TX_SIGN)),\n })\n );\n}\n"]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,CAAC,IAAI,CAA0C,CAAC;IAC5E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,kDAAkD,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACxF,CAAC;AACH,CAAC","sourcesContent":["import type { Transaction, TransactionWithLifetime } from \"@solana/transactions\";\nimport { getTransactionDecoder, getTransactionEncoder } from \"@solana/transactions\";\n\n// Lazy initialization for encoder/decoder\nlet _encoder: ReturnType<typeof getTransactionEncoder> | null = null;\nlet _decoder: ReturnType<typeof getTransactionDecoder> | null = null;\n\nfunction getEncoder() {\n if (_encoder === null) {\n _encoder = getTransactionEncoder();\n }\n return _encoder;\n}\n\nfunction getDecoder() {\n if (_decoder === null) {\n _decoder = getTransactionDecoder();\n }\n return _decoder;\n}\n\n/**\n * Detect if a serialized transaction contains a versioned message.\n *\n * Wire format: [signature_count (compact-u16)] [signatures (64 bytes each)] [message]\n * Versioned messages have bit 7 set (0x80) in the first message byte.\n *\n * @internal\n */\nfunction isVersionedMessage(wireBytes: Uint8Array): boolean {\n // First byte is signature count (compact-u16, but < 128 signatures = 1 byte)\n const signatureCount = wireBytes[0] ?? 0;\n // Message starts after: 1 byte count + (signatureCount * 64 bytes)\n const messageOffset = 1 + signatureCount * 64;\n // biome-ignore lint/suspicious/noBitwiseOperators: Checking version bit\n return ((wireBytes[messageOffset] ?? 0) & 0x80) !== 0;\n}\n\n/**\n * Convert a @solana/kit transaction to a @solana/web3.js Transaction or VersionedTransaction.\n *\n * Uses wire-format bytes as the interchange format. Dynamically imports @solana/web3.js\n * for tree-shaking when legacy compatibility is not needed.\n *\n * @param tx - Transaction from @solana/kit\n * @returns Promise of Transaction or VersionedTransaction from @solana/web3.js\n *\n * @category Compatibility\n *\n * @example\n * ```typescript\n * import { toWeb3Transaction } from \"@prb/effect-solana/compat\";\n *\n * const kitTx: Transaction & TransactionWithLifetime = /* ... *\\/;\n * const legacyTx = await toWeb3Transaction(kitTx);\n * // => Transaction or VersionedTransaction instance\n * ```\n */\nexport async function toWeb3Transaction(\n tx: Transaction & TransactionWithLifetime\n): Promise<unknown> {\n const wire = getEncoder().encode(tx);\n\n let LegacyTransaction: { from(bytes: Uint8Array): unknown };\n let VersionedTransaction: { deserialize(bytes: Uint8Array): unknown };\n\n try {\n const web3Module = await import(\"@solana/web3.js\");\n LegacyTransaction = web3Module.Transaction;\n VersionedTransaction = web3Module.VersionedTransaction;\n } catch (error) {\n throw new Error(\n \"@solana/web3.js is required for legacy compatibility. Install it as a peer dependency.\",\n { cause: error }\n );\n }\n\n // Convert ReadonlyUint8Array to Uint8Array for web3.js compatibility\n const wireBytes = new Uint8Array(wire);\n\n return isVersionedMessage(wireBytes)\n ? VersionedTransaction.deserialize(wireBytes)\n : LegacyTransaction.from(wireBytes);\n}\n\n/**\n * Convert a @solana/web3.js Transaction or VersionedTransaction to a @solana/kit transaction.\n *\n * Uses wire-format bytes as the interchange format.\n *\n * @param tx - Transaction or VersionedTransaction from @solana/web3.js\n * @returns Transaction from @solana/kit\n *\n * @category Compatibility\n *\n * @example\n * ```typescript\n * import { fromWeb3Transaction } from \"@prb/effect-solana/compat\";\n * import { Transaction } from \"@solana/web3.js\";\n *\n * const legacyTx = new Transaction();\n * const kitTx = fromWeb3Transaction(legacyTx);\n * // => Transaction & TransactionWithLifetime\n * ```\n */\nexport function fromWeb3Transaction(tx: {\n serialize(opts: { requireAllSignatures: boolean; verifySignatures: boolean }): Uint8Array;\n}): Transaction & TransactionWithLifetime {\n const wire = tx.serialize({ requireAllSignatures: false, verifySignatures: false });\n\n try {\n return getDecoder().decode(wire) as Transaction & TransactionWithLifetime;\n } catch (error) {\n throw new Error(\"Failed to decode transaction from web3.js format\", { cause: error });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/web3.js/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AA4C5C,MAAM,UAAU,kBAAkB,CAAC,EAA0B;IAC3D,OAAO,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;AAChC,CAAC;AAqBD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAa;IACpD,IAAI,CAAC;QACH,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC;QACtD,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,wFAAwF,EACxF,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/web3.js/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AA4C5C,MAAM,UAAU,kBAAkB,CAAC,EAA0B;IAC3D,OAAO,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;AAChC,CAAC;AAqBD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAa;IACpD,IAAI,CAAC;QACH,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC;QACtD,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,wFAAwF,EACxF,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import type { Address } from \"@solana/addresses\";\nimport { address } from \"@solana/addresses\";\n\n/**\n * Legacy wallet adapter interface matching @solana/web3.js v1.x patterns.\n *\n * @category Compatibility\n *\n * @example\n * ```typescript\n * import type { LegacyWalletAdapter } from \"@prb/effect-solana/compat\";\n *\n * const adapter: LegacyWalletAdapter = {\n * publicKey: walletProvider?.publicKey ?? null,\n * connected: !!walletProvider?.publicKey,\n * signTransaction: walletProvider.signTransaction.bind(walletProvider),\n * signAllTransactions: walletProvider.signAllTransactions.bind(walletProvider),\n * };\n * ```\n */\nexport type LegacyWalletAdapter = {\n readonly publicKey: unknown | null; // PublicKey from @solana/web3.js\n readonly connected: boolean;\n readonly signTransaction: <T>(tx: T) => Promise<T>; // T = Transaction | VersionedTransaction\n readonly signAllTransactions: <T>(txs: T[]) => Promise<T[]>;\n};\n\n/**\n * Convert a legacy PublicKey to a modern Address.\n *\n * @param pk - PublicKey from @solana/web3.js\n * @returns Address string (base58)\n *\n * @category Compatibility\n *\n * @example\n * ```typescript\n * import { publicKeyToAddress } from \"@prb/effect-solana/compat\";\n * import { PublicKey } from \"@solana/web3.js\";\n *\n * const pk = new PublicKey(\"11111111111111111111111111111111\");\n * const addr = publicKeyToAddress(pk);\n * // => \"11111111111111111111111111111111\" as Address\n * ```\n */\nexport function publicKeyToAddress(pk: { toBase58(): string }): Address {\n return address(pk.toBase58());\n}\n\n/**\n * Convert a modern Address to a legacy PublicKey.\n *\n * Uses dynamic import for tree-shaking when @solana/web3.js is not needed.\n *\n * @param addr - Address string\n * @returns PublicKey from @solana/web3.js\n *\n * @category Compatibility\n *\n * @example\n * ```typescript\n * import { addressToPublicKey } from \"@prb/effect-solana/compat\";\n *\n * const addr = address(\"11111111111111111111111111111111\");\n * const pk = await addressToPublicKey(addr);\n * // => PublicKey instance\n * ```\n */\nexport async function addressToPublicKey(addr: Address): Promise<unknown> {\n try {\n const { PublicKey } = await import(\"@solana/web3.js\");\n return new PublicKey(addr);\n } catch (error) {\n throw new Error(\n \"@solana/web3.js is required for legacy compatibility. Install it as a peer dependency.\",\n { cause: error }\n );\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prb/effect-solana",
|
|
3
|
-
"description": "Effect-TS integration for Solana",
|
|
4
|
-
"
|
|
3
|
+
"description": "Effect-TS integration for Solana frontend development",
|
|
4
|
+
"homepage": "https://github.com/PaulRBerg/prb-effect/tree/main/solana#readme",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"sideEffects": false,
|
|
5
8
|
"type": "module",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"version": "1.0.0-beta.5",
|
|
6
11
|
"scripts": {
|
|
7
12
|
"build": "just build",
|
|
8
13
|
"prepack": "bun install --frozen-lockfile && just build"
|
|
9
14
|
},
|
|
10
|
-
"main": "./dist/index.js",
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
15
|
"author": {
|
|
13
16
|
"name": "Paul Razvan Berg",
|
|
14
17
|
"url": "https://github.com/PaulRBerg"
|
|
15
18
|
},
|
|
16
|
-
"license": "MIT",
|
|
17
19
|
"repository": {
|
|
20
|
+
"directory": "solana",
|
|
18
21
|
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/PaulRBerg/prb-effect.git"
|
|
20
|
-
"directory": "solana"
|
|
22
|
+
"url": "git+https://github.com/PaulRBerg/prb-effect.git"
|
|
21
23
|
},
|
|
22
24
|
"bugs": {
|
|
23
25
|
"url": "https://github.com/PaulRBerg/prb-effect/issues"
|
|
24
26
|
},
|
|
25
|
-
"homepage": "https://github.com/PaulRBerg/prb-effect/tree/main/solana#readme",
|
|
26
27
|
"dependencies": {
|
|
27
|
-
"bn.js": "^5.2.1"
|
|
28
|
+
"bn.js": "^5.2.1",
|
|
29
|
+
"buffer": "^6.0.3"
|
|
28
30
|
},
|
|
29
31
|
"devDependencies": {
|
|
30
32
|
"@biomejs/biome": "catalog:dev",
|
|
@@ -32,10 +34,10 @@
|
|
|
32
34
|
"@effect/platform": "catalog:effect",
|
|
33
35
|
"@effect/vitest": "catalog:dev",
|
|
34
36
|
"@sablier/devkit": "catalog:dev",
|
|
35
|
-
"@solana-program/compute-budget": "^0.
|
|
36
|
-
"@solana-program/system": "^0.
|
|
37
|
-
"@solana-program/token": "^0.
|
|
38
|
-
"@solana/kit": "^
|
|
37
|
+
"@solana-program/compute-budget": "^0.12.0",
|
|
38
|
+
"@solana-program/system": "^0.10.0",
|
|
39
|
+
"@solana-program/token": "^0.9.0",
|
|
40
|
+
"@solana/kit": "^5.4.0",
|
|
39
41
|
"@solana/web3.js": "^1.95.0",
|
|
40
42
|
"@types/bn.js": "^5.2.0",
|
|
41
43
|
"@types/node": "^25.0.3",
|
|
@@ -46,7 +48,6 @@
|
|
|
46
48
|
"effect": "catalog:effect",
|
|
47
49
|
"react": "catalog:",
|
|
48
50
|
"react-dom": "catalog:",
|
|
49
|
-
"tsc-alias": "catalog:dev",
|
|
50
51
|
"typescript": "catalog:dev",
|
|
51
52
|
"vitest": "catalog:dev"
|
|
52
53
|
},
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
"import": "./dist/index.js"
|
|
57
58
|
},
|
|
58
59
|
"./internal/*": null,
|
|
60
|
+
"./*/internal/*": null,
|
|
59
61
|
"./*": {
|
|
60
62
|
"types": "./dist/*/index.d.ts",
|
|
61
63
|
"import": "./dist/*/index.js"
|
|
@@ -63,19 +65,27 @@
|
|
|
63
65
|
},
|
|
64
66
|
"files": [
|
|
65
67
|
"dist/**",
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
"DOCS.md"
|
|
69
|
+
],
|
|
70
|
+
"keywords": [
|
|
71
|
+
"anchor",
|
|
72
|
+
"effect",
|
|
73
|
+
"effect-ts",
|
|
74
|
+
"react",
|
|
75
|
+
"solana",
|
|
76
|
+
"spl-token",
|
|
77
|
+
"typescript",
|
|
78
|
+
"web3"
|
|
69
79
|
],
|
|
70
80
|
"peerDependencies": {
|
|
71
81
|
"@coral-xyz/anchor": "^0.31.1",
|
|
72
82
|
"@effect/platform": "catalog:peers",
|
|
73
|
-
"
|
|
74
|
-
"@solana/
|
|
75
|
-
"@solana-program/
|
|
76
|
-
"@solana
|
|
77
|
-
"@solana-program/compute-budget": "^0.8.0",
|
|
83
|
+
"@solana-program/compute-budget": "^0.12.0",
|
|
84
|
+
"@solana-program/system": "^0.10.0",
|
|
85
|
+
"@solana-program/token": "^0.9.0",
|
|
86
|
+
"@solana/kit": "^5.4.0",
|
|
78
87
|
"@solana/web3.js": "^1.95.0",
|
|
88
|
+
"effect": "catalog:peers",
|
|
79
89
|
"react": "catalog:peers",
|
|
80
90
|
"react-dom": "catalog:peers"
|
|
81
91
|
},
|
|
@@ -93,6 +103,12 @@
|
|
|
93
103
|
"optional": true
|
|
94
104
|
}
|
|
95
105
|
},
|
|
106
|
+
"imports": {
|
|
107
|
+
"#src/*": {
|
|
108
|
+
"source": "./src/*",
|
|
109
|
+
"default": "./dist/*"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
96
112
|
"publishConfig": {
|
|
97
113
|
"access": "public"
|
|
98
114
|
}
|