sporeprotocol / spore-sdk

The Ultimate TypeScript SDK for Spore Protocol
https://docs.spore.pro
MIT License
12 stars 10 forks source link

feat: adds `transferMultipleSpore` and `meltMultipleThenCreateSpore` #126

Closed code-monad closed 1 month ago

code-monad commented 1 month ago

What does this PR do

This PR adds a Multiple-variants for function transferSpore, meltThenCreateSpore, brings the ability to operate multiple Spore assets in a single compacted transaction.

Also adds the necessary unit test for these two function.

About Fee payments behavior

I've also checked and fixed the fee payment part of the original meltThenCreateSpore.

The Zero-Fee feature will only happens if:

  1. Sum of [inputs.capacity] is greater than [outputs.capacity]
  2. [inputs.capacity] - [outputs.capacity] is greater than minimal current on-chain fee-rate
SpectreMercury commented 1 month ago

LGTM