-
Notifications
You must be signed in to change notification settings - Fork 137
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 helpful abstractions for common invocation types. #703
Conversation
Size Change: +30 kB (+1%) Total Size: 3.19 MB
|
@@ -35,3 +46,184 @@ export function invokeHostFunction(opts) { | |||
|
|||
return new xdr.Operation(opAttributes); | |||
} | |||
|
|||
/** | |||
* Returns an operation that invokes a contract function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than imbuing base with this app knowhow, is it worthwhile for separation to implement these function wrappers in js-stellar-sdk/src/contract_spec.ts
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's still better in base because it's just a variation of the XDR rather than something related to the RPC server or Horizon. To be honest, the only reason why ContractSpec
is in stellar-sdk
is because it was written in TypeScript. So yeah, I do think it belongs more here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have not reviewed the code but assuming these all work these are very helpful functions and will be a tremendous value add for a lot of folks. 👏
…#710) * Upgrade XDR to the final, stable testnet version. (#704, #715) XDR has been upgraded to the latest stable version. This is mostly renames, but it includes the following relevant breaking changes: - `Operation.bumpFootprintExpiration` is now `extendFootprintTtl` and its `ledgersToExpire` field is now named `extendTo`, but it serves the same purpose. - `xdr.ContractExecutable.contractExecutableToken` is now `contractExecutableStellarAsset` - `xdr.SorobanTransactionData.refundableFee` is now `resourceFee` - In turn, `SorobanDataBuilder.setRefundableFee` is now `setResourceFee` - This new fee encompasses the entirety of the Soroban-related resource fees. Note that this is distinct from the "network-inclusion" fee that you would set on your transaction (i.e. `TransactionBuilder(..., { fee: ... })`). - In TypeScript, the `Operation.BumpFootprintExpiration` is now `Operation.ExtendFootprintTtl` Commit: stellar/stellar-xdr @ bb54e50 * Add helpful abstractions for common invocation types. (#703) * Drop incorrect key entry for contract footprint (#709) * Republish package under @stellar/ scope (#714)
What
This adds four new aliases for
Operation
to make common versions ofOperation.invokeHostFunction
easier to create.Why
Closes #700 and #697.