{"_id":"@ackrate/core","_rev":"6-529a2308291204bb48ed00a52916f3de","name":"@ackrate/core","dist-tags":{"latest":"0.4.1"},"versions":{"0.3.1":{"name":"@ackrate/core","version":"0.3.1","keywords":["stellar","soroban","ackrate","agent-payments","x402","ap2","mandate","payments","ai-agents","sdk"],"license":"Apache-2.0","_id":"@ackrate/core@0.3.1","maintainers":[{"name":"ackrate","email":"drewgonzales2021@gmail.com"}],"homepage":"https://github.com/reapp-protocol/ackrate-research-arena#readme","bugs":{"url":"https://github.com/reapp-protocol/ackrate-research-arena/issues"},"dist":{"shasum":"f89417c3d1a1fdcd96465ad1f9a8acb8bc1987b2","tarball":"https://registry.npmjs.org/@ackrate/core/-/core-0.3.1.tgz","fileCount":8,"integrity":"sha512-YHRAg8VqCS/Hi/fGRokEol1X1NEt+YItnqLkbqblUOurtbd1TGPipz3vSEcEg0BBaHnm9akwlLiPM/2jn/HF1A==","signatures":[{"sig":"MEUCIDPDrBmyRju0TBlhc1Eo5FQde1SKAI7njW2vz3I3rYmkAiEAplaKSCy4iooVP6aYJXOI14234JWhFqZuhCZyOqspZD4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69079},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"dd5e43133a11e178e220640a73defa9e8d96a048","scripts":{"test":"node --import tsx --test src/x402.test.ts src/payment-sequence.test.ts src/fetch.test.ts test/index.test.mjs","build":"tsc -p tsconfig.json"},"_npmUser":{"name":"ackrate","email":"drewgonzales2021@gmail.com"},"repository":{"url":"git+https://github.com/reapp-protocol/ackrate-research-arena.git","type":"git","directory":"packages/core"},"_npmVersion":"11.16.0","description":"ackrate's thin, untrusted client for contract-enforced agent payment mandates on Stellar.","directories":{},"_nodeVersion":"26.3.0","dependencies":{"buffer":"6.0.3","@ackrate/stellar":"^0.2.2","@stellar/stellar-sdk":"^14.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/core_0.3.1_1785558074074_0.29274645105049935","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@ackrate/core","version":"0.3.2","keywords":["stellar","soroban","ackrate","agent-payments","x402","ap2","mandate","payments","ai-agents","sdk"],"license":"Apache-2.0","_id":"@ackrate/core@0.3.2","maintainers":[{"name":"ackrate","email":"drewgonzales2021@gmail.com"}],"homepage":"https://github.com/reapp-protocol/ackrate-research-arena#readme","bugs":{"url":"https://github.com/reapp-protocol/ackrate-research-arena/issues"},"dist":{"shasum":"f00589ae01fdc4e32c58b6d1696a9abfc9a635ad","tarball":"https://registry.npmjs.org/@ackrate/core/-/core-0.3.2.tgz","fileCount":8,"integrity":"sha512-C7EgRrbeMChk4kJGD2k2fVOde6rsL+Hsn84LjG3+9xCukqIW8mYidxeaRf6Rh9zqkX2oDTNNR61K2subUfV/zQ==","signatures":[{"sig":"MEUCIQCZCbTTQZA8Bhd3GfxalW1ZNxs/rnMHKUWllSAeT7f+ugIgdNDC3japBA9OrDJvm2qqAodhyCJrW0iiua79sHdQyUg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":85997},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"0e0d1a2c01c73310ab4aa47ff2c84b1e0dc46e8d","_npmUser":{"name":"ackrate","email":"drewgonzales2021@gmail.com"},"repository":{"url":"git+https://github.com/reapp-protocol/ackrate-research-arena.git","type":"git","directory":"packages/core"},"_npmVersion":"11.16.0","description":"High-level TypeScript SDK for contract-enforced ackrate agent-payment mandates on Stellar.","directories":{},"_nodeVersion":"26.3.0","dependencies":{"buffer":"6.0.3","@ackrate/stellar":"^0.2.3","@stellar/stellar-sdk":"^14.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/core_0.3.2_1785641034572_0.6757353683302625","host":"s3://npm-registry-packages-npm-production"}},"0.3.3":{"name":"@ackrate/core","version":"0.3.3","keywords":["stellar","soroban","ackrate","agent-payments","x402","ap2","mandate","payments","ai-agents","sdk"],"license":"Apache-2.0","_id":"@ackrate/core@0.3.3","maintainers":[{"name":"ackrate","email":"drewgonzales2021@gmail.com"}],"homepage":"https://github.com/ackrate/ackrate-protocol/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/ackrate/ackrate-protocol/issues"},"dist":{"shasum":"5b2c0e3df4eecac8a0d5639cfdbaea33f4cef7d4","tarball":"https://registry.npmjs.org/@ackrate/core/-/core-0.3.3.tgz","fileCount":14,"integrity":"sha512-IQ9c5eK0mjDia2EuT3tGO44VOivAA8UushmMURpGEtH2E04MgRzN8F1O1paMXfk1Sox0FBBMxoM5y3QNae+5pw==","signatures":[{"sig":"MEUCIQCeShlHJ95+/nknlJ5TrkhiB9+HiX7anWw+qcCdOHubYAIgB+IzFCriVZO1HO3/fk4v0LaeDihnK1Solbda5VONXhc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":137206},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"76dcd1ed93729dc54a87a253dc272ee4915addef","scripts":{"test":"node --import tsx --test src/x402.test.ts src/payment-sequence.test.ts src/fetch.test.ts test/index.test.mjs","build":"tsc -p tsconfig.json"},"_npmUser":{"name":"ackrate","email":"drewgonzales2021@gmail.com"},"repository":{"url":"git+https://github.com/ackrate/ackrate-protocol.git","type":"git","directory":"packages/sdk"},"_npmVersion":"11.16.0","description":"Thin, untrusted client for the Ackrate MandateRegistry. The contract is the source of truth.","directories":{},"_nodeVersion":"26.3.0","dependencies":{"buffer":"6.0.3","@ackrate/stellar":"^0.2.4","@stellar/stellar-sdk":"^14.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/core_0.3.3_1787742846921_0.4921102797942851","host":"s3://npm-registry-packages-npm-production"}},"0.3.4":{"name":"@ackrate/core","version":"0.3.4","keywords":["stellar","soroban","ackrate","agent-payments","x402","ap2","mandate","payments","ai-agents","sdk"],"license":"Apache-2.0","_id":"@ackrate/core@0.3.4","maintainers":[{"name":"ackrate","email":"drewgonzales2021@gmail.com"}],"homepage":"https://github.com/ackrate/ackrate-protocol/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/ackrate/ackrate-protocol/issues"},"dist":{"shasum":"3813e5f5f07ef58499dae737cfd137335f6c0410","tarball":"https://registry.npmjs.org/@ackrate/core/-/core-0.3.4.tgz","fileCount":18,"integrity":"sha512-ZmiZkCzBUHM/ovzVg+VETmgyMcCwJNjqnUf1PSG+juoTdM444nSUBnXLozuAv/iGvstsNnsmP9B7NSeeydNlsw==","signatures":[{"sig":"MEYCIQC1aBVrLzTQGlGS+E1Diz4eApkEX5NeCR7GHsja7lQzBgIhAP1fc1Q/ZlxNRZ/lF/TWszVeWthywyTQ0MhbIHC2fEMN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":142701},"main":"./dist/index.js","type":"module","_from":"file:/var/folders/t0/nkfkv7xj1bx7njmf7_mb7nhh0000gn/T/ackrate-verified-candidates-oZ1dCG/ackrate-core-0.3.4.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"test":"node --import tsx --test src/x402.test.ts src/payment-sequence.test.ts src/registered-id.test.ts src/fetch.test.ts test/index.test.mjs","build":"tsc -p tsconfig.json"},"_npmUser":{"name":"ackrate","email":"drewgonzales2021@gmail.com"},"_resolved":"/var/folders/t0/nkfkv7xj1bx7njmf7_mb7nhh0000gn/T/ackrate-verified-candidates-oZ1dCG/ackrate-core-0.3.4.tgz","_integrity":"sha512-ZmiZkCzBUHM/ovzVg+VETmgyMcCwJNjqnUf1PSG+juoTdM444nSUBnXLozuAv/iGvstsNnsmP9B7NSeeydNlsw==","repository":{"url":"git+https://github.com/ackrate/ackrate-protocol.git","type":"git","directory":"packages/sdk"},"_npmVersion":"11.16.0","description":"Thin, untrusted client for the Ackrate MandateRegistry. The contract is the source of truth.","directories":{},"_nodeVersion":"26.3.0","dependencies":{"buffer":"6.0.3","@ackrate/stellar":"^0.2.5","@stellar/stellar-sdk":"16.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/core_0.3.4_1788726395541_0.5935658121847871","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@ackrate/core","version":"0.4.0","keywords":["stellar","soroban","ackrate","agent-payments","x402","ap2","mandate","payments","ai-agents","sdk"],"license":"Apache-2.0","_id":"@ackrate/core@0.4.0","maintainers":[{"name":"ackrate","email":"drewgonzales2021@gmail.com"}],"homepage":"https://github.com/ackrate/ackrate-protocol/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/ackrate/ackrate-protocol/issues"},"dist":{"shasum":"43a6cfdf72d6ce1f0e883f790b881e6d08f2babe","tarball":"https://registry.npmjs.org/@ackrate/core/-/core-0.4.0.tgz","fileCount":18,"integrity":"sha512-q+c9+GVfqk7KInXzs41+vQt82/btayXXCqq2oWpS7blGo0+u+TwgffEsneORHrtdzAfOpbnJAvJcnB2E8C7ZdA==","signatures":[{"sig":"MEUCIAdyrT9b078UOq3XJ6obEGVys/dOlPiaCaHsN9juhgl1AiEAttiBG27M66EfLeefGE/oxml92xGmGUE0UD82JrpTSp0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":133771},"main":"./dist/index.js","type":"module","_from":"file:/var/folders/t0/nkfkv7xj1bx7njmf7_mb7nhh0000gn/T/ackrate-verified-candidates-oWZbx4/ackrate-core-0.4.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"test":"node --import tsx --test src/x402.test.ts src/payment-sequence.test.ts src/registered-id.test.ts src/fetch.test.ts test/index.test.mjs","build":"tsc -p tsconfig.json"},"_npmUser":{"name":"ackrate","email":"drewgonzales2021@gmail.com"},"_resolved":"/var/folders/t0/nkfkv7xj1bx7njmf7_mb7nhh0000gn/T/ackrate-verified-candidates-oWZbx4/ackrate-core-0.4.0.tgz","_integrity":"sha512-q+c9+GVfqk7KInXzs41+vQt82/btayXXCqq2oWpS7blGo0+u+TwgffEsneORHrtdzAfOpbnJAvJcnB2E8C7ZdA==","repository":{"url":"git+https://github.com/ackrate/ackrate-protocol.git","type":"git","directory":"packages/sdk"},"_npmVersion":"11.16.0","description":"Mainnet SDK for ACKRATE mandates, USDC payments, and x402 delivery. The MandateRegistry enforces every payment.","directories":{},"_nodeVersion":"26.3.0","dependencies":{"buffer":"6.0.3","@ackrate/stellar":"^0.3.0","@stellar/stellar-sdk":"16.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/core_0.4.0_1788729538149_0.6314241147138162","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@ackrate/core","version":"0.4.1","description":"Mainnet SDK for ACKRATE mandates, USDC payments, and x402 delivery. The MandateRegistry enforces every payment.","repository":{"type":"git","url":"git+https://github.com/ackrate/ackrate-protocol.git","directory":"packages/sdk"},"homepage":"https://github.com/ackrate/ackrate-protocol/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/ackrate/ackrate-protocol/issues"},"keywords":["stellar","soroban","ackrate","agent-payments","x402","ap2","mandate","payments","ai-agents","sdk"],"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","test":"node --import tsx --test src/x402.test.ts src/payment-sequence.test.ts src/registered-id.test.ts src/fetch.test.ts test/index.test.mjs"},"dependencies":{"@ackrate/stellar":"^0.3.0","@stellar/stellar-sdk":"16.3.0","buffer":"6.0.3"},"license":"Apache-2.0","publishConfig":{"access":"public"},"engines":{"node":">=22.0.0"},"_id":"@ackrate/core@0.4.1","_integrity":"sha512-hSdluMJ9oSa1pFvcuCAlhFUPEvdNvCKiYA5jaZ3xeH8QuV4cZBld67fUFxDcctMl4Tv3BhvLE1jij7N++BwGSA==","_resolved":"/private/tmp/ackrate-patch-pack-yO2Fo4/ackrate-core-0.4.1.tgz","_from":"file:/private/tmp/ackrate-patch-pack-yO2Fo4/ackrate-core-0.4.1.tgz","_nodeVersion":"26.3.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-hSdluMJ9oSa1pFvcuCAlhFUPEvdNvCKiYA5jaZ3xeH8QuV4cZBld67fUFxDcctMl4Tv3BhvLE1jij7N++BwGSA==","shasum":"f5fbfde1f4fbbaed067ed47bb9c7c80abe2c7d4e","tarball":"https://registry.npmjs.org/@ackrate/core/-/core-0.4.1.tgz","fileCount":18,"unpackedSize":141774,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIC3oFcMe5PG4tmx1SY68jyBO5QRWpebjEnPHsrd+nfepAiACFukFqEsYYy37oeGplo5srPHKDvLeCqLg+VsEArgA/Q=="}]},"_npmUser":{"name":"ackrate","email":"drewgonzales2021@gmail.com"},"directories":{},"maintainers":[{"name":"ackrate","email":"drewgonzales2021@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_0.4.1_1788777644800_0.44495196416213956"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-01T04:21:13.892Z","modified":"2026-09-07T10:40:45.106Z","0.3.1":"2026-08-01T04:21:14.217Z","0.3.2":"2026-08-02T03:23:54.713Z","0.3.3":"2026-08-26T11:14:07.062Z","0.3.4":"2026-09-06T20:26:35.689Z","0.4.0":"2026-09-06T21:18:58.302Z","0.4.1":"2026-09-07T10:40:44.918Z"},"bugs":{"url":"https://github.com/ackrate/ackrate-protocol/issues"},"license":"Apache-2.0","homepage":"https://github.com/ackrate/ackrate-protocol/tree/main/packages/sdk#readme","keywords":["stellar","soroban","ackrate","agent-payments","x402","ap2","mandate","payments","ai-agents","sdk"],"repository":{"type":"git","url":"git+https://github.com/ackrate/ackrate-protocol.git","directory":"packages/sdk"},"description":"Mainnet SDK for ACKRATE mandates, USDC payments, and x402 delivery. The MandateRegistry enforces every payment.","maintainers":[{"name":"ackrate","email":"drewgonzales2021@gmail.com"}],"readme":"# @ackrate/core 0.4.1\n\nGive an agent a capped USDC budget on Stellar Mainnet. The MandateRegistry\nenforces the budget, merchant, agent, expiry, and payment sequence on-chain.\nThe SDK prepares the workflow; it never receives custody of the user's funds.\n\nMainnet MandateRegistry:\n[`CCLZEBJXG4YVJEPBCR5F27N733BCK5HQJWZZGB3K54JVODY3VAGP4HWR`](https://stellar.expert/explorer/public/contract/CCLZEBJXG4YVJEPBCR5F27N733BCK5HQJWZZGB3K54JVODY3VAGP4HWR).\n\n`ackrate.mainnet` uses this official deployment through `@ackrate/stellar`.\nCore's default network is Mainnet. Authorized upgrades replace the contract\nimplementation at the same address; compatibility and deployment evidence\nmust still be checked when the implementation changes.\n\n## Install\n\n```bash\nnpm install --save-exact @ackrate/core@0.4.1 @stellar/stellar-sdk@16.3.0\n```\n\nRequires Node.js 22 or newer and the coordinated Stellar package `^0.3.0`.\nSee the [release status](https://github.com/ackrate/ackrate-protocol/blob/main/docs/ackrate-sdk-npm.md)\nfor publication and clean-install verification.\n\n## Authorize a budget and pay\n\nThis example authorizes real USDC. Obtain the user's approval of the merchant,\n`0.03` USDC cap, and one-hour expiry before running the signing steps. The\naccounts must exist, be authorized for USDC, and have enough XLM for fees.\n\n`userSigner` and `agentSigner` below are wallet or securely managed\n`StellarSigner` integrations. `merchantAddress` is your verified seller address;\n`saveMandate` and `paymentJournal.save` are durable application storage.\n\n```ts\nimport { ackrate } from \"@ackrate/core\";\n\nconst mandate = ackrate.createIntentMandate({\n  user: userSigner.publicKey,\n  agent: agentSigner.publicKey,\n  merchant: merchantAddress,\n  asset: ackrate.mainnet.settlementAsset.contractId,\n  maxAmount: \"0.03\",\n  expiry: Math.floor(Date.now() / 1000) + 3600,\n});\n\nawait ackrate.registerMandate(mandate, { signer: userSigner });\nawait saveMandate(mandate); // Retain the confirmed registry storage ID.\nawait ackrate.approveBudget(mandate, { signer: userSigner });\n\nconst agent = ackrate.agent({ mandate, signer: agentSigner });\nconst txHash = await agent.pay(\"0.01\", {\n  onPrepared: (pending) => paymentJournal.save(pending),\n});\n\nconsole.log(`https://stellar.expert/explorer/public/tx/${txHash}`);\n```\n\nThe two user approvals do different jobs: registration stores the mandate;\nallowance approval lets the **contract**, not the agent, transfer up to the\napproved token allowance. The budget is a cap, not an upfront deposit. Each\npayment still has to pass the contract's `execute_payment` checks.\n\nRegistration updates the mutable mandate's `id` and `idBuffer` to the confirmed\non-chain storage ID and retains its original digest as `credentialHash`. Await\nregistration and persist the updated mandate before constructing an agent.\n\n## Buy an x402 resource\n\nUse `proofPolicy: \"bound-v2-only\"` for new paid endpoints. The authenticated\nchallenge binds the exact HTTP origin, GET path and query, registry, network,\nmerchant, asset, amount, and validity window. The agent pays through\n`execute_payment`, then signs a proof binding that challenge to the settlement.\nThe merchant independently verifies the payment before delivering its result.\n\n```ts\nimport { getSettlementReceipt } from \"@ackrate/core\";\n\nconst consumer = ackrate.agent({\n  mandate,\n  signer: agentSigner, // Also supports detached signPayload for bound proofs.\n  proofPolicy: \"bound-v2-only\",\n  receiptStore,        // Durable SettlementReceiptStore implementation.\n});\n\nconst response = await consumer.fetch(\"https://merchant.example/report\");\nconst result = await response.json();\nconst receipt = getSettlementReceipt(response);\nawait persistAcceptedResult(result, receipt);\nif (receipt) await consumer.acknowledgeDelivery(receipt);\n```\n\nYour `receiptStore` must durably implement `savePending`, `listPending`, and\n`clearPending`. The exact signed transaction hash and bound proof are saved\n**before** broadcast. Storage failure prevents submission. On restart, pending\nreceipts restore the no-second-payment lock. Multi-worker applications need\nshared, linearizable storage and coordination; an in-memory store is not enough.\n\nA non-402 response is returned without payment. Redirects are disabled so a\nproof cannot be forwarded to a different origin. The HTTP adapter is separate\nfrom the mandate and contract, allowing the wire format to evolve independently.\n\n## Recover the original purchase\n\nIf payment or delivery becomes uncertain, do not start a fresh purchase. Recover\nthe saved receipt and retry its exact proof:\n\n```ts\nimport { DeliveryPendingError } from \"@ackrate/core\";\n\ntry {\n  const response = await consumer.fetch(\"https://merchant.example/report\");\n  const result = await response.json();\n  const receipt = getSettlementReceipt(response);\n  await persistAcceptedResult(result, receipt);\n  if (receipt) await consumer.acknowledgeDelivery(receipt);\n} catch (error) {\n  if (!(error instanceof DeliveryPendingError)) throw error;\n  const response = await consumer.retryDelivery(error.receipt);\n  const result = await response.json();\n  await persistAcceptedResult(result, error.receipt);\n  await consumer.acknowledgeDelivery(error.receipt);\n}\n```\n\n`retryDelivery` never makes another payment, signature, or transaction. It\nvalidates the receipt and retries only its original request. New payments remain\nblocked until the complete successful result is accepted by the application and\nacknowledged. Protect receipts as sensitive bearer data for that exact request.\n\nFor direct `pay`, `SettlementUncertainError` carries the prepared hash and\nvalidity window. Persist it and use `agent.reconcilePendingSettlement(record)`\nto query the same transaction. A new payment is unsafe while its result is unknown.\n\n## API reference\n\n| API | Purpose |\n|---|---|\n| `ackrate.mainnet` | Official Mainnet configuration and canonical USDC asset. |\n| `ackrate.createIntentMandate(input, network?)` | Create a local mandate and credential hash without signing or sending. |\n| `ackrate.registerMandate(mandate, { signer }, network?)` | User-signed registration; return a transaction hash and retain the confirmed storage ID. |\n| `ackrate.approveBudget(mandate, { signer }, network?)` | User-signed token allowance to the registry, capped at the mandate budget. |\n| `ackrate.agent(options, network?)` | Create the agent using the registered mandate and authorized signer. |\n| `agent.pay(amount, lifecycle)` | Agent-signed atomic mandate consumption and payment. |\n| `agent.fetch(url, init?)` | Request a paid resource using the x402 challenge/payment/proof flow. |\n| `agent.retryDelivery(receipt, init?)` | Recover the original delivery without paying again. |\n| `agent.acknowledgeDelivery(receipt)` | Clear pending delivery only after durable application acceptance. |\n| `agent.getPendingSettlement()` | Inspect the currently unresolved prepared payment. |\n| `agent.reconcilePendingSettlement(record?)` | Query the original hash and return `pending`, `failed`, `expired`, or `succeeded`. |\n| `getSettlementReceipt(response)` | Read the exact recovery receipt on a paid response. |\n| `ackrate.revokeMandate(mandate, { signer }, network?)` | User-signed revocation; later payments are rejected on-chain. |\n| `toStroops(amount, decimals?)` | Strict decimal-string to integer conversion. |\n\nMandate inputs:\n\n| Field | Meaning |\n|---|---|\n| `user` | Public address that owns the funds and authorizes setup. |\n| `agent` | Public address allowed to request payments. |\n| `merchant` | Single permitted payee. |\n| `asset` | USDC token contract from `ackrate.mainnet.settlementAsset.contractId`. |\n| `maxAmount` | Total budget as a decimal string, such as `\"0.03\"`. |\n| `expiry` | Expiry in Unix seconds. |\n| `decimals` | Optional token precision; Stellar USDC uses `7`. |\n| `nonce` | Optional binding nonce; omitted for normal unique mandates. |\n\nDirect payments require a `PaymentSubmissionLifecycle` with durable\n`onPrepared`. For a retriable application operation, also preserve its immutable\n`expectedSeq`; both SDK and contract reject reuse of a consumed sequence.\nSigners may be an external `StellarSigner` or a securely managed Stellar keypair.\nDo not put secret material in code, URLs, logs, or command arguments.\n\n## What the contract rejects\n\nUnauthorized agents, wrong merchant scope, revoked or expired mandates,\noverspending, non-positive amounts, replayed sequences, disallowed assets, and\npayments while paused are rejected on-chain. A failed atomic payment does not\npartially consume its budget or transfer tokens. A read-only validation or a\ncached mandate is never a substitute for `execute_payment`.\n\nUse decimal strings, not JavaScript floats, for money. The SDK rejects negatives,\nscientific notation, excess precision, and malformed amounts. Inspect typed\nerrors and recorded transaction evidence; never convert uncertainty into an\nautomatic second payment.\n\n## Related packages\n\n- [`@ackrate/stellar`](https://www.npmjs.com/package/@ackrate/stellar): Mainnet configuration, wallet signing, and contract access.\n- [`@ackrate/ap2`](https://www.npmjs.com/package/@ackrate/ap2): signed intent admission and binding.\n- [`@ackrate/express-middleware`](https://www.npmjs.com/package/@ackrate/express-middleware): merchant-side verification and durable delivery.\n- [`@ackrate/cli`](https://www.npmjs.com/package/@ackrate/cli): the same Mainnet workflow from a terminal.\n\nThe [configuration source](https://github.com/ackrate/ackrate-protocol/blob/main/packages/stellar/src/deployments.ts)\nand [Mainnet deployment record](https://github.com/ackrate/ackrate-protocol-contracts/blob/main/contracts/mainnet-v2/README.md)\nshow how the coordinated packages map to the contract above.\n\nApache-2.0.\n","readmeFilename":"README.md"}