anymal-protocol 1.0.120 → 1.0.121
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/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +196 -61
- package/dist/index.mjs +165 -31
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -497,4 +497,9 @@ declare function useClaimOrgActionReward(): (orgContractAddress: string, rewarda
|
|
|
497
497
|
|
|
498
498
|
declare function useSubmitContractAction(): (idToken: string, pid: string, source: ActionSourceType, endpoint: string, payload: ActionPayload) => Promise<SubmitResponse> | undefined;
|
|
499
499
|
|
|
500
|
-
|
|
500
|
+
/**
|
|
501
|
+
* Turn a raw revert payload into a human string.
|
|
502
|
+
*/
|
|
503
|
+
declare function humanRevert(raw: `0x${string}` | undefined, shortMessage?: string): string;
|
|
504
|
+
|
|
505
|
+
export { AUTH_API_ENDPOINTS, type ActionDefinition, type ActionPayload, type ActionRecord, type ActionReferral, ActionSourceType, ActionStatus, ActionType, type AnymalNftMetadataInputData, type AuthEnvelope, type ContractActionPayload, type CreateAnymalInputData, type ExternalActionPayload, FIREBASE_WEB_API_KEYS, FIREBASE_WEB_AUTH_API_ENDPOINTS, type GraphQLActionPayload, type JWTOptions, type MarketplaceActionPayload, MarketplacePaymentType, NETWORK_HOSTS, Network, type NotificationData, type NotificationEventData, type SubmitResponse, type WishlistPurchaseActionPayload, convertToActionDefinition, convertToActionRecord, convertToMultipleActionDefinitions, convertToMultipleActionRecords, createApp, createAuthEnvelope, fetchAnymals, flattenFirestoreData, generateAppSignature, generateBytes32Nonce, generateJWT, getFirebaseTokenForApp, humanRevert, loadExistingSecp256k1PrivateKey, processDirectKibbleApproval, processDirectPartialPayment, processOrgKibbleApproval, processOrgPartialPayment, sendUserOpWithRetries, serializePublicKeyCompressed, submitAction, useAddAnymalToDatabase, useApproveKibbleToken, useApproveOrgPartialPayment, useClaimActionReward, useClaimOrgActionReward, useCreateOrganizationAppData, useCreateOrganizationBase, useCreateUserAppData, useCreateWeb3Account, useDeleteAnymalFromDatabase, useFetchActionDefinitions, useFetchActions, useFetchAnymals, useFetchBalance, useFetchNotifications, useFetchUserData, useMintAnymalNFT, useProcessOrgPartialKibblePayment, useProcessPartialKibblePayment, useSaveAnymalMetadata, useSubmitContractAction, useUpdateAnymalWithNFT, useUpdateOrgWalletAddress, useUpdateUserAsVerified, useUpdateUserEmail, useUpdateUserName, useUpdateUserPid, useUploadAnymalImage, useVerifyAccount, useVerifyWeb3AuthSession, waitForAllowance, waitForReceiptWithRetries };
|
package/dist/index.d.ts
CHANGED
|
@@ -497,4 +497,9 @@ declare function useClaimOrgActionReward(): (orgContractAddress: string, rewarda
|
|
|
497
497
|
|
|
498
498
|
declare function useSubmitContractAction(): (idToken: string, pid: string, source: ActionSourceType, endpoint: string, payload: ActionPayload) => Promise<SubmitResponse> | undefined;
|
|
499
499
|
|
|
500
|
-
|
|
500
|
+
/**
|
|
501
|
+
* Turn a raw revert payload into a human string.
|
|
502
|
+
*/
|
|
503
|
+
declare function humanRevert(raw: `0x${string}` | undefined, shortMessage?: string): string;
|
|
504
|
+
|
|
505
|
+
export { AUTH_API_ENDPOINTS, type ActionDefinition, type ActionPayload, type ActionRecord, type ActionReferral, ActionSourceType, ActionStatus, ActionType, type AnymalNftMetadataInputData, type AuthEnvelope, type ContractActionPayload, type CreateAnymalInputData, type ExternalActionPayload, FIREBASE_WEB_API_KEYS, FIREBASE_WEB_AUTH_API_ENDPOINTS, type GraphQLActionPayload, type JWTOptions, type MarketplaceActionPayload, MarketplacePaymentType, NETWORK_HOSTS, Network, type NotificationData, type NotificationEventData, type SubmitResponse, type WishlistPurchaseActionPayload, convertToActionDefinition, convertToActionRecord, convertToMultipleActionDefinitions, convertToMultipleActionRecords, createApp, createAuthEnvelope, fetchAnymals, flattenFirestoreData, generateAppSignature, generateBytes32Nonce, generateJWT, getFirebaseTokenForApp, humanRevert, loadExistingSecp256k1PrivateKey, processDirectKibbleApproval, processDirectPartialPayment, processOrgKibbleApproval, processOrgPartialPayment, sendUserOpWithRetries, serializePublicKeyCompressed, submitAction, useAddAnymalToDatabase, useApproveKibbleToken, useApproveOrgPartialPayment, useClaimActionReward, useClaimOrgActionReward, useCreateOrganizationAppData, useCreateOrganizationBase, useCreateUserAppData, useCreateWeb3Account, useDeleteAnymalFromDatabase, useFetchActionDefinitions, useFetchActions, useFetchAnymals, useFetchBalance, useFetchNotifications, useFetchUserData, useMintAnymalNFT, useProcessOrgPartialKibblePayment, useProcessPartialKibblePayment, useSaveAnymalMetadata, useSubmitContractAction, useUpdateAnymalWithNFT, useUpdateOrgWalletAddress, useUpdateUserAsVerified, useUpdateUserEmail, useUpdateUserName, useUpdateUserPid, useUploadAnymalImage, useVerifyAccount, useVerifyWeb3AuthSession, waitForAllowance, waitForReceiptWithRetries };
|
package/dist/index.js
CHANGED
|
@@ -41,6 +41,7 @@ __export(index_exports, {
|
|
|
41
41
|
generateBytes32Nonce: () => generateBytes32Nonce,
|
|
42
42
|
generateJWT: () => generateJWT,
|
|
43
43
|
getFirebaseTokenForApp: () => getFirebaseTokenForApp,
|
|
44
|
+
humanRevert: () => humanRevert,
|
|
44
45
|
loadExistingSecp256k1PrivateKey: () => loadExistingSecp256k1PrivateKey,
|
|
45
46
|
processDirectKibbleApproval: () => processDirectKibbleApproval,
|
|
46
47
|
processDirectPartialPayment: () => processDirectPartialPayment,
|
|
@@ -458,9 +459,10 @@ function useFetchNotifications() {
|
|
|
458
459
|
}
|
|
459
460
|
|
|
460
461
|
// src/utils/anymals/useMintAnymalNFT.ts
|
|
461
|
-
var
|
|
462
|
+
var import_viem3 = require("viem");
|
|
462
463
|
|
|
463
464
|
// src/helpers/BlockchainAbiHelper.tsx
|
|
465
|
+
var import_viem = require("viem");
|
|
464
466
|
var PET_NFT_ABI = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "AccessControlBadConfirmation", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "bytes32", "name": "neededRole", "type": "bytes32" }], "name": "AccessControlUnauthorizedAccount", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [], "name": "EnforcedPause", "type": "error" }, { "inputs": [], "name": "ExpectedPause", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataApproved", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "anymalTxId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataRejected", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataSubmitted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Paused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "RewardDistributed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" }], "name": "RoleAdminChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleGranted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleRevoked", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Unpaused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "APPROVER_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DEFAULT_ADMIN_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "approveMetadata", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "campaignCount", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "campaigns", "outputs": [{ "internalType": "string", "name": "name", "type": "string" }, { "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "internalType": "bool", "name": "isActive", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_name", "type": "string" }, { "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }], "name": "createCampaign", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "defaultRewardAmount", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], "name": "getRoleAdmin", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "grantRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "hasRole", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "initialOwner", "type": "address" }, { "internalType": "contract IERC20", "name": "_rewardToken", "type": "address" }, { "internalType": "contract IPetToken", "name": "_petToken", "type": "address" }, { "internalType": "uint256", "name": "_defaultRewardAmount", "type": "uint256" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "paused", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "petToken", "outputs": [{ "internalType": "contract IPetToken", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "callerConfirmation", "type": "address" }], "name": "renounceRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "revokeRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "rewardToken", "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "submitMetadata", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "string", "name": "_campaignName", "type": "string" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "submitMetadataByCampaignName", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], "name": "supportsInterface", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }, { "internalType": "bool", "name": "_isActive", "type": "bool" }], "name": "updateCampaign", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }], "name": "updateDefaultReward", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }];
|
|
465
467
|
var MARKETPLACE_ABI = [{ "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [], "name": "ECDSAInvalidSignature", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "length", "type": "uint256" }], "name": "ECDSAInvalidSignatureLength", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "ECDSAInvalidSignatureS", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "OwnableInvalidOwner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "OwnableUnauthorizedAccount", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "string", "name": "orderId", "type": "string" }, { "indexed": true, "internalType": "address", "name": "payer", "type": "address" }, { "indexed": true, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "anymalNftId", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "amountInTokens", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "name": "PartialPaymentMade", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "string", "name": "orderId", "type": "string" }, { "indexed": true, "internalType": "address", "name": "payer", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amountInTokens", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "name": "PaymentMade", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "string", "name": "orderId", "type": "string" }, { "indexed": true, "internalType": "address", "name": "payer", "type": "address" }, { "indexed": true, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "refundedAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "name": "RefundProcessed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "bool", "name": "enabled", "type": "bool" }], "name": "SignatureCheckToggled", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "authorizer", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_initialOwner", "type": "address" }, { "internalType": "address", "name": "_authorizer", "type": "address" }, { "internalType": "address", "name": "_kibbleToken", "type": "address" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "kibbleToken", "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }, { "internalType": "address", "name": "", "type": "address" }], "name": "paidAmounts", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "orderId", "type": "string" }, { "internalType": "string", "name": "anymalNftId", "type": "string" }, { "internalType": "string", "name": "pid", "type": "string" }, { "internalType": "uint256", "name": "amountInTokens", "type": "uint256" }, { "internalType": "uint256", "name": "maxTokenPayment", "type": "uint256" }, { "internalType": "bytes32", "name": "nonce", "type": "bytes32" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "bytes", "name": "backendSignature", "type": "bytes" }], "name": "partialPay", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "orderId", "type": "string" }, { "internalType": "address", "name": "payer", "type": "address" }, { "internalType": "string", "name": "pid", "type": "string" }], "name": "refund", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_authorizer", "type": "address" }], "name": "setAuthorizer", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bool", "name": "enabled", "type": "bool" }], "name": "setSignatureCheckEnabled", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "signatureCheckEnabled", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "name": "usedNonces", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "withdrawKibble", "outputs": [], "stateMutability": "nonpayable", "type": "function" }];
|
|
466
468
|
var ORGANIZATION_BEACON_ABI = [{ "inputs": [{ "internalType": "address", "name": "_initialImplementation", "type": "address" }, { "internalType": "address", "name": "_initialOwner", "type": "address" }, { "internalType": "address", "name": "_anymalNFTProxy", "type": "address" }], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "BeaconInvalidImplementation", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "OwnableInvalidOwner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "OwnableUnauthorizedAccount", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "name", "type": "string" }, { "indexed": false, "internalType": "address", "name": "proxyAddress", "type": "address" }, { "indexed": false, "internalType": "address", "name": "networkAdmin", "type": "address" }, { "indexed": false, "internalType": "address", "name": "userAdmin", "type": "address" }], "name": "NewOrganizationCreated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "anymalNFTProxy", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_userAdmin", "type": "address" }, { "internalType": "string", "name": "_orgName", "type": "string" }, { "internalType": "string", "name": "_orgPid", "type": "string" }], "name": "createOrganizationProxy", "outputs": [{ "internalType": "address", "name": "proxyAddress", "type": "address" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "implementation", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }], "name": "upgradeBeaconTo", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }], "name": "upgradeTo", "outputs": [], "stateMutability": "nonpayable", "type": "function" }];
|
|
@@ -1275,6 +1277,21 @@ var ORGANIZATION_IMPL_ABI = [
|
|
|
1275
1277
|
"type": "function"
|
|
1276
1278
|
}
|
|
1277
1279
|
];
|
|
1280
|
+
var KIBBLE_TOKEN_ABI = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [], "name": "CheckpointUnorderedInsertion", "type": "error" }, { "inputs": [], "name": "ECDSAInvalidSignature", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "length", "type": "uint256" }], "name": "ECDSAInvalidSignatureLength", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "ECDSAInvalidSignatureS", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "increasedSupply", "type": "uint256" }, { "internalType": "uint256", "name": "cap", "type": "uint256" }], "name": "ERC20ExceededSafeSupply", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }, { "internalType": "uint256", "name": "needed", "type": "uint256" }], "name": "ERC20InsufficientAllowance", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "sender", "type": "address" }, { "internalType": "uint256", "name": "balance", "type": "uint256" }, { "internalType": "uint256", "name": "needed", "type": "uint256" }], "name": "ERC20InsufficientBalance", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "approver", "type": "address" }], "name": "ERC20InvalidApprover", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "receiver", "type": "address" }], "name": "ERC20InvalidReceiver", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "sender", "type": "address" }], "name": "ERC20InvalidSender", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }], "name": "ERC20InvalidSpender", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "deadline", "type": "uint256" }], "name": "ERC2612ExpiredSignature", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "signer", "type": "address" }, { "internalType": "address", "name": "owner", "type": "address" }], "name": "ERC2612InvalidSigner", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "timepoint", "type": "uint256" }, { "internalType": "uint48", "name": "clock", "type": "uint48" }], "name": "ERC5805FutureLookup", "type": "error" }, { "inputs": [], "name": "ERC6372InconsistentClock", "type": "error" }, { "inputs": [], "name": "EnforcedPause", "type": "error" }, { "inputs": [], "name": "ExpectedPause", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "currentNonce", "type": "uint256" }], "name": "InvalidAccountNonce", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "OwnableInvalidOwner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "OwnableUnauthorizedAccount", "type": "error" }, { "inputs": [{ "internalType": "uint8", "name": "bits", "type": "uint8" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "SafeCastOverflowedUintDowncast", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "expiry", "type": "uint256" }], "name": "VotesExpiredSignature", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "delegator", "type": "address" }, { "indexed": true, "internalType": "address", "name": "fromDelegate", "type": "address" }, { "indexed": true, "internalType": "address", "name": "toDelegate", "type": "address" }], "name": "DelegateChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "delegate", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "previousVotes", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "newVotes", "type": "uint256" }], "name": "DelegateVotesChanged", "type": "event" }, { "anonymous": false, "inputs": [], "name": "EIP712DomainChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Paused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Transfer", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Unpaused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "CLOCK_MODE", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }], "name": "allowance", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "approve", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "balanceOf", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "burn", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "burnFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint32", "name": "pos", "type": "uint32" }], "name": "checkpoints", "outputs": [{ "components": [{ "internalType": "uint48", "name": "_key", "type": "uint48" }, { "internalType": "uint208", "name": "_value", "type": "uint208" }], "internalType": "struct Checkpoints.Checkpoint208", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "clock", "outputs": [{ "internalType": "uint48", "name": "", "type": "uint48" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "decimals", "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "delegatee", "type": "address" }], "name": "delegate", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "delegatee", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "delegateBySig", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "delegates", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "eip712Domain", "outputs": [{ "internalType": "bytes1", "name": "fields", "type": "bytes1" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "version", "type": "string" }, { "internalType": "uint256", "name": "chainId", "type": "uint256" }, { "internalType": "address", "name": "verifyingContract", "type": "address" }, { "internalType": "bytes32", "name": "salt", "type": "bytes32" }, { "internalType": "uint256[]", "name": "extensions", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "timepoint", "type": "uint256" }], "name": "getPastTotalSupply", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "timepoint", "type": "uint256" }], "name": "getPastVotes", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "getVotes", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "initialOwner", "type": "address" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "mint", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "nonces", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "numCheckpoints", "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "paused", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "permit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transfer", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transferFrom", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }];
|
|
1281
|
+
var LOCAL_ERRORS = [
|
|
1282
|
+
...KIBBLE_TOKEN_ABI.filter((item) => item.type === "error"),
|
|
1283
|
+
...ORGANIZATION_IMPL_ABI.filter((item) => item.type === "error"),
|
|
1284
|
+
...MARKETPLACE_ABI.filter((item) => item.type === "error"),
|
|
1285
|
+
...REWARDABLE_ACTIONS_ABI.filter((item) => item.type === "error"),
|
|
1286
|
+
...PET_NFT_ABI.filter((item) => item.type === "error"),
|
|
1287
|
+
...ORGANIZATION_BEACON_ABI.filter((item) => item.type === "error")
|
|
1288
|
+
];
|
|
1289
|
+
var OZ_ERROR_FRAGMENTS = [
|
|
1290
|
+
"error AddressLowLevelCallFailed(address target, bytes data)",
|
|
1291
|
+
"error AddressEmptyCode(address target)"
|
|
1292
|
+
];
|
|
1293
|
+
var ERROR_ABI = [...LOCAL_ERRORS, (0, import_viem.parseAbi)([...OZ_ERROR_FRAGMENTS])];
|
|
1294
|
+
var ORG_FUNCTION = "executeCall";
|
|
1278
1295
|
|
|
1279
1296
|
// src/utils/anymals/useMintAnymalNFT.ts
|
|
1280
1297
|
var import_react10 = require("react");
|
|
@@ -1320,6 +1337,42 @@ async function applyBundlerGasEstimator(account, bundlerClient, options) {
|
|
|
1320
1337
|
};
|
|
1321
1338
|
}
|
|
1322
1339
|
|
|
1340
|
+
// src/helpers/HumanRevert.tsx
|
|
1341
|
+
var import_viem2 = require("viem");
|
|
1342
|
+
function humanRevert(raw, shortMessage) {
|
|
1343
|
+
if (!raw) return shortMessage ?? "Simulation reverted";
|
|
1344
|
+
try {
|
|
1345
|
+
const { errorName, args } = (0, import_viem2.decodeErrorResult)({
|
|
1346
|
+
abi: ERROR_ABI,
|
|
1347
|
+
data: raw
|
|
1348
|
+
});
|
|
1349
|
+
return `${errorName}(${args.map(String).join(", ")})`;
|
|
1350
|
+
} catch {
|
|
1351
|
+
if (raw.startsWith("0x08c379a0") && raw.length >= 138) {
|
|
1352
|
+
return (0, import_viem2.hexToString)(`0x${raw.slice(138)}`);
|
|
1353
|
+
}
|
|
1354
|
+
return `${raw.slice(0, 10)}\u2026`;
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
// src/helpers/SimulationHelper.tsx
|
|
1359
|
+
async function simulateCall(publicClient, target, abi, functionName, args, caller) {
|
|
1360
|
+
try {
|
|
1361
|
+
await publicClient.simulateContract({
|
|
1362
|
+
address: target,
|
|
1363
|
+
abi,
|
|
1364
|
+
functionName,
|
|
1365
|
+
args,
|
|
1366
|
+
account: caller
|
|
1367
|
+
});
|
|
1368
|
+
} catch (simErr) {
|
|
1369
|
+
const raw = simErr.raw ?? simErr.cause?.raw;
|
|
1370
|
+
const shortMsg = simErr.shortMessage;
|
|
1371
|
+
const reason = humanRevert(raw, shortMsg);
|
|
1372
|
+
throw new Error(`Simulation failed: ${reason}`);
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1323
1376
|
// src/utils/anymals/useMintAnymalNFT.ts
|
|
1324
1377
|
function useMintAnymalNFT() {
|
|
1325
1378
|
return (0, import_react10.useCallback)(
|
|
@@ -1330,17 +1383,27 @@ function useMintAnymalNFT() {
|
|
|
1330
1383
|
message: "Missing authentication token OR NFT ID."
|
|
1331
1384
|
};
|
|
1332
1385
|
}
|
|
1333
|
-
const
|
|
1386
|
+
const functionName = "submitMetadataByCampaignName";
|
|
1387
|
+
const args = [
|
|
1388
|
+
pid,
|
|
1389
|
+
nftId,
|
|
1390
|
+
`https://dev-nft.petastic.com/metadata/${nftId}`,
|
|
1391
|
+
"petastic-signup-campaign-1",
|
|
1392
|
+
anymalTxId
|
|
1393
|
+
];
|
|
1394
|
+
const callData = (0, import_viem3.encodeFunctionData)({
|
|
1334
1395
|
abi: PET_NFT_ABI,
|
|
1335
|
-
functionName
|
|
1336
|
-
args
|
|
1337
|
-
pid,
|
|
1338
|
-
nftId,
|
|
1339
|
-
`https://dev-nft.petastic.com/metadata/${nftId}`,
|
|
1340
|
-
"petastic-signup-campaign-1",
|
|
1341
|
-
anymalTxId
|
|
1342
|
-
]
|
|
1396
|
+
functionName,
|
|
1397
|
+
args
|
|
1343
1398
|
});
|
|
1399
|
+
await simulateCall(
|
|
1400
|
+
bundlerClient.client,
|
|
1401
|
+
validationContractAddress,
|
|
1402
|
+
PET_NFT_ABI,
|
|
1403
|
+
functionName,
|
|
1404
|
+
args,
|
|
1405
|
+
smartAccount.address
|
|
1406
|
+
);
|
|
1344
1407
|
await applyBundlerGasEstimator(smartAccount, bundlerClient);
|
|
1345
1408
|
const userOpHash = await bundlerClient.sendUserOperation({
|
|
1346
1409
|
account: smartAccount,
|
|
@@ -1738,7 +1801,7 @@ function useFetchAnymals() {
|
|
|
1738
1801
|
var import_react17 = require("react");
|
|
1739
1802
|
|
|
1740
1803
|
// src/helpers/ProcessDirectPartialPayment.tsx
|
|
1741
|
-
var
|
|
1804
|
+
var import_viem4 = require("viem");
|
|
1742
1805
|
|
|
1743
1806
|
// src/helpers/SendUserOpWithRetries.tsx
|
|
1744
1807
|
async function sendUserOpWithRetries(bundlerClient, params, retries = 3, delay = 1e3) {
|
|
@@ -1787,20 +1850,30 @@ async function waitForReceiptWithRetries(bundlerClient, hash, retries = 3, delay
|
|
|
1787
1850
|
// src/helpers/ProcessDirectPartialPayment.tsx
|
|
1788
1851
|
async function processDirectPartialPayment(marketplaceContract, smartAccount, bundlerClient, orderId, anymalNftId, pid, amountInTokens, maxTokenPayment, nonce, deadline, backendSignature) {
|
|
1789
1852
|
try {
|
|
1790
|
-
const
|
|
1853
|
+
const functionName = "partialPay";
|
|
1854
|
+
const args = [
|
|
1855
|
+
orderId,
|
|
1856
|
+
anymalNftId,
|
|
1857
|
+
pid,
|
|
1858
|
+
amountInTokens,
|
|
1859
|
+
maxTokenPayment,
|
|
1860
|
+
nonce,
|
|
1861
|
+
deadline,
|
|
1862
|
+
backendSignature
|
|
1863
|
+
];
|
|
1864
|
+
const partialPayCalldata = (0, import_viem4.encodeFunctionData)({
|
|
1791
1865
|
abi: MARKETPLACE_ABI,
|
|
1792
|
-
functionName
|
|
1793
|
-
args
|
|
1794
|
-
orderId,
|
|
1795
|
-
anymalNftId,
|
|
1796
|
-
pid,
|
|
1797
|
-
amountInTokens,
|
|
1798
|
-
maxTokenPayment,
|
|
1799
|
-
nonce,
|
|
1800
|
-
deadline,
|
|
1801
|
-
backendSignature
|
|
1802
|
-
]
|
|
1866
|
+
functionName,
|
|
1867
|
+
args
|
|
1803
1868
|
});
|
|
1869
|
+
await simulateCall(
|
|
1870
|
+
bundlerClient.client,
|
|
1871
|
+
marketplaceContract,
|
|
1872
|
+
MARKETPLACE_ABI,
|
|
1873
|
+
functionName,
|
|
1874
|
+
args,
|
|
1875
|
+
smartAccount.address
|
|
1876
|
+
);
|
|
1804
1877
|
await applyBundlerGasEstimator(smartAccount, bundlerClient);
|
|
1805
1878
|
const userOpHash = await sendUserOpWithRetries(bundlerClient, {
|
|
1806
1879
|
account: smartAccount,
|
|
@@ -1815,6 +1888,7 @@ async function processDirectPartialPayment(marketplaceContract, smartAccount, bu
|
|
|
1815
1888
|
};
|
|
1816
1889
|
} catch (error) {
|
|
1817
1890
|
const errorMessage = error instanceof Error ? error.cause?.message || error.message : "An unknown error occurred.";
|
|
1891
|
+
console.error(errorMessage);
|
|
1818
1892
|
return {
|
|
1819
1893
|
success: false,
|
|
1820
1894
|
message: `Error during direct payment processing: ${errorMessage}`
|
|
@@ -1883,14 +1957,24 @@ function useProcessPartialKibblePayment() {
|
|
|
1883
1957
|
var import_react18 = require("react");
|
|
1884
1958
|
|
|
1885
1959
|
// src/helpers/ProcessDirectKibbleApproval.tsx
|
|
1886
|
-
var
|
|
1960
|
+
var import_viem5 = require("viem");
|
|
1887
1961
|
async function processDirectKibbleApproval(kibbleTokenAddress, spenderAddress, smartAccount, bundlerClient, approveAmount) {
|
|
1888
1962
|
try {
|
|
1889
|
-
const
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1963
|
+
const functionName = "approve";
|
|
1964
|
+
const args = [spenderAddress, approveAmount];
|
|
1965
|
+
const approveCalldata = (0, import_viem5.encodeFunctionData)({
|
|
1966
|
+
abi: import_viem5.erc20Abi,
|
|
1967
|
+
functionName,
|
|
1968
|
+
args
|
|
1893
1969
|
});
|
|
1970
|
+
await simulateCall(
|
|
1971
|
+
bundlerClient.client,
|
|
1972
|
+
kibbleTokenAddress,
|
|
1973
|
+
import_viem5.erc20Abi,
|
|
1974
|
+
functionName,
|
|
1975
|
+
args,
|
|
1976
|
+
smartAccount.address
|
|
1977
|
+
);
|
|
1894
1978
|
await applyBundlerGasEstimator(smartAccount, bundlerClient);
|
|
1895
1979
|
const userOpHash = await sendUserOpWithRetries(bundlerClient, {
|
|
1896
1980
|
account: smartAccount,
|
|
@@ -1905,6 +1989,7 @@ async function processDirectKibbleApproval(kibbleTokenAddress, spenderAddress, s
|
|
|
1905
1989
|
};
|
|
1906
1990
|
} catch (error) {
|
|
1907
1991
|
const errorMessage = error instanceof Error ? error.cause?.message || error.message : "An unknown error occurred.";
|
|
1992
|
+
console.error(errorMessage);
|
|
1908
1993
|
return {
|
|
1909
1994
|
success: false,
|
|
1910
1995
|
message: `Error during direct approval processing: ${errorMessage}`
|
|
@@ -1942,7 +2027,7 @@ function useApproveKibbleToken() {
|
|
|
1942
2027
|
|
|
1943
2028
|
// src/utils/organization/useCreateOrganizationBase.ts
|
|
1944
2029
|
var import_react19 = require("react");
|
|
1945
|
-
var
|
|
2030
|
+
var import_viem6 = require("viem");
|
|
1946
2031
|
function useCreateOrganizationBase() {
|
|
1947
2032
|
return (0, import_react19.useCallback)(
|
|
1948
2033
|
/**
|
|
@@ -1964,11 +2049,21 @@ function useCreateOrganizationBase() {
|
|
|
1964
2049
|
};
|
|
1965
2050
|
}
|
|
1966
2051
|
try {
|
|
1967
|
-
const
|
|
2052
|
+
const functionName = "createOrganizationProxy";
|
|
2053
|
+
const args = [ownerAddress, orgName, orgPid];
|
|
2054
|
+
const callData = (0, import_viem6.encodeFunctionData)({
|
|
1968
2055
|
abi: ORGANIZATION_BEACON_ABI,
|
|
1969
|
-
functionName
|
|
1970
|
-
args
|
|
2056
|
+
functionName,
|
|
2057
|
+
args
|
|
1971
2058
|
});
|
|
2059
|
+
await simulateCall(
|
|
2060
|
+
bundlerClient.client,
|
|
2061
|
+
orgContractAddress,
|
|
2062
|
+
ORGANIZATION_BEACON_ABI,
|
|
2063
|
+
functionName,
|
|
2064
|
+
args,
|
|
2065
|
+
adminSmartAccount.address
|
|
2066
|
+
);
|
|
1972
2067
|
await applyBundlerGasEstimator(adminSmartAccount, bundlerClient);
|
|
1973
2068
|
const userOpHash = await bundlerClient.sendUserOperation({
|
|
1974
2069
|
account: adminSmartAccount,
|
|
@@ -1994,7 +2089,7 @@ function useCreateOrganizationBase() {
|
|
|
1994
2089
|
let proxyAddress;
|
|
1995
2090
|
for (const log of txReceipt.logs) {
|
|
1996
2091
|
try {
|
|
1997
|
-
const decoded = (0,
|
|
2092
|
+
const decoded = (0, import_viem6.decodeEventLog)({
|
|
1998
2093
|
abi: ORGANIZATION_BEACON_ABI,
|
|
1999
2094
|
data: log.data,
|
|
2000
2095
|
topics: log.topics
|
|
@@ -2033,10 +2128,10 @@ function useCreateOrganizationBase() {
|
|
|
2033
2128
|
var import_react20 = require("react");
|
|
2034
2129
|
|
|
2035
2130
|
// src/helpers/ProcessOrgKibbleApproval.tsx
|
|
2036
|
-
var
|
|
2131
|
+
var import_viem8 = require("viem");
|
|
2037
2132
|
|
|
2038
2133
|
// src/helpers/WaitForAllowance.tsx
|
|
2039
|
-
var
|
|
2134
|
+
var import_viem7 = require("viem");
|
|
2040
2135
|
async function waitForAllowance(publicClient, tokenAddress, ownerAddress, spenderAddress, expectedAmount) {
|
|
2041
2136
|
const MAX_RETRIES = 10;
|
|
2042
2137
|
const RETRY_INTERVAL = 2e3;
|
|
@@ -2045,7 +2140,7 @@ async function waitForAllowance(publicClient, tokenAddress, ownerAddress, spende
|
|
|
2045
2140
|
try {
|
|
2046
2141
|
const currentAllowance = await publicClient.readContract({
|
|
2047
2142
|
address: tokenAddress,
|
|
2048
|
-
abi:
|
|
2143
|
+
abi: import_viem7.erc20Abi,
|
|
2049
2144
|
functionName: "allowance",
|
|
2050
2145
|
args: [ownerAddress, spenderAddress]
|
|
2051
2146
|
});
|
|
@@ -2070,16 +2165,25 @@ async function processOrgKibbleApproval(orgContractAddress, kibbleTokenAddress,
|
|
|
2070
2165
|
if (approveAmount <= 0n) {
|
|
2071
2166
|
return { success: false, message: "Approval amount must be greater than zero." };
|
|
2072
2167
|
}
|
|
2073
|
-
const approveCalldata = (0,
|
|
2074
|
-
abi:
|
|
2168
|
+
const approveCalldata = (0, import_viem8.encodeFunctionData)({
|
|
2169
|
+
abi: import_viem8.erc20Abi,
|
|
2075
2170
|
functionName: "approve",
|
|
2076
2171
|
args: [partialPaymentModuleAddress, approveAmount]
|
|
2077
2172
|
});
|
|
2078
|
-
const
|
|
2173
|
+
const args = [kibbleTokenAddress, approveCalldata];
|
|
2174
|
+
const executeApproveCalldata = (0, import_viem8.encodeFunctionData)({
|
|
2079
2175
|
abi: ORGANIZATION_IMPL_ABI,
|
|
2080
|
-
functionName:
|
|
2081
|
-
args
|
|
2176
|
+
functionName: ORG_FUNCTION,
|
|
2177
|
+
args
|
|
2082
2178
|
});
|
|
2179
|
+
await simulateCall(
|
|
2180
|
+
bundlerClient.client,
|
|
2181
|
+
orgContractAddress,
|
|
2182
|
+
ORGANIZATION_IMPL_ABI,
|
|
2183
|
+
ORG_FUNCTION,
|
|
2184
|
+
args,
|
|
2185
|
+
managerSmartAccount.address
|
|
2186
|
+
);
|
|
2083
2187
|
await applyBundlerGasEstimator(managerSmartAccount, bundlerClient);
|
|
2084
2188
|
const userOpApproveHash = await sendUserOpWithRetries(bundlerClient, {
|
|
2085
2189
|
account: managerSmartAccount,
|
|
@@ -2109,6 +2213,7 @@ async function processOrgKibbleApproval(orgContractAddress, kibbleTokenAddress,
|
|
|
2109
2213
|
};
|
|
2110
2214
|
} catch (error) {
|
|
2111
2215
|
const errorMessage = error instanceof Error ? error.cause?.message || error.message : "An unknown error occurred.";
|
|
2216
|
+
console.error(errorMessage);
|
|
2112
2217
|
return {
|
|
2113
2218
|
success: false,
|
|
2114
2219
|
message: `Error during approval processing: ${errorMessage}`
|
|
@@ -2153,10 +2258,10 @@ function useApproveOrgPartialPayment() {
|
|
|
2153
2258
|
var import_react21 = require("react");
|
|
2154
2259
|
|
|
2155
2260
|
// src/helpers/ProcessOrgPartialPayment.tsx
|
|
2156
|
-
var
|
|
2261
|
+
var import_viem9 = require("viem");
|
|
2157
2262
|
async function processOrgPartialPayment(orgContractAddress, partialPaymentModuleAddress, managerSmartAccount, bundlerClient, orderId, anymalNftId, pid, amountInTokens, maxTokenPayment, nonce, deadline, backendSignature) {
|
|
2158
2263
|
try {
|
|
2159
|
-
const partialPayCalldata = (0,
|
|
2264
|
+
const partialPayCalldata = (0, import_viem9.encodeFunctionData)({
|
|
2160
2265
|
abi: MARKETPLACE_ABI,
|
|
2161
2266
|
functionName: "partialPay",
|
|
2162
2267
|
args: [
|
|
@@ -2170,11 +2275,20 @@ async function processOrgPartialPayment(orgContractAddress, partialPaymentModule
|
|
|
2170
2275
|
backendSignature
|
|
2171
2276
|
]
|
|
2172
2277
|
});
|
|
2173
|
-
const
|
|
2278
|
+
const args = [partialPaymentModuleAddress, partialPayCalldata];
|
|
2279
|
+
const executePartialPayCalldata = (0, import_viem9.encodeFunctionData)({
|
|
2174
2280
|
abi: ORGANIZATION_IMPL_ABI,
|
|
2175
|
-
functionName:
|
|
2176
|
-
args
|
|
2281
|
+
functionName: ORG_FUNCTION,
|
|
2282
|
+
args
|
|
2177
2283
|
});
|
|
2284
|
+
await simulateCall(
|
|
2285
|
+
bundlerClient.client,
|
|
2286
|
+
orgContractAddress,
|
|
2287
|
+
ORGANIZATION_IMPL_ABI,
|
|
2288
|
+
ORG_FUNCTION,
|
|
2289
|
+
args,
|
|
2290
|
+
managerSmartAccount.address
|
|
2291
|
+
);
|
|
2178
2292
|
await applyBundlerGasEstimator(managerSmartAccount, bundlerClient);
|
|
2179
2293
|
const userOpHash = await sendUserOpWithRetries(bundlerClient, {
|
|
2180
2294
|
account: managerSmartAccount,
|
|
@@ -2189,6 +2303,7 @@ async function processOrgPartialPayment(orgContractAddress, partialPaymentModule
|
|
|
2189
2303
|
};
|
|
2190
2304
|
} catch (error) {
|
|
2191
2305
|
const errorMessage = error instanceof Error ? error.cause?.message || error.message : "An unknown error occurred.";
|
|
2306
|
+
console.error(errorMessage);
|
|
2192
2307
|
return {
|
|
2193
2308
|
success: false,
|
|
2194
2309
|
message: `Error during payment processing: ${errorMessage}`
|
|
@@ -2278,10 +2393,10 @@ function useUpdateOrgWalletAddress() {
|
|
|
2278
2393
|
|
|
2279
2394
|
// src/helpers/NonceHelper.tsx
|
|
2280
2395
|
var import_uuid = require("uuid");
|
|
2281
|
-
var
|
|
2396
|
+
var import_viem10 = require("viem");
|
|
2282
2397
|
var generateBytes32Nonce = () => {
|
|
2283
2398
|
const uuid3 = (0, import_uuid.v4)().replace(/-/g, "");
|
|
2284
|
-
return (0,
|
|
2399
|
+
return (0, import_viem10.padHex)(`0x${uuid3}`, { size: 32 });
|
|
2285
2400
|
};
|
|
2286
2401
|
|
|
2287
2402
|
// src/helpers/CryptoUtils.tsx
|
|
@@ -2737,16 +2852,16 @@ function useCreateOrganizationAppData() {
|
|
|
2737
2852
|
|
|
2738
2853
|
// src/utils/balance/useFetchBalance.ts
|
|
2739
2854
|
var import_react27 = require("react");
|
|
2740
|
-
var
|
|
2855
|
+
var import_viem11 = require("viem");
|
|
2741
2856
|
function useFetchBalance() {
|
|
2742
2857
|
return (0, import_react27.useCallback)(
|
|
2743
2858
|
async (publicClient, walletAddress, kibbleTokenAddress) => {
|
|
2744
2859
|
try {
|
|
2745
2860
|
const balance = await publicClient.readContract({
|
|
2746
|
-
address: (0,
|
|
2747
|
-
abi:
|
|
2861
|
+
address: (0, import_viem11.getAddress)(kibbleTokenAddress),
|
|
2862
|
+
abi: import_viem11.erc20Abi,
|
|
2748
2863
|
functionName: "balanceOf",
|
|
2749
|
-
args: [(0,
|
|
2864
|
+
args: [(0, import_viem11.getAddress)(walletAddress)]
|
|
2750
2865
|
});
|
|
2751
2866
|
return Number(balance);
|
|
2752
2867
|
} catch (error) {
|
|
@@ -2758,7 +2873,7 @@ function useFetchBalance() {
|
|
|
2758
2873
|
}
|
|
2759
2874
|
|
|
2760
2875
|
// src/utils/actions/useClaimActionReward.ts
|
|
2761
|
-
var
|
|
2876
|
+
var import_viem12 = require("viem");
|
|
2762
2877
|
var import_react28 = require("react");
|
|
2763
2878
|
function useClaimActionReward() {
|
|
2764
2879
|
return (0, import_react28.useCallback)(
|
|
@@ -2769,11 +2884,21 @@ function useClaimActionReward() {
|
|
|
2769
2884
|
message: "Missing web3auth account info or contract address."
|
|
2770
2885
|
};
|
|
2771
2886
|
}
|
|
2772
|
-
const
|
|
2887
|
+
const args = [actionId, claimIndex];
|
|
2888
|
+
const functionName = "claimByIndex";
|
|
2889
|
+
const callData = (0, import_viem12.encodeFunctionData)({
|
|
2773
2890
|
abi: REWARDABLE_ACTIONS_ABI,
|
|
2774
|
-
functionName
|
|
2775
|
-
args
|
|
2891
|
+
functionName,
|
|
2892
|
+
args
|
|
2776
2893
|
});
|
|
2894
|
+
await simulateCall(
|
|
2895
|
+
bundlerClient.client,
|
|
2896
|
+
rewardableActionContractAddress,
|
|
2897
|
+
REWARDABLE_ACTIONS_ABI,
|
|
2898
|
+
functionName,
|
|
2899
|
+
args,
|
|
2900
|
+
smartAccount.address
|
|
2901
|
+
);
|
|
2777
2902
|
await applyBundlerGasEstimator(smartAccount, bundlerClient);
|
|
2778
2903
|
const userOpHash = await bundlerClient.sendUserOperation({
|
|
2779
2904
|
account: smartAccount,
|
|
@@ -2797,7 +2922,7 @@ function useClaimActionReward() {
|
|
|
2797
2922
|
}
|
|
2798
2923
|
|
|
2799
2924
|
// src/utils/actions/useClaimOrgActionReward.ts
|
|
2800
|
-
var
|
|
2925
|
+
var import_viem13 = require("viem");
|
|
2801
2926
|
var import_react29 = require("react");
|
|
2802
2927
|
function useClaimOrgActionReward() {
|
|
2803
2928
|
return (0, import_react29.useCallback)(
|
|
@@ -2808,16 +2933,25 @@ function useClaimOrgActionReward() {
|
|
|
2808
2933
|
message: "Missing web3auth account info or contract address."
|
|
2809
2934
|
};
|
|
2810
2935
|
}
|
|
2811
|
-
const claimCallData = (0,
|
|
2936
|
+
const claimCallData = (0, import_viem13.encodeFunctionData)({
|
|
2812
2937
|
abi: REWARDABLE_ACTIONS_ABI,
|
|
2813
2938
|
functionName: "claimByIndex",
|
|
2814
2939
|
args: [actionId, claimIndex]
|
|
2815
2940
|
});
|
|
2816
|
-
const
|
|
2941
|
+
const args = [rewardableActionContractAddress, claimCallData];
|
|
2942
|
+
const executeClaimCalldata = (0, import_viem13.encodeFunctionData)({
|
|
2817
2943
|
abi: ORGANIZATION_IMPL_ABI,
|
|
2818
|
-
functionName:
|
|
2819
|
-
args
|
|
2944
|
+
functionName: ORG_FUNCTION,
|
|
2945
|
+
args
|
|
2820
2946
|
});
|
|
2947
|
+
await simulateCall(
|
|
2948
|
+
bundlerClient.client,
|
|
2949
|
+
orgContractAddress,
|
|
2950
|
+
ORGANIZATION_IMPL_ABI,
|
|
2951
|
+
ORG_FUNCTION,
|
|
2952
|
+
args,
|
|
2953
|
+
smartAccount.address
|
|
2954
|
+
);
|
|
2821
2955
|
await applyBundlerGasEstimator(smartAccount, bundlerClient);
|
|
2822
2956
|
const userOpHash = await bundlerClient.sendUserOperation({
|
|
2823
2957
|
account: smartAccount,
|
|
@@ -2981,6 +3115,7 @@ function isMarketplacePurchaseAction(payload) {
|
|
|
2981
3115
|
generateBytes32Nonce,
|
|
2982
3116
|
generateJWT,
|
|
2983
3117
|
getFirebaseTokenForApp,
|
|
3118
|
+
humanRevert,
|
|
2984
3119
|
loadExistingSecp256k1PrivateKey,
|
|
2985
3120
|
processDirectKibbleApproval,
|
|
2986
3121
|
processDirectPartialPayment,
|
package/dist/index.mjs
CHANGED
|
@@ -391,6 +391,7 @@ function useFetchNotifications() {
|
|
|
391
391
|
import { encodeFunctionData } from "viem";
|
|
392
392
|
|
|
393
393
|
// src/helpers/BlockchainAbiHelper.tsx
|
|
394
|
+
import { parseAbi } from "viem";
|
|
394
395
|
var PET_NFT_ABI = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "AccessControlBadConfirmation", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "bytes32", "name": "neededRole", "type": "bytes32" }], "name": "AccessControlUnauthorizedAccount", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [], "name": "EnforcedPause", "type": "error" }, { "inputs": [], "name": "ExpectedPause", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataApproved", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "anymalTxId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataRejected", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataSubmitted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Paused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "RewardDistributed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" }], "name": "RoleAdminChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleGranted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleRevoked", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Unpaused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "APPROVER_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DEFAULT_ADMIN_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "approveMetadata", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "campaignCount", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "campaigns", "outputs": [{ "internalType": "string", "name": "name", "type": "string" }, { "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "internalType": "bool", "name": "isActive", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_name", "type": "string" }, { "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }], "name": "createCampaign", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "defaultRewardAmount", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], "name": "getRoleAdmin", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "grantRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "hasRole", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "initialOwner", "type": "address" }, { "internalType": "contract IERC20", "name": "_rewardToken", "type": "address" }, { "internalType": "contract IPetToken", "name": "_petToken", "type": "address" }, { "internalType": "uint256", "name": "_defaultRewardAmount", "type": "uint256" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "paused", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "petToken", "outputs": [{ "internalType": "contract IPetToken", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "callerConfirmation", "type": "address" }], "name": "renounceRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "revokeRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "rewardToken", "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "submitMetadata", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "string", "name": "_campaignName", "type": "string" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "submitMetadataByCampaignName", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], "name": "supportsInterface", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }, { "internalType": "bool", "name": "_isActive", "type": "bool" }], "name": "updateCampaign", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }], "name": "updateDefaultReward", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }];
|
|
395
396
|
var MARKETPLACE_ABI = [{ "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [], "name": "ECDSAInvalidSignature", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "length", "type": "uint256" }], "name": "ECDSAInvalidSignatureLength", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "ECDSAInvalidSignatureS", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "OwnableInvalidOwner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "OwnableUnauthorizedAccount", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "string", "name": "orderId", "type": "string" }, { "indexed": true, "internalType": "address", "name": "payer", "type": "address" }, { "indexed": true, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "anymalNftId", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "amountInTokens", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "name": "PartialPaymentMade", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "string", "name": "orderId", "type": "string" }, { "indexed": true, "internalType": "address", "name": "payer", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amountInTokens", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "name": "PaymentMade", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "string", "name": "orderId", "type": "string" }, { "indexed": true, "internalType": "address", "name": "payer", "type": "address" }, { "indexed": true, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "refundedAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "name": "RefundProcessed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "bool", "name": "enabled", "type": "bool" }], "name": "SignatureCheckToggled", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "authorizer", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_initialOwner", "type": "address" }, { "internalType": "address", "name": "_authorizer", "type": "address" }, { "internalType": "address", "name": "_kibbleToken", "type": "address" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "kibbleToken", "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }, { "internalType": "address", "name": "", "type": "address" }], "name": "paidAmounts", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "orderId", "type": "string" }, { "internalType": "string", "name": "anymalNftId", "type": "string" }, { "internalType": "string", "name": "pid", "type": "string" }, { "internalType": "uint256", "name": "amountInTokens", "type": "uint256" }, { "internalType": "uint256", "name": "maxTokenPayment", "type": "uint256" }, { "internalType": "bytes32", "name": "nonce", "type": "bytes32" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "bytes", "name": "backendSignature", "type": "bytes" }], "name": "partialPay", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "orderId", "type": "string" }, { "internalType": "address", "name": "payer", "type": "address" }, { "internalType": "string", "name": "pid", "type": "string" }], "name": "refund", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_authorizer", "type": "address" }], "name": "setAuthorizer", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bool", "name": "enabled", "type": "bool" }], "name": "setSignatureCheckEnabled", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "signatureCheckEnabled", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "name": "usedNonces", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "withdrawKibble", "outputs": [], "stateMutability": "nonpayable", "type": "function" }];
|
|
396
397
|
var ORGANIZATION_BEACON_ABI = [{ "inputs": [{ "internalType": "address", "name": "_initialImplementation", "type": "address" }, { "internalType": "address", "name": "_initialOwner", "type": "address" }, { "internalType": "address", "name": "_anymalNFTProxy", "type": "address" }], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "BeaconInvalidImplementation", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "OwnableInvalidOwner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "OwnableUnauthorizedAccount", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "name", "type": "string" }, { "indexed": false, "internalType": "address", "name": "proxyAddress", "type": "address" }, { "indexed": false, "internalType": "address", "name": "networkAdmin", "type": "address" }, { "indexed": false, "internalType": "address", "name": "userAdmin", "type": "address" }], "name": "NewOrganizationCreated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "anymalNFTProxy", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_userAdmin", "type": "address" }, { "internalType": "string", "name": "_orgName", "type": "string" }, { "internalType": "string", "name": "_orgPid", "type": "string" }], "name": "createOrganizationProxy", "outputs": [{ "internalType": "address", "name": "proxyAddress", "type": "address" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "implementation", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }], "name": "upgradeBeaconTo", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }], "name": "upgradeTo", "outputs": [], "stateMutability": "nonpayable", "type": "function" }];
|
|
@@ -1205,6 +1206,21 @@ var ORGANIZATION_IMPL_ABI = [
|
|
|
1205
1206
|
"type": "function"
|
|
1206
1207
|
}
|
|
1207
1208
|
];
|
|
1209
|
+
var KIBBLE_TOKEN_ABI = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [], "name": "CheckpointUnorderedInsertion", "type": "error" }, { "inputs": [], "name": "ECDSAInvalidSignature", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "length", "type": "uint256" }], "name": "ECDSAInvalidSignatureLength", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "ECDSAInvalidSignatureS", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "increasedSupply", "type": "uint256" }, { "internalType": "uint256", "name": "cap", "type": "uint256" }], "name": "ERC20ExceededSafeSupply", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }, { "internalType": "uint256", "name": "needed", "type": "uint256" }], "name": "ERC20InsufficientAllowance", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "sender", "type": "address" }, { "internalType": "uint256", "name": "balance", "type": "uint256" }, { "internalType": "uint256", "name": "needed", "type": "uint256" }], "name": "ERC20InsufficientBalance", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "approver", "type": "address" }], "name": "ERC20InvalidApprover", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "receiver", "type": "address" }], "name": "ERC20InvalidReceiver", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "sender", "type": "address" }], "name": "ERC20InvalidSender", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }], "name": "ERC20InvalidSpender", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "deadline", "type": "uint256" }], "name": "ERC2612ExpiredSignature", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "signer", "type": "address" }, { "internalType": "address", "name": "owner", "type": "address" }], "name": "ERC2612InvalidSigner", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "timepoint", "type": "uint256" }, { "internalType": "uint48", "name": "clock", "type": "uint48" }], "name": "ERC5805FutureLookup", "type": "error" }, { "inputs": [], "name": "ERC6372InconsistentClock", "type": "error" }, { "inputs": [], "name": "EnforcedPause", "type": "error" }, { "inputs": [], "name": "ExpectedPause", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "currentNonce", "type": "uint256" }], "name": "InvalidAccountNonce", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "OwnableInvalidOwner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "OwnableUnauthorizedAccount", "type": "error" }, { "inputs": [{ "internalType": "uint8", "name": "bits", "type": "uint8" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "SafeCastOverflowedUintDowncast", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "expiry", "type": "uint256" }], "name": "VotesExpiredSignature", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "delegator", "type": "address" }, { "indexed": true, "internalType": "address", "name": "fromDelegate", "type": "address" }, { "indexed": true, "internalType": "address", "name": "toDelegate", "type": "address" }], "name": "DelegateChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "delegate", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "previousVotes", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "newVotes", "type": "uint256" }], "name": "DelegateVotesChanged", "type": "event" }, { "anonymous": false, "inputs": [], "name": "EIP712DomainChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Paused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Transfer", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Unpaused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "CLOCK_MODE", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }], "name": "allowance", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "approve", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "balanceOf", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "burn", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "burnFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint32", "name": "pos", "type": "uint32" }], "name": "checkpoints", "outputs": [{ "components": [{ "internalType": "uint48", "name": "_key", "type": "uint48" }, { "internalType": "uint208", "name": "_value", "type": "uint208" }], "internalType": "struct Checkpoints.Checkpoint208", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "clock", "outputs": [{ "internalType": "uint48", "name": "", "type": "uint48" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "decimals", "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "delegatee", "type": "address" }], "name": "delegate", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "delegatee", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "delegateBySig", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "delegates", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "eip712Domain", "outputs": [{ "internalType": "bytes1", "name": "fields", "type": "bytes1" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "version", "type": "string" }, { "internalType": "uint256", "name": "chainId", "type": "uint256" }, { "internalType": "address", "name": "verifyingContract", "type": "address" }, { "internalType": "bytes32", "name": "salt", "type": "bytes32" }, { "internalType": "uint256[]", "name": "extensions", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "timepoint", "type": "uint256" }], "name": "getPastTotalSupply", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "timepoint", "type": "uint256" }], "name": "getPastVotes", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "getVotes", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "initialOwner", "type": "address" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "mint", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "nonces", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "numCheckpoints", "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "paused", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "permit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transfer", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transferFrom", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }];
|
|
1210
|
+
var LOCAL_ERRORS = [
|
|
1211
|
+
...KIBBLE_TOKEN_ABI.filter((item) => item.type === "error"),
|
|
1212
|
+
...ORGANIZATION_IMPL_ABI.filter((item) => item.type === "error"),
|
|
1213
|
+
...MARKETPLACE_ABI.filter((item) => item.type === "error"),
|
|
1214
|
+
...REWARDABLE_ACTIONS_ABI.filter((item) => item.type === "error"),
|
|
1215
|
+
...PET_NFT_ABI.filter((item) => item.type === "error"),
|
|
1216
|
+
...ORGANIZATION_BEACON_ABI.filter((item) => item.type === "error")
|
|
1217
|
+
];
|
|
1218
|
+
var OZ_ERROR_FRAGMENTS = [
|
|
1219
|
+
"error AddressLowLevelCallFailed(address target, bytes data)",
|
|
1220
|
+
"error AddressEmptyCode(address target)"
|
|
1221
|
+
];
|
|
1222
|
+
var ERROR_ABI = [...LOCAL_ERRORS, parseAbi([...OZ_ERROR_FRAGMENTS])];
|
|
1223
|
+
var ORG_FUNCTION = "executeCall";
|
|
1208
1224
|
|
|
1209
1225
|
// src/utils/anymals/useMintAnymalNFT.ts
|
|
1210
1226
|
import { useCallback as useCallback10 } from "react";
|
|
@@ -1250,6 +1266,42 @@ async function applyBundlerGasEstimator(account, bundlerClient, options) {
|
|
|
1250
1266
|
};
|
|
1251
1267
|
}
|
|
1252
1268
|
|
|
1269
|
+
// src/helpers/HumanRevert.tsx
|
|
1270
|
+
import { decodeErrorResult, hexToString } from "viem";
|
|
1271
|
+
function humanRevert(raw, shortMessage) {
|
|
1272
|
+
if (!raw) return shortMessage ?? "Simulation reverted";
|
|
1273
|
+
try {
|
|
1274
|
+
const { errorName, args } = decodeErrorResult({
|
|
1275
|
+
abi: ERROR_ABI,
|
|
1276
|
+
data: raw
|
|
1277
|
+
});
|
|
1278
|
+
return `${errorName}(${args.map(String).join(", ")})`;
|
|
1279
|
+
} catch {
|
|
1280
|
+
if (raw.startsWith("0x08c379a0") && raw.length >= 138) {
|
|
1281
|
+
return hexToString(`0x${raw.slice(138)}`);
|
|
1282
|
+
}
|
|
1283
|
+
return `${raw.slice(0, 10)}\u2026`;
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
// src/helpers/SimulationHelper.tsx
|
|
1288
|
+
async function simulateCall(publicClient, target, abi, functionName, args, caller) {
|
|
1289
|
+
try {
|
|
1290
|
+
await publicClient.simulateContract({
|
|
1291
|
+
address: target,
|
|
1292
|
+
abi,
|
|
1293
|
+
functionName,
|
|
1294
|
+
args,
|
|
1295
|
+
account: caller
|
|
1296
|
+
});
|
|
1297
|
+
} catch (simErr) {
|
|
1298
|
+
const raw = simErr.raw ?? simErr.cause?.raw;
|
|
1299
|
+
const shortMsg = simErr.shortMessage;
|
|
1300
|
+
const reason = humanRevert(raw, shortMsg);
|
|
1301
|
+
throw new Error(`Simulation failed: ${reason}`);
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1253
1305
|
// src/utils/anymals/useMintAnymalNFT.ts
|
|
1254
1306
|
function useMintAnymalNFT() {
|
|
1255
1307
|
return useCallback10(
|
|
@@ -1260,17 +1312,27 @@ function useMintAnymalNFT() {
|
|
|
1260
1312
|
message: "Missing authentication token OR NFT ID."
|
|
1261
1313
|
};
|
|
1262
1314
|
}
|
|
1315
|
+
const functionName = "submitMetadataByCampaignName";
|
|
1316
|
+
const args = [
|
|
1317
|
+
pid,
|
|
1318
|
+
nftId,
|
|
1319
|
+
`https://dev-nft.petastic.com/metadata/${nftId}`,
|
|
1320
|
+
"petastic-signup-campaign-1",
|
|
1321
|
+
anymalTxId
|
|
1322
|
+
];
|
|
1263
1323
|
const callData = encodeFunctionData({
|
|
1264
1324
|
abi: PET_NFT_ABI,
|
|
1265
|
-
functionName
|
|
1266
|
-
args
|
|
1267
|
-
pid,
|
|
1268
|
-
nftId,
|
|
1269
|
-
`https://dev-nft.petastic.com/metadata/${nftId}`,
|
|
1270
|
-
"petastic-signup-campaign-1",
|
|
1271
|
-
anymalTxId
|
|
1272
|
-
]
|
|
1325
|
+
functionName,
|
|
1326
|
+
args
|
|
1273
1327
|
});
|
|
1328
|
+
await simulateCall(
|
|
1329
|
+
bundlerClient.client,
|
|
1330
|
+
validationContractAddress,
|
|
1331
|
+
PET_NFT_ABI,
|
|
1332
|
+
functionName,
|
|
1333
|
+
args,
|
|
1334
|
+
smartAccount.address
|
|
1335
|
+
);
|
|
1274
1336
|
await applyBundlerGasEstimator(smartAccount, bundlerClient);
|
|
1275
1337
|
const userOpHash = await bundlerClient.sendUserOperation({
|
|
1276
1338
|
account: smartAccount,
|
|
@@ -1717,20 +1779,30 @@ async function waitForReceiptWithRetries(bundlerClient, hash, retries = 3, delay
|
|
|
1717
1779
|
// src/helpers/ProcessDirectPartialPayment.tsx
|
|
1718
1780
|
async function processDirectPartialPayment(marketplaceContract, smartAccount, bundlerClient, orderId, anymalNftId, pid, amountInTokens, maxTokenPayment, nonce, deadline, backendSignature) {
|
|
1719
1781
|
try {
|
|
1782
|
+
const functionName = "partialPay";
|
|
1783
|
+
const args = [
|
|
1784
|
+
orderId,
|
|
1785
|
+
anymalNftId,
|
|
1786
|
+
pid,
|
|
1787
|
+
amountInTokens,
|
|
1788
|
+
maxTokenPayment,
|
|
1789
|
+
nonce,
|
|
1790
|
+
deadline,
|
|
1791
|
+
backendSignature
|
|
1792
|
+
];
|
|
1720
1793
|
const partialPayCalldata = encodeFunctionData2({
|
|
1721
1794
|
abi: MARKETPLACE_ABI,
|
|
1722
|
-
functionName
|
|
1723
|
-
args
|
|
1724
|
-
orderId,
|
|
1725
|
-
anymalNftId,
|
|
1726
|
-
pid,
|
|
1727
|
-
amountInTokens,
|
|
1728
|
-
maxTokenPayment,
|
|
1729
|
-
nonce,
|
|
1730
|
-
deadline,
|
|
1731
|
-
backendSignature
|
|
1732
|
-
]
|
|
1795
|
+
functionName,
|
|
1796
|
+
args
|
|
1733
1797
|
});
|
|
1798
|
+
await simulateCall(
|
|
1799
|
+
bundlerClient.client,
|
|
1800
|
+
marketplaceContract,
|
|
1801
|
+
MARKETPLACE_ABI,
|
|
1802
|
+
functionName,
|
|
1803
|
+
args,
|
|
1804
|
+
smartAccount.address
|
|
1805
|
+
);
|
|
1734
1806
|
await applyBundlerGasEstimator(smartAccount, bundlerClient);
|
|
1735
1807
|
const userOpHash = await sendUserOpWithRetries(bundlerClient, {
|
|
1736
1808
|
account: smartAccount,
|
|
@@ -1745,6 +1817,7 @@ async function processDirectPartialPayment(marketplaceContract, smartAccount, bu
|
|
|
1745
1817
|
};
|
|
1746
1818
|
} catch (error) {
|
|
1747
1819
|
const errorMessage = error instanceof Error ? error.cause?.message || error.message : "An unknown error occurred.";
|
|
1820
|
+
console.error(errorMessage);
|
|
1748
1821
|
return {
|
|
1749
1822
|
success: false,
|
|
1750
1823
|
message: `Error during direct payment processing: ${errorMessage}`
|
|
@@ -1816,11 +1889,21 @@ import { useCallback as useCallback18 } from "react";
|
|
|
1816
1889
|
import { encodeFunctionData as encodeFunctionData3, erc20Abi } from "viem";
|
|
1817
1890
|
async function processDirectKibbleApproval(kibbleTokenAddress, spenderAddress, smartAccount, bundlerClient, approveAmount) {
|
|
1818
1891
|
try {
|
|
1892
|
+
const functionName = "approve";
|
|
1893
|
+
const args = [spenderAddress, approveAmount];
|
|
1819
1894
|
const approveCalldata = encodeFunctionData3({
|
|
1820
1895
|
abi: erc20Abi,
|
|
1821
|
-
functionName
|
|
1822
|
-
args
|
|
1896
|
+
functionName,
|
|
1897
|
+
args
|
|
1823
1898
|
});
|
|
1899
|
+
await simulateCall(
|
|
1900
|
+
bundlerClient.client,
|
|
1901
|
+
kibbleTokenAddress,
|
|
1902
|
+
erc20Abi,
|
|
1903
|
+
functionName,
|
|
1904
|
+
args,
|
|
1905
|
+
smartAccount.address
|
|
1906
|
+
);
|
|
1824
1907
|
await applyBundlerGasEstimator(smartAccount, bundlerClient);
|
|
1825
1908
|
const userOpHash = await sendUserOpWithRetries(bundlerClient, {
|
|
1826
1909
|
account: smartAccount,
|
|
@@ -1835,6 +1918,7 @@ async function processDirectKibbleApproval(kibbleTokenAddress, spenderAddress, s
|
|
|
1835
1918
|
};
|
|
1836
1919
|
} catch (error) {
|
|
1837
1920
|
const errorMessage = error instanceof Error ? error.cause?.message || error.message : "An unknown error occurred.";
|
|
1921
|
+
console.error(errorMessage);
|
|
1838
1922
|
return {
|
|
1839
1923
|
success: false,
|
|
1840
1924
|
message: `Error during direct approval processing: ${errorMessage}`
|
|
@@ -1894,11 +1978,21 @@ function useCreateOrganizationBase() {
|
|
|
1894
1978
|
};
|
|
1895
1979
|
}
|
|
1896
1980
|
try {
|
|
1981
|
+
const functionName = "createOrganizationProxy";
|
|
1982
|
+
const args = [ownerAddress, orgName, orgPid];
|
|
1897
1983
|
const callData = encodeFunctionData4({
|
|
1898
1984
|
abi: ORGANIZATION_BEACON_ABI,
|
|
1899
|
-
functionName
|
|
1900
|
-
args
|
|
1985
|
+
functionName,
|
|
1986
|
+
args
|
|
1901
1987
|
});
|
|
1988
|
+
await simulateCall(
|
|
1989
|
+
bundlerClient.client,
|
|
1990
|
+
orgContractAddress,
|
|
1991
|
+
ORGANIZATION_BEACON_ABI,
|
|
1992
|
+
functionName,
|
|
1993
|
+
args,
|
|
1994
|
+
adminSmartAccount.address
|
|
1995
|
+
);
|
|
1902
1996
|
await applyBundlerGasEstimator(adminSmartAccount, bundlerClient);
|
|
1903
1997
|
const userOpHash = await bundlerClient.sendUserOperation({
|
|
1904
1998
|
account: adminSmartAccount,
|
|
@@ -2005,11 +2099,20 @@ async function processOrgKibbleApproval(orgContractAddress, kibbleTokenAddress,
|
|
|
2005
2099
|
functionName: "approve",
|
|
2006
2100
|
args: [partialPaymentModuleAddress, approveAmount]
|
|
2007
2101
|
});
|
|
2102
|
+
const args = [kibbleTokenAddress, approveCalldata];
|
|
2008
2103
|
const executeApproveCalldata = encodeFunctionData5({
|
|
2009
2104
|
abi: ORGANIZATION_IMPL_ABI,
|
|
2010
|
-
functionName:
|
|
2011
|
-
args
|
|
2105
|
+
functionName: ORG_FUNCTION,
|
|
2106
|
+
args
|
|
2012
2107
|
});
|
|
2108
|
+
await simulateCall(
|
|
2109
|
+
bundlerClient.client,
|
|
2110
|
+
orgContractAddress,
|
|
2111
|
+
ORGANIZATION_IMPL_ABI,
|
|
2112
|
+
ORG_FUNCTION,
|
|
2113
|
+
args,
|
|
2114
|
+
managerSmartAccount.address
|
|
2115
|
+
);
|
|
2013
2116
|
await applyBundlerGasEstimator(managerSmartAccount, bundlerClient);
|
|
2014
2117
|
const userOpApproveHash = await sendUserOpWithRetries(bundlerClient, {
|
|
2015
2118
|
account: managerSmartAccount,
|
|
@@ -2039,6 +2142,7 @@ async function processOrgKibbleApproval(orgContractAddress, kibbleTokenAddress,
|
|
|
2039
2142
|
};
|
|
2040
2143
|
} catch (error) {
|
|
2041
2144
|
const errorMessage = error instanceof Error ? error.cause?.message || error.message : "An unknown error occurred.";
|
|
2145
|
+
console.error(errorMessage);
|
|
2042
2146
|
return {
|
|
2043
2147
|
success: false,
|
|
2044
2148
|
message: `Error during approval processing: ${errorMessage}`
|
|
@@ -2100,11 +2204,20 @@ async function processOrgPartialPayment(orgContractAddress, partialPaymentModule
|
|
|
2100
2204
|
backendSignature
|
|
2101
2205
|
]
|
|
2102
2206
|
});
|
|
2207
|
+
const args = [partialPaymentModuleAddress, partialPayCalldata];
|
|
2103
2208
|
const executePartialPayCalldata = encodeFunctionData6({
|
|
2104
2209
|
abi: ORGANIZATION_IMPL_ABI,
|
|
2105
|
-
functionName:
|
|
2106
|
-
args
|
|
2210
|
+
functionName: ORG_FUNCTION,
|
|
2211
|
+
args
|
|
2107
2212
|
});
|
|
2213
|
+
await simulateCall(
|
|
2214
|
+
bundlerClient.client,
|
|
2215
|
+
orgContractAddress,
|
|
2216
|
+
ORGANIZATION_IMPL_ABI,
|
|
2217
|
+
ORG_FUNCTION,
|
|
2218
|
+
args,
|
|
2219
|
+
managerSmartAccount.address
|
|
2220
|
+
);
|
|
2108
2221
|
await applyBundlerGasEstimator(managerSmartAccount, bundlerClient);
|
|
2109
2222
|
const userOpHash = await sendUserOpWithRetries(bundlerClient, {
|
|
2110
2223
|
account: managerSmartAccount,
|
|
@@ -2119,6 +2232,7 @@ async function processOrgPartialPayment(orgContractAddress, partialPaymentModule
|
|
|
2119
2232
|
};
|
|
2120
2233
|
} catch (error) {
|
|
2121
2234
|
const errorMessage = error instanceof Error ? error.cause?.message || error.message : "An unknown error occurred.";
|
|
2235
|
+
console.error(errorMessage);
|
|
2122
2236
|
return {
|
|
2123
2237
|
success: false,
|
|
2124
2238
|
message: `Error during payment processing: ${errorMessage}`
|
|
@@ -2516,11 +2630,21 @@ function useClaimActionReward() {
|
|
|
2516
2630
|
message: "Missing web3auth account info or contract address."
|
|
2517
2631
|
};
|
|
2518
2632
|
}
|
|
2633
|
+
const args = [actionId, claimIndex];
|
|
2634
|
+
const functionName = "claimByIndex";
|
|
2519
2635
|
const callData = encodeFunctionData7({
|
|
2520
2636
|
abi: REWARDABLE_ACTIONS_ABI,
|
|
2521
|
-
functionName
|
|
2522
|
-
args
|
|
2637
|
+
functionName,
|
|
2638
|
+
args
|
|
2523
2639
|
});
|
|
2640
|
+
await simulateCall(
|
|
2641
|
+
bundlerClient.client,
|
|
2642
|
+
rewardableActionContractAddress,
|
|
2643
|
+
REWARDABLE_ACTIONS_ABI,
|
|
2644
|
+
functionName,
|
|
2645
|
+
args,
|
|
2646
|
+
smartAccount.address
|
|
2647
|
+
);
|
|
2524
2648
|
await applyBundlerGasEstimator(smartAccount, bundlerClient);
|
|
2525
2649
|
const userOpHash = await bundlerClient.sendUserOperation({
|
|
2526
2650
|
account: smartAccount,
|
|
@@ -2560,11 +2684,20 @@ function useClaimOrgActionReward() {
|
|
|
2560
2684
|
functionName: "claimByIndex",
|
|
2561
2685
|
args: [actionId, claimIndex]
|
|
2562
2686
|
});
|
|
2687
|
+
const args = [rewardableActionContractAddress, claimCallData];
|
|
2563
2688
|
const executeClaimCalldata = encodeFunctionData8({
|
|
2564
2689
|
abi: ORGANIZATION_IMPL_ABI,
|
|
2565
|
-
functionName:
|
|
2566
|
-
args
|
|
2690
|
+
functionName: ORG_FUNCTION,
|
|
2691
|
+
args
|
|
2567
2692
|
});
|
|
2693
|
+
await simulateCall(
|
|
2694
|
+
bundlerClient.client,
|
|
2695
|
+
orgContractAddress,
|
|
2696
|
+
ORGANIZATION_IMPL_ABI,
|
|
2697
|
+
ORG_FUNCTION,
|
|
2698
|
+
args,
|
|
2699
|
+
smartAccount.address
|
|
2700
|
+
);
|
|
2568
2701
|
await applyBundlerGasEstimator(smartAccount, bundlerClient);
|
|
2569
2702
|
const userOpHash = await bundlerClient.sendUserOperation({
|
|
2570
2703
|
account: smartAccount,
|
|
@@ -2727,6 +2860,7 @@ export {
|
|
|
2727
2860
|
generateBytes32Nonce,
|
|
2728
2861
|
generateJWT,
|
|
2729
2862
|
getFirebaseTokenForApp,
|
|
2863
|
+
humanRevert,
|
|
2730
2864
|
loadExistingSecp256k1PrivateKey,
|
|
2731
2865
|
processDirectKibbleApproval,
|
|
2732
2866
|
processDirectPartialPayment,
|
package/package.json
CHANGED