Skip to content

feat: add sponsored transaction support for gasless relay#8

Open
whoabuddy wants to merge 1 commit intotony1908:mainfrom
whoabuddy:feat/sponsored-transactions
Open

feat: add sponsored transaction support for gasless relay#8
whoabuddy wants to merge 1 commit intotony1908:mainfrom
whoabuddy:feat/sponsored-transactions

Conversation

@whoabuddy
Copy link
Copy Markdown

Summary

  • Add sponsored?: boolean to PaymentDetails interface
  • Thread sponsored flag through all transaction builders
  • Add PaymentInterceptorConfig for axios interceptor
  • When sponsored=true, transactions are built with fee: 0n for sponsor relay services

Usage

// Client-side: build sponsored transaction
const signedTx = await client.signSTXTransfer({
  ...details,
  sponsored: true
});

// Interceptor: configure for gasless
const api = withPaymentInterceptor(axios.create(), account, { sponsored: true });

Closes #7

🤖 Generated with Claude Code

- Add `sponsored?: boolean` to PaymentDetails interface
- Pass sponsored flag through all transaction builders in client.ts
- Add SignPaymentOptions and PaymentInterceptorConfig interfaces
- Update withPaymentInterceptor and createPaymentClient to accept sponsored config
- Export new types from index.ts

When sponsored=true, transactions are built with fee=0 for sponsor relay services.

Closes tony1908#7

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

Add sponsored transaction support

1 participant