ipfind
1
Hi team ,
How to generate signature using Signature of [Public Key ++ Timestamp] bytes ?
Because i need to get the order book using matcher ( https://matcher.testnet.wavesnodes.com/matcher/orderbook/3sAZVZZwhP9sGG6xUA3snihb1T9HmvsyfrW5GbvRNiD2?activeOnly=false ) .
In this request we need to send signature.
Signature of [Public Key ++ Timestamp] bytes ===>> The public key user key or matcher key ?
So kindly provide the solution ASAP.
deemru
2
You provide your public key, timestamp and signature of them both, the signature on 32 bytes of your public key + 8 bytes of the timestamp provided.
ipfind
3
@deemru Okay fine.
I got public key bytes on using this process ==>
base58Decode(‘3sAZVZZwhP9sGG6xUA3snihb1T9HmvsyfrW5GbvRNiD2’).
I am using ts-lib-crypto functions ( https://github.com/wavesplatform/ts-lib-crypto )
But how to get timestamp value to 8 bytes ?
Can you please provide any example ASAP. Please.
I am working on node js.
Please provide the solution.
brox
4
Unix epoch timestamp is long value (8 bytes integer)
See https://www.epochconverter.com/
ipfind
5
@brox
I have use this format ( Math.floor(new Date().getTime()) ) .
Its correct ?
brox
6
Unfortunately, javascript is alien language to me. I don’t know how to convert number to array of 8 bytes in js
ipfind
7
@brox Okay Fine.
If possible to cancel the order using order id ?
Then the cancel order not working when i am using waves-api …
Sample Function
Waves.API.matcher.cancelOrder(‘amountAsset’,‘priceAssetgwkqdn’,‘orderID’,seed.keyPair).then((responseData) => {
console.log(‘responseData’,responseData);
});
brox
8