@402flow/sdk-third-party-executors
v0.1.2
Published
Official supported delegated-execution adapters for @402flow/sdk.
Maintainers
Readme
@402flow/sdk-third-party-executors
Official supported delegated-execution adapters for @402flow/sdk.
This package is intentionally separate from the main @402flow/sdk package so the core SDK stays provider-neutral while officially supported provider adapters can evolve on their own dependency surface.
Current scope:
- Dexter delegated-execution adapter
- pay.sh x402 Solana exact delegated-execution adapter
Install
This adapter package requires Node 20.18 or newer because of its Solana dependency surface.
Install this package alongside the matching @402flow/sdk version.
npm install @402flow/sdk @402flow/sdk-third-party-executorsIf you pin versions explicitly, pin both packages to the same version:
npm install @402flow/sdk@<version> @402flow/sdk-third-party-executors@<version>This adapter package is versioned and supported in lockstep with @402flow/sdk, so keep the two package versions aligned.
Choose A Provider
import { AgentPayClient } from '@402flow/sdk';
import { createDexterExecutor } from '@402flow/sdk-third-party-executors/dexter';
// or:
import { createPayShExecutor } from '@402flow/sdk-third-party-executors/pay-sh';Prefer the provider-specific subpath you use. This prevents the other adapter from loading at runtime and lets bundlers exclude it. It does not change what npm installs: this combined package currently declares both provider dependency trees.
Constructor options:
| Provider | Required | Optional |
| --- | --- | --- |
| Dexter | wallets from @dexterai/x402/client | payAndFetchOptions |
| pay.sh | a Solana signer accepted by @x402/svm | fetch, networks, paymentRequirementsSelector, policies, rpcUrl, x402HttpClient |
Pass the selected adapter to the prepared execution call:
const prepared = await client.preparePaidRequest(url, requestInit);
if (prepared.kind === 'ready' && prepared.nextAction === 'execute') {
const result = await client.executePreparedRequest(prepared, {
description: 'execute through Dexter',
idempotencyKey: businessOperationId,
executionProvider: 'dexter',
executor: createDexterExecutor({
wallets: { evm: dexterWallet },
}),
});
console.log(result.response.status);
}Complete executable examples:
Both examples require 402flow credentials and provider signing credentials.
Run either command with --help before submitting a paid request.
Dexter Network Boundary
@dexterai/x402 5.4.2 resolves Base and Solana mainnet, but it does not resolve
Base Sepolia or Solana devnet. The hosted demo routes validate the native
402flow SDK flow; they cannot validate a Dexter settlement. Against either
hosted test route, Dexter returns no_payment_options before wallet signing and
this adapter normalizes it to a typed preflight_failed result.
A full Dexter settlement requires a supported network and a funded wallet. Do not move an integration test to mainnet merely to bypass the testnet limitation; use an intentional, spend-capped verification plan.
Dependency Footprint
The core @402flow/sdk package depends only on Zod. The optional combined
adapter package installs both provider stacks. The package pins
@dexterai/x402 because its payment and result contracts are part of this
adapter's tested runtime boundary.
Dexter 5.4.2 currently brings a legacy Solana dependency path even when your
Dexter wallet is EVM-only. npm audit --omit=dev reports the
bigint-buffer advisory through @solana/spl-token and @dexterai/vault,
with no upstream fix available. Review that advisory against your deployment
and threat model. Do not force transitive cryptography or Solana overrides.
A future breaking release can split provider packages or move provider SDKs to optional peer dependencies. That change must not be made in a patch release because it changes installation and runtime resolution behavior.
The main SDK package owns:
- the public executor contract
- delegated authorization and finalization
- outward result normalization to
PaidResponseorFetchPaidError
This package owns:
- provider-specific adapter implementations
- provider-specific proof tests
- source-level examples in this repo under
third-party-executors/examples/
In-Repo Verification
If you are working in this repo, useful commands are:
npm run checknpm run pack:checknpm run example:dexter-delegated-executor -- --helpnpm run example:pay-sh-delegated-executor -- --help
From the SDK root, you can also run npm run check:all to validate both the main SDK package and this package in one pass.
Release Order
When publishing from this repo, publish the main @402flow/sdk package first, then publish @402flow/sdk-third-party-executors after the matching SDK version is available.
