UNPKG

plugin-my

Version:

COTI blockchain plugin for ElizaOS - enables private token operations and encrypted transactions

234 lines (217 loc) 8.07 kB
import { Action, Provider, IAgentRuntime, Plugin } from '@elizaos/core'; import { z } from 'zod'; import { ethers } from 'ethers'; declare const getNativeBalanceAction: Action; declare const transferNativeAction: Action; declare const listAccountsAction: Action; declare const walletInfoAction: Action; declare const DeployPrivateERC721Schema: z.ZodObject<{ name: z.ZodString; symbol: z.ZodString; gasLimit: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { symbol: string; name: string; gasLimit?: number | undefined; }, { symbol: string; name: string; gasLimit?: number | undefined; }>; type DeployPrivateERC721Params = z.infer<typeof DeployPrivateERC721Schema>; declare const deployPrivateERC721ContractAction: Action; declare const MintPrivateERC721Schema: z.ZodObject<{ tokenAddress: z.ZodString; toAddress: z.ZodString; tokenUri: z.ZodString; gasLimit: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { tokenAddress: string; toAddress: string; tokenUri: string; gasLimit?: number | undefined; }, { tokenAddress: string; toAddress: string; tokenUri: string; gasLimit?: number | undefined; }>; type MintPrivateERC721Params = z.infer<typeof MintPrivateERC721Schema>; declare const mintPrivateErc721TokenAction: Action; declare const TransferPrivateERC721Schema: z.ZodObject<{ tokenAddress: z.ZodString; recipientAddress: z.ZodString; tokenId: z.ZodString; useSafeTransfer: z.ZodOptional<z.ZodBoolean>; gasLimit: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { tokenAddress: string; tokenId: string; recipientAddress: string; gasLimit?: number | undefined; useSafeTransfer?: boolean | undefined; }, { tokenAddress: string; tokenId: string; recipientAddress: string; gasLimit?: number | undefined; useSafeTransfer?: boolean | undefined; }>; type TransferPrivateERC721Params = z.infer<typeof TransferPrivateERC721Schema>; declare const transferPrivateErc721TokenAction: Action; declare const GetPrivateERC721TokenURISchema: z.ZodObject<{ tokenAddress: z.ZodString; tokenId: z.ZodString; }, "strip", z.ZodTypeAny, { tokenAddress: string; tokenId: string; }, { tokenAddress: string; tokenId: string; }>; type GetPrivateERC721TokenURIParams = z.infer<typeof GetPrivateERC721TokenURISchema>; declare const getPrivateErc721TokenUriAction: Action; declare const DeployPrivateERC20Schema: z.ZodObject<{ name: z.ZodString; symbol: z.ZodString; decimals: z.ZodNumber; gasLimit: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { symbol: string; name: string; decimals: number; gasLimit?: number | undefined; }, { symbol: string; name: string; decimals: number; gasLimit?: number | undefined; }>; type DeployPrivateERC20Params = z.infer<typeof DeployPrivateERC20Schema>; declare const deployPrivateErc20ContractAction: Action; declare const GetPrivateERC20BalanceSchema: z.ZodObject<{ tokenAddress: z.ZodString; accountAddress: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { tokenAddress: string; accountAddress?: string | undefined; }, { tokenAddress: string; accountAddress?: string | undefined; }>; type GetPrivateERC20BalanceParams = z.infer<typeof GetPrivateERC20BalanceSchema>; declare const getPrivateErc20BalanceAction: Action; declare const TransferPrivateERC20Schema: z.ZodObject<{ tokenAddress: z.ZodString; recipientAddress: z.ZodString; amount: z.ZodString; gasLimit: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { amount: string; tokenAddress: string; recipientAddress: string; gasLimit?: number | undefined; }, { amount: string; tokenAddress: string; recipientAddress: string; gasLimit?: number | undefined; }>; type TransferPrivateERC20Params = z.infer<typeof TransferPrivateERC20Schema>; declare const transferPrivateErc20TokenAction: Action; declare const GetNativeBalanceSchema: z.ZodObject<{ accountAddress: z.ZodString; }, "strip", z.ZodTypeAny, { accountAddress: string; }, { accountAddress: string; }>; type GetNativeBalanceParams = z.infer<typeof GetNativeBalanceSchema>; declare const TransferNativeSchema: z.ZodObject<{ to: z.ZodString; amount: z.ZodString; }, "strip", z.ZodTypeAny, { to: string; amount: string; }, { to: string; amount: string; }>; type TransferNativeParams = z.infer<typeof TransferNativeSchema>; declare const WalletInfoSchema: z.ZodObject<{ includeBalance: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>; }, "strip", z.ZodTypeAny, { includeBalance: boolean; }, { includeBalance?: boolean | undefined; }>; type WalletInfoParams = z.infer<typeof WalletInfoSchema>; interface BalanceResponse { success: boolean; accountAddress?: string; balance?: string; balanceWei?: string; error?: string; } interface TransferResponse { success: boolean; transactionHash?: string; from?: string; to?: string; amount?: string; error?: string; } interface WalletInfoResponse { success: boolean; address?: string; balance?: string; balanceWei?: string; network?: string; error?: string; } interface CotiWalletConfig { privateKey?: string; rpcUrl?: string; networkId?: number; } interface CotiProviderConfig { rpcUrl: string; networkId: number; timeout?: number; } declare class CotiProvider { private provider; private config; constructor(config: CotiProviderConfig); getBlockNumber(): Promise<number>; getGasPrice(): Promise<bigint>; getBalance(address: string): Promise<bigint>; getTransactionCount(address: string): Promise<number>; getTransaction(txHash: string): Promise<ethers.TransactionResponse | null>; getTransactionReceipt(txHash: string): Promise<ethers.TransactionReceipt | null>; estimateGas(transaction: ethers.TransactionRequest): Promise<bigint>; getProvider(): ethers.JsonRpcProvider; getNetworkInfo(): { rpcUrl: string; networkId: number; }; } declare function initCotiProvider(): CotiProvider; declare const cotiProvider: Provider; declare class CotiWalletProvider { private wallet; private provider; private runtime; constructor(runtime: IAgentRuntime, config: CotiWalletConfig); getAddress(): string; getBalance(address?: string): Promise<bigint>; transfer(to: string, amount: string): Promise<ethers.TransactionResponse>; getTransactionReceipt(txHash: string): Promise<ethers.TransactionReceipt | null>; estimateGas(to: string, amount: string): Promise<bigint>; getProvider(): ethers.JsonRpcProvider; getWallet(): ethers.Wallet; } declare function initCotiWalletProvider(runtime: IAgentRuntime): CotiWalletProvider; declare const cotiWalletProvider: Provider; declare const plugin: Plugin; export { type BalanceResponse, CotiProvider, type CotiProviderConfig, type CotiWalletConfig, CotiWalletProvider, type DeployPrivateERC20Params, DeployPrivateERC20Schema, type DeployPrivateERC721Params, DeployPrivateERC721Schema, type GetNativeBalanceParams, GetNativeBalanceSchema, type GetPrivateERC20BalanceParams, GetPrivateERC20BalanceSchema, type GetPrivateERC721TokenURIParams, GetPrivateERC721TokenURISchema, type MintPrivateERC721Params, MintPrivateERC721Schema, type TransferNativeParams, TransferNativeSchema, type TransferPrivateERC20Params, TransferPrivateERC20Schema, type TransferPrivateERC721Params, TransferPrivateERC721Schema, type TransferResponse, type WalletInfoParams, type WalletInfoResponse, WalletInfoSchema, cotiProvider, cotiWalletProvider, plugin as default, deployPrivateERC721ContractAction, deployPrivateErc20ContractAction, getNativeBalanceAction, getPrivateErc20BalanceAction, getPrivateErc721TokenUriAction, initCotiProvider, initCotiWalletProvider, listAccountsAction, mintPrivateErc721TokenAction, plugin, transferNativeAction, transferPrivateErc20TokenAction, transferPrivateErc721TokenAction, walletInfoAction };