feat(sdk-coin-tempo): add token transaction builder#7824
Conversation
db9c1c3 to
6d25ce9
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds TIP-20 token transaction builder functionality to the Tempo SDK, enabling developers to construct and sign token transfer transactions on the Tempo blockchain with Account Abstraction support.
Key changes:
- Implements
Tip20TransactionBuilderfor creating single and batch TIP-20 token transfers with optional memo fields - Adds viem integration for Ethereum-compatible address validation and transaction encoding
- Extends
Tip20Tokenclass with complete implementations ofverifyCoin,getSendMethodArgs,getOperation, andqueryAddressTokenBalancemethods
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds viem@^2.21.0 and dependencies (ox@0.11.1, abitype@1.2.3) for Ethereum-compatible operations |
| modules/sdk-coin-tempo/package.json | Declares viem@^2.21.0 as a dependency |
| modules/sdk-coin-tempo/src/lib/constants.ts | Adds TIP-20 constants including 6-decimal precision, chain IDs, and AA transaction type (0x76) |
| modules/sdk-coin-tempo/src/lib/types.ts | Defines Tip20Operation interface for transfer operations with optional memo support |
| modules/sdk-coin-tempo/src/lib/utils.ts | Implements TIP-20 utility functions for amount conversion, memo encoding, and validation using viem |
| modules/sdk-coin-tempo/src/lib/tip20Abi.ts | Defines TIP-20 token ABI including transferWithMemo function signature |
| modules/sdk-coin-tempo/src/lib/transactionBuilder.ts | Implements transaction builder with fluent API for constructing TIP-20 transactions |
| modules/sdk-coin-tempo/src/lib/transaction.ts | Implements Tip20Transaction class representing AA transactions with batch operation support |
| modules/sdk-coin-tempo/src/lib/index.ts | Exports new types, builder, and transaction classes |
| modules/sdk-coin-tempo/src/tip20Token.ts | Completes token class implementation with actual validation and encoding logic |
| modules/sdk-coin-tempo/test/unit/utils.ts | Updates address validation test to use proper checksummed address |
| modules/sdk-coin-tempo/test/unit/transactionBuilder.ts | Adds comprehensive unit tests for builder, utilities, and validation |
| modules/sdk-coin-tempo/test/integration/tip20.ts | Adds integration test scaffolding for end-to-end transaction scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2c7a9cd to
58a4b51
Compare
OttoAllmendinger
left a comment
There was a problem hiding this comment.
@copilot to what extent do we use the viem library and can we use the existing ethereum dependencies instead?
|
@OttoAllmendinger I've opened a new pull request, #7836, to work on those changes. Once the pull request is ready, I'll request review from you. |
70abc32
5f7062b to
269e66e
Compare
Dismissing the review to get this PR merged. I removed the new package addition and switched to using ethers.js instead.
TICKET: WIN-8479