In this Section, you will learn what are the functions provided by the SDK to integrate authentication, user management, and Movement transaction execution into your project.
This function will initiate and execute a transaction on the specified Movement network and return an object containing a success status and transaction result or an error message.
* @param {MovementTransactionFuncArgs} args - The arguments required to execute the generic transaction on the Movement blockchain.
* @param {string} args.email - The email of the user.
* @param {MovementNetwork} args.network - The network type enum (MovementNetwork).
* @param {string} args.apiKey - Your API key generated from the {@link https://dashboard.lync.world|LYNC dashboard}.
* @param {string} args.accountAddress - The wallet address of the currently signed-in user.
* @param {string} args.contractAddress - The contract address.
* @param {string} args.contractName - The contract name.
* @param {string} args.functionName - The function name.
* @param {Array} args.arguments - The arguments for the transaction.
* @param {Object} args.arguments[].argument - The argument used by the function.
* @param {TransactionArgumentTypes} args.arguments[].type - The type of the argument. Can be TransactionArgumentTypes.String, TransactionArgumentTypes.Number, TransactionArgumentTypes.Boolean, TransactionArgumentTypes.ByteArray, or TransactionArgumentTypes.Signature.
* @param {boolean} [args.usePaymaster=false] - Enable/disable the use of paymaster. If enabled, the transaction will be sponsored. If the wallet doesn't exist, it will be created automatically before the transaction.
* @param {string} apiKey - Your API key generated from the {@link https://dashboard.lync.world|LYNC dashboard}.
* @param {boolean} [logEnabled=true] - Enable/disable logging. The default is true.
* @returns {object} MovementTransactionReturn - Returns an object with the success status and the transaction data or error message.
* @typedef {enum} MovementNetwork - { Mainnet = 1; Testnet = 2; Devnet = 3; }
* @typedef {object} MovementTransactionFuncArgs - { email: string; accountAddress: string; network: MovementNetwork; apiKey: string; contractAddress: string; contractName: string; functionName: string; arguments: Array<MovementTransactionArguments>; usePaymaster?: boolean; }
* @typedef {object} MovementTransactionArguments - { argument: string; type: TransactionArgumentTypes }
* @typedef {enum} TransactionArgumentTypes - { String = 1; Number = 2; ByteArray = 3; Signature = 4; Boolean = 5; }
* @typedef {object} MovementTransactionData - { transactionHash: string }
* @typedef {object} MovementTransactionReturn - { success: true; data: MovementTransactionData } | { success: false; data: string }