Module assets

Source

Functions§

assert_native_asset_info
Assert that an AssetInfo is a native token.
assert_native_coin
Assert that an asset is a native token.
assert_native_token_received
Assert that a specific native token in the form of an Asset was sent to the contract.
assert_native_tokens_received
Assert that all assets in the AssetList are native tokens, and that all of them were also sent in the correct amount in info.funds. Does not error if there are additional native tokens in info.funds that are not in the AssetList.
assert_only_native_coins
Assert that all assets in the AssetList are native tokens.
increase_allowance_msgs
Separate native tokens and Cw20’s in an AssetList and return messages for increasing allowance for the Cw20’s.
merge_assets
Merge duplicates of assets in an AssetList.
receive_asset
Calls TransferFrom on an Asset if it is a Cw20. If it is a native we just assert that the native token was already sent to the contract.
receive_assets
Verifies that all native tokens were a sent in info.funds and returns a Response with a messages that transfers all Cw20 tokens to env.contract.address.
separate_natives_and_cw20s
Converts an AssetList into a Vec<Coin> and a Vec<Cw20Coin>.
to_asset_list
Create an AssetList from a Vec<Coin> and an optional Vec<Cw20Coin>. Removes duplicates from each of the inputs.