ποΈSubmit Ticket
Ticket system is a way to report problematic transactions to our system to resolve. Here is a detailed explanation of the parameters for the submitTicket API:
Header
Evmaddress
The current address of the user's connected wallet.
Signature
The user's signature of the post body
Body
hash
Problematic transaction hash
chain
From chain nickName
Signature:
To obtain a correct interface signature, we need to follow these 5 steps:
Construct the body parameter object correctly according to the requirements.
Concatenate the parameters of the complete body parameter object, sorted alphabetically, using '&' as a separator. For example:
chan=FSN&hash=0x4190dc4627cb4e97292...
Prefix the string generated in
step 2
withEvmAddress=...&{result of step 2}
, for example:EvmAddress=0x42a6685ef29886Cbcb595Aa903f00dea0d1787d8&chan=FSN&hash=0x4190dc4627...
Apply
keccak256
hashing to the result ofstep 3
.Sign the result of
step 4
with the wallet.
get Signature examplesοΌ
sortParams = (params, evmAddress) => {
let keys = Object.keys(params)
if(!keys.length) return undefined
keys = keys.sort();
const keyValList = []
for (const key of keys) {
const val = params[key];
if(val) {
keyValList.push(`${key}=${val}`)
}
}
const data = keyValList.join('&')
const raw = `EvmAddress=${evmAddress}&${data}`
return raw
}
// step 1
const bodyParams = {
chain: "FSN",
hash: "0x4190dc4627cb4e97292b6b718d718d3c3af93f14477346efc181ff549f69f794"
}
// step 2 & setp3
let raw = sortParams(bodyParams, '0x42a6685ef29886Cbcb595Aa903f00dea0d1787d8') as string;
console.log(raw) // EvmAddress=0x42a6685ef29886Cbcb595Aa903f00dea0d1787d8&chan=FSN&hash=0x4190dc4627cb4e97292b6b718d718d3c3af93f14477346efc181ff549f69f794
// step4
raw = keccak256(toHex(raw));
console.log(raw) // 0x86a444bc2c6104a3aadcf82c00dc6328fea2bd3472298369dedcbdb592ad257d
// step5 Calling wallet message signing
// Calculates an Ethereum-specific signature in EIP-191 format: keccak256("\x19Ethereum Signed Message:\n" + len(message) + message)).
// Note: The signature should not include the prefix '0x'.
let signature = wallet.signMessage(raw)
Last updated
Was this helpful?