butaneprotocol / translucent-compat

Deprecated in favour of blaze https://github.com/butaneprotocol/blaze-cardano
https://github.com/butaneprotocol/blaze-cardano
Other
15 stars 8 forks source link

Suggested API update #41

Open Quantumplation opened 5 months ago

Quantumplation commented 5 months ago

Given recent issues, I'd like to propose updating the surface API of translucent to prevent accidental mistakes.

Currently, payToContract prevents sending to a smart contract if no datum is attached.

This is super useful to prevent accidental mistakes, but occasionally people will accidentally use the payToAddressWithData method instead, which bypasses this check.

If we made this method private, and added payToNativeScriptWithData and payToWalletAddressWithData that, respectively, required you to pass the native address and required you to pass a non-script address, this could solve some accidental use of the library.

micahkendall commented 4 months ago

Makes sense but generally we're keeping the lucid apis for compatibility, with intent to move away entirely at some point. Later variations can have such considerations.