Function contractPrincipalCV

  • Converts stx address in to ContractPrincipalCV clarity type

    Returns

    returns instance of type ContractPrincipalCV

    Example

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

    const contractAddress = contractPrincipalCV('SP2JXKMSH007NPYAQHKJPQMAQYAD90NQGTVJVQ02B', 'test');
    // { type: 6, address: { type: 0, version: 22, hash160: 'a5d9d331000f5b79578ce56bd157f29a9056f0d6' }, contractName: { type: 2, content: 'test', lengthPrefixBytes: 1, maxLengthBytes: 128 } }

    See

    clarity test cases for more examples

    Parameters

    • addressString: string
    • contractName: string

    Returns ContractPrincipalCV

Generated using TypeDoc