With this new release, we are expanding WaaS’s capabilities to interact with Ethereum smart contracts and also introduce several quality-of-life upgrades for our supported Blockchains. For this new feature set, we have put a focus on streamlining the WaaS developing experience as well as improving the overall accessibility to our expanding Tangany ecosystem.
Check everything the new and updated below and let us always know on what features we should work next.
Sweep Bitcoin wallets
The Bitcoin sweeping endpoint available via
POST /btc/wallet/:wallet/sweep-async can be used to transfer all confirmed coins from a wallet to an arbitrary Bitcoin address. This endpoint also takes into account any fees that occur during the transaction and handles edge cases with unconfirmed UTXOs.
Unconfirmed coins from e.g. pending transactions are normally not swept due to their only recent inclusion to the blockchain. To enforce sweeping unconfirmed coins as well, the request configuration header
tangany-bitcoin-tx-confirmations needs to be set to
Call Ethereum Smart Contract methods
In a past release we have introduced the universal Ethereum smart contract endpoint
that supports executing blockchain state altering contract methods (“write” access).
Suitably in addition we are introducing multiple endpoints to call “read-only” smart contract methods. The general contract call endpoint
POST /eth/contract/:contract/call features an ABI-like configuration in the request body that makes it very easy to interact with a smart contract.
The wallet-based contract call endpoint
POST /eth/contract/:contract/:wallet/call works similarly but sets the
msg.sender variable of the underlying ABI call to the route’s
:wallet address. Contract functions that rely on
msg.sender benefit greatly from this call type.
GET /eth/contract/:contract/call/:method and
GET /eth/contract/:contract/:wallet/call/:method are convenience endpoints designed to quickly access basic smart contract data. Both routes call the smart contract
:method in a predefined fashion. While the first route does not pass any arguments to the method call, its wallet-based variant does set
msg.sender to the route’s
:wallet address and automatically resolves the wallet address as the method’s first
address type argument. Use this route to e.g. quickly get ERC20 balances for WaaS wallets:
The response type can be adjusted via the optional
?typequery parameter with a valid solidity data type. The response type defaults to
Execute payable Smart Contract methods
payable functions in a smart contract, the transaction is required to be accommodated by some Ether funding the method call. This is now supported in the
POST /eth/contract/:contract/:wallet/send-async endpoint utilizing the optional
amount body parameter.
Use wallet names in request body
In addition to the established WaaS workflow for sending funds to Blockchain addresses, it is now possible to directly send transactions to known Tangany wallets of the current
tangany-vault-url Key Vault using the body argument
In the past, when trying to send Ether to an arbitrary recipient wallet
my-wallet it was required to resolve the Ethereum address of
my-wallet in a separate call
.. and then copy the address to the transaction route:
Using the new
wallet body argument it is now possible to complete the same transaction in a single API call:
The simultaneous usage of the
to parameters are supported for verification purposes. If a mismatch between both recipient types is encountered the request is rejected with matching error:
The wallet JSON body parameter is supported extensively throughout the API:
In our upcoming post, we will explore possibilities utilizing the
wallet parameter as a custom Solidity type using our universal smart contract endpoint
Other notable changes
- Support empty
inputsargument in request bodies of Ethereum smart contract endpoints like
- Convert the
amountJSON body parameter to an optional argument (defaults to “0”) in all Ethereum-sending endpoints. This benefits e.g. smart contract interactions like
POST /eth/erc20/:contract/:wallet/send-asyncwhere the
amountbody parameter is not relevant to the transaction
Keep your eyes peeled on our social activity to stay informed about all-things Tangany and always stay safe through these troubled times!