• Converts a string to BufferCV clarity type

    Parameters

    • str: string

    Returns BufferCV

    returns instance of type BufferCV

    Example

     import { bufferCVFromString } from '@stacks/transactions';

    const str = 'this is a test';
    const buf = bufferCVFromString(str);
    // { type: 2, buffer: <Buffer 74 68 69 73 20 69 73 20 61 20 74 65 73 74> }
    const value = bytesToUtf8(buf.buffer);
    // this is a test

    See

    clarity test cases for more examples

Generated using TypeDoc