anymal-protocol 1.0.140 → 1.0.142
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 +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -36
- package/dist/index.mjs +10 -39
- 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,7 @@ declare function useCoinbaseCreateOrganizationWallet(): (orgPid: string, orgName
|
|
|
433
434
|
message: string;
|
|
434
435
|
proxyAddress?: string;
|
|
435
436
|
status: string;
|
|
437
|
+
data: GetUserOperationResult | undefined;
|
|
436
438
|
}>;
|
|
437
439
|
|
|
438
440
|
declare function useMintAnymalNFT(): (pid: string, nftId: string, anymalTxId: string, dbAuthToken: string, validationContractAddress: string, smartAccount: any, bundlerClient: any) => Promise<{
|
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,7 @@ declare function useCoinbaseCreateOrganizationWallet(): (orgPid: string, orgName
|
|
|
433
434
|
message: string;
|
|
434
435
|
proxyAddress?: string;
|
|
435
436
|
status: string;
|
|
437
|
+
data: GetUserOperationResult | undefined;
|
|
436
438
|
}>;
|
|
437
439
|
|
|
438
440
|
declare function useMintAnymalNFT(): (pid: string, nftId: string, anymalTxId: string, dbAuthToken: string, validationContractAddress: string, smartAccount: any, bundlerClient: any) => Promise<{
|
package/dist/index.js
CHANGED
|
@@ -3040,7 +3040,8 @@ function useCoinbaseCreateOrganizationWallet() {
|
|
|
3040
3040
|
return {
|
|
3041
3041
|
success: false,
|
|
3042
3042
|
message: "Missing required parameters for organization creation.",
|
|
3043
|
-
status: "error"
|
|
3043
|
+
status: "error",
|
|
3044
|
+
data
|
|
3044
3045
|
};
|
|
3045
3046
|
}
|
|
3046
3047
|
try {
|
|
@@ -3052,50 +3053,20 @@ function useCoinbaseCreateOrganizationWallet() {
|
|
|
3052
3053
|
[ownerAddress, orgName, orgPid]
|
|
3053
3054
|
);
|
|
3054
3055
|
if (!result.success) {
|
|
3055
|
-
return { ...result, status: "error" };
|
|
3056
|
-
}
|
|
3057
|
-
let proxyAddress;
|
|
3058
|
-
try {
|
|
3059
|
-
const txHash = data?.receipts?.[0]?.transactionHash || data?.transactionHash;
|
|
3060
|
-
if (txHash) {
|
|
3061
|
-
const receipt = await publicClient.getTransactionReceipt({
|
|
3062
|
-
hash: txHash
|
|
3063
|
-
});
|
|
3064
|
-
for (const log of receipt.logs) {
|
|
3065
|
-
try {
|
|
3066
|
-
const decoded = (0, import_viem3.decodeEventLog)({
|
|
3067
|
-
abi: ORGANIZATION_BEACON_ABI,
|
|
3068
|
-
data: log.data,
|
|
3069
|
-
topics: log.topics
|
|
3070
|
-
});
|
|
3071
|
-
if (decoded.eventName === "NewOrganizationCreated") {
|
|
3072
|
-
proxyAddress = decoded.args.proxyAddress;
|
|
3073
|
-
break;
|
|
3074
|
-
}
|
|
3075
|
-
} catch {
|
|
3076
|
-
}
|
|
3077
|
-
}
|
|
3078
|
-
}
|
|
3079
|
-
} catch (e) {
|
|
3080
|
-
console.error("Failed to get transaction receipt:", e);
|
|
3081
|
-
}
|
|
3082
|
-
if (!proxyAddress) {
|
|
3083
|
-
return {
|
|
3084
|
-
...result,
|
|
3085
|
-
status
|
|
3086
|
-
};
|
|
3056
|
+
return { ...result, status: "error", data };
|
|
3087
3057
|
}
|
|
3088
3058
|
return {
|
|
3089
3059
|
...result,
|
|
3090
|
-
|
|
3091
|
-
|
|
3060
|
+
status,
|
|
3061
|
+
data
|
|
3092
3062
|
};
|
|
3093
3063
|
} catch (error) {
|
|
3094
3064
|
console.error("Org wallet creation error", error);
|
|
3095
3065
|
return {
|
|
3096
3066
|
success: false,
|
|
3097
3067
|
message: "Error",
|
|
3098
|
-
status: "error"
|
|
3068
|
+
status: "error",
|
|
3069
|
+
data
|
|
3099
3070
|
};
|
|
3100
3071
|
}
|
|
3101
3072
|
},
|
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();
|
|
@@ -2961,7 +2961,8 @@ function useCoinbaseCreateOrganizationWallet() {
|
|
|
2961
2961
|
return {
|
|
2962
2962
|
success: false,
|
|
2963
2963
|
message: "Missing required parameters for organization creation.",
|
|
2964
|
-
status: "error"
|
|
2964
|
+
status: "error",
|
|
2965
|
+
data
|
|
2965
2966
|
};
|
|
2966
2967
|
}
|
|
2967
2968
|
try {
|
|
@@ -2973,50 +2974,20 @@ function useCoinbaseCreateOrganizationWallet() {
|
|
|
2973
2974
|
[ownerAddress, orgName, orgPid]
|
|
2974
2975
|
);
|
|
2975
2976
|
if (!result.success) {
|
|
2976
|
-
return { ...result, status: "error" };
|
|
2977
|
-
}
|
|
2978
|
-
let proxyAddress;
|
|
2979
|
-
try {
|
|
2980
|
-
const txHash = data?.receipts?.[0]?.transactionHash || data?.transactionHash;
|
|
2981
|
-
if (txHash) {
|
|
2982
|
-
const receipt = await publicClient.getTransactionReceipt({
|
|
2983
|
-
hash: txHash
|
|
2984
|
-
});
|
|
2985
|
-
for (const log of receipt.logs) {
|
|
2986
|
-
try {
|
|
2987
|
-
const decoded = decodeEventLog({
|
|
2988
|
-
abi: ORGANIZATION_BEACON_ABI,
|
|
2989
|
-
data: log.data,
|
|
2990
|
-
topics: log.topics
|
|
2991
|
-
});
|
|
2992
|
-
if (decoded.eventName === "NewOrganizationCreated") {
|
|
2993
|
-
proxyAddress = decoded.args.proxyAddress;
|
|
2994
|
-
break;
|
|
2995
|
-
}
|
|
2996
|
-
} catch {
|
|
2997
|
-
}
|
|
2998
|
-
}
|
|
2999
|
-
}
|
|
3000
|
-
} catch (e) {
|
|
3001
|
-
console.error("Failed to get transaction receipt:", e);
|
|
3002
|
-
}
|
|
3003
|
-
if (!proxyAddress) {
|
|
3004
|
-
return {
|
|
3005
|
-
...result,
|
|
3006
|
-
status
|
|
3007
|
-
};
|
|
2977
|
+
return { ...result, status: "error", data };
|
|
3008
2978
|
}
|
|
3009
2979
|
return {
|
|
3010
2980
|
...result,
|
|
3011
|
-
|
|
3012
|
-
|
|
2981
|
+
status,
|
|
2982
|
+
data
|
|
3013
2983
|
};
|
|
3014
2984
|
} catch (error) {
|
|
3015
2985
|
console.error("Org wallet creation error", error);
|
|
3016
2986
|
return {
|
|
3017
2987
|
success: false,
|
|
3018
2988
|
message: "Error",
|
|
3019
|
-
status: "error"
|
|
2989
|
+
status: "error",
|
|
2990
|
+
data
|
|
3020
2991
|
};
|
|
3021
2992
|
}
|
|
3022
2993
|
},
|
|
@@ -3536,7 +3507,7 @@ function useApproveKibbleToken() {
|
|
|
3536
3507
|
|
|
3537
3508
|
// src/utils/organization/useCreateOrganizationBase.ts
|
|
3538
3509
|
import { useCallback as useCallback19 } from "react";
|
|
3539
|
-
import { decodeEventLog
|
|
3510
|
+
import { decodeEventLog, encodeFunctionData as encodeFunctionData5 } from "viem";
|
|
3540
3511
|
function useCreateOrganizationBase() {
|
|
3541
3512
|
return useCallback19(
|
|
3542
3513
|
/**
|
|
@@ -3598,7 +3569,7 @@ function useCreateOrganizationBase() {
|
|
|
3598
3569
|
let proxyAddress;
|
|
3599
3570
|
for (const log of txReceipt.logs) {
|
|
3600
3571
|
try {
|
|
3601
|
-
const decoded =
|
|
3572
|
+
const decoded = decodeEventLog({
|
|
3602
3573
|
abi: ORGANIZATION_BEACON_ABI,
|
|
3603
3574
|
data: log.data,
|
|
3604
3575
|
topics: log.topics
|
package/package.json
CHANGED