Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const ATTEMPT_TIMEOUT = 500
const PROTOCOL_VERSION = 0
const SERVICE_ID = 42
const TX_TRANSFER_ID = 2
const TX_WALLET_ID = 1
const SIGNATURE_LENGTH = 64
const PAYLOAD_SIZE_OFFSET = 6
const PER_PAGE = 10
const MAX_VALUE = 2147483647
const MessageHead = Exonum.newType({
fields: [
{ name: 'network_id', type: Exonum.Uint8 },
{ name: 'protocol_version', type: Exonum.Uint8 },
{ name: 'message_id', type: Exonum.Uint16 },
{ name: 'service_id', type: Exonum.Uint16 },
{ name: 'payload', type: Exonum.Uint32 }
]
})
function getWallet (publicKey) {
return axios.get(`/api/cryptocurrency-demo-service/wallet/${publicKey}`)
.then(response => response.data)
.then(data => {
return {
wallet: data,
transactions: []
}
})
}
function waitForAcceptance (publicKey, hash) {
const ATTEMPTS = 10
const ATTEMPT_TIMEOUT = 500
const PROTOCOL_VERSION = 0
const SERVICE_ID = 42
const TX_TRANSFER_ID = 2
const TX_WALLET_ID = 1
const SIGNATURE_LENGTH = 64
const PAYLOAD_SIZE_OFFSET = 6
const PER_PAGE = 10
const MAX_VALUE = 2147483647
const MessageHead = Exonum.newType({
fields: [
{ name: 'network_id', type: Exonum.Uint8 },
{ name: 'protocol_version', type: Exonum.Uint8 },
{ name: 'message_id', type: Exonum.Uint16 },
{ name: 'service_id', type: Exonum.Uint16 },
{ name: 'payload', type: Exonum.Uint32 }
]
})
function getWallet (publicKey) {
return axios.get(`/api/cryptocurrency-demo-service/wallet/${publicKey}`)
.then(response => response.data)
.then(data => {
return {
wallet: data,
transactions: []
}
})
}