js-stellar-base icon indicating copy to clipboard operation
js-stellar-base copied to clipboard

[WIP] Soroban XDR

Open paulbellamy opened this issue 2 years ago • 1 comments

Work-in-progress branch using the soroban XDR. Pretty rough-and-ready, but you can build InvokeHostFunctionOperations

You can do:

let invokeHostFunctionOp = new StellarBase.Contract("add_u32_contract_id").call(
  "add",
  xdr.ScVal.u32(5),
  xdr.ScVal.u32(8)
);
// Then use it as a normal Operation.

TODO

  • [ ] figure out signing for invokeHostFunction operations
  • [ ] nicer contractSpec based method wrapper
  • [ ] Enforce some of the intricacies around how invokeHostFunctions can be used. e.g. must be the only function in the transaction
  • [ ] Nicer scval input based on strval in soroban-cli

paulbellamy avatar Aug 15 '22 16:08 paulbellamy

Fixes https://github.com/stellar/js-stellar-sdk/issues/787

paulbellamy avatar Aug 16 '22 13:08 paulbellamy

@paulbellamy Apologies, I accidentally published a new version of this branch while trying to debug an issue in Freighter. It just created a new version 8.2.2-soroban.8 that is exactly the same as soroban.7. NPM won't allow that version to be unpublished and reused, so the next version will need to be 8.2.2-soroban.9.

Again, sorry about that. The automated pipeline worked a bit too well, it seems 😬

piyalbasu avatar Feb 03 '23 21:02 piyalbasu

Size Change: +649 kB (+26%) 🚨

Total Size: 3.15 MB

Filename Size Change
dist/stellar-base.js 2.31 MB +480 kB (+26%) 🚨
dist/stellar-base.min.js 840 kB +168 kB (+25%) 🚨

compressed-size-action

github-actions[bot] avatar Jul 18 '23 18:07 github-actions[bot]