Crates.io | astroport-native-coin-wrapper |
lib.rs | astroport-native-coin-wrapper |
version | 0.1.0 |
source | src |
created_at | 2023-07-20 17:21:42.610927 |
updated_at | 2023-07-20 17:21:42.610927 |
description | Astroport Native Coin Wrapper wraps native coins to CW20 tokens enabling them to be used as Astroport 3rd party rewards in generator. |
homepage | https://astroport.fi |
repository | https://github.com/astroport-fi/astroport |
max_upload_size | |
id | 921599 |
size | 43,464 |
This contract allows you to wrap native coins into Cw20 tokens.
Initializes the contract with the token code identifier that will be used to create a Cw20 token for wrapping native coins.
{
"denom": "denom",
"token_code_id": 123,
"token_decimals": 6
}
wrap
Wraps the amount of specified native coin and issues cw20 tokens instead.
You should send the amount of the native coin through the funds
array.
{
"wrap": {}
}
receive
CW20 receive msg.
{
"receive": {
"sender": "terra...",
"amount": "123",
"msg": "<base64_encoded_json_string>"
}
}
Unwrap
Receives Cw20 wrapped tokens and returns unwrapped native coins.
Execute this message by calling the CW20 native wrapped token contract and use a message like this:
{
"send": {
"contract": <NativeWrapperContractAddress>,
"amount": "999",
"msg": "base64-encodedStringOfWithdrawMsg"
}
}
In send.msg
, you may encode this JSON string into base64 encoding:
{
"unwrap": {}
}
config
Returns the general config of the contract.
{
"config": {}
}