Denota SDK
Search
⌃K

Cross-chain

The Cross-chain module enables creating notas that pay out on the Celo network while minting the NFT on the Polygon network. This feature allows integration with platforms like OpenSea and Lens, combining the benefits of both networks. The cross-chain module currently only supports payments originating on Celo.

Usage

import Denota from '@denota-labs/denota-sdk';
async function createCrossChainNota() {
const { txHash, notaId } = await Denota.write({
amount: 10,
currency: "CELO",
metadata: { type: "uploaded", ipfsHash, imageUrl },
module: {
moduleName: "crosschain",
creditor: "0x...",
},
});
}
createCrossChainNota();
In the code snippet above, we pass in the module object, which contains the details of the nota. We also pass in the amount and currency parameters, representing the total amount and the currency in which the nota is written.
The module object properties are as follows:
  • moduleName: Set to "crosschain" for the Cross-Chain module.
  • creditor: The Ethereum address of the payee.
  • ipfsHash (optional): The IPFS hash of any additional documentation, like a statement of work or contract.
  • imageHash (optional): The IPFS hash of an image associated with the nota.
When creating a cross-chain nota, provide the Ethereum address of the creditor and the IPFS hash of any relevant documentation or images.
The writeCrossChainNota function will create a nota that pays out on the Celo network while minting the NFT on the Polygon network. The function returns the transaction hash and a temporary nota ID, which will be replaced by the actual nota ID once the nota is minted on the Polygon network.