Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transaction builder #22

Open
rantan opened this issue Aug 25, 2020 · 3 comments
Open

Add transaction builder #22

rantan opened this issue Aug 25, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@rantan
Copy link
Contributor

rantan commented Aug 25, 2020

Implement Transaction Builder to create a mixture of remittance and issuance of multiple assets and remittance of TPC in one transaction.

Steps

  • Design public interface and review on this issue.
  • Impl the interface and create PR
@Yamaguchi
Copy link
Contributor

TransactionBuilder.new
    .issue(issuer:, token_type:, amount:)
    .transfer(token:, sender:, receiver:, amount)
    .burn(token:, sender:, amount)
    .reissue(token:, amount)
    .payment(sender:, receiver:, amount)
    .build()
=> [[Token], [Tapyrus::Tx]]
(発行したトークンの配列, ブロードキャストするTxの配列)

@Yamaguchi
Copy link
Contributor

issue method can be separated by 3 types.

TransactionBuilder.new
    .reissuable(issuer:, amount:)
    .non_reissuable(issuer:, amount:)
    .nft(issuer:)
    .transfer(token:, sender:, receiver:, amount)
    .burn(token:, sender:, amount)
    .reissue(token:, amount)
    .payment(sender:, receiver:, amount)
    .build()
=> [[Token], [Tapyrus::Tx]]

@Yamaguchi
Copy link
Contributor

build() method may return multiple transactions because 2 transactions will be needed to issue new reissuable token

@rantan rantan added the enhancement New feature or request label Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants