|
|
|
@ -63,8 +63,9 @@ export function encodeParams (params, funAbi, callback) { |
|
|
|
|
try { |
|
|
|
|
params = params.replace(/(^|,\s+|,)(\d+)(\s+,|,|$)/g, '$1"$2"$3') // replace non quoted number by quoted number
|
|
|
|
|
params = params.replace(/(^|,\s+|,)(0[xX][0-9a-fA-F]+)(\s+,|,|$)/g, '$1"$2"$3') // replace non quoted hex string by quoted hex string
|
|
|
|
|
params = JSON.stringify([params]) |
|
|
|
|
funArgs = JSON.parse(params) |
|
|
|
|
const args = '[' + params + ']' |
|
|
|
|
|
|
|
|
|
funArgs = JSON.parse(args) |
|
|
|
|
} catch (e) { |
|
|
|
|
return callback('Error encoding arguments: ' + e) |
|
|
|
|
} |
|
|
|
|