anymal-protocol 1.0.145 → 1.0.147
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 +5 -35
- package/dist/index.mjs +8 -38
- 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
|
@@ -3039,7 +3039,8 @@ function useCoinbaseCreateOrganizationWallet() {
|
|
|
3039
3039
|
return {
|
|
3040
3040
|
success: false,
|
|
3041
3041
|
message: "Missing required parameters for organization creation.",
|
|
3042
|
-
status: "error"
|
|
3042
|
+
status: "error",
|
|
3043
|
+
data
|
|
3043
3044
|
};
|
|
3044
3045
|
}
|
|
3045
3046
|
const result = await sendOperationFn(
|
|
@@ -3050,43 +3051,12 @@ function useCoinbaseCreateOrganizationWallet() {
|
|
|
3050
3051
|
[evmAddress, orgName, orgPid]
|
|
3051
3052
|
);
|
|
3052
3053
|
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
|
-
};
|
|
3054
|
+
return { ...result, status: "error", data };
|
|
3085
3055
|
}
|
|
3086
3056
|
return {
|
|
3087
3057
|
...result,
|
|
3088
|
-
|
|
3089
|
-
|
|
3058
|
+
status,
|
|
3059
|
+
data
|
|
3090
3060
|
};
|
|
3091
3061
|
},
|
|
3092
3062
|
[sendOperationFn, data, publicClient, status]
|
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,43 +2972,12 @@ 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]
|
|
@@ -3526,7 +3496,7 @@ function useApproveKibbleToken() {
|
|
|
3526
3496
|
|
|
3527
3497
|
// src/utils/organization/useCreateOrganizationBase.ts
|
|
3528
3498
|
import { useCallback as useCallback19 } from "react";
|
|
3529
|
-
import { decodeEventLog
|
|
3499
|
+
import { decodeEventLog, encodeFunctionData as encodeFunctionData5 } from "viem";
|
|
3530
3500
|
function useCreateOrganizationBase() {
|
|
3531
3501
|
return useCallback19(
|
|
3532
3502
|
/**
|
|
@@ -3588,7 +3558,7 @@ function useCreateOrganizationBase() {
|
|
|
3588
3558
|
let proxyAddress;
|
|
3589
3559
|
for (const log of txReceipt.logs) {
|
|
3590
3560
|
try {
|
|
3591
|
-
const decoded =
|
|
3561
|
+
const decoded = decodeEventLog({
|
|
3592
3562
|
abi: ORGANIZATION_BEACON_ABI,
|
|
3593
3563
|
data: log.data,
|
|
3594
3564
|
topics: log.topics
|
package/package.json
CHANGED