• Creates a "Create Currency" operation for the given project and arguments, either wrapping an existing mint or creating a new currency with a new mint.

    Parameters

    • honeycomb: Honeycomb

      The Honeycomb instance.

    • args: CreateCreateCurrencyOperationArgs

      The arguments for creating the "Create Currency" operation.

    Returns Promise<{
        currency: web3.PublicKey;
        operation: Operation;
    }>

    An object containing the "Create Currency" operation and the currency address.

    Example

    const honeycomb = new Honeycomb(...); // Initialize Honeycomb instance
    const project = ...; // HoneycombProject instance
    const mintPublicKey = ...; // Mint public key for wrapping an existing currency
    const createCurrencyArgs = {
    name: "My Token",
    symbol: "MTK",
    decimals: 6,
    kind: CurrencyKind.Token,
    permissions: {
    mint: [mintAuthorityPublicKey],
    freeze: [],
    admin: [adminPublicKey],
    tokenOwner: [],
    },
    };

    // Create a "Create Currency" operation
    const operationArgs: CreateCreateCurrencyOperationArgs = {
    args: mintPublicKey ? { mint: mintPublicKey } : createCurrencyArgs,
    project,
    };
    const { operation } = await createCreateCurrencyOperation(honeycomb, operationArgs);
    operation.send();

Generated using TypeDoc