Releases: selimaytac/hashspan
Release list
@hashspan/x402@0.5.0
@hashspan/x402@0.4.0
Minor Changes
- #98
20a830aThanks @selimaytac! - Add@hashspan/x402:withHashspan(client, { reader })registers hooks on anx402Client, so each payment made
through@x402/fetch,@x402/axiosor@x402/mcpbecomes apayment {chainId}span with the payer, recipient,
asset, amount, scheme, resource and settlement, and, with a reader, a linked confirm span for the settling
transaction (ADR 0013). The confirm span does not check that the reported transaction is the payment, and revert
reasons of settlements are replayed only withdecodeRevertReason: true. Payments without a response end as
timeout; x402 v1 and non-EVM payments are not traced.
Patch Changes
@hashspan/viem@0.5.0
@hashspan/viem@0.4.0
Minor Changes
- #109
c92f9e3Thanks @selimaytac! -sendTransactionandwriteContractnow run while their send span is the active span, so spans that wallet, RPC or
HTTP instrumentation creates for the call nest under the send span instead of beside it (ADR 0015). Background
confirmations and the code after the call stay under the caller. Sends of clients without a chain are recorded after
the call and do not nest; with a tracker from@hashspan/corebefore 0.4, the call runs in the caller's context as
before.
Patch Changes
- #108
3a382f2Thanks @selimaytac! -waitForTransactionReceiptkeeps every option when another extension applied beforewithHashspan()copies its
arguments with a spread. Since 0.3.2 onlyonReplacedwas an own property of the options the adapter passed on, so
such a copy losthash,timeoutandconfirmations. - Updated dependencies [
c20d91d,15f16ba,990a2ea,2f424f2,905d2f8]:- @hashspan/core@0.4.0
@hashspan/viem@0.3.2
Patch Changes
-
#79
1051084Thanks @selimaytac! - TracingwriteContractno longer runs getters inside the ABI. To find the function selector and to decode revert
reasons, the adapter now uses a copy of the needed ABI items (the called function's overloads and the errors) made
of own data properties only, so an ABI built at runtime with accessors encodes the same call as without tracing. -
#78
6cf7e8aThanks @selimaytac! - A tracedwaitForTransactionReceiptbehaves like viem's own with any options object: frozen options no longer throw
"Cannot redefine property: onReplaced", and anonReplacedcallback inherited from a prototype is called again.
The adapter now passes viem an object whose prototype is the caller's options instead of a copy.
@hashspan/viem@0.3.1
Patch Changes
-
#72
f8828e3Thanks @selimaytac! - Tracing no longer runs getters on call arguments. The adapters read the fields they record (such asto,value,
networkor a transaction's fields) only from own data properties, so a getter with side effects, or one that
returns a different value per read, now sees the same reads as without tracing; a field behind a getter is left out
of the span. AwaitForTransactionReceiptcall whosehashoronReplacedis a getter is passed on untraced. -
#73
d8748f9Thanks @selimaytac! -watch()records nothing, with adiagwarning, when itschainIdoption contradicts the chain of the client it
was given, instead of polling that client and ending the confirm span as a timeout for the wrong chain.
@hashspan/core@0.5.0
Minor Changes
-
#127
2c2ddb6Thanks @selimaytac! - Addblockchain.payment.settled_amount: the amount the settling party reports it settled, recorded as reported next
toblockchain.payment.amount, which keeps the amount the payer knew. With x402'suptoscheme, it shows what was
actually charged when that is less than the authorized maximum. -
#120
7ca4af6Thanks @selimaytac! - A confirm span that gave up waiting, on its own timeout or inflush(), no longer recordsblockchain.tx.status
timeout, as announced in 0.4.0 (ADR 0016). It keeps error status anderror.typetimeout; query that instead.
blockchain.tx.statusnow comes only from chain data (success,reverted,replaced), and the semantic
conventions schema version is0.2.0-dev. The deprecated constantBLOCKCHAIN_TX_STATUS_VALUE_TIMEOUTstays
exported until 1.0.
@hashspan/core@0.4.0
Minor Changes
-
#107
c20d91dThanks @selimaytac! - Deprecate the valuetimeoutofblockchain.tx.statusand the constantBLOCKCHAIN_TX_STATUS_VALUE_TIMEOUT
(ADR 0016).blockchain.tx.statusdescribes the transaction as the chain recorded it; a confirm span that gave up
waiting already records error status anderror.typetimeout, so query that instead. The value is still recorded
in this release and stops being recorded in the next minor release; the constant is removed in 1.0. -
#94
15f16baThanks @selimaytac! - Handle methods take an options object:send.end({ hash }, { endTime }),send.fail(error, { endTime, errorType }),
confirm.end(receipt, { endTime }),confirm.timeout({ endTime })andconfirm.fail(error, { endTime })(ADR 0014).
The positional forms still work and are deprecated until 1.0:send.end(hash, endTime),
send.fail(error, endTime, { errorType }),confirm.end(receipt, endTime),confirm.timeout(endTime)and
confirm.fail(error, endTime). An end time that is not aDate, anHrTimeor a finite number is ignored. -
#92
990a2eaThanks @selimaytac! - Addtracker.startPayment(), which records a payment that another party settles on chain, such as an x402
facilitator, as apayment {chainId}span with the newblockchain.payment.*andx402.*attributes. A settlement
with a transaction hash links that transaction's confirm span to the payment span (ADR 0013). The settling party's
report never replaces what the payer knew: its payer and amount fill only fields the input left empty, and its hash
does not take over a link the tracker already has. A payment whose
outcome was never learned ends withtimeout():error.typetimeoutand noblockchain.payment.status. The
paymentResourceoption sets how much of the paid resource's URLx402.resourcerecords:origin(default),path
oroff, at most 512 characters. -
#93
2f424f2Thanks @selimaytac! -TxTrackerand its handles are produced bycreateTxTracker()only and are not meant to be implemented: members
may be added to them in minor releases (ADR 0014). This release addsstartPaymentto the tracker andcontextto
the send handle, so a hand-written tracker no longer type-checks; usecreateTxTracker()instead, which adapters
accept to share one tracker between them. -
#103
905d2f8Thanks @selimaytac! -SendHandle.contextis the parent context with the send span set: run the call that sends the transaction in it,
e.g.await context.with(send.context, () => sendSomehow()), so that spans of wallet, RPC or HTTP instrumentation
nest under the send span (ADR 0015). When starting the send span fails, it is the parent context.
@hashspan/cdp@0.5.0
@hashspan/cdp@0.4.0
Minor Changes
- #110
0707134Thanks @selimaytac! - Traced CDP calls now run while their send span is the active span, so spans that HTTP instrumentation creates for the
CDP API request nest under the send span instead of beside it (ADR 0015). Background confirmations and the code after
the call stay under the caller; with a tracker from@hashspan/corebefore 0.4, the call runs in the caller's context
as before.