import { tx , u } from "@cityofzion/neon-core" ; import { getVerificationSignatureForSmartContract } from "./common" ; import { DoInvokeConfig } from "./types" ; param { object } config return { Promise < object > } export async function addAttributeForMintToken ( config ) { if ( typeof config . script === "object" && config . script . operation === "mintTokens" && config . script . scriptHash ) { config . tx ! . addAttribute ( tx . TxAttrUsage . Script , u . reverseHex ( config . script . scriptHash ) ) ; } return config ; } param { object } config return { Promise < object > } export async function addSignatureForMintToken ( config ) { if ( typeof config . script === "object" && config . script . operation === "mintTokens" && config . script . scriptHash ) { const witness = await getVerificationSignatureForSmartContract ( config . url ! , config . script . scriptHash ) ; config . tx ! . addWitness ( witness ) ; } return config ; }