I’m trying to not transfer tokens by having a private key on a networked computer using dfx ledger transfer. I’d like to accomplish this by signing a message on the air gapped computer and then moving that message.json to networked computer for a token transfer. It seems in order to transfer, you have to import your pem key on your networked computer into a dfx identity to transfer. This is not ideal.
I’ve made it to the point of understanding this will use the ledger.did and the method to invoke looks like this:
"send_dfx : (SendArgs) -> (BlockHeight)"
Here is my attempted “SendArgs” but having a bit of trouble with the syntax. Let’s solve this so we can maintain full air gap.
request:
"sign $CANISTER send_dfx args..."
response:
"send_dfx : (SendArgs) -> (BlockHeight)"
------------------------------------------------------------------
body:
(
record {
memo = record {
Memo = nat64 {
'$MEMO:nat64'
}
};
amount = record {
ICPTs = record {
e8s = nat64 {
'$AMOUNT:nat64'
}
}
};
to = record {
AccountIdentifier = text {
'$TO_ACCOUNT:text'
}
}
from_subaccount = opt SubAccount {
vec {
'$ACCOUNT_ID_WITHOUT_CHECKSUM_BYTES'
}
}
}
)
Yes, but the question is around the “send_dfx” argument body. We know that we can sign any message, constructing the message here can be the challenge in getting all arguments right and formatted properly to their corresponding object structure.
How can we get the request status of a request from the networked computer? Not really needed for sending, but for other informational things like the get_full_neuron info call.
So in the new dfx release, 0.7.1, you can get the result of a request status request.
What you’d do it is after the send you’d do send message.json --status
When using dfx canister sign to generate a update message, a corresponding request_status message is also signed and append to the json as signed_request_status . Then after sending the update message, the user can check the request_status using dfx canister send message.json --status .
However the result is actually a Certificatetype that you’ll have to paste into cbor.me and decode…this will be improved in the upcoming releases
Thanks very much for this clue. I’ve gotten to the point in cbor.me that I see a bunch of output like \x83\x02Nrequest_status\x83\x01... Would you mind letting me know, what am I looking at here? Is it ascii mixed with other stuff? and how do I decode it? Many thanks!