Approve a request
Get the challenge
curl --request GET \
--url https://api.vault.ledger.com/requests/{{request_id}}/challenge \
--header 'authorization: Bearer {{access_token}}' \
--header 'content-type: application/json' \
--header 'x-ledger-workspace: minivault'{
"challenge": "eyJhbnRpcmVwbGF5IjoiM0JCMzdERkIxREYxRkQ5REUzNEZDQUZCQkVGNjZDQjVDMUVEMTU3MzEzNTRGQjAxNDZEQ0MyMjk3NjdEMzVCMSIsImRhdGEiOnsidHJhbnNhY3Rpb25fZGF0YSI6eyJhY2NvdW50X25hbWUiOiJDbGllbnRBIENPTCBUQlRDIDEiLCJhbW91bnQiOiIxMDAiLCJjdXJyZW5jeSI6ImJpdGNvaW4gdGVzdG5ldCIsIm1heF9mZWVzIjoiMjExIiwicmVjaXBpZW50IjoidGIxcTl3ZXh3OXB6amtsajd5cWxkNmczbGVqeHpyMHdndndoengwbmVrIn0sInRyYW5zYWN0aW9uX3R5cGUiOiJCSVRDT0lOX0xJS0VfU0VORCJ9LCJ0eXBlIjoiQVBQUk9WRV9UUkFOU0FDVElPTiJ9",
"id": 29
}Decode the challenge
import jwt
// decode the challenge
challenge_data_bytes = jwt.utils.base64url_decode(challenge)import * as crypto from 'crypto';
import * as jwt from 'jsonwebtoken';
// decode the challenge
const decodedString = atob(dataToSign);
const jsonObject = JSON.parse(decodedString);{
"antireplay": "3BB37DFB1DF1FD9DE34FCAFBBEF66CB5C1ED15731354FB0146DCC229767D35B1",
"data": {
"transaction_data": {
"account_name": "ClientA COL TBTC 1",
"amount": "200000000",
"currency": "bitcoin testnet",
"max_fees": "211",
"recipient": "tb1q9wexw9pzjklj7yqld6g3lejxzr0wgvwhzx0nek"
},
"transaction_type": "BITCOIN_LIKE_SEND"
},
"type": "APPROVE_TRANSACTION"
}Sign the challenge
Approve the request
Last updated