Hi can anyone point me to a simple payment example? e.g. sending DFN to a canister.
2 Likes
hey @deagol , the native tokens haven’t been included into the sdk yet. but you could look at this
5 Likes
enzo
July 25, 2020, 1:47am
3
If you’re looking for a minimalistic token payment example, then checkout: https://github.com/enzoh/motoko-token
5 Likes
where can i find a document about how to Integration with wallet
Ori
October 9, 2020, 12:03pm
5
Hi bitcodernull, further info and documentation for managing ICP tokens, cycles, and charging canisters etc. will all follow soon. There will likely be some announcements on this so we’ll keep you posted.
1 Like
enzo
October 9, 2020, 4:07pm
6
There are some primitives provided in the Rust CDK, but they aren’t very well documented at this point.
pub async fn call<T: ArgumentEncoder, R: for<'a> ArgumentDecoder<'a>>(
id: Principal,
method: &str,
args: T,
) -> CallResult<R> {
let args_raw = encode_args(args).expect("Failed to encode arguments.");
let bytes = call_raw(id, method, args_raw, 0).await?;
decode_args(&bytes).map_err(|err| trap(&format!("{:?}", err)))
}
pub async fn call_with_payment<T: ArgumentEncoder, R: for<'a> ArgumentDecoder<'a>>(
id: Principal,
method: &str,
args: T,
cycles: i64,
) -> CallResult<R> {
let args_raw = encode_args(args).expect("Failed to encode arguments.");
let bytes = call_raw(id, method, args_raw, cycles).await?;
decode_args(&bytes).map_err(|err| trap(&format!("{:?}", err)))
}
3 Likes
mac
October 26, 2020, 9:20pm
7
I’m specifically curious to know if hardware wallets will be supported by mainnet launch. I wouldn’t think all users would be expected to hold all their private keys directly on their computers.
1 Like
Ori
October 27, 2020, 12:12pm
8
I do believe they will be. I agree on the need for these or YubiKeys etc.
1 Like