| Crates.io | cw-simple-assets |
| lib.rs | cw-simple-assets |
| version | 1.0.2 |
| created_at | 2025-04-10 19:42:35.916013+00 |
| updated_at | 2025-04-15 21:21:39.056049+00 |
| description | Helpers to work with native and cw20 tokens in CosmWasm contracts |
| homepage | |
| repository | https://github.com/M-Daeva/cw-simple-assets |
| max_upload_size | |
| id | 1628778 |
| size | 23,421 |
Helpers to work with native and cw20 tokens in CosmWasm contracts
use cosmwasm_std::{DepsMut, Env, MessageInfo, Response, StdResult, Uint128};
use cw_simple_assets::{Funds, InfoResp};
pub fn try_deposit(
deps: DepsMut,
env: Env,
info: MessageInfo,
sender: Option<String>,
amount: Option<Uint128>,
) -> Result<Response, ContractError> {
let InfoResp {
sender,
asset_amount,
asset_token,
} = Funds::single(sender, amount).check(&deps.api, &info)?;
// ...
}
This repo is licensed under Apache 2.0.