Quick Start
npm install @actions/sdkimport { Action, TransferAction } from '@actions/sdk'; const myAction: Action = { title: "Send ETH", icon: "<https://example.com/eth-icon.png>", description: "Send ETH to a specified address", label: "Transfer ETH", links: [ { type: "transfer-action", label: "Send 0.1 ETH", address: { type: "constant", id: "recipientAddress", value: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" }, value: "100000000000000000", // 0.1 ETH in wei success: { message: "Successfully sent 0.1 ETH!" }, error: { message: "Failed to send ETH. Please try again." } } as TransferAction ] };import { validateAction } from '@actions/sdk'; const { valid, errors } = validateAction(myAction); if (valid) { console.log('Action is valid'); } else { console.error('Validation errors:', errors); }import { deployToIpfs } from '@actions/sdk'; const pinataCredentials = { apiKey: 'YOUR_PINATA_API_KEY', apiSecretKey: 'YOUR_PINATA_API_SECRET_KEY', }; deployToIpfs(myAction, pinataCredentials) .then((ipfsHash) => console.log('Deployed to IPFS:', ipfsHash)) .catch((error) => console.error('Deployment failed:', error));
Last updated