TyrPay Buyer Skill
Use this skill when an agent needs to act as the buyer in a TyrPay payment flow.
It assumes the runtime already has a configured BuyerSdk and access to the
@tyrpay/buyer-skill tool set.
Quick Start
- Install
@tyrpay/buyer-skill,@tyrpay/buyer-sdk, and a storage adapter. - Construct
BuyerSdkwith a signer, settlement address, and storage adapter. - Register
createBuyerTools(sdk)with your tool-calling runtime. - Call
tyrpay_readybefore the first paid workflow. - Use
tyrpay_post_taskwithexpectationsfor the default flow, orcreateOnly: trueplustyrpay_fund_task(withexpectations) for explicit control.
When To Use
- The agent is responsible for creating and funding a TyrPay task.
- The agent must enforce buyer-side commitment expectations before payment is locked.
- The agent needs structured task state that is safe to show to an end user.
- The buyer workflow must stay non-blocking and recover cleanly after seller-response timeouts.
Workflow
- Run
tyrpay_readyto verify signer and provider connectivity. - Call
tyrpay_post_taskwithexpectationsdescribing the acceptable commitment terms. - If you need explicit orchestration, set
createOnly: true(noexpectationsneeded at creation). - When the seller commitment is ready, call
tyrpay_fund_taskwithexpectationsto validate and fund. - Use
tyrpay_check_taskortyrpay_list_tasksto monitor progress. - If proof submission or verification stalls past protocol timeouts, call
tyrpay_refund_task.
Mandatory Expectations
expectationsis required on every funding path.tyrpay_fund_taskalways requires it.tyrpay_post_taskrequires it unlesscreateOnly: true.- The on-chain protocol does not enforce that the seller's commitment matches the buyer's requirements. The chain only records the commitment; it does not validate host, path, models, minimum usage, verifier, or deadline against the buyer's intent.
- The skill layer rejects any funding call that omits
expectations, preventing the agent from locking funds under unintended terms.
Tooling Notes
- All tools reject malformed inputs with structured
BuyerSkillToolErrorerrors. tyrpay_post_taskreturnstimedOut: trueinstead of throwing when seller wait time expires after task creation.tyrpay_fund_taskvalidates the commitment once, then funds without a second redundant validation pass.- Buyer-facing statuses include
VERIFIED_PASSandVERIFIED_FAILwhen a verification report is available.
Resources
references/tool-reference.mdfor the tool contract and status model.
