Class: BuckspayClient
Defined in: packages/core/src/client.ts:50Constructors
Constructor
new BuckspayClient(Defined in: packages/core/src/client.ts:58config,sim?,opts?):BuckspayClient
Parameters
config
BuckspayConfig
sim?
AccountSimContext
opts?
now?
() =>number
Returns
BuckspayClient
Methods
connect()
connect():Defined in: packages/core/src/client.ts:73Promise<BuckspayWallet>
Returns
Promise<BuckspayWallet>
getAccountState()
getAccountState(Defined in: packages/core/src/client.ts:85address?):Promise<AccountState>
Parameters
address?
string
Returns
Promise<AccountState>
grantSession()
grantSession(Defined in: packages/core/src/client.ts:341 Grant a policy-scoped session key (contract account model only; throws INVALID_CONFIG on classic). The root signer authorizes the install once; thereafter the session key transacts within its on-chain policies (spend limit + allowlist) without per-action root prompts.grant):Promise<{receipt:Receipt;session:Session; }>
Parameters
grant
SessionGrant
Returns
Promise<{ receipt: Receipt; session: Session; }>
pay()
pay(Defined in: packages/core/src/client.ts:262calls):Promise<Receipt>
Parameters
calls
Call[]
Returns
Promise<Receipt>
prepare()
prepare(Defined in: packages/core/src/client.ts:109calls):Promise<PreparedIntent>
Parameters
calls
Call[]
Returns
Promise<PreparedIntent>
quoteSwap()
quoteSwap(Defined in: packages/core/src/client.ts:269 STRETCH: quote a gasless swap via the relayer’s /swap/* rail. README §4.9.opts):Promise<SwapQuote>
Parameters
opts
amount
string | bigint
tokenIn
string
tokenOut
string
Returns
Promise<SwapQuote>
revokeSession()
revokeSession(Defined in: packages/core/src/client.ts:347 Revoke a granted session by its object or id (contract account model only). Takes effect immediately on-chain - the session key no longer authorizes anything.session):Promise<Receipt>
Parameters
session
string | Session
Returns
Promise<Receipt>
send()
send(Defined in: packages/core/src/client.ts:251signed):Promise<Receipt>
Parameters
signed
SignedIntent
Returns
Promise<Receipt>
sendCalls()
sendCalls(Defined in: packages/core/src/client.ts:354 EIP-5792-style alias of pay(calls): submit an atomic, all-or-nothing batch. Enforces the MAX_BATCH_CALLS ceiling up front so an over-cap batch fails before any simulation or signing. A single call behaves exactly like pay([call]).calls):Promise<Receipt>
Parameters
calls
Call[]
Returns
Promise<Receipt>
sign()
sign(Defined in: packages/core/src/client.ts:217intent):Promise<SignedIntent>
Parameters
intent
PreparedIntent
Returns
Promise<SignedIntent>
swap()
swap(Defined in: packages/core/src/client.ts:287 STRETCH: execute a gasless swap. Enforces the minOut floor BEFORE submit. README §4.9.opts):Promise<Receipt>
Parameters
opts
amount
string | bigint
minOut?
string
tokenIn
string
tokenOut
string
Returns
Promise<Receipt>
transfer()
transfer(Defined in: packages/core/src/client.ts:93opts):Call
Parameters
opts
amount
string | bigint
to
string
token
string
Returns
Call
