Skip to content

feat(quote): bind QuoteDetails / JobQuoteDetails to requester for tnt-core v0.13.0#16

Open
drewstone wants to merge 4 commits into
mainfrom
chore/tnt-core-v0.13.0-quote-requester
Open

feat(quote): bind QuoteDetails / JobQuoteDetails to requester for tnt-core v0.13.0#16
drewstone wants to merge 4 commits into
mainfrom
chore/tnt-core-v0.13.0-quote-requester

Conversation

@drewstone
Copy link
Copy Markdown
Contributor

Summary

tnt-core v0.13.0 adds address requester as the first field of the typed-data
structs Types.QuoteDetails and Types.JobQuoteDetails. The contract enforces
requester == msg.sender and rejects address(0) (no wildcard quotes). This PR
threads that field through the package's ABI and RFQ hooks.

This is a BREAKING type change for consumers. Downstream dapps using
useQuotes / useJobPrice / useJobPrices must pass useAccount().address
as the new required requester argument. The createServiceFromQuotes ABI
tuple shape also changed, so old encoded payloads will not match v0.13.0
contract layouts.

Refs: tangle-network/tnt-core#124, tangle-network/tnt-core#125

Changes

  • src/contracts/abi.ts — prepend { name: 'requester', type: 'address' } to
    the details tuple inside createServiceFromQuotes.
  • src/hooks/useQuotes.tsOperatorQuote.details.requester: Address,
    required requester parameter on useQuotes, JSON /pricing/quote
    request/response decoder threads it through, JSDoc + entry guard.
  • src/hooks/useJobPrice.tsJobQuote.requester: Address, required
    requester parameter on useJobPrice and useJobPrices, decoders
    updated, JSDoc + shared assertRequester guard.
  • src/components/forms/JobExecutionDialog.tsx — in-package consumer
    migrated to source requester from useAccount().address; enabled
    now gates on a connected wallet.
  • package.json — bump 0.1.20.2.0 (minor signals breaking type
    shape pre-1.0).

Consumer migration

Pass useAccount().address as the new required requester argument to
useQuotes / useJobPrice / useJobPrices, and gate enabled on a
connected wallet so the address is non-zero when fetching begins.

Test plan

  • pnpm run typecheck passes
  • pnpm run build passes (ESM + DTS)
  • Smoke-test in a downstream dapp: connect wallet, request quote,
    submit createServiceFromQuotes, confirm tx lands on a v0.13.0
    contract
  • Same for submitJobFromQuote once a v0.13.0 service is live

drewstone added 4 commits May 8, 2026 15:53
…13.0

Prepend `{ name: 'requester', type: 'address' }` as the first component of the
`details` tuple in createServiceFromQuotes. tnt-core v0.13.0 enforces
`requester == msg.sender` and rejects `address(0)` (no wildcard quotes).

Refs tnt-core#124, tnt-core#125
…0.13.0

- Add `requester: Address` to `OperatorQuote.details`.
- Add `requester: Address` as a required parameter on `useQuotes` (no
  optional/undefined — tnt-core v0.13.0 contracts reject `address(0)`).
- Forward `requester` to the operator JSON `/pricing/quote` body and
  populate it on the decoded payload (preferring the operator-signed
  echo, falling back to the hook input).
- Defensive runtime guard at hook entry when `enabled=true`.
- JSDoc explains the v0.13.0 contract behavior.

Refs tnt-core#124, tnt-core#125
- Add `requester: Address` to `JobQuote` (signed into JobQuoteDetails by
  operators; tnt-core v0.13.0 enforces `requester == msg.sender`).
- Add `requester: Address` as a required parameter on both `useJobPrice`
  and `useJobPrices`, with a shared `assertRequester` defensive guard
  that fires when `enabled=true`.
- Forward `requester` to the operator JSON `/pricing/job-quote` body and
  populate it on the decoded payload (operator echo first, fallback to
  hook input).
- Update the in-package `JobExecutionDialog` consumer to source
  `requester` from `useAccount().address` and gate `enabled` on a
  connected wallet.

Refs tnt-core#124, tnt-core#125
Minor bump because consumers now must pass a non-zero `requester` to
`useQuotes`, `useJobPrice`, and `useJobPrices`, and the
`createServiceFromQuotes` ABI tuple shape gained a leading `requester`
field. Pre-1.0 minor signals a breaking type change to consumers per
package convention.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant