js-stellar-base
                                
                                 js-stellar-base copied to clipboard
                                
                                    js-stellar-base copied to clipboard
                            
                            
                            
                        [WIP] Soroban XDR
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 invokeHostFunctionoperations
- [ ] nicer contractSpec based method wrapper
- [ ] Enforce some of the intricacies around how invokeHostFunctionscan be used. e.g. must be the only function in the transaction
- [ ] Nicer scval input based on strval in soroban-cli
Fixes https://github.com/stellar/js-stellar-sdk/issues/787
@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 😬
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%) | 🚨 |