parseReadOnlyResponse
Usage
import { parseReadOnlyResponse } from '@stacks/transactions';
// Typically used internally by fetchCallReadOnlyFunction,
// but can be used directly with raw node responses:
const cv = parseReadOnlyResponse({
okay: true,
result: '0x0100000000000000000000000000000064',
});
// UIntCV { type: 'uint', value: 100n }
// Throws if the response is not okay:
parseReadOnlyResponse({
okay: false,
cause: 'Runtime error',
});
// Error: 'Runtime error'Signature
Returns
Parameters
response (required)
Last updated
Was this helpful?