mcpField
B
Bankr x402 SDK - Job Management

Bankr x402 SDK - Job Management

github.com/bankrbotDevelopment88355 installsUpdated 31w ago
Repository

About Bankr x402 SDK - Job Management

A Bankr SDK skill for managing asynchronous jobs, from submission and status checks to polling and cancellation. It is intended for developers who need to control individual or batches of SDK requests.

Key features

  1. 01Submit jobs and wait for results
  2. 02Poll jobs or check status once
  3. 03Cancel pending or processing jobs
  4. 04Submit multiple jobs in parallel
  5. 05Configure timeouts for operations

Use cases

  1. 01Wait for a swap request to finish
  2. 02Track a background prompt later
  3. 03Stop a job that is no longer needed
  4. 04Run several price queries concurrently

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/bankrbot/claude-plugins --skill bankr-x402-sdk---job-management

After installing, type/bankr-x402-sdk---job-managementin Claude Code to confirm it loaded.

Details

From the project README

SDK Job Management

Manage asynchronous jobs: submit, poll, check status, cancel, and batch operations.

SDK Methods

MethodDescriptionUse Case
promptAndWait()Submit and wait for resultRecommended for most cases
prompt()Submit, return immediatelyBackground processing
pollJob()Poll until job completesManual job tracking
getJobStatus()Check status onceCustom polling logic
cancelJob()Cancel pending/processing jobStop unwanted jobs

Job Lifecycle

pending → processing → completed
                    ↘ failed
                    ↘ cancelled
StateCancellableDescription
pendingYesAwaiting processing
processingYesActively processing
completedNoFinished successfully
failedNoEncountered error
cancelledNoCancelled by user

Usage Examples

Recommended: promptAndWait
const result = await client.promptAndWait({
  prompt: "Swap 0.1 ETH to USDC",
  timeout: 60000,
});

if (result.status === "completed") {
  console.log(result.response);
}
Manual Job Control
// Submit without waiting
const { jobId } = await client.prompt({ prompt: "What are trending tokens?" });

// Check status later
const status = await client.getJobStatus(jobId);

// Or poll until complete
const result = await client.pollJob({ jobId, timeout: 60000 });
Cancel Job
const { jobId } = await client.prompt({ prompt: "..." });
await client.cancelJob(jobId);
Batch Processing
const prompts = ["Price of ETH", "Price of BTC", "Price of SOL"];

// Submit all in parallel
const jobs = await Promise.all(
  prompts.map(prompt => client.prompt({ prompt }))
);

// Wait for all to complete
const results = await Promise.all(
  jobs.map(job => client.pollJob({ jobId: job.jobId }))
);

Timing Guidelines

OperationTypical TimeRecommended Timeout
Price queries2-5s15s
Balance checks2-5s15s
Token swaps5-15s60s
Cross-chain bridges10-30s120s
NFT operations5-15s60s

Related Skills

  • sdk-wallet-operations: Client setup and configuration
  • sdk-capabilities: Full list of supported operations

Comments

Markdown supported