@sudobility/contracts 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +353 -0
- package/artifacts/contracts/Mailer.sol/Mailer.d.ts +1146 -0
- package/artifacts/contracts/Mailer.sol/Mailer.dbg.json +4 -0
- package/artifacts/contracts/Mailer.sol/Mailer.json +1096 -0
- package/artifacts/contracts/Mailer.sol/artifacts.d.ts +21 -0
- package/artifacts/contracts/MockUSDC.sol/MockUSDC.d.ts +284 -0
- package/artifacts/contracts/MockUSDC.sol/MockUSDC.dbg.json +4 -0
- package/artifacts/contracts/MockUSDC.sol/MockUSDC.json +234 -0
- package/artifacts/contracts/MockUSDC.sol/artifacts.d.ts +21 -0
- package/artifacts/contracts/interfaces/IERC20.sol/IERC20.d.ts +157 -0
- package/artifacts/contracts/interfaces/IERC20.sol/IERC20.dbg.json +4 -0
- package/artifacts/contracts/interfaces/IERC20.sol/IERC20.json +107 -0
- package/artifacts/contracts/interfaces/IERC20.sol/artifacts.d.ts +21 -0
- package/dist/evm/src/evm/index.d.ts +4 -0
- package/dist/evm/src/evm/index.d.ts.map +1 -0
- package/dist/evm/src/evm/index.js +10 -0
- package/dist/evm/src/evm/index.js.map +1 -0
- package/dist/evm/src/evm/mailer-client.d.ts +966 -0
- package/dist/evm/src/evm/mailer-client.d.ts.map +1 -0
- package/dist/evm/src/evm/mailer-client.js +619 -0
- package/dist/evm/src/evm/mailer-client.js.map +1 -0
- package/dist/evm/typechain-types/Mailer.d.ts +698 -0
- package/dist/evm/typechain-types/Mailer.d.ts.map +1 -0
- package/dist/evm/typechain-types/Mailer.js +3 -0
- package/dist/evm/typechain-types/Mailer.js.map +1 -0
- package/dist/evm/typechain-types/MockUSDC.d.ts +118 -0
- package/dist/evm/typechain-types/MockUSDC.d.ts.map +1 -0
- package/dist/evm/typechain-types/MockUSDC.js +3 -0
- package/dist/evm/typechain-types/MockUSDC.js.map +1 -0
- package/dist/evm/typechain-types/common.d.ts +51 -0
- package/dist/evm/typechain-types/common.d.ts.map +1 -0
- package/dist/evm/typechain-types/common.js +3 -0
- package/dist/evm/typechain-types/common.js.map +1 -0
- package/dist/evm/typechain-types/factories/Mailer__factory.d.ts +875 -0
- package/dist/evm/typechain-types/factories/Mailer__factory.d.ts.map +1 -0
- package/dist/evm/typechain-types/factories/Mailer__factory.js +1125 -0
- package/dist/evm/typechain-types/factories/Mailer__factory.js.map +1 -0
- package/dist/evm/typechain-types/factories/MockUSDC__factory.d.ts +193 -0
- package/dist/evm/typechain-types/factories/MockUSDC__factory.d.ts.map +1 -0
- package/dist/evm/typechain-types/factories/MockUSDC__factory.js +263 -0
- package/dist/evm/typechain-types/factories/MockUSDC__factory.js.map +1 -0
- package/dist/evm/typechain-types/factories/index.d.ts +4 -0
- package/dist/evm/typechain-types/factories/index.d.ts.map +1 -0
- package/dist/evm/typechain-types/factories/index.js +45 -0
- package/dist/evm/typechain-types/factories/index.js.map +1 -0
- package/dist/evm/typechain-types/factories/interfaces/IERC20__factory.d.ts +80 -0
- package/dist/evm/typechain-types/factories/interfaces/IERC20__factory.d.ts.map +1 -0
- package/dist/evm/typechain-types/factories/interfaces/IERC20__factory.js +116 -0
- package/dist/evm/typechain-types/factories/interfaces/IERC20__factory.js.map +1 -0
- package/dist/evm/typechain-types/factories/interfaces/index.d.ts +2 -0
- package/dist/evm/typechain-types/factories/interfaces/index.d.ts.map +1 -0
- package/dist/evm/typechain-types/factories/interfaces/index.js +9 -0
- package/dist/evm/typechain-types/factories/interfaces/index.js.map +1 -0
- package/dist/evm/typechain-types/index.d.ts +10 -0
- package/dist/evm/typechain-types/index.d.ts.map +1 -0
- package/dist/evm/typechain-types/index.js +44 -0
- package/dist/evm/typechain-types/index.js.map +1 -0
- package/dist/evm/typechain-types/interfaces/IERC20.d.ts +70 -0
- package/dist/evm/typechain-types/interfaces/IERC20.d.ts.map +1 -0
- package/dist/evm/typechain-types/interfaces/IERC20.js +3 -0
- package/dist/evm/typechain-types/interfaces/IERC20.js.map +1 -0
- package/dist/evm/typechain-types/interfaces/index.d.ts +2 -0
- package/dist/evm/typechain-types/interfaces/index.d.ts.map +1 -0
- package/dist/evm/typechain-types/interfaces/index.js +3 -0
- package/dist/evm/typechain-types/interfaces/index.js.map +1 -0
- package/dist/solana/solana/index.d.ts +3 -0
- package/dist/solana/solana/index.d.ts.map +1 -0
- package/dist/solana/solana/index.js +21 -0
- package/dist/solana/solana/index.js.map +1 -0
- package/dist/solana/solana/mailer-client.d.ts +282 -0
- package/dist/solana/solana/mailer-client.d.ts.map +1 -0
- package/dist/solana/solana/mailer-client.js +989 -0
- package/dist/solana/solana/mailer-client.js.map +1 -0
- package/dist/solana/solana/types.d.ts +28 -0
- package/dist/solana/solana/types.d.ts.map +1 -0
- package/dist/solana/solana/types.js +23 -0
- package/dist/solana/solana/types.js.map +1 -0
- package/dist/solana/utils/currency.d.ts +26 -0
- package/dist/solana/utils/currency.d.ts.map +1 -0
- package/dist/solana/utils/currency.js +36 -0
- package/dist/solana/utils/currency.js.map +1 -0
- package/dist/unified/package.json +3 -0
- package/dist/unified/src/evm/index.d.ts +4 -0
- package/dist/unified/src/evm/index.d.ts.map +1 -0
- package/dist/unified/src/evm/index.js +10 -0
- package/dist/unified/src/evm/index.js.map +1 -0
- package/dist/unified/src/evm/mailer-client.d.ts +966 -0
- package/dist/unified/src/evm/mailer-client.d.ts.map +1 -0
- package/dist/unified/src/evm/mailer-client.js +619 -0
- package/dist/unified/src/evm/mailer-client.js.map +1 -0
- package/dist/unified/src/react/context/MailerProvider.d.ts +102 -0
- package/dist/unified/src/react/context/MailerProvider.d.ts.map +1 -0
- package/dist/unified/src/react/context/MailerProvider.js +160 -0
- package/dist/unified/src/react/context/MailerProvider.js.map +1 -0
- package/dist/unified/src/react/hooks/useMailerMutations.d.ts +301 -0
- package/dist/unified/src/react/hooks/useMailerMutations.d.ts.map +1 -0
- package/dist/unified/src/react/hooks/useMailerMutations.js +417 -0
- package/dist/unified/src/react/hooks/useMailerMutations.js.map +1 -0
- package/dist/unified/src/react/hooks/useMailerQueries.d.ts +130 -0
- package/dist/unified/src/react/hooks/useMailerQueries.d.ts.map +1 -0
- package/dist/unified/src/react/hooks/useMailerQueries.js +197 -0
- package/dist/unified/src/react/hooks/useMailerQueries.js.map +1 -0
- package/dist/unified/src/react/index.d.ts +37 -0
- package/dist/unified/src/react/index.d.ts.map +1 -0
- package/dist/unified/src/react/index.js +70 -0
- package/dist/unified/src/react/index.js.map +1 -0
- package/dist/unified/src/solana/index.d.ts +3 -0
- package/dist/unified/src/solana/index.d.ts.map +1 -0
- package/dist/unified/src/solana/index.js +21 -0
- package/dist/unified/src/solana/index.js.map +1 -0
- package/dist/unified/src/solana/mailer-client.d.ts +282 -0
- package/dist/unified/src/solana/mailer-client.d.ts.map +1 -0
- package/dist/unified/src/solana/mailer-client.js +989 -0
- package/dist/unified/src/solana/mailer-client.js.map +1 -0
- package/dist/unified/src/solana/types.d.ts +28 -0
- package/dist/unified/src/solana/types.d.ts.map +1 -0
- package/dist/unified/src/solana/types.js +23 -0
- package/dist/unified/src/solana/types.js.map +1 -0
- package/dist/unified/src/unified/index.d.ts +4 -0
- package/dist/unified/src/unified/index.d.ts.map +1 -0
- package/dist/unified/src/unified/index.js +9 -0
- package/dist/unified/src/unified/index.js.map +1 -0
- package/dist/unified/src/unified/onchain-mailer-client.d.ts +173 -0
- package/dist/unified/src/unified/onchain-mailer-client.d.ts.map +1 -0
- package/dist/unified/src/unified/onchain-mailer-client.js +1048 -0
- package/dist/unified/src/unified/onchain-mailer-client.js.map +1 -0
- package/dist/unified/src/unified/types.d.ts +47 -0
- package/dist/unified/src/unified/types.d.ts.map +1 -0
- package/dist/unified/src/unified/types.js +3 -0
- package/dist/unified/src/unified/types.js.map +1 -0
- package/dist/unified/src/unified/wallet-detector.d.ts +28 -0
- package/dist/unified/src/unified/wallet-detector.d.ts.map +1 -0
- package/dist/unified/src/unified/wallet-detector.js +63 -0
- package/dist/unified/src/unified/wallet-detector.js.map +1 -0
- package/dist/unified/src/utils/chain-config.d.ts +75 -0
- package/dist/unified/src/utils/chain-config.d.ts.map +1 -0
- package/dist/unified/src/utils/chain-config.js +203 -0
- package/dist/unified/src/utils/chain-config.js.map +1 -0
- package/dist/unified/src/utils/currency.d.ts +26 -0
- package/dist/unified/src/utils/currency.d.ts.map +1 -0
- package/dist/unified/src/utils/currency.js +36 -0
- package/dist/unified/src/utils/currency.js.map +1 -0
- package/dist/unified/src/utils/index.d.ts +4 -0
- package/dist/unified/src/utils/index.d.ts.map +1 -0
- package/dist/unified/src/utils/index.js +20 -0
- package/dist/unified/src/utils/index.js.map +1 -0
- package/dist/unified/src/utils/validation.d.ts +10 -0
- package/dist/unified/src/utils/validation.d.ts.map +1 -0
- package/dist/unified/src/utils/validation.js +102 -0
- package/dist/unified/src/utils/validation.js.map +1 -0
- package/dist/unified/typechain-types/Mailer.d.ts +698 -0
- package/dist/unified/typechain-types/Mailer.d.ts.map +1 -0
- package/dist/unified/typechain-types/Mailer.js +3 -0
- package/dist/unified/typechain-types/Mailer.js.map +1 -0
- package/dist/unified/typechain-types/MockUSDC.d.ts +118 -0
- package/dist/unified/typechain-types/MockUSDC.d.ts.map +1 -0
- package/dist/unified/typechain-types/MockUSDC.js +3 -0
- package/dist/unified/typechain-types/MockUSDC.js.map +1 -0
- package/dist/unified/typechain-types/common.d.ts +51 -0
- package/dist/unified/typechain-types/common.d.ts.map +1 -0
- package/dist/unified/typechain-types/common.js +3 -0
- package/dist/unified/typechain-types/common.js.map +1 -0
- package/dist/unified/typechain-types/factories/Mailer__factory.d.ts +875 -0
- package/dist/unified/typechain-types/factories/Mailer__factory.d.ts.map +1 -0
- package/dist/unified/typechain-types/factories/Mailer__factory.js +1125 -0
- package/dist/unified/typechain-types/factories/Mailer__factory.js.map +1 -0
- package/dist/unified/typechain-types/factories/MockUSDC__factory.d.ts +193 -0
- package/dist/unified/typechain-types/factories/MockUSDC__factory.d.ts.map +1 -0
- package/dist/unified/typechain-types/factories/MockUSDC__factory.js +263 -0
- package/dist/unified/typechain-types/factories/MockUSDC__factory.js.map +1 -0
- package/dist/unified/typechain-types/factories/index.d.ts +4 -0
- package/dist/unified/typechain-types/factories/index.d.ts.map +1 -0
- package/dist/unified/typechain-types/factories/index.js +45 -0
- package/dist/unified/typechain-types/factories/index.js.map +1 -0
- package/dist/unified/typechain-types/factories/interfaces/IERC20__factory.d.ts +80 -0
- package/dist/unified/typechain-types/factories/interfaces/IERC20__factory.d.ts.map +1 -0
- package/dist/unified/typechain-types/factories/interfaces/IERC20__factory.js +116 -0
- package/dist/unified/typechain-types/factories/interfaces/IERC20__factory.js.map +1 -0
- package/dist/unified/typechain-types/factories/interfaces/index.d.ts +2 -0
- package/dist/unified/typechain-types/factories/interfaces/index.d.ts.map +1 -0
- package/dist/unified/typechain-types/factories/interfaces/index.js +9 -0
- package/dist/unified/typechain-types/factories/interfaces/index.js.map +1 -0
- package/dist/unified/typechain-types/index.d.ts +10 -0
- package/dist/unified/typechain-types/index.d.ts.map +1 -0
- package/dist/unified/typechain-types/index.js +44 -0
- package/dist/unified/typechain-types/index.js.map +1 -0
- package/dist/unified/typechain-types/interfaces/IERC20.d.ts +70 -0
- package/dist/unified/typechain-types/interfaces/IERC20.d.ts.map +1 -0
- package/dist/unified/typechain-types/interfaces/IERC20.js +3 -0
- package/dist/unified/typechain-types/interfaces/IERC20.js.map +1 -0
- package/dist/unified/typechain-types/interfaces/index.d.ts +2 -0
- package/dist/unified/typechain-types/interfaces/index.d.ts.map +1 -0
- package/dist/unified/typechain-types/interfaces/index.js +3 -0
- package/dist/unified/typechain-types/interfaces/index.js.map +1 -0
- package/dist/unified-esm/src/evm/index.d.ts +4 -0
- package/dist/unified-esm/src/evm/index.d.ts.map +1 -0
- package/dist/unified-esm/src/evm/index.js +5 -0
- package/dist/unified-esm/src/evm/index.js.map +1 -0
- package/dist/unified-esm/src/evm/mailer-client.d.ts +966 -0
- package/dist/unified-esm/src/evm/mailer-client.d.ts.map +1 -0
- package/dist/unified-esm/src/evm/mailer-client.js +615 -0
- package/dist/unified-esm/src/evm/mailer-client.js.map +1 -0
- package/dist/unified-esm/src/react/context/MailerProvider.d.ts +102 -0
- package/dist/unified-esm/src/react/context/MailerProvider.d.ts.map +1 -0
- package/dist/unified-esm/src/react/context/MailerProvider.js +120 -0
- package/dist/unified-esm/src/react/context/MailerProvider.js.map +1 -0
- package/dist/unified-esm/src/react/hooks/useMailerMutations.d.ts +301 -0
- package/dist/unified-esm/src/react/hooks/useMailerMutations.d.ts.map +1 -0
- package/dist/unified-esm/src/react/hooks/useMailerMutations.js +400 -0
- package/dist/unified-esm/src/react/hooks/useMailerMutations.js.map +1 -0
- package/dist/unified-esm/src/react/hooks/useMailerQueries.d.ts +130 -0
- package/dist/unified-esm/src/react/hooks/useMailerQueries.d.ts.map +1 -0
- package/dist/unified-esm/src/react/hooks/useMailerQueries.js +186 -0
- package/dist/unified-esm/src/react/hooks/useMailerQueries.js.map +1 -0
- package/dist/unified-esm/src/react/index.d.ts +37 -0
- package/dist/unified-esm/src/react/index.d.ts.map +1 -0
- package/dist/unified-esm/src/react/index.js +39 -0
- package/dist/unified-esm/src/react/index.js.map +1 -0
- package/dist/unified-esm/src/solana/index.d.ts +3 -0
- package/dist/unified-esm/src/solana/index.d.ts.map +1 -0
- package/dist/unified-esm/src/solana/index.js +3 -0
- package/dist/unified-esm/src/solana/index.js.map +1 -0
- package/dist/unified-esm/src/solana/mailer-client.d.ts +282 -0
- package/dist/unified-esm/src/solana/mailer-client.d.ts.map +1 -0
- package/dist/unified-esm/src/solana/mailer-client.js +985 -0
- package/dist/unified-esm/src/solana/mailer-client.js.map +1 -0
- package/dist/unified-esm/src/solana/types.d.ts +28 -0
- package/dist/unified-esm/src/solana/types.d.ts.map +1 -0
- package/dist/unified-esm/src/solana/types.js +16 -0
- package/dist/unified-esm/src/solana/types.js.map +1 -0
- package/dist/unified-esm/src/unified/index.d.ts +4 -0
- package/dist/unified-esm/src/unified/index.d.ts.map +1 -0
- package/dist/unified-esm/src/unified/index.js +4 -0
- package/dist/unified-esm/src/unified/index.js.map +1 -0
- package/dist/unified-esm/src/unified/onchain-mailer-client.d.ts +173 -0
- package/dist/unified-esm/src/unified/onchain-mailer-client.d.ts.map +1 -0
- package/dist/unified-esm/src/unified/onchain-mailer-client.js +1011 -0
- package/dist/unified-esm/src/unified/onchain-mailer-client.js.map +1 -0
- package/dist/unified-esm/src/unified/types.d.ts +47 -0
- package/dist/unified-esm/src/unified/types.d.ts.map +1 -0
- package/dist/unified-esm/src/unified/types.js +2 -0
- package/dist/unified-esm/src/unified/types.js.map +1 -0
- package/dist/unified-esm/src/unified/wallet-detector.d.ts +28 -0
- package/dist/unified-esm/src/unified/wallet-detector.d.ts.map +1 -0
- package/dist/unified-esm/src/unified/wallet-detector.js +59 -0
- package/dist/unified-esm/src/unified/wallet-detector.js.map +1 -0
- package/dist/unified-esm/src/utils/chain-config.d.ts +75 -0
- package/dist/unified-esm/src/utils/chain-config.d.ts.map +1 -0
- package/dist/unified-esm/src/utils/chain-config.js +199 -0
- package/dist/unified-esm/src/utils/chain-config.js.map +1 -0
- package/dist/unified-esm/src/utils/currency.d.ts +26 -0
- package/dist/unified-esm/src/utils/currency.d.ts.map +1 -0
- package/dist/unified-esm/src/utils/currency.js +31 -0
- package/dist/unified-esm/src/utils/currency.js.map +1 -0
- package/dist/unified-esm/src/utils/index.d.ts +4 -0
- package/dist/unified-esm/src/utils/index.d.ts.map +1 -0
- package/dist/unified-esm/src/utils/index.js +4 -0
- package/dist/unified-esm/src/utils/index.js.map +1 -0
- package/dist/unified-esm/src/utils/validation.d.ts +10 -0
- package/dist/unified-esm/src/utils/validation.d.ts.map +1 -0
- package/dist/unified-esm/src/utils/validation.js +96 -0
- package/dist/unified-esm/src/utils/validation.js.map +1 -0
- package/dist/unified-esm/typechain-types/Mailer.d.ts +698 -0
- package/dist/unified-esm/typechain-types/Mailer.d.ts.map +1 -0
- package/dist/unified-esm/typechain-types/Mailer.js +2 -0
- package/dist/unified-esm/typechain-types/Mailer.js.map +1 -0
- package/dist/unified-esm/typechain-types/MockUSDC.d.ts +118 -0
- package/dist/unified-esm/typechain-types/MockUSDC.d.ts.map +1 -0
- package/dist/unified-esm/typechain-types/MockUSDC.js +2 -0
- package/dist/unified-esm/typechain-types/MockUSDC.js.map +1 -0
- package/dist/unified-esm/typechain-types/common.d.ts +51 -0
- package/dist/unified-esm/typechain-types/common.d.ts.map +1 -0
- package/dist/unified-esm/typechain-types/common.js +2 -0
- package/dist/unified-esm/typechain-types/common.js.map +1 -0
- package/dist/unified-esm/typechain-types/factories/Mailer__factory.d.ts +875 -0
- package/dist/unified-esm/typechain-types/factories/Mailer__factory.d.ts.map +1 -0
- package/dist/unified-esm/typechain-types/factories/Mailer__factory.js +1121 -0
- package/dist/unified-esm/typechain-types/factories/Mailer__factory.js.map +1 -0
- package/dist/unified-esm/typechain-types/factories/MockUSDC__factory.d.ts +193 -0
- package/dist/unified-esm/typechain-types/factories/MockUSDC__factory.d.ts.map +1 -0
- package/dist/unified-esm/typechain-types/factories/MockUSDC__factory.js +259 -0
- package/dist/unified-esm/typechain-types/factories/MockUSDC__factory.js.map +1 -0
- package/dist/unified-esm/typechain-types/factories/index.d.ts +4 -0
- package/dist/unified-esm/typechain-types/factories/index.d.ts.map +1 -0
- package/dist/unified-esm/typechain-types/factories/index.js +7 -0
- package/dist/unified-esm/typechain-types/factories/index.js.map +1 -0
- package/dist/unified-esm/typechain-types/factories/interfaces/IERC20__factory.d.ts +80 -0
- package/dist/unified-esm/typechain-types/factories/interfaces/IERC20__factory.d.ts.map +1 -0
- package/dist/unified-esm/typechain-types/factories/interfaces/IERC20__factory.js +112 -0
- package/dist/unified-esm/typechain-types/factories/interfaces/IERC20__factory.js.map +1 -0
- package/dist/unified-esm/typechain-types/factories/interfaces/index.d.ts +2 -0
- package/dist/unified-esm/typechain-types/factories/interfaces/index.d.ts.map +1 -0
- package/dist/unified-esm/typechain-types/factories/interfaces/index.js +5 -0
- package/dist/unified-esm/typechain-types/factories/interfaces/index.js.map +1 -0
- package/dist/unified-esm/typechain-types/index.d.ts +10 -0
- package/dist/unified-esm/typechain-types/index.d.ts.map +1 -0
- package/dist/unified-esm/typechain-types/index.js +5 -0
- package/dist/unified-esm/typechain-types/index.js.map +1 -0
- package/dist/unified-esm/typechain-types/interfaces/IERC20.d.ts +70 -0
- package/dist/unified-esm/typechain-types/interfaces/IERC20.d.ts.map +1 -0
- package/dist/unified-esm/typechain-types/interfaces/IERC20.js +2 -0
- package/dist/unified-esm/typechain-types/interfaces/IERC20.js.map +1 -0
- package/dist/unified-esm/typechain-types/interfaces/index.d.ts +2 -0
- package/dist/unified-esm/typechain-types/interfaces/index.d.ts.map +1 -0
- package/dist/unified-esm/typechain-types/interfaces/index.js +2 -0
- package/dist/unified-esm/typechain-types/interfaces/index.js.map +1 -0
- package/package.json +250 -0
- package/programs/mailer/Cargo.toml +29 -0
- package/programs/mailer/src/lib.rs +2034 -0
- package/programs/mailer/tests/integration_tests.rs +1236 -0
- package/typechain-types/Mailer.ts +1393 -0
- package/typechain-types/MockUSDC.ts +236 -0
- package/typechain-types/common.ts +131 -0
- package/typechain-types/factories/Mailer__factory.ts +1157 -0
- package/typechain-types/factories/MockUSDC__factory.ts +284 -0
- package/typechain-types/factories/index.ts +6 -0
- package/typechain-types/factories/interfaces/IERC20__factory.ts +115 -0
- package/typechain-types/factories/interfaces/index.ts +4 -0
- package/typechain-types/hardhat.d.ts +99 -0
- package/typechain-types/index.ts +12 -0
- package/typechain-types/interfaces/IERC20.ts +148 -0
- package/typechain-types/interfaces/index.ts +4 -0
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { useMailerClient } from '../context/MailerProvider.js';
|
|
3
|
+
import { mailerQueryKeys } from './useMailerQueries.js';
|
|
4
|
+
/**
|
|
5
|
+
* Hook to send a message
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* function SendMessageForm() {
|
|
10
|
+
* const sendMessage = useSendMessage();
|
|
11
|
+
*
|
|
12
|
+
* const handleSend = () => {
|
|
13
|
+
* sendMessage.mutate({
|
|
14
|
+
* subject: 'Hello',
|
|
15
|
+
* body: 'World!',
|
|
16
|
+
* priority: true,
|
|
17
|
+
* resolveSenderToName: false
|
|
18
|
+
* });
|
|
19
|
+
* };
|
|
20
|
+
*
|
|
21
|
+
* return (
|
|
22
|
+
* <button onClick={handleSend} disabled={sendMessage.isPending}>
|
|
23
|
+
* {sendMessage.isPending ? 'Sending...' : 'Send Message'}
|
|
24
|
+
* </button>
|
|
25
|
+
* );
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export function useSendMessage(options) {
|
|
30
|
+
const client = useMailerClient();
|
|
31
|
+
const queryClient = useQueryClient();
|
|
32
|
+
return useMutation({
|
|
33
|
+
mutationFn: async ({ subject, body, priority = false, resolveSenderToName = false }) => client.sendMessage(subject, body, priority, resolveSenderToName),
|
|
34
|
+
onSuccess: () => {
|
|
35
|
+
// Invalidate claimable amounts as sending affects balances
|
|
36
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.claimableAmount() });
|
|
37
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.ownerClaimable() });
|
|
38
|
+
},
|
|
39
|
+
...options,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Hook to send a prepared message
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* function SendPreparedButton() {
|
|
48
|
+
* const sendPrepared = useSendPrepared();
|
|
49
|
+
*
|
|
50
|
+
* return (
|
|
51
|
+
* <button
|
|
52
|
+
* onClick={() => sendPrepared.mutate({
|
|
53
|
+
* to: '0x123...',
|
|
54
|
+
* mailId: 'template-001',
|
|
55
|
+
* priority: true
|
|
56
|
+
* })}
|
|
57
|
+
* disabled={sendPrepared.isPending}
|
|
58
|
+
* >
|
|
59
|
+
* Send Prepared
|
|
60
|
+
* </button>
|
|
61
|
+
* );
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export function useSendPrepared(options) {
|
|
66
|
+
const client = useMailerClient();
|
|
67
|
+
const queryClient = useQueryClient();
|
|
68
|
+
return useMutation({
|
|
69
|
+
mutationFn: async ({ to, mailId, priority = false, resolveSenderToName = false }) => client.sendPrepared(to, mailId, priority, resolveSenderToName),
|
|
70
|
+
onSuccess: () => {
|
|
71
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.claimableAmount() });
|
|
72
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.ownerClaimable() });
|
|
73
|
+
},
|
|
74
|
+
...options,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Hook to send message to email address
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```tsx
|
|
82
|
+
* function SendToEmailForm() {
|
|
83
|
+
* const sendToEmail = useSendToEmail();
|
|
84
|
+
*
|
|
85
|
+
* return (
|
|
86
|
+
* <button
|
|
87
|
+
* onClick={() => sendToEmail.mutate({
|
|
88
|
+
* toEmail: 'user@example.com',
|
|
89
|
+
* subject: 'Hello',
|
|
90
|
+
* body: 'Welcome!'
|
|
91
|
+
* })}
|
|
92
|
+
* >
|
|
93
|
+
* Send to Email
|
|
94
|
+
* </button>
|
|
95
|
+
* );
|
|
96
|
+
* }
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
export function useSendToEmail(options) {
|
|
100
|
+
const client = useMailerClient();
|
|
101
|
+
const queryClient = useQueryClient();
|
|
102
|
+
return useMutation({
|
|
103
|
+
mutationFn: async ({ toEmail, subject, body }) => client.sendToEmail(toEmail, subject, body),
|
|
104
|
+
onSuccess: () => {
|
|
105
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.ownerClaimable() });
|
|
106
|
+
},
|
|
107
|
+
...options,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Hook to send prepared message to email address
|
|
112
|
+
*/
|
|
113
|
+
export function useSendPreparedToEmail(options) {
|
|
114
|
+
const client = useMailerClient();
|
|
115
|
+
const queryClient = useQueryClient();
|
|
116
|
+
return useMutation({
|
|
117
|
+
mutationFn: async ({ toEmail, mailId }) => client.sendPreparedToEmail(toEmail, mailId),
|
|
118
|
+
onSuccess: () => {
|
|
119
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.ownerClaimable() });
|
|
120
|
+
},
|
|
121
|
+
...options,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Hook to claim revenue share
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```tsx
|
|
129
|
+
* function ClaimButton() {
|
|
130
|
+
* const { data: claimable } = useGetClaimableAmount();
|
|
131
|
+
* const claimRevenue = useClaimRevenue();
|
|
132
|
+
*
|
|
133
|
+
* if (!claimable || claimable === 0n) return null;
|
|
134
|
+
*
|
|
135
|
+
* return (
|
|
136
|
+
* <button
|
|
137
|
+
* onClick={() => claimRevenue.mutate()}
|
|
138
|
+
* disabled={claimRevenue.isPending}
|
|
139
|
+
* >
|
|
140
|
+
* Claim {Number(claimable) / 1_000_000} USDC
|
|
141
|
+
* </button>
|
|
142
|
+
* );
|
|
143
|
+
* }
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
export function useClaimRevenue(options) {
|
|
147
|
+
const client = useMailerClient();
|
|
148
|
+
const queryClient = useQueryClient();
|
|
149
|
+
return useMutation({
|
|
150
|
+
mutationFn: () => client.claimRevenue(),
|
|
151
|
+
onSuccess: () => {
|
|
152
|
+
// Invalidate claimable amount after successful claim
|
|
153
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.claimableAmount() });
|
|
154
|
+
},
|
|
155
|
+
...options,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Hook to claim owner share (owner only)
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```tsx
|
|
163
|
+
* function OwnerClaimButton() {
|
|
164
|
+
* const { data: ownerClaimable } = useGetOwnerClaimable();
|
|
165
|
+
* const claimOwner = useClaimOwnerShare();
|
|
166
|
+
*
|
|
167
|
+
* return (
|
|
168
|
+
* <button onClick={() => claimOwner.mutate()}>
|
|
169
|
+
* Claim Owner Fees: {Number(ownerClaimable) / 1_000_000} USDC
|
|
170
|
+
* </button>
|
|
171
|
+
* );
|
|
172
|
+
* }
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
export function useClaimOwnerShare(options) {
|
|
176
|
+
const client = useMailerClient();
|
|
177
|
+
const queryClient = useQueryClient();
|
|
178
|
+
return useMutation({
|
|
179
|
+
mutationFn: () => client.claimOwnerShare(),
|
|
180
|
+
onSuccess: () => {
|
|
181
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.ownerClaimable() });
|
|
182
|
+
},
|
|
183
|
+
...options,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Hook to reclaim expired recipient shares (owner only)
|
|
188
|
+
*/
|
|
189
|
+
export function useClaimExpiredShares(options) {
|
|
190
|
+
const client = useMailerClient();
|
|
191
|
+
const queryClient = useQueryClient();
|
|
192
|
+
return useMutation({
|
|
193
|
+
mutationFn: async ({ recipient }) => client.claimExpiredShares(recipient),
|
|
194
|
+
onSuccess: (_, variables) => {
|
|
195
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.claimableAmount(variables.recipient) });
|
|
196
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.ownerClaimable() });
|
|
197
|
+
},
|
|
198
|
+
...options,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Hook to delegate to another address
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```tsx
|
|
206
|
+
* function DelegateButton() {
|
|
207
|
+
* const delegate = useDelegateTo();
|
|
208
|
+
*
|
|
209
|
+
* return (
|
|
210
|
+
* <button
|
|
211
|
+
* onClick={() => delegate.mutate({ delegate: '0xABC...' })}
|
|
212
|
+
* disabled={delegate.isPending}
|
|
213
|
+
* >
|
|
214
|
+
* Delegate
|
|
215
|
+
* </button>
|
|
216
|
+
* );
|
|
217
|
+
* }
|
|
218
|
+
* ```
|
|
219
|
+
*/
|
|
220
|
+
export function useDelegateTo(options) {
|
|
221
|
+
const client = useMailerClient();
|
|
222
|
+
const queryClient = useQueryClient();
|
|
223
|
+
return useMutation({
|
|
224
|
+
mutationFn: async ({ delegate }) => client.delegateTo(delegate),
|
|
225
|
+
onSuccess: () => {
|
|
226
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.delegation() });
|
|
227
|
+
},
|
|
228
|
+
...options,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Hook to reject a delegation made to you
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* ```tsx
|
|
236
|
+
* function RejectDelegationButton({ delegatorAddress }: { delegatorAddress: string }) {
|
|
237
|
+
* const rejectDelegation = useRejectDelegation();
|
|
238
|
+
*
|
|
239
|
+
* return (
|
|
240
|
+
* <button
|
|
241
|
+
* onClick={() => rejectDelegation.mutate({ delegatorAddress })}
|
|
242
|
+
* >
|
|
243
|
+
* Reject Delegation
|
|
244
|
+
* </button>
|
|
245
|
+
* );
|
|
246
|
+
* }
|
|
247
|
+
* ```
|
|
248
|
+
*/
|
|
249
|
+
export function useRejectDelegation(options) {
|
|
250
|
+
const client = useMailerClient();
|
|
251
|
+
const queryClient = useQueryClient();
|
|
252
|
+
return useMutation({
|
|
253
|
+
mutationFn: async ({ delegatorAddress }) => client.rejectDelegation(delegatorAddress),
|
|
254
|
+
onSuccess: () => {
|
|
255
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.delegation() });
|
|
256
|
+
},
|
|
257
|
+
...options,
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Hook to set send fee (owner only)
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* ```tsx
|
|
265
|
+
* function SetFeeForm() {
|
|
266
|
+
* const setFee = useSetFee();
|
|
267
|
+
*
|
|
268
|
+
* return (
|
|
269
|
+
* <button onClick={() => setFee.mutate({ newFee: 200000n })}>
|
|
270
|
+
* Update Fee to 0.2 USDC
|
|
271
|
+
* </button>
|
|
272
|
+
* );
|
|
273
|
+
* }
|
|
274
|
+
* ```
|
|
275
|
+
*/
|
|
276
|
+
export function useSetFee(options) {
|
|
277
|
+
const client = useMailerClient();
|
|
278
|
+
const queryClient = useQueryClient();
|
|
279
|
+
return useMutation({
|
|
280
|
+
mutationFn: async ({ newFee }) => client.setFee(newFee),
|
|
281
|
+
onSuccess: () => {
|
|
282
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.sendFee() });
|
|
283
|
+
},
|
|
284
|
+
...options,
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Hook to set delegation fee (owner only)
|
|
289
|
+
*/
|
|
290
|
+
export function useSetDelegationFee(options) {
|
|
291
|
+
const client = useMailerClient();
|
|
292
|
+
const queryClient = useQueryClient();
|
|
293
|
+
return useMutation({
|
|
294
|
+
mutationFn: async ({ newFee }) => client.setDelegationFee(newFee),
|
|
295
|
+
onSuccess: () => {
|
|
296
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.delegationFee() });
|
|
297
|
+
},
|
|
298
|
+
...options,
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Hook to pause the contract (owner only)
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* ```tsx
|
|
306
|
+
* function PauseButton() {
|
|
307
|
+
* const pause = usePause();
|
|
308
|
+
*
|
|
309
|
+
* return (
|
|
310
|
+
* <button
|
|
311
|
+
* onClick={() => pause.mutate()}
|
|
312
|
+
* disabled={pause.isPending}
|
|
313
|
+
* >
|
|
314
|
+
* Pause Contract
|
|
315
|
+
* </button>
|
|
316
|
+
* );
|
|
317
|
+
* }
|
|
318
|
+
* ```
|
|
319
|
+
*/
|
|
320
|
+
export function usePause(options) {
|
|
321
|
+
const client = useMailerClient();
|
|
322
|
+
const queryClient = useQueryClient();
|
|
323
|
+
return useMutation({
|
|
324
|
+
mutationFn: () => client.pause(),
|
|
325
|
+
onSuccess: () => {
|
|
326
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.isPaused() });
|
|
327
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.ownerClaimable() });
|
|
328
|
+
},
|
|
329
|
+
...options,
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Hook to unpause the contract (owner only)
|
|
334
|
+
*
|
|
335
|
+
* @example
|
|
336
|
+
* ```tsx
|
|
337
|
+
* function UnpauseButton() {
|
|
338
|
+
* const unpause = useUnpause();
|
|
339
|
+
*
|
|
340
|
+
* return (
|
|
341
|
+
* <button onClick={() => unpause.mutate()}>
|
|
342
|
+
* Unpause Contract
|
|
343
|
+
* </button>
|
|
344
|
+
* );
|
|
345
|
+
* }
|
|
346
|
+
* ```
|
|
347
|
+
*/
|
|
348
|
+
export function useUnpause(options) {
|
|
349
|
+
const client = useMailerClient();
|
|
350
|
+
const queryClient = useQueryClient();
|
|
351
|
+
return useMutation({
|
|
352
|
+
mutationFn: () => client.unpause(),
|
|
353
|
+
onSuccess: () => {
|
|
354
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.isPaused() });
|
|
355
|
+
},
|
|
356
|
+
...options,
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Hook to emergency unpause (owner only)
|
|
361
|
+
*/
|
|
362
|
+
export function useEmergencyUnpause(options) {
|
|
363
|
+
const client = useMailerClient();
|
|
364
|
+
const queryClient = useQueryClient();
|
|
365
|
+
return useMutation({
|
|
366
|
+
mutationFn: () => client.emergencyUnpause(),
|
|
367
|
+
onSuccess: () => {
|
|
368
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.isPaused() });
|
|
369
|
+
},
|
|
370
|
+
...options,
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Hook to distribute claimable funds (anyone can call when paused)
|
|
375
|
+
*
|
|
376
|
+
* @example
|
|
377
|
+
* ```tsx
|
|
378
|
+
* function DistributeFundsButton({ recipient }: { recipient: string }) {
|
|
379
|
+
* const distribute = useDistributeClaimableFunds();
|
|
380
|
+
*
|
|
381
|
+
* return (
|
|
382
|
+
* <button onClick={() => distribute.mutate({ recipient })}>
|
|
383
|
+
* Distribute Funds to {recipient}
|
|
384
|
+
* </button>
|
|
385
|
+
* );
|
|
386
|
+
* }
|
|
387
|
+
* ```
|
|
388
|
+
*/
|
|
389
|
+
export function useDistributeClaimableFunds(options) {
|
|
390
|
+
const client = useMailerClient();
|
|
391
|
+
const queryClient = useQueryClient();
|
|
392
|
+
return useMutation({
|
|
393
|
+
mutationFn: async ({ recipient }) => client.distributeClaimableFunds(recipient),
|
|
394
|
+
onSuccess: (_, variables) => {
|
|
395
|
+
queryClient.invalidateQueries({ queryKey: mailerQueryKeys.claimableAmount(variables.recipient) });
|
|
396
|
+
},
|
|
397
|
+
...options,
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
//# sourceMappingURL=useMailerMutations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMailerMutations.js","sourceRoot":"","sources":["../../../../../src/react/hooks/useMailerMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAyC,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC3G,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAA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e,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACpG,CAAC;QACD,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
/**
|
|
3
|
+
* Query keys for React Query cache management
|
|
4
|
+
*/
|
|
5
|
+
export declare const mailerQueryKeys: {
|
|
6
|
+
all: readonly ["mailer"];
|
|
7
|
+
sendFee: () => readonly ["mailer", "sendFee"];
|
|
8
|
+
delegationFee: () => readonly ["mailer", "delegationFee"];
|
|
9
|
+
claimableAmount: (address?: string) => readonly ["mailer", "claimableAmount", string | undefined];
|
|
10
|
+
ownerClaimable: () => readonly ["mailer", "ownerClaimable"];
|
|
11
|
+
delegation: (address?: string) => readonly ["mailer", "delegation", string | undefined];
|
|
12
|
+
isPaused: () => readonly ["mailer", "isPaused"];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Hook to get the current send fee
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* function FeeDisplay() {
|
|
20
|
+
* const { data: fee, isLoading } = useGetSendFee();
|
|
21
|
+
*
|
|
22
|
+
* if (isLoading) return <div>Loading...</div>;
|
|
23
|
+
* return <div>Send Fee: {Number(fee) / 1_000_000} USDC</div>;
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function useGetSendFee(options?: Omit<UseQueryOptions<bigint, Error>, 'queryKey' | 'queryFn'>): UseQueryResult<bigint, Error>;
|
|
28
|
+
/**
|
|
29
|
+
* Hook to get the current delegation fee
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* function DelegationFeeDisplay() {
|
|
34
|
+
* const { data: fee, isLoading } = useGetDelegationFee();
|
|
35
|
+
*
|
|
36
|
+
* if (isLoading) return <div>Loading...</div>;
|
|
37
|
+
* return <div>Delegation Fee: {Number(fee) / 1_000_000} USDC</div>;
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function useGetDelegationFee(options?: Omit<UseQueryOptions<bigint, Error>, 'queryKey' | 'queryFn'>): UseQueryResult<bigint, Error>;
|
|
42
|
+
/**
|
|
43
|
+
* Hook to get claimable amount for an address
|
|
44
|
+
*
|
|
45
|
+
* @param address - Address to check (defaults to connected wallet)
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* function ClaimableBalance() {
|
|
49
|
+
* const { data: amount, isLoading } = useGetClaimableAmount();
|
|
50
|
+
*
|
|
51
|
+
* if (isLoading) return <div>Loading...</div>;
|
|
52
|
+
* if (!amount || amount === 0n) return <div>No claimable balance</div>;
|
|
53
|
+
* return <div>Claimable: {Number(amount) / 1_000_000} USDC</div>;
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function useGetClaimableAmount(address?: string, options?: Omit<UseQueryOptions<bigint, Error>, 'queryKey' | 'queryFn'>): UseQueryResult<bigint, Error>;
|
|
58
|
+
/**
|
|
59
|
+
* Hook to get owner's claimable fee balance
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```tsx
|
|
63
|
+
* function OwnerDashboard() {
|
|
64
|
+
* const { data: amount, isLoading } = useGetOwnerClaimable();
|
|
65
|
+
*
|
|
66
|
+
* if (isLoading) return <div>Loading...</div>;
|
|
67
|
+
* return <div>Owner Fees: {Number(amount) / 1_000_000} USDC</div>;
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare function useGetOwnerClaimable(options?: Omit<UseQueryOptions<bigint, Error>, 'queryKey' | 'queryFn'>): UseQueryResult<bigint, Error>;
|
|
72
|
+
/**
|
|
73
|
+
* Hook to get delegation information for an address
|
|
74
|
+
*
|
|
75
|
+
* @param address - Address to check delegation for (defaults to connected wallet)
|
|
76
|
+
* @example
|
|
77
|
+
* ```tsx
|
|
78
|
+
* function DelegationStatus() {
|
|
79
|
+
* const { data: delegate, isLoading } = useGetDelegation();
|
|
80
|
+
*
|
|
81
|
+
* if (isLoading) return <div>Loading...</div>;
|
|
82
|
+
* if (!delegate) return <div>No delegation set</div>;
|
|
83
|
+
* return <div>Delegated to: {delegate}</div>;
|
|
84
|
+
* }
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare function useGetDelegation(address?: string, options?: Omit<UseQueryOptions<string | null, Error>, 'queryKey' | 'queryFn'>): UseQueryResult<string | null, Error>;
|
|
88
|
+
/**
|
|
89
|
+
* Hook to check if contract is currently paused
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```tsx
|
|
93
|
+
* function PauseStatus() {
|
|
94
|
+
* const { data: isPaused, isLoading } = useIsPaused();
|
|
95
|
+
*
|
|
96
|
+
* if (isLoading) return <div>Loading...</div>;
|
|
97
|
+
* return (
|
|
98
|
+
* <div>
|
|
99
|
+
* Contract Status: {isPaused ? '⏸️ Paused' : '✅ Active'}
|
|
100
|
+
* </div>
|
|
101
|
+
* );
|
|
102
|
+
* }
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
export declare function useIsPaused(options?: Omit<UseQueryOptions<boolean, Error>, 'queryKey' | 'queryFn'>): UseQueryResult<boolean, Error>;
|
|
106
|
+
/**
|
|
107
|
+
* Hook to get wallet address from the client
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```tsx
|
|
111
|
+
* function WalletAddress() {
|
|
112
|
+
* const address = useWalletAddress();
|
|
113
|
+
* return <div>Connected: {address}</div>;
|
|
114
|
+
* }
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
export declare function useWalletAddress(): string;
|
|
118
|
+
/**
|
|
119
|
+
* Hook to get chain type (EVM or Solana)
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```tsx
|
|
123
|
+
* function ChainBadge() {
|
|
124
|
+
* const chainType = useChainType();
|
|
125
|
+
* return <div>Chain: {chainType}</div>;
|
|
126
|
+
* }
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
export declare function useChainType(): import("@sudobility/types").ChainType;
|
|
130
|
+
//# sourceMappingURL=useMailerQueries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMailerQueries.d.ts","sourceRoot":"","sources":["../../../../../src/react/hooks/useMailerQueries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,eAAe,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGlF;;GAEG;AACH,eAAO,MAAM,eAAe;;;;gCAIE,MAAM;;2BAEX,MAAM;;CAE9B,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,GACrE,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAS/B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,GACrE,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAS/B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,GACrE,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAS/B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC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