ava-labs / avalanchejs

The Avalanche Platform JavaScript Library
Other
321 stars 164 forks source link

feat: adjust etna builder props #882

Closed erictaylor closed 6 days ago

erictaylor commented 1 week ago

This pull request includes several changes to the src/vms/pvm/etna-builder/builder.ts file and its related test files. The primary focus is on refactoring the code to replace the usage of SpendOptions with individual parameters and improving code readability. Additionally, a minor typo was corrected in src/vms/common/models.ts.

Changes

  1. Removal of spendOptions prop.
  2. Add changeAddressesBytes common builder prop. Defaults to use the fromAddressesBytes.
  3. Add memo common builder prop. Defaults to empty Uint8Array.
  4. Add minIssuanceTime common builder prop. Defaults to current unix time in seconds.
  5. Renamed newImportTx toAddresses prop to toAddressesBytes.

Migration

Any usage of spendOptions.locktime or spendOptions.threshold need removed. Those props didn't do anything in the builder, and therefore caused confusion.