anymal-protocol 1.0.146 → 1.0.148
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 +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +75 -71
- package/dist/index.mjs +77 -74
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _coinbase_cdp_hooks from '@coinbase/cdp-hooks';
|
|
2
2
|
import * as _coinbase_cdp_api_client from '@coinbase/cdp-api-client';
|
|
3
3
|
import * as abitype from 'abitype';
|
|
4
|
+
import { GetUserOperationResult } from '@coinbase/cdp-core';
|
|
4
5
|
import { BundlerClient } from 'viem/account-abstraction';
|
|
5
6
|
import { ec } from 'elliptic';
|
|
6
7
|
|
|
@@ -433,6 +434,13 @@ declare function useCoinbaseCreateOrganizationWallet(): (orgPid: string, orgName
|
|
|
433
434
|
message: string;
|
|
434
435
|
proxyAddress?: string;
|
|
435
436
|
status: string;
|
|
437
|
+
data: GetUserOperationResult | undefined;
|
|
438
|
+
}>;
|
|
439
|
+
|
|
440
|
+
declare function useCoinbaseMintOrgAnymalNFT(): (evmAddress: `0x${string}`, pid: string, nftId: string, anymalTxId: string, validationContractAddress: `0x${string}`) => Promise<{
|
|
441
|
+
success: boolean;
|
|
442
|
+
message: string;
|
|
443
|
+
status: string;
|
|
436
444
|
}>;
|
|
437
445
|
|
|
438
446
|
declare function useMintAnymalNFT(): (pid: string, nftId: string, anymalTxId: string, dbAuthToken: string, validationContractAddress: string, smartAccount: any, bundlerClient: any) => Promise<{
|
|
@@ -871,4 +879,4 @@ declare function useSubmitContractAction(): (idToken: string, pid: string, sourc
|
|
|
871
879
|
*/
|
|
872
880
|
declare function humanRevert(raw: `0x${string}` | undefined, shortMessage?: string): string;
|
|
873
881
|
|
|
874
|
-
export { AUTH_API_ENDPOINTS, type ActionDefinition, type ActionPayload, type ActionRecord, type ActionReferral, ActionSourceType, ActionStatus, ActionType, type AnymalNftMetadataInputData, type AuthEnvelope, type ContractActionPayload, type CreateAnymalInputData, ERROR_ABI, type ExternalActionPayload, FIREBASE_WEB_API_KEYS, FIREBASE_WEB_AUTH_API_ENDPOINTS, type GraphQLActionPayload, type JWTOptions, KIBBLE_TOKEN_ABI, MARKETPLACE_ABI, type MarketplaceActionPayload, MarketplacePaymentType, NETWORK_HOSTS, Network, type NotificationData, type NotificationEventData, ORGANIZATION_BEACON_ABI, ORGANIZATION_IMPL_ABI, ORG_FUNCTION, PET_NFT_ABI, REWARDABLE_ACTIONS_ABI, type SubmitResponse, type WishlistPurchaseActionPayload, convertToActionDefinition, convertToActionRecord, convertToMultipleActionDefinitions, convertToMultipleActionRecords, createApp, createAuthEnvelope, flattenFirestoreData, generateAppSignature, generateBytes32Nonce, generateJWT, getFirebaseTokenForApp, humanRevert, loadExistingSecp256k1PrivateKey, processDirectKibbleApproval, processDirectPartialPayment, processOrgKibbleApproval, processOrgPartialPayment, sendUserOpWithRetries, serializePublicKeyCompressed, submitAction, useApproveKibbleToken, useApproveOrgPartialPayment, useClaimActionReward, useClaimOrgActionReward, useCoinbaseClaimActionReward, useCoinbaseCreateOrganizationWallet, useCoinbaseMintAnymalNFT, useCreateOrganizationAppData, useCreateOrganizationBase, useCreateUserAppData, useCreateWeb3Account, useFetchActionDefinitions, useFetchActions, useFetchBalance, useFetchNotifications, useFetchUserData, useMintAnymalNFT, useMintOrgAnymalNFT, useProcessOrgPartialKibblePayment, useProcessPartialKibblePayment, useSaveAnymalMetadata, useSendCoinbaseUserOperation, useSubmitContractAction, useUpdateOrgWalletAddress, useUpdateUserAsVerified, useUpdateUserEmail, useUpdateUserName, useUpdateUserPid, useUploadAnymalImage, useVerifyAccount, useVerifyWeb3AuthSession, waitForAllowance, waitForReceiptWithRetries };
|
|
882
|
+
export { AUTH_API_ENDPOINTS, type ActionDefinition, type ActionPayload, type ActionRecord, type ActionReferral, ActionSourceType, ActionStatus, ActionType, type AnymalNftMetadataInputData, type AuthEnvelope, type ContractActionPayload, type CreateAnymalInputData, ERROR_ABI, type ExternalActionPayload, FIREBASE_WEB_API_KEYS, FIREBASE_WEB_AUTH_API_ENDPOINTS, type GraphQLActionPayload, type JWTOptions, KIBBLE_TOKEN_ABI, MARKETPLACE_ABI, type MarketplaceActionPayload, MarketplacePaymentType, NETWORK_HOSTS, Network, type NotificationData, type NotificationEventData, ORGANIZATION_BEACON_ABI, ORGANIZATION_IMPL_ABI, ORG_FUNCTION, PET_NFT_ABI, REWARDABLE_ACTIONS_ABI, type SubmitResponse, type WishlistPurchaseActionPayload, convertToActionDefinition, convertToActionRecord, convertToMultipleActionDefinitions, convertToMultipleActionRecords, createApp, createAuthEnvelope, flattenFirestoreData, generateAppSignature, generateBytes32Nonce, generateJWT, getFirebaseTokenForApp, humanRevert, loadExistingSecp256k1PrivateKey, processDirectKibbleApproval, processDirectPartialPayment, processOrgKibbleApproval, processOrgPartialPayment, sendUserOpWithRetries, serializePublicKeyCompressed, submitAction, useApproveKibbleToken, useApproveOrgPartialPayment, useClaimActionReward, useClaimOrgActionReward, useCoinbaseClaimActionReward, useCoinbaseCreateOrganizationWallet, useCoinbaseMintAnymalNFT, useCoinbaseMintOrgAnymalNFT, useCreateOrganizationAppData, useCreateOrganizationBase, useCreateUserAppData, useCreateWeb3Account, useFetchActionDefinitions, useFetchActions, useFetchBalance, useFetchNotifications, useFetchUserData, useMintAnymalNFT, useMintOrgAnymalNFT, useProcessOrgPartialKibblePayment, useProcessPartialKibblePayment, useSaveAnymalMetadata, useSendCoinbaseUserOperation, useSubmitContractAction, useUpdateOrgWalletAddress, useUpdateUserAsVerified, useUpdateUserEmail, useUpdateUserName, useUpdateUserPid, useUploadAnymalImage, useVerifyAccount, useVerifyWeb3AuthSession, waitForAllowance, waitForReceiptWithRetries };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _coinbase_cdp_hooks from '@coinbase/cdp-hooks';
|
|
2
2
|
import * as _coinbase_cdp_api_client from '@coinbase/cdp-api-client';
|
|
3
3
|
import * as abitype from 'abitype';
|
|
4
|
+
import { GetUserOperationResult } from '@coinbase/cdp-core';
|
|
4
5
|
import { BundlerClient } from 'viem/account-abstraction';
|
|
5
6
|
import { ec } from 'elliptic';
|
|
6
7
|
|
|
@@ -433,6 +434,13 @@ declare function useCoinbaseCreateOrganizationWallet(): (orgPid: string, orgName
|
|
|
433
434
|
message: string;
|
|
434
435
|
proxyAddress?: string;
|
|
435
436
|
status: string;
|
|
437
|
+
data: GetUserOperationResult | undefined;
|
|
438
|
+
}>;
|
|
439
|
+
|
|
440
|
+
declare function useCoinbaseMintOrgAnymalNFT(): (evmAddress: `0x${string}`, pid: string, nftId: string, anymalTxId: string, validationContractAddress: `0x${string}`) => Promise<{
|
|
441
|
+
success: boolean;
|
|
442
|
+
message: string;
|
|
443
|
+
status: string;
|
|
436
444
|
}>;
|
|
437
445
|
|
|
438
446
|
declare function useMintAnymalNFT(): (pid: string, nftId: string, anymalTxId: string, dbAuthToken: string, validationContractAddress: string, smartAccount: any, bundlerClient: any) => Promise<{
|
|
@@ -871,4 +879,4 @@ declare function useSubmitContractAction(): (idToken: string, pid: string, sourc
|
|
|
871
879
|
*/
|
|
872
880
|
declare function humanRevert(raw: `0x${string}` | undefined, shortMessage?: string): string;
|
|
873
881
|
|
|
874
|
-
export { AUTH_API_ENDPOINTS, type ActionDefinition, type ActionPayload, type ActionRecord, type ActionReferral, ActionSourceType, ActionStatus, ActionType, type AnymalNftMetadataInputData, type AuthEnvelope, type ContractActionPayload, type CreateAnymalInputData, ERROR_ABI, type ExternalActionPayload, FIREBASE_WEB_API_KEYS, FIREBASE_WEB_AUTH_API_ENDPOINTS, type GraphQLActionPayload, type JWTOptions, KIBBLE_TOKEN_ABI, MARKETPLACE_ABI, type MarketplaceActionPayload, MarketplacePaymentType, NETWORK_HOSTS, Network, type NotificationData, type NotificationEventData, ORGANIZATION_BEACON_ABI, ORGANIZATION_IMPL_ABI, ORG_FUNCTION, PET_NFT_ABI, REWARDABLE_ACTIONS_ABI, type SubmitResponse, type WishlistPurchaseActionPayload, convertToActionDefinition, convertToActionRecord, convertToMultipleActionDefinitions, convertToMultipleActionRecords, createApp, createAuthEnvelope, flattenFirestoreData, generateAppSignature, generateBytes32Nonce, generateJWT, getFirebaseTokenForApp, humanRevert, loadExistingSecp256k1PrivateKey, processDirectKibbleApproval, processDirectPartialPayment, processOrgKibbleApproval, processOrgPartialPayment, sendUserOpWithRetries, serializePublicKeyCompressed, submitAction, useApproveKibbleToken, useApproveOrgPartialPayment, useClaimActionReward, useClaimOrgActionReward, useCoinbaseClaimActionReward, useCoinbaseCreateOrganizationWallet, useCoinbaseMintAnymalNFT, useCreateOrganizationAppData, useCreateOrganizationBase, useCreateUserAppData, useCreateWeb3Account, useFetchActionDefinitions, useFetchActions, useFetchBalance, useFetchNotifications, useFetchUserData, useMintAnymalNFT, useMintOrgAnymalNFT, useProcessOrgPartialKibblePayment, useProcessPartialKibblePayment, useSaveAnymalMetadata, useSendCoinbaseUserOperation, useSubmitContractAction, useUpdateOrgWalletAddress, useUpdateUserAsVerified, useUpdateUserEmail, useUpdateUserName, useUpdateUserPid, useUploadAnymalImage, useVerifyAccount, useVerifyWeb3AuthSession, waitForAllowance, waitForReceiptWithRetries };
|
|
882
|
+
export { AUTH_API_ENDPOINTS, type ActionDefinition, type ActionPayload, type ActionRecord, type ActionReferral, ActionSourceType, ActionStatus, ActionType, type AnymalNftMetadataInputData, type AuthEnvelope, type ContractActionPayload, type CreateAnymalInputData, ERROR_ABI, type ExternalActionPayload, FIREBASE_WEB_API_KEYS, FIREBASE_WEB_AUTH_API_ENDPOINTS, type GraphQLActionPayload, type JWTOptions, KIBBLE_TOKEN_ABI, MARKETPLACE_ABI, type MarketplaceActionPayload, MarketplacePaymentType, NETWORK_HOSTS, Network, type NotificationData, type NotificationEventData, ORGANIZATION_BEACON_ABI, ORGANIZATION_IMPL_ABI, ORG_FUNCTION, PET_NFT_ABI, REWARDABLE_ACTIONS_ABI, type SubmitResponse, type WishlistPurchaseActionPayload, convertToActionDefinition, convertToActionRecord, convertToMultipleActionDefinitions, convertToMultipleActionRecords, createApp, createAuthEnvelope, flattenFirestoreData, generateAppSignature, generateBytes32Nonce, generateJWT, getFirebaseTokenForApp, humanRevert, loadExistingSecp256k1PrivateKey, processDirectKibbleApproval, processDirectPartialPayment, processOrgKibbleApproval, processOrgPartialPayment, sendUserOpWithRetries, serializePublicKeyCompressed, submitAction, useApproveKibbleToken, useApproveOrgPartialPayment, useClaimActionReward, useClaimOrgActionReward, useCoinbaseClaimActionReward, useCoinbaseCreateOrganizationWallet, useCoinbaseMintAnymalNFT, useCoinbaseMintOrgAnymalNFT, useCreateOrganizationAppData, useCreateOrganizationBase, useCreateUserAppData, useCreateWeb3Account, useFetchActionDefinitions, useFetchActions, useFetchBalance, useFetchNotifications, useFetchUserData, useMintAnymalNFT, useMintOrgAnymalNFT, useProcessOrgPartialKibblePayment, useProcessPartialKibblePayment, useSaveAnymalMetadata, useSendCoinbaseUserOperation, useSubmitContractAction, useUpdateOrgWalletAddress, useUpdateUserAsVerified, useUpdateUserEmail, useUpdateUserName, useUpdateUserPid, useUploadAnymalImage, useVerifyAccount, useVerifyWeb3AuthSession, waitForAllowance, waitForReceiptWithRetries };
|
package/dist/index.js
CHANGED
|
@@ -64,6 +64,7 @@ __export(index_exports, {
|
|
|
64
64
|
useCoinbaseClaimActionReward: () => useCoinbaseClaimActionReward,
|
|
65
65
|
useCoinbaseCreateOrganizationWallet: () => useCoinbaseCreateOrganizationWallet,
|
|
66
66
|
useCoinbaseMintAnymalNFT: () => useCoinbaseMintAnymalNFT,
|
|
67
|
+
useCoinbaseMintOrgAnymalNFT: () => useCoinbaseMintOrgAnymalNFT,
|
|
67
68
|
useCreateOrganizationAppData: () => useCreateOrganizationAppData,
|
|
68
69
|
useCreateOrganizationBase: () => useCreateOrganizationBase,
|
|
69
70
|
useCreateUserAppData: () => useCreateUserAppData,
|
|
@@ -3039,7 +3040,8 @@ function useCoinbaseCreateOrganizationWallet() {
|
|
|
3039
3040
|
return {
|
|
3040
3041
|
success: false,
|
|
3041
3042
|
message: "Missing required parameters for organization creation.",
|
|
3042
|
-
status: "error"
|
|
3043
|
+
status: "error",
|
|
3044
|
+
data
|
|
3043
3045
|
};
|
|
3044
3046
|
}
|
|
3045
3047
|
const result = await sendOperationFn(
|
|
@@ -3050,52 +3052,53 @@ function useCoinbaseCreateOrganizationWallet() {
|
|
|
3050
3052
|
[evmAddress, orgName, orgPid]
|
|
3051
3053
|
);
|
|
3052
3054
|
if (!result.success) {
|
|
3053
|
-
return { ...result, status: "error" };
|
|
3054
|
-
}
|
|
3055
|
-
let proxyAddress;
|
|
3056
|
-
try {
|
|
3057
|
-
const txHash = data?.receipts?.[0]?.transactionHash || data?.transactionHash;
|
|
3058
|
-
if (txHash) {
|
|
3059
|
-
const receipt = await publicClient.getTransactionReceipt({
|
|
3060
|
-
hash: txHash
|
|
3061
|
-
});
|
|
3062
|
-
for (const log of receipt.logs) {
|
|
3063
|
-
try {
|
|
3064
|
-
const decoded = (0, import_viem3.decodeEventLog)({
|
|
3065
|
-
abi: ORGANIZATION_BEACON_ABI,
|
|
3066
|
-
data: log.data,
|
|
3067
|
-
topics: log.topics
|
|
3068
|
-
});
|
|
3069
|
-
if (decoded.eventName === "NewOrganizationCreated") {
|
|
3070
|
-
proxyAddress = decoded.args.proxyAddress;
|
|
3071
|
-
break;
|
|
3072
|
-
}
|
|
3073
|
-
} catch {
|
|
3074
|
-
}
|
|
3075
|
-
}
|
|
3076
|
-
}
|
|
3077
|
-
} catch (e) {
|
|
3078
|
-
console.error("Failed to get transaction receipt:", e);
|
|
3079
|
-
}
|
|
3080
|
-
if (!proxyAddress) {
|
|
3081
|
-
return {
|
|
3082
|
-
...result,
|
|
3083
|
-
status
|
|
3084
|
-
};
|
|
3055
|
+
return { ...result, status: "error", data };
|
|
3085
3056
|
}
|
|
3086
3057
|
return {
|
|
3087
3058
|
...result,
|
|
3088
|
-
|
|
3089
|
-
|
|
3059
|
+
status,
|
|
3060
|
+
data
|
|
3090
3061
|
};
|
|
3091
3062
|
},
|
|
3092
3063
|
[sendOperationFn, data, publicClient, status]
|
|
3093
3064
|
);
|
|
3094
3065
|
}
|
|
3095
3066
|
|
|
3067
|
+
// src/utils/coinbase/useCoinbaseMintOrgAnymalNFT.ts
|
|
3068
|
+
var import_react14 = require("react");
|
|
3069
|
+
function useCoinbaseMintOrgAnymalNFT() {
|
|
3070
|
+
const { sendOperationFn, status } = useSendCoinbaseUserOperation();
|
|
3071
|
+
return (0, import_react14.useCallback)(
|
|
3072
|
+
async (evmAddress, pid, nftId, anymalTxId, validationContractAddress) => {
|
|
3073
|
+
if (!nftId || !pid || !validationContractAddress) {
|
|
3074
|
+
return {
|
|
3075
|
+
success: false,
|
|
3076
|
+
message: "Coinbase Mint NFT: Missing authentication token OR NFT ID.",
|
|
3077
|
+
status: "error"
|
|
3078
|
+
};
|
|
3079
|
+
}
|
|
3080
|
+
const result = await sendOperationFn(
|
|
3081
|
+
evmAddress,
|
|
3082
|
+
validationContractAddress,
|
|
3083
|
+
PET_NFT_ABI,
|
|
3084
|
+
"submitMetadataByCampaignName",
|
|
3085
|
+
[
|
|
3086
|
+
pid,
|
|
3087
|
+
nftId,
|
|
3088
|
+
`https://dev-nft.petastic.com/metadata/${nftId}`,
|
|
3089
|
+
"petastic-signup-campaign-1",
|
|
3090
|
+
anymalTxId
|
|
3091
|
+
]
|
|
3092
|
+
);
|
|
3093
|
+
return { ...result, status };
|
|
3094
|
+
},
|
|
3095
|
+
[sendOperationFn, status]
|
|
3096
|
+
);
|
|
3097
|
+
}
|
|
3098
|
+
|
|
3096
3099
|
// src/utils/anymals/useMintAnymalNFT.ts
|
|
3097
3100
|
var import_viem5 = require("viem");
|
|
3098
|
-
var
|
|
3101
|
+
var import_react15 = require("react");
|
|
3099
3102
|
|
|
3100
3103
|
// src/helpers/GasEstimateHelper.tsx
|
|
3101
3104
|
async function applyBundlerGasEstimator(account, bundlerClient, options) {
|
|
@@ -3176,7 +3179,7 @@ async function simulateCall(publicClient, target, abi, functionName, args, calle
|
|
|
3176
3179
|
|
|
3177
3180
|
// src/utils/anymals/useMintAnymalNFT.ts
|
|
3178
3181
|
function useMintAnymalNFT() {
|
|
3179
|
-
return (0,
|
|
3182
|
+
return (0, import_react15.useCallback)(
|
|
3180
3183
|
async (pid, nftId, anymalTxId, dbAuthToken, validationContractAddress, smartAccount, bundlerClient) => {
|
|
3181
3184
|
if (!dbAuthToken || !nftId || !bundlerClient || !smartAccount || !pid || !validationContractAddress) {
|
|
3182
3185
|
return {
|
|
@@ -3228,9 +3231,9 @@ function useMintAnymalNFT() {
|
|
|
3228
3231
|
}
|
|
3229
3232
|
|
|
3230
3233
|
// src/utils/anymals/useSaveAnymalMetadata.ts
|
|
3231
|
-
var
|
|
3234
|
+
var import_react16 = require("react");
|
|
3232
3235
|
function useSaveAnymalMetadata() {
|
|
3233
|
-
return (0,
|
|
3236
|
+
return (0, import_react16.useCallback)(
|
|
3234
3237
|
async (userPid, anymalTxId, idToken, nftMetadataInput, authServiceBaseUrl) => {
|
|
3235
3238
|
const response = await fetch(`${authServiceBaseUrl}/process-nft`, {
|
|
3236
3239
|
method: "POST",
|
|
@@ -3258,7 +3261,7 @@ function useSaveAnymalMetadata() {
|
|
|
3258
3261
|
}
|
|
3259
3262
|
|
|
3260
3263
|
// src/utils/anymals/useUploadAnymalImage.ts
|
|
3261
|
-
var
|
|
3264
|
+
var import_react17 = require("react");
|
|
3262
3265
|
|
|
3263
3266
|
// src/helpers/UploadImageHelper.tsx
|
|
3264
3267
|
function resizeImage(file, maxWidth = 800, maxHeight = 800, quality = 0.7) {
|
|
@@ -3315,7 +3318,7 @@ function toBase64(file) {
|
|
|
3315
3318
|
|
|
3316
3319
|
// src/utils/anymals/useUploadAnymalImage.ts
|
|
3317
3320
|
function useUploadAnymalImage() {
|
|
3318
|
-
return (0,
|
|
3321
|
+
return (0, import_react17.useCallback)(
|
|
3319
3322
|
async (imageFile, type, idToken, authServiceBaseUrl, petType, breed, lifestage, anymalPid) => {
|
|
3320
3323
|
if (!imageFile || !idToken) {
|
|
3321
3324
|
return {
|
|
@@ -3376,7 +3379,7 @@ function useUploadAnymalImage() {
|
|
|
3376
3379
|
}
|
|
3377
3380
|
|
|
3378
3381
|
// src/utils/marketplace/useProcessPartialKibblePayment.ts
|
|
3379
|
-
var
|
|
3382
|
+
var import_react18 = require("react");
|
|
3380
3383
|
|
|
3381
3384
|
// src/helpers/ProcessDirectPartialPayment.tsx
|
|
3382
3385
|
var import_viem6 = require("viem");
|
|
@@ -3476,7 +3479,7 @@ async function processDirectPartialPayment(marketplaceContract, smartAccount, bu
|
|
|
3476
3479
|
|
|
3477
3480
|
// src/utils/marketplace/useProcessPartialKibblePayment.ts
|
|
3478
3481
|
function useProcessPartialKibblePayment() {
|
|
3479
|
-
return (0,
|
|
3482
|
+
return (0, import_react18.useCallback)(
|
|
3480
3483
|
async (pid, nftId, orderId, dbAuthToken, marketplaceContract, smartAccount, bundlerClient, amountInTokens, maxTokenPayment, nonce, deadline, backendSignature) => {
|
|
3481
3484
|
if (!orderId || !dbAuthToken || !nftId || !bundlerClient || !smartAccount || !pid || !marketplaceContract || !amountInTokens || !maxTokenPayment || !nonce || !deadline) {
|
|
3482
3485
|
return {
|
|
@@ -3532,7 +3535,7 @@ function useProcessPartialKibblePayment() {
|
|
|
3532
3535
|
}
|
|
3533
3536
|
|
|
3534
3537
|
// src/utils/marketplace/useApproveKibbleToken.ts
|
|
3535
|
-
var
|
|
3538
|
+
var import_react19 = require("react");
|
|
3536
3539
|
|
|
3537
3540
|
// src/helpers/ProcessDirectKibbleApproval.tsx
|
|
3538
3541
|
var import_viem7 = require("viem");
|
|
@@ -3577,7 +3580,7 @@ async function processDirectKibbleApproval(kibbleTokenAddress, spenderAddress, s
|
|
|
3577
3580
|
|
|
3578
3581
|
// src/utils/marketplace/useApproveKibbleToken.ts
|
|
3579
3582
|
function useApproveKibbleToken() {
|
|
3580
|
-
return (0,
|
|
3583
|
+
return (0, import_react19.useCallback)(
|
|
3581
3584
|
async (kibbleTokenAddress, marketplaceContract, amount, smartAccount, bundlerClient) => {
|
|
3582
3585
|
try {
|
|
3583
3586
|
const result = await processDirectKibbleApproval(
|
|
@@ -3604,10 +3607,10 @@ function useApproveKibbleToken() {
|
|
|
3604
3607
|
}
|
|
3605
3608
|
|
|
3606
3609
|
// src/utils/organization/useCreateOrganizationBase.ts
|
|
3607
|
-
var
|
|
3610
|
+
var import_react20 = require("react");
|
|
3608
3611
|
var import_viem8 = require("viem");
|
|
3609
3612
|
function useCreateOrganizationBase() {
|
|
3610
|
-
return (0,
|
|
3613
|
+
return (0, import_react20.useCallback)(
|
|
3611
3614
|
/**
|
|
3612
3615
|
* Creates a new organization on-chain.
|
|
3613
3616
|
*
|
|
@@ -3703,7 +3706,7 @@ function useCreateOrganizationBase() {
|
|
|
3703
3706
|
}
|
|
3704
3707
|
|
|
3705
3708
|
// src/utils/organization/useApproveOrgKibbleToken.ts
|
|
3706
|
-
var
|
|
3709
|
+
var import_react21 = require("react");
|
|
3707
3710
|
|
|
3708
3711
|
// src/helpers/ProcessOrgKibbleApproval.tsx
|
|
3709
3712
|
var import_viem10 = require("viem");
|
|
@@ -3801,7 +3804,7 @@ async function processOrgKibbleApproval(orgContractAddress, kibbleTokenAddress,
|
|
|
3801
3804
|
|
|
3802
3805
|
// src/utils/organization/useApproveOrgKibbleToken.ts
|
|
3803
3806
|
function useApproveOrgPartialPayment() {
|
|
3804
|
-
return (0,
|
|
3807
|
+
return (0, import_react21.useCallback)(
|
|
3805
3808
|
async (orgContractAddress, kibbleTokenAddress, partialPaymentModuleAddress, managerSmartAccount, bundlerClient, approveAmount) => {
|
|
3806
3809
|
if (!orgContractAddress || !kibbleTokenAddress || !partialPaymentModuleAddress || !managerSmartAccount || !bundlerClient || !approveAmount) {
|
|
3807
3810
|
return {
|
|
@@ -3833,7 +3836,7 @@ function useApproveOrgPartialPayment() {
|
|
|
3833
3836
|
}
|
|
3834
3837
|
|
|
3835
3838
|
// src/utils/organization/useProcessOrgPartialKibblePayment.ts
|
|
3836
|
-
var
|
|
3839
|
+
var import_react22 = require("react");
|
|
3837
3840
|
|
|
3838
3841
|
// src/helpers/ProcessOrgPartialPayment.tsx
|
|
3839
3842
|
var import_viem11 = require("viem");
|
|
@@ -3891,7 +3894,7 @@ async function processOrgPartialPayment(orgContractAddress, partialPaymentModule
|
|
|
3891
3894
|
|
|
3892
3895
|
// src/utils/organization/useProcessOrgPartialKibblePayment.ts
|
|
3893
3896
|
function useProcessOrgPartialKibblePayment() {
|
|
3894
|
-
return (0,
|
|
3897
|
+
return (0, import_react22.useCallback)(
|
|
3895
3898
|
async (orgContractAddress, partialPaymentModuleAddress, managerSmartAccount, bundlerClient, orderId, anymalNftId, pid, amountInTokens, maxTokenPayment, nonce, deadline, backendSignature) => {
|
|
3896
3899
|
if (!orgContractAddress || !partialPaymentModuleAddress || !managerSmartAccount || !bundlerClient || !orderId || !pid || !nonce || !backendSignature) {
|
|
3897
3900
|
return {
|
|
@@ -3929,9 +3932,9 @@ function useProcessOrgPartialKibblePayment() {
|
|
|
3929
3932
|
}
|
|
3930
3933
|
|
|
3931
3934
|
// src/utils/organization/useUpdateOrgWalletAddress.ts
|
|
3932
|
-
var
|
|
3935
|
+
var import_react23 = require("react");
|
|
3933
3936
|
function useUpdateOrgWalletAddress() {
|
|
3934
|
-
return (0,
|
|
3937
|
+
return (0, import_react23.useCallback)(
|
|
3935
3938
|
async (dbAuthToken, docID, baseWalletAddress, endpoint) => {
|
|
3936
3939
|
try {
|
|
3937
3940
|
const mutation = `
|
|
@@ -3971,9 +3974,9 @@ function useUpdateOrgWalletAddress() {
|
|
|
3971
3974
|
|
|
3972
3975
|
// src/utils/organization/useMintOrgAnymalNFT.ts
|
|
3973
3976
|
var import_viem12 = require("viem");
|
|
3974
|
-
var
|
|
3977
|
+
var import_react24 = require("react");
|
|
3975
3978
|
function useMintOrgAnymalNFT() {
|
|
3976
|
-
return (0,
|
|
3979
|
+
return (0, import_react24.useCallback)(
|
|
3977
3980
|
async (orgContractAddress, pid, nftId, anymalTxId, dbAuthToken, validationContractAddress, managerSmartAccount, bundlerClient) => {
|
|
3978
3981
|
if (!dbAuthToken || !nftId || !bundlerClient || !managerSmartAccount || !pid || !validationContractAddress || !orgContractAddress) {
|
|
3979
3982
|
return {
|
|
@@ -4241,9 +4244,9 @@ async function submitAction(idToken, pid, sourceType, payload, endpointBaseUrl)
|
|
|
4241
4244
|
}
|
|
4242
4245
|
|
|
4243
4246
|
// src/utils/actions/useFetchActions.ts
|
|
4244
|
-
var
|
|
4247
|
+
var import_react25 = require("react");
|
|
4245
4248
|
function useFetchActions() {
|
|
4246
|
-
return (0,
|
|
4249
|
+
return (0, import_react25.useCallback)(
|
|
4247
4250
|
async (idToken, actionsServiceBaseUrl, pid, status, limit, offset) => {
|
|
4248
4251
|
const params = new URLSearchParams({ pid });
|
|
4249
4252
|
if (status) params.set("status", status);
|
|
@@ -4272,9 +4275,9 @@ function useFetchActions() {
|
|
|
4272
4275
|
}
|
|
4273
4276
|
|
|
4274
4277
|
// src/utils/actions/useFetchActionDefinitions.ts
|
|
4275
|
-
var
|
|
4278
|
+
var import_react26 = require("react");
|
|
4276
4279
|
function useFetchActionDefinitions() {
|
|
4277
|
-
return (0,
|
|
4280
|
+
return (0, import_react26.useCallback)(
|
|
4278
4281
|
async (idToken, actionsServiceBaseUrl) => {
|
|
4279
4282
|
try {
|
|
4280
4283
|
const response = await fetch(
|
|
@@ -4371,10 +4374,10 @@ var convertToMultipleActionRecords = (frs) => frs.map(convertToActionRecord);
|
|
|
4371
4374
|
var convertToMultipleActionDefinitions = (frs) => frs.map(convertToActionDefinition);
|
|
4372
4375
|
|
|
4373
4376
|
// src/utils/application/useCreateUserAppData.ts
|
|
4374
|
-
var
|
|
4377
|
+
var import_react27 = require("react");
|
|
4375
4378
|
var import_uuid2 = require("uuid");
|
|
4376
4379
|
function useCreateUserAppData() {
|
|
4377
|
-
return (0,
|
|
4380
|
+
return (0, import_react27.useCallback)(
|
|
4378
4381
|
async (appId, pid, dbAuthToken, endpoint) => {
|
|
4379
4382
|
if (!dbAuthToken || !pid || !dbAuthToken || !endpoint) return;
|
|
4380
4383
|
const appValues = {
|
|
@@ -4429,10 +4432,10 @@ function useCreateUserAppData() {
|
|
|
4429
4432
|
}
|
|
4430
4433
|
|
|
4431
4434
|
// src/utils/application/useCreateOrganizationAppData.ts
|
|
4432
|
-
var
|
|
4435
|
+
var import_react28 = require("react");
|
|
4433
4436
|
var import_uuid3 = require("uuid");
|
|
4434
4437
|
function useCreateOrganizationAppData() {
|
|
4435
|
-
return (0,
|
|
4438
|
+
return (0, import_react28.useCallback)(
|
|
4436
4439
|
async (appId, pid, dbAuthToken, endpoint) => {
|
|
4437
4440
|
if (!dbAuthToken || !pid || !dbAuthToken || !endpoint) return;
|
|
4438
4441
|
const appValues = {
|
|
@@ -4486,10 +4489,10 @@ function useCreateOrganizationAppData() {
|
|
|
4486
4489
|
}
|
|
4487
4490
|
|
|
4488
4491
|
// src/utils/balance/useFetchBalance.ts
|
|
4489
|
-
var
|
|
4492
|
+
var import_react29 = require("react");
|
|
4490
4493
|
var import_viem14 = require("viem");
|
|
4491
4494
|
function useFetchBalance() {
|
|
4492
|
-
return (0,
|
|
4495
|
+
return (0, import_react29.useCallback)(
|
|
4493
4496
|
async (publicClient, walletAddress, kibbleTokenAddress) => {
|
|
4494
4497
|
try {
|
|
4495
4498
|
const balance = await publicClient.readContract({
|
|
@@ -4509,9 +4512,9 @@ function useFetchBalance() {
|
|
|
4509
4512
|
|
|
4510
4513
|
// src/utils/actions/useClaimActionReward.ts
|
|
4511
4514
|
var import_viem15 = require("viem");
|
|
4512
|
-
var
|
|
4515
|
+
var import_react30 = require("react");
|
|
4513
4516
|
function useClaimActionReward() {
|
|
4514
|
-
return (0,
|
|
4517
|
+
return (0, import_react30.useCallback)(
|
|
4515
4518
|
async (actionId, claimIndex, rewardableActionContractAddress, smartAccount, bundlerClient) => {
|
|
4516
4519
|
if (!actionId || claimIndex === void 0 || !bundlerClient || !smartAccount || !rewardableActionContractAddress) {
|
|
4517
4520
|
return {
|
|
@@ -4558,9 +4561,9 @@ function useClaimActionReward() {
|
|
|
4558
4561
|
|
|
4559
4562
|
// src/utils/actions/useClaimOrgActionReward.ts
|
|
4560
4563
|
var import_viem16 = require("viem");
|
|
4561
|
-
var
|
|
4564
|
+
var import_react31 = require("react");
|
|
4562
4565
|
function useClaimOrgActionReward() {
|
|
4563
|
-
return (0,
|
|
4566
|
+
return (0, import_react31.useCallback)(
|
|
4564
4567
|
async (orgContractAddress, rewardableActionContractAddress, actionId, claimIndex, smartAccount, bundlerClient) => {
|
|
4565
4568
|
if (!orgContractAddress || !actionId || claimIndex === void 0 || !bundlerClient || !smartAccount) {
|
|
4566
4569
|
return {
|
|
@@ -4610,9 +4613,9 @@ function useClaimOrgActionReward() {
|
|
|
4610
4613
|
}
|
|
4611
4614
|
|
|
4612
4615
|
// src/utils/actions/useSubmitContractAction.ts
|
|
4613
|
-
var
|
|
4616
|
+
var import_react32 = require("react");
|
|
4614
4617
|
function useSubmitContractAction() {
|
|
4615
|
-
return (0,
|
|
4618
|
+
return (0, import_react32.useCallback)(
|
|
4616
4619
|
(idToken, pid, source, endpoint, payload) => {
|
|
4617
4620
|
if (!idToken || !pid || !source || !endpoint || !payload) return;
|
|
4618
4621
|
let sourceTypePayload = {};
|
|
@@ -4773,6 +4776,7 @@ function isMarketplacePurchaseAction(payload) {
|
|
|
4773
4776
|
useCoinbaseClaimActionReward,
|
|
4774
4777
|
useCoinbaseCreateOrganizationWallet,
|
|
4775
4778
|
useCoinbaseMintAnymalNFT,
|
|
4779
|
+
useCoinbaseMintOrgAnymalNFT,
|
|
4776
4780
|
useCreateOrganizationAppData,
|
|
4777
4781
|
useCreateOrganizationBase,
|
|
4778
4782
|
useCreateUserAppData,
|
package/dist/index.mjs
CHANGED
|
@@ -2934,7 +2934,7 @@ function useCoinbaseMintAnymalNFT() {
|
|
|
2934
2934
|
|
|
2935
2935
|
// src/utils/coinbase/useCoinbaseCreateOrganizationWallet.ts
|
|
2936
2936
|
import { useCallback as useCallback13, useMemo as useMemo2 } from "react";
|
|
2937
|
-
import { createPublicClient as createPublicClient2,
|
|
2937
|
+
import { createPublicClient as createPublicClient2, http as http2 } from "viem";
|
|
2938
2938
|
import { baseSepolia as baseSepolia2 } from "viem/chains";
|
|
2939
2939
|
function useCoinbaseCreateOrganizationWallet() {
|
|
2940
2940
|
const { sendOperationFn, data, status } = useSendCoinbaseUserOperation();
|
|
@@ -2960,7 +2960,8 @@ function useCoinbaseCreateOrganizationWallet() {
|
|
|
2960
2960
|
return {
|
|
2961
2961
|
success: false,
|
|
2962
2962
|
message: "Missing required parameters for organization creation.",
|
|
2963
|
-
status: "error"
|
|
2963
|
+
status: "error",
|
|
2964
|
+
data
|
|
2964
2965
|
};
|
|
2965
2966
|
}
|
|
2966
2967
|
const result = await sendOperationFn(
|
|
@@ -2971,52 +2972,53 @@ function useCoinbaseCreateOrganizationWallet() {
|
|
|
2971
2972
|
[evmAddress, orgName, orgPid]
|
|
2972
2973
|
);
|
|
2973
2974
|
if (!result.success) {
|
|
2974
|
-
return { ...result, status: "error" };
|
|
2975
|
-
}
|
|
2976
|
-
let proxyAddress;
|
|
2977
|
-
try {
|
|
2978
|
-
const txHash = data?.receipts?.[0]?.transactionHash || data?.transactionHash;
|
|
2979
|
-
if (txHash) {
|
|
2980
|
-
const receipt = await publicClient.getTransactionReceipt({
|
|
2981
|
-
hash: txHash
|
|
2982
|
-
});
|
|
2983
|
-
for (const log of receipt.logs) {
|
|
2984
|
-
try {
|
|
2985
|
-
const decoded = decodeEventLog({
|
|
2986
|
-
abi: ORGANIZATION_BEACON_ABI,
|
|
2987
|
-
data: log.data,
|
|
2988
|
-
topics: log.topics
|
|
2989
|
-
});
|
|
2990
|
-
if (decoded.eventName === "NewOrganizationCreated") {
|
|
2991
|
-
proxyAddress = decoded.args.proxyAddress;
|
|
2992
|
-
break;
|
|
2993
|
-
}
|
|
2994
|
-
} catch {
|
|
2995
|
-
}
|
|
2996
|
-
}
|
|
2997
|
-
}
|
|
2998
|
-
} catch (e) {
|
|
2999
|
-
console.error("Failed to get transaction receipt:", e);
|
|
3000
|
-
}
|
|
3001
|
-
if (!proxyAddress) {
|
|
3002
|
-
return {
|
|
3003
|
-
...result,
|
|
3004
|
-
status
|
|
3005
|
-
};
|
|
2975
|
+
return { ...result, status: "error", data };
|
|
3006
2976
|
}
|
|
3007
2977
|
return {
|
|
3008
2978
|
...result,
|
|
3009
|
-
|
|
3010
|
-
|
|
2979
|
+
status,
|
|
2980
|
+
data
|
|
3011
2981
|
};
|
|
3012
2982
|
},
|
|
3013
2983
|
[sendOperationFn, data, publicClient, status]
|
|
3014
2984
|
);
|
|
3015
2985
|
}
|
|
3016
2986
|
|
|
2987
|
+
// src/utils/coinbase/useCoinbaseMintOrgAnymalNFT.ts
|
|
2988
|
+
import { useCallback as useCallback14 } from "react";
|
|
2989
|
+
function useCoinbaseMintOrgAnymalNFT() {
|
|
2990
|
+
const { sendOperationFn, status } = useSendCoinbaseUserOperation();
|
|
2991
|
+
return useCallback14(
|
|
2992
|
+
async (evmAddress, pid, nftId, anymalTxId, validationContractAddress) => {
|
|
2993
|
+
if (!nftId || !pid || !validationContractAddress) {
|
|
2994
|
+
return {
|
|
2995
|
+
success: false,
|
|
2996
|
+
message: "Coinbase Mint NFT: Missing authentication token OR NFT ID.",
|
|
2997
|
+
status: "error"
|
|
2998
|
+
};
|
|
2999
|
+
}
|
|
3000
|
+
const result = await sendOperationFn(
|
|
3001
|
+
evmAddress,
|
|
3002
|
+
validationContractAddress,
|
|
3003
|
+
PET_NFT_ABI,
|
|
3004
|
+
"submitMetadataByCampaignName",
|
|
3005
|
+
[
|
|
3006
|
+
pid,
|
|
3007
|
+
nftId,
|
|
3008
|
+
`https://dev-nft.petastic.com/metadata/${nftId}`,
|
|
3009
|
+
"petastic-signup-campaign-1",
|
|
3010
|
+
anymalTxId
|
|
3011
|
+
]
|
|
3012
|
+
);
|
|
3013
|
+
return { ...result, status };
|
|
3014
|
+
},
|
|
3015
|
+
[sendOperationFn, status]
|
|
3016
|
+
);
|
|
3017
|
+
}
|
|
3018
|
+
|
|
3017
3019
|
// src/utils/anymals/useMintAnymalNFT.ts
|
|
3018
3020
|
import { encodeFunctionData as encodeFunctionData2 } from "viem";
|
|
3019
|
-
import { useCallback as
|
|
3021
|
+
import { useCallback as useCallback15 } from "react";
|
|
3020
3022
|
|
|
3021
3023
|
// src/helpers/GasEstimateHelper.tsx
|
|
3022
3024
|
async function applyBundlerGasEstimator(account, bundlerClient, options) {
|
|
@@ -3097,7 +3099,7 @@ async function simulateCall(publicClient, target, abi, functionName, args, calle
|
|
|
3097
3099
|
|
|
3098
3100
|
// src/utils/anymals/useMintAnymalNFT.ts
|
|
3099
3101
|
function useMintAnymalNFT() {
|
|
3100
|
-
return
|
|
3102
|
+
return useCallback15(
|
|
3101
3103
|
async (pid, nftId, anymalTxId, dbAuthToken, validationContractAddress, smartAccount, bundlerClient) => {
|
|
3102
3104
|
if (!dbAuthToken || !nftId || !bundlerClient || !smartAccount || !pid || !validationContractAddress) {
|
|
3103
3105
|
return {
|
|
@@ -3149,9 +3151,9 @@ function useMintAnymalNFT() {
|
|
|
3149
3151
|
}
|
|
3150
3152
|
|
|
3151
3153
|
// src/utils/anymals/useSaveAnymalMetadata.ts
|
|
3152
|
-
import { useCallback as
|
|
3154
|
+
import { useCallback as useCallback16 } from "react";
|
|
3153
3155
|
function useSaveAnymalMetadata() {
|
|
3154
|
-
return
|
|
3156
|
+
return useCallback16(
|
|
3155
3157
|
async (userPid, anymalTxId, idToken, nftMetadataInput, authServiceBaseUrl) => {
|
|
3156
3158
|
const response = await fetch(`${authServiceBaseUrl}/process-nft`, {
|
|
3157
3159
|
method: "POST",
|
|
@@ -3179,7 +3181,7 @@ function useSaveAnymalMetadata() {
|
|
|
3179
3181
|
}
|
|
3180
3182
|
|
|
3181
3183
|
// src/utils/anymals/useUploadAnymalImage.ts
|
|
3182
|
-
import { useCallback as
|
|
3184
|
+
import { useCallback as useCallback17 } from "react";
|
|
3183
3185
|
|
|
3184
3186
|
// src/helpers/UploadImageHelper.tsx
|
|
3185
3187
|
function resizeImage(file, maxWidth = 800, maxHeight = 800, quality = 0.7) {
|
|
@@ -3236,7 +3238,7 @@ function toBase64(file) {
|
|
|
3236
3238
|
|
|
3237
3239
|
// src/utils/anymals/useUploadAnymalImage.ts
|
|
3238
3240
|
function useUploadAnymalImage() {
|
|
3239
|
-
return
|
|
3241
|
+
return useCallback17(
|
|
3240
3242
|
async (imageFile, type, idToken, authServiceBaseUrl, petType, breed, lifestage, anymalPid) => {
|
|
3241
3243
|
if (!imageFile || !idToken) {
|
|
3242
3244
|
return {
|
|
@@ -3297,7 +3299,7 @@ function useUploadAnymalImage() {
|
|
|
3297
3299
|
}
|
|
3298
3300
|
|
|
3299
3301
|
// src/utils/marketplace/useProcessPartialKibblePayment.ts
|
|
3300
|
-
import { useCallback as
|
|
3302
|
+
import { useCallback as useCallback18 } from "react";
|
|
3301
3303
|
|
|
3302
3304
|
// src/helpers/ProcessDirectPartialPayment.tsx
|
|
3303
3305
|
import { encodeFunctionData as encodeFunctionData3 } from "viem";
|
|
@@ -3397,7 +3399,7 @@ async function processDirectPartialPayment(marketplaceContract, smartAccount, bu
|
|
|
3397
3399
|
|
|
3398
3400
|
// src/utils/marketplace/useProcessPartialKibblePayment.ts
|
|
3399
3401
|
function useProcessPartialKibblePayment() {
|
|
3400
|
-
return
|
|
3402
|
+
return useCallback18(
|
|
3401
3403
|
async (pid, nftId, orderId, dbAuthToken, marketplaceContract, smartAccount, bundlerClient, amountInTokens, maxTokenPayment, nonce, deadline, backendSignature) => {
|
|
3402
3404
|
if (!orderId || !dbAuthToken || !nftId || !bundlerClient || !smartAccount || !pid || !marketplaceContract || !amountInTokens || !maxTokenPayment || !nonce || !deadline) {
|
|
3403
3405
|
return {
|
|
@@ -3453,7 +3455,7 @@ function useProcessPartialKibblePayment() {
|
|
|
3453
3455
|
}
|
|
3454
3456
|
|
|
3455
3457
|
// src/utils/marketplace/useApproveKibbleToken.ts
|
|
3456
|
-
import { useCallback as
|
|
3458
|
+
import { useCallback as useCallback19 } from "react";
|
|
3457
3459
|
|
|
3458
3460
|
// src/helpers/ProcessDirectKibbleApproval.tsx
|
|
3459
3461
|
import { encodeFunctionData as encodeFunctionData4, erc20Abi } from "viem";
|
|
@@ -3498,7 +3500,7 @@ async function processDirectKibbleApproval(kibbleTokenAddress, spenderAddress, s
|
|
|
3498
3500
|
|
|
3499
3501
|
// src/utils/marketplace/useApproveKibbleToken.ts
|
|
3500
3502
|
function useApproveKibbleToken() {
|
|
3501
|
-
return
|
|
3503
|
+
return useCallback19(
|
|
3502
3504
|
async (kibbleTokenAddress, marketplaceContract, amount, smartAccount, bundlerClient) => {
|
|
3503
3505
|
try {
|
|
3504
3506
|
const result = await processDirectKibbleApproval(
|
|
@@ -3525,10 +3527,10 @@ function useApproveKibbleToken() {
|
|
|
3525
3527
|
}
|
|
3526
3528
|
|
|
3527
3529
|
// src/utils/organization/useCreateOrganizationBase.ts
|
|
3528
|
-
import { useCallback as
|
|
3529
|
-
import { decodeEventLog
|
|
3530
|
+
import { useCallback as useCallback20 } from "react";
|
|
3531
|
+
import { decodeEventLog, encodeFunctionData as encodeFunctionData5 } from "viem";
|
|
3530
3532
|
function useCreateOrganizationBase() {
|
|
3531
|
-
return
|
|
3533
|
+
return useCallback20(
|
|
3532
3534
|
/**
|
|
3533
3535
|
* Creates a new organization on-chain.
|
|
3534
3536
|
*
|
|
@@ -3588,7 +3590,7 @@ function useCreateOrganizationBase() {
|
|
|
3588
3590
|
let proxyAddress;
|
|
3589
3591
|
for (const log of txReceipt.logs) {
|
|
3590
3592
|
try {
|
|
3591
|
-
const decoded =
|
|
3593
|
+
const decoded = decodeEventLog({
|
|
3592
3594
|
abi: ORGANIZATION_BEACON_ABI,
|
|
3593
3595
|
data: log.data,
|
|
3594
3596
|
topics: log.topics
|
|
@@ -3624,7 +3626,7 @@ function useCreateOrganizationBase() {
|
|
|
3624
3626
|
}
|
|
3625
3627
|
|
|
3626
3628
|
// src/utils/organization/useApproveOrgKibbleToken.ts
|
|
3627
|
-
import { useCallback as
|
|
3629
|
+
import { useCallback as useCallback21 } from "react";
|
|
3628
3630
|
|
|
3629
3631
|
// src/helpers/ProcessOrgKibbleApproval.tsx
|
|
3630
3632
|
import { encodeFunctionData as encodeFunctionData6, erc20Abi as erc20Abi3 } from "viem";
|
|
@@ -3722,7 +3724,7 @@ async function processOrgKibbleApproval(orgContractAddress, kibbleTokenAddress,
|
|
|
3722
3724
|
|
|
3723
3725
|
// src/utils/organization/useApproveOrgKibbleToken.ts
|
|
3724
3726
|
function useApproveOrgPartialPayment() {
|
|
3725
|
-
return
|
|
3727
|
+
return useCallback21(
|
|
3726
3728
|
async (orgContractAddress, kibbleTokenAddress, partialPaymentModuleAddress, managerSmartAccount, bundlerClient, approveAmount) => {
|
|
3727
3729
|
if (!orgContractAddress || !kibbleTokenAddress || !partialPaymentModuleAddress || !managerSmartAccount || !bundlerClient || !approveAmount) {
|
|
3728
3730
|
return {
|
|
@@ -3754,7 +3756,7 @@ function useApproveOrgPartialPayment() {
|
|
|
3754
3756
|
}
|
|
3755
3757
|
|
|
3756
3758
|
// src/utils/organization/useProcessOrgPartialKibblePayment.ts
|
|
3757
|
-
import { useCallback as
|
|
3759
|
+
import { useCallback as useCallback22 } from "react";
|
|
3758
3760
|
|
|
3759
3761
|
// src/helpers/ProcessOrgPartialPayment.tsx
|
|
3760
3762
|
import { encodeFunctionData as encodeFunctionData7 } from "viem";
|
|
@@ -3812,7 +3814,7 @@ async function processOrgPartialPayment(orgContractAddress, partialPaymentModule
|
|
|
3812
3814
|
|
|
3813
3815
|
// src/utils/organization/useProcessOrgPartialKibblePayment.ts
|
|
3814
3816
|
function useProcessOrgPartialKibblePayment() {
|
|
3815
|
-
return
|
|
3817
|
+
return useCallback22(
|
|
3816
3818
|
async (orgContractAddress, partialPaymentModuleAddress, managerSmartAccount, bundlerClient, orderId, anymalNftId, pid, amountInTokens, maxTokenPayment, nonce, deadline, backendSignature) => {
|
|
3817
3819
|
if (!orgContractAddress || !partialPaymentModuleAddress || !managerSmartAccount || !bundlerClient || !orderId || !pid || !nonce || !backendSignature) {
|
|
3818
3820
|
return {
|
|
@@ -3850,9 +3852,9 @@ function useProcessOrgPartialKibblePayment() {
|
|
|
3850
3852
|
}
|
|
3851
3853
|
|
|
3852
3854
|
// src/utils/organization/useUpdateOrgWalletAddress.ts
|
|
3853
|
-
import { useCallback as
|
|
3855
|
+
import { useCallback as useCallback23 } from "react";
|
|
3854
3856
|
function useUpdateOrgWalletAddress() {
|
|
3855
|
-
return
|
|
3857
|
+
return useCallback23(
|
|
3856
3858
|
async (dbAuthToken, docID, baseWalletAddress, endpoint) => {
|
|
3857
3859
|
try {
|
|
3858
3860
|
const mutation = `
|
|
@@ -3892,9 +3894,9 @@ function useUpdateOrgWalletAddress() {
|
|
|
3892
3894
|
|
|
3893
3895
|
// src/utils/organization/useMintOrgAnymalNFT.ts
|
|
3894
3896
|
import { encodeFunctionData as encodeFunctionData8 } from "viem";
|
|
3895
|
-
import { useCallback as
|
|
3897
|
+
import { useCallback as useCallback24 } from "react";
|
|
3896
3898
|
function useMintOrgAnymalNFT() {
|
|
3897
|
-
return
|
|
3899
|
+
return useCallback24(
|
|
3898
3900
|
async (orgContractAddress, pid, nftId, anymalTxId, dbAuthToken, validationContractAddress, managerSmartAccount, bundlerClient) => {
|
|
3899
3901
|
if (!dbAuthToken || !nftId || !bundlerClient || !managerSmartAccount || !pid || !validationContractAddress || !orgContractAddress) {
|
|
3900
3902
|
return {
|
|
@@ -3979,9 +3981,9 @@ async function submitAction(idToken, pid, sourceType, payload, endpointBaseUrl)
|
|
|
3979
3981
|
}
|
|
3980
3982
|
|
|
3981
3983
|
// src/utils/actions/useFetchActions.ts
|
|
3982
|
-
import { useCallback as
|
|
3984
|
+
import { useCallback as useCallback25 } from "react";
|
|
3983
3985
|
function useFetchActions() {
|
|
3984
|
-
return
|
|
3986
|
+
return useCallback25(
|
|
3985
3987
|
async (idToken, actionsServiceBaseUrl, pid, status, limit, offset) => {
|
|
3986
3988
|
const params = new URLSearchParams({ pid });
|
|
3987
3989
|
if (status) params.set("status", status);
|
|
@@ -4010,9 +4012,9 @@ function useFetchActions() {
|
|
|
4010
4012
|
}
|
|
4011
4013
|
|
|
4012
4014
|
// src/utils/actions/useFetchActionDefinitions.ts
|
|
4013
|
-
import { useCallback as
|
|
4015
|
+
import { useCallback as useCallback26 } from "react";
|
|
4014
4016
|
function useFetchActionDefinitions() {
|
|
4015
|
-
return
|
|
4017
|
+
return useCallback26(
|
|
4016
4018
|
async (idToken, actionsServiceBaseUrl) => {
|
|
4017
4019
|
try {
|
|
4018
4020
|
const response = await fetch(
|
|
@@ -4109,10 +4111,10 @@ var convertToMultipleActionRecords = (frs) => frs.map(convertToActionRecord);
|
|
|
4109
4111
|
var convertToMultipleActionDefinitions = (frs) => frs.map(convertToActionDefinition);
|
|
4110
4112
|
|
|
4111
4113
|
// src/utils/application/useCreateUserAppData.ts
|
|
4112
|
-
import { useCallback as
|
|
4114
|
+
import { useCallback as useCallback27 } from "react";
|
|
4113
4115
|
import { v4 as uuid } from "uuid";
|
|
4114
4116
|
function useCreateUserAppData() {
|
|
4115
|
-
return
|
|
4117
|
+
return useCallback27(
|
|
4116
4118
|
async (appId, pid, dbAuthToken, endpoint) => {
|
|
4117
4119
|
if (!dbAuthToken || !pid || !dbAuthToken || !endpoint) return;
|
|
4118
4120
|
const appValues = {
|
|
@@ -4167,10 +4169,10 @@ function useCreateUserAppData() {
|
|
|
4167
4169
|
}
|
|
4168
4170
|
|
|
4169
4171
|
// src/utils/application/useCreateOrganizationAppData.ts
|
|
4170
|
-
import { useCallback as
|
|
4172
|
+
import { useCallback as useCallback28 } from "react";
|
|
4171
4173
|
import { v4 as uuid2 } from "uuid";
|
|
4172
4174
|
function useCreateOrganizationAppData() {
|
|
4173
|
-
return
|
|
4175
|
+
return useCallback28(
|
|
4174
4176
|
async (appId, pid, dbAuthToken, endpoint) => {
|
|
4175
4177
|
if (!dbAuthToken || !pid || !dbAuthToken || !endpoint) return;
|
|
4176
4178
|
const appValues = {
|
|
@@ -4224,10 +4226,10 @@ function useCreateOrganizationAppData() {
|
|
|
4224
4226
|
}
|
|
4225
4227
|
|
|
4226
4228
|
// src/utils/balance/useFetchBalance.ts
|
|
4227
|
-
import { useCallback as
|
|
4229
|
+
import { useCallback as useCallback29 } from "react";
|
|
4228
4230
|
import { erc20Abi as erc20Abi4, getAddress } from "viem";
|
|
4229
4231
|
function useFetchBalance() {
|
|
4230
|
-
return
|
|
4232
|
+
return useCallback29(
|
|
4231
4233
|
async (publicClient, walletAddress, kibbleTokenAddress) => {
|
|
4232
4234
|
try {
|
|
4233
4235
|
const balance = await publicClient.readContract({
|
|
@@ -4247,9 +4249,9 @@ function useFetchBalance() {
|
|
|
4247
4249
|
|
|
4248
4250
|
// src/utils/actions/useClaimActionReward.ts
|
|
4249
4251
|
import { encodeFunctionData as encodeFunctionData9 } from "viem";
|
|
4250
|
-
import { useCallback as
|
|
4252
|
+
import { useCallback as useCallback30 } from "react";
|
|
4251
4253
|
function useClaimActionReward() {
|
|
4252
|
-
return
|
|
4254
|
+
return useCallback30(
|
|
4253
4255
|
async (actionId, claimIndex, rewardableActionContractAddress, smartAccount, bundlerClient) => {
|
|
4254
4256
|
if (!actionId || claimIndex === void 0 || !bundlerClient || !smartAccount || !rewardableActionContractAddress) {
|
|
4255
4257
|
return {
|
|
@@ -4296,9 +4298,9 @@ function useClaimActionReward() {
|
|
|
4296
4298
|
|
|
4297
4299
|
// src/utils/actions/useClaimOrgActionReward.ts
|
|
4298
4300
|
import { encodeFunctionData as encodeFunctionData10 } from "viem";
|
|
4299
|
-
import { useCallback as
|
|
4301
|
+
import { useCallback as useCallback31 } from "react";
|
|
4300
4302
|
function useClaimOrgActionReward() {
|
|
4301
|
-
return
|
|
4303
|
+
return useCallback31(
|
|
4302
4304
|
async (orgContractAddress, rewardableActionContractAddress, actionId, claimIndex, smartAccount, bundlerClient) => {
|
|
4303
4305
|
if (!orgContractAddress || !actionId || claimIndex === void 0 || !bundlerClient || !smartAccount) {
|
|
4304
4306
|
return {
|
|
@@ -4348,9 +4350,9 @@ function useClaimOrgActionReward() {
|
|
|
4348
4350
|
}
|
|
4349
4351
|
|
|
4350
4352
|
// src/utils/actions/useSubmitContractAction.ts
|
|
4351
|
-
import { useCallback as
|
|
4353
|
+
import { useCallback as useCallback32 } from "react";
|
|
4352
4354
|
function useSubmitContractAction() {
|
|
4353
|
-
return
|
|
4355
|
+
return useCallback32(
|
|
4354
4356
|
(idToken, pid, source, endpoint, payload) => {
|
|
4355
4357
|
if (!idToken || !pid || !source || !endpoint || !payload) return;
|
|
4356
4358
|
let sourceTypePayload = {};
|
|
@@ -4510,6 +4512,7 @@ export {
|
|
|
4510
4512
|
useCoinbaseClaimActionReward,
|
|
4511
4513
|
useCoinbaseCreateOrganizationWallet,
|
|
4512
4514
|
useCoinbaseMintAnymalNFT,
|
|
4515
|
+
useCoinbaseMintOrgAnymalNFT,
|
|
4513
4516
|
useCreateOrganizationAppData,
|
|
4514
4517
|
useCreateOrganizationBase,
|
|
4515
4518
|
useCreateUserAppData,
|
package/package.json
CHANGED