@aromedia/contracts-sdk 0.2.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/chains.d.cts +10 -0
  2. package/dist/chains.d.ts +10 -0
  3. package/dist/{chunk-7I5N3BGV.js → chunk-BENMJNYO.js} +3 -3
  4. package/dist/chunk-BENMJNYO.js.map +1 -0
  5. package/dist/{chunk-TZQHQLNY.js → chunk-EGUPIYHR.js} +2242 -199
  6. package/dist/chunk-EGUPIYHR.js.map +1 -0
  7. package/dist/{chunk-BYPGUFYV.js → chunk-VUYKYCOD.js} +1 -1
  8. package/dist/chunk-VUYKYCOD.js.map +1 -0
  9. package/dist/{chunk-FWZ7XKFC.js → chunk-WUHQC3GY.js} +22 -12
  10. package/dist/chunk-WUHQC3GY.js.map +1 -0
  11. package/dist/generated/abis.cjs +2245 -200
  12. package/dist/generated/abis.cjs.map +1 -1
  13. package/dist/generated/abis.d.cts +6046 -2916
  14. package/dist/generated/abis.d.ts +6046 -2916
  15. package/dist/generated/abis.js +7 -3
  16. package/dist/generated/addresses.cjs +21 -11
  17. package/dist/generated/addresses.cjs.map +1 -1
  18. package/dist/generated/addresses.js +1 -1
  19. package/dist/hooks/index.cjs +307 -27
  20. package/dist/hooks/index.cjs.map +1 -1
  21. package/dist/hooks/index.d.cts +46 -5
  22. package/dist/hooks/index.d.ts +46 -5
  23. package/dist/hooks/index.js +7 -3
  24. package/dist/hooks/index.js.map +1 -1
  25. package/dist/index.cjs +2421 -313
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +132 -14
  28. package/dist/index.d.ts +132 -14
  29. package/dist/index.js +60 -7
  30. package/dist/index.js.map +1 -1
  31. package/dist/{onboarding-DxL_LpM3.d.ts → onboarding-BD_g7Len.d.ts} +64 -9
  32. package/dist/{onboarding-BHpAJaNW.d.cts → onboarding-DDKwXy8O.d.cts} +64 -9
  33. package/dist/workflows/index.cjs +282 -17
  34. package/dist/workflows/index.cjs.map +1 -1
  35. package/dist/workflows/index.d.cts +1 -1
  36. package/dist/workflows/index.d.ts +1 -1
  37. package/dist/workflows/index.js +3 -3
  38. package/package.json +1 -1
  39. package/dist/chunk-7I5N3BGV.js.map +0 -1
  40. package/dist/chunk-BYPGUFYV.js.map +0 -1
  41. package/dist/chunk-FWZ7XKFC.js.map +0 -1
  42. package/dist/chunk-TZQHQLNY.js.map +0 -1
@@ -2,7 +2,7 @@ import { addresses, AroChainId } from '../generated/addresses.cjs';
2
2
  import * as wagmi from 'wagmi';
3
3
  import { UseReadContractParameters } from 'wagmi';
4
4
  import * as abitype from 'abitype';
5
- import { O as OnboardingState } from '../onboarding-BHpAJaNW.cjs';
5
+ import { O as OnboardingState } from '../onboarding-DDKwXy8O.cjs';
6
6
  import '../generated/abis.cjs';
7
7
  import 'viem';
8
8
 
@@ -30,21 +30,62 @@ declare function useMemberData(account: `0x${string}` | undefined, opts?: Partia
30
30
  * the dapp's UI should hide this control for non-admin users.
31
31
  */
32
32
  declare function useMintSBT(): wagmi.UseWriteContractReturnType<wagmi.Config, unknown>;
33
+ /**
34
+ * Candidate-side write hook for AroSBT.mintWithApproval.
35
+ *
36
+ * The candidate submits an admin-issued EIP-712 voucher (see
37
+ * `signMintApproval` in `../utils/mintApproval`) and its signature; the
38
+ * contract recovers the approver, checks ROLE_MINTER, marks the voucher
39
+ * nullified, and mints the SBT to msg.sender. The candidate's wallet
40
+ * does NOT need any role — the gate is the signature.
41
+ *
42
+ * Usage:
43
+ *
44
+ * ```tsx
45
+ * const addrs = useAroAddresses()
46
+ * const { writeContractAsync } = useMintWithApproval()
47
+ *
48
+ * await writeContractAsync({
49
+ * address: addrs!.AroSBT,
50
+ * abi: AroSBT_ABI,
51
+ * functionName: "mintWithApproval",
52
+ * args: [approval, signature],
53
+ * })
54
+ * ```
55
+ */
56
+ declare function useMintWithApproval(): wagmi.UseWriteContractReturnType<wagmi.Config, unknown>;
33
57
 
34
58
  /**
35
59
  * Read the full nomination record for a candidate.
60
+ *
61
+ * @deprecated Use the admin portal nomination API. The on-chain nomination
62
+ * contract is being retired; see the file header for migration notes.
36
63
  */
37
64
  declare function useNomination(candidate: `0x${string}` | undefined, opts?: Partial<UseReadContractParameters>): wagmi.UseReadContractReturnType<readonly unknown[] | abitype.Abi, string, readonly unknown[], unknown>;
38
65
  /**
39
66
  * Convenience read: just the status enum, when the dapp only needs to
40
67
  * branch on PENDING / APPROVED / CLEARED.
68
+ *
69
+ * @deprecated Use the admin portal nomination API. See file header.
41
70
  */
42
71
  declare function useNominationStatus(candidate: `0x${string}` | undefined, opts?: Partial<UseReadContractParameters>): wagmi.UseReadContractReturnType<readonly unknown[] | abitype.Abi, string, readonly unknown[], unknown>;
43
- /** Current vouch threshold (typically 3 per KYC Policy §6.3). */
72
+ /**
73
+ * Current vouch threshold (typically 3 per KYC Policy §6.3).
74
+ *
75
+ * @deprecated Use the admin portal nomination API. See file header.
76
+ */
44
77
  declare function useNominationThreshold(opts?: Partial<UseReadContractParameters>): wagmi.UseReadContractReturnType<readonly unknown[] | abitype.Abi, string, readonly unknown[], unknown>;
45
- /** Whether `voucher` has already vouched for `candidate`. */
78
+ /**
79
+ * Whether `voucher` has already vouched for `candidate`.
80
+ *
81
+ * @deprecated Use the admin portal nomination API. See file header.
82
+ */
46
83
  declare function useHasVouched(voucher: `0x${string}` | undefined, candidate: `0x${string}` | undefined, opts?: Partial<UseReadContractParameters>): wagmi.UseReadContractReturnType<readonly unknown[] | abitype.Abi, string, readonly unknown[], unknown>;
47
- /** Write hook returning `writeContractAsync` for nominate/vouch/clear. */
84
+ /**
85
+ * Write hook returning `writeContractAsync` for nominate/vouch/clear.
86
+ *
87
+ * @deprecated Use the admin portal nomination API. See file header.
88
+ */
48
89
  declare function useNominationWriter(): wagmi.UseWriteContractReturnType<wagmi.Config, unknown>;
49
90
 
50
91
  /**
@@ -60,4 +101,4 @@ declare function useMembership(wallet: `0x${string}` | undefined): {
60
101
  refetch: () => void;
61
102
  };
62
103
 
63
- export { useAroAddresses, useAroChainId, useHasSBT, useHasVouched, useMemberData, useMembership, useMintSBT, useNomination, useNominationStatus, useNominationThreshold, useNominationWriter };
104
+ export { useAroAddresses, useAroChainId, useHasSBT, useHasVouched, useMemberData, useMembership, useMintSBT, useMintWithApproval, useNomination, useNominationStatus, useNominationThreshold, useNominationWriter };
@@ -2,7 +2,7 @@ import { addresses, AroChainId } from '../generated/addresses.js';
2
2
  import * as wagmi from 'wagmi';
3
3
  import { UseReadContractParameters } from 'wagmi';
4
4
  import * as abitype from 'abitype';
5
- import { O as OnboardingState } from '../onboarding-DxL_LpM3.js';
5
+ import { O as OnboardingState } from '../onboarding-BD_g7Len.js';
6
6
  import '../generated/abis.js';
7
7
  import 'viem';
8
8
 
@@ -30,21 +30,62 @@ declare function useMemberData(account: `0x${string}` | undefined, opts?: Partia
30
30
  * the dapp's UI should hide this control for non-admin users.
31
31
  */
32
32
  declare function useMintSBT(): wagmi.UseWriteContractReturnType<wagmi.Config, unknown>;
33
+ /**
34
+ * Candidate-side write hook for AroSBT.mintWithApproval.
35
+ *
36
+ * The candidate submits an admin-issued EIP-712 voucher (see
37
+ * `signMintApproval` in `../utils/mintApproval`) and its signature; the
38
+ * contract recovers the approver, checks ROLE_MINTER, marks the voucher
39
+ * nullified, and mints the SBT to msg.sender. The candidate's wallet
40
+ * does NOT need any role — the gate is the signature.
41
+ *
42
+ * Usage:
43
+ *
44
+ * ```tsx
45
+ * const addrs = useAroAddresses()
46
+ * const { writeContractAsync } = useMintWithApproval()
47
+ *
48
+ * await writeContractAsync({
49
+ * address: addrs!.AroSBT,
50
+ * abi: AroSBT_ABI,
51
+ * functionName: "mintWithApproval",
52
+ * args: [approval, signature],
53
+ * })
54
+ * ```
55
+ */
56
+ declare function useMintWithApproval(): wagmi.UseWriteContractReturnType<wagmi.Config, unknown>;
33
57
 
34
58
  /**
35
59
  * Read the full nomination record for a candidate.
60
+ *
61
+ * @deprecated Use the admin portal nomination API. The on-chain nomination
62
+ * contract is being retired; see the file header for migration notes.
36
63
  */
37
64
  declare function useNomination(candidate: `0x${string}` | undefined, opts?: Partial<UseReadContractParameters>): wagmi.UseReadContractReturnType<readonly unknown[] | abitype.Abi, string, readonly unknown[], unknown>;
38
65
  /**
39
66
  * Convenience read: just the status enum, when the dapp only needs to
40
67
  * branch on PENDING / APPROVED / CLEARED.
68
+ *
69
+ * @deprecated Use the admin portal nomination API. See file header.
41
70
  */
42
71
  declare function useNominationStatus(candidate: `0x${string}` | undefined, opts?: Partial<UseReadContractParameters>): wagmi.UseReadContractReturnType<readonly unknown[] | abitype.Abi, string, readonly unknown[], unknown>;
43
- /** Current vouch threshold (typically 3 per KYC Policy §6.3). */
72
+ /**
73
+ * Current vouch threshold (typically 3 per KYC Policy §6.3).
74
+ *
75
+ * @deprecated Use the admin portal nomination API. See file header.
76
+ */
44
77
  declare function useNominationThreshold(opts?: Partial<UseReadContractParameters>): wagmi.UseReadContractReturnType<readonly unknown[] | abitype.Abi, string, readonly unknown[], unknown>;
45
- /** Whether `voucher` has already vouched for `candidate`. */
78
+ /**
79
+ * Whether `voucher` has already vouched for `candidate`.
80
+ *
81
+ * @deprecated Use the admin portal nomination API. See file header.
82
+ */
46
83
  declare function useHasVouched(voucher: `0x${string}` | undefined, candidate: `0x${string}` | undefined, opts?: Partial<UseReadContractParameters>): wagmi.UseReadContractReturnType<readonly unknown[] | abitype.Abi, string, readonly unknown[], unknown>;
47
- /** Write hook returning `writeContractAsync` for nominate/vouch/clear. */
84
+ /**
85
+ * Write hook returning `writeContractAsync` for nominate/vouch/clear.
86
+ *
87
+ * @deprecated Use the admin portal nomination API. See file header.
88
+ */
48
89
  declare function useNominationWriter(): wagmi.UseWriteContractReturnType<wagmi.Config, unknown>;
49
90
 
50
91
  /**
@@ -60,4 +101,4 @@ declare function useMembership(wallet: `0x${string}` | undefined): {
60
101
  refetch: () => void;
61
102
  };
62
103
 
63
- export { useAroAddresses, useAroChainId, useHasSBT, useHasVouched, useMemberData, useMembership, useMintSBT, useNomination, useNominationStatus, useNominationThreshold, useNominationWriter };
104
+ export { useAroAddresses, useAroChainId, useHasSBT, useHasVouched, useMemberData, useMembership, useMintSBT, useMintWithApproval, useNomination, useNominationStatus, useNominationThreshold, useNominationWriter };
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  SUPPORTED_CHAIN_IDS,
3
3
  addresses
4
- } from "../chunk-FWZ7XKFC.js";
5
- import "../chunk-BYPGUFYV.js";
4
+ } from "../chunk-WUHQC3GY.js";
5
+ import "../chunk-VUYKYCOD.js";
6
6
  import {
7
7
  AroNomination_ABI,
8
8
  AroSBT_ABI
9
- } from "../chunk-TZQHQLNY.js";
9
+ } from "../chunk-EGUPIYHR.js";
10
10
 
11
11
  // src/hooks/useAroAddresses.ts
12
12
  import { useMemo } from "react";
@@ -59,6 +59,9 @@ function useMemberData(account, opts = {}) {
59
59
  function useMintSBT() {
60
60
  return useWriteContract();
61
61
  }
62
+ function useMintWithApproval() {
63
+ return useWriteContract();
64
+ }
62
65
 
63
66
  // src/hooks/useAroNomination.ts
64
67
  import { useReadContract as useReadContract2, useWriteContract as useWriteContract2 } from "wagmi";
@@ -210,6 +213,7 @@ export {
210
213
  useMemberData,
211
214
  useMembership,
212
215
  useMintSBT,
216
+ useMintWithApproval,
213
217
  useNomination,
214
218
  useNominationStatus,
215
219
  useNominationThreshold,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hooks/useAroAddresses.ts","../../src/hooks/useAroSBT.ts","../../src/hooks/useAroNomination.ts","../../src/hooks/useMembership.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useChainId } from \"wagmi\";\n\nimport { addresses, SUPPORTED_CHAIN_IDS, type AroChainId } from \"../generated/addresses.js\";\n\n/**\n * Returns the deployed contract addresses for the chain the user is\n * currently connected to. Returns `null` for chains the SDK does not\n * recognize so the dapp can render a \"switch network\" prompt.\n */\nexport function useAroAddresses(): Record<keyof typeof addresses[AroChainId], `0x${string}`> | null {\n const chainId = useChainId();\n return useMemo(() => {\n if (!isSupportedChain(chainId)) return null;\n return addresses[chainId];\n }, [chainId]);\n}\n\nexport function useAroChainId(): AroChainId | null {\n const chainId = useChainId();\n return isSupportedChain(chainId) ? chainId : null;\n}\n\nfunction isSupportedChain(id: number): id is AroChainId {\n return (SUPPORTED_CHAIN_IDS as readonly number[]).includes(id);\n}\n","import { useReadContract, useWriteContract, type UseReadContractParameters } from \"wagmi\";\n\nimport { AroSBT_ABI } from \"../generated/abis.js\";\nimport { useAroAddresses } from \"./useAroAddresses.js\";\n\n/**\n * Read whether an address holds an SBT. Returns `undefined` while loading\n * and `false` if the address has been confirmed as a non-member.\n */\nexport function useHasSBT(\n account: `0x${string}` | undefined,\n opts: Partial<UseReadContractParameters> = {},\n) {\n const addrs = useAroAddresses();\n return useReadContract({\n address: addrs?.AroSBT,\n abi: AroSBT_ABI,\n functionName: \"hasSBT\",\n args: account ? [account] : undefined,\n query: {\n enabled: Boolean(addrs?.AroSBT && account),\n ...((opts as { query?: unknown }).query as object | undefined),\n },\n ...opts,\n } as UseReadContractParameters);\n}\n\n/**\n * Decoded MemberData for an address. Throws on-chain if the address has\n * no SBT, so the dapp should only call this after `useHasSBT` returns true.\n */\nexport function useMemberData(\n account: `0x${string}` | undefined,\n opts: Partial<UseReadContractParameters> = {},\n) {\n const addrs = useAroAddresses();\n return useReadContract({\n address: addrs?.AroSBT,\n abi: AroSBT_ABI,\n functionName: \"getMemberData\",\n args: account ? [account] : undefined,\n query: {\n enabled: Boolean(addrs?.AroSBT && account),\n ...((opts as { query?: unknown }).query as object | undefined),\n },\n ...opts,\n } as UseReadContractParameters);\n}\n\n/**\n * Admin write hook for minting an SBT. The contract gates this behind\n * ROLE_MINTER, so the caller's wallet must be a holder of that role —\n * the dapp's UI should hide this control for non-admin users.\n */\nexport function useMintSBT() {\n return useWriteContract();\n}\n","import { useReadContract, useWriteContract, type UseReadContractParameters } from \"wagmi\";\n\nimport { AroNomination_ABI } from \"../generated/abis.js\";\nimport { useAroAddresses } from \"./useAroAddresses.js\";\n\n/**\n * Read the full nomination record for a candidate.\n */\nexport function useNomination(\n candidate: `0x${string}` | undefined,\n opts: Partial<UseReadContractParameters> = {},\n) {\n const addrs = useAroAddresses();\n return useReadContract({\n address: addrs?.AroNomination,\n abi: AroNomination_ABI,\n functionName: \"getNomination\",\n args: candidate ? [candidate] : undefined,\n query: {\n enabled: Boolean(addrs?.AroNomination && candidate),\n ...((opts as { query?: unknown }).query as object | undefined),\n },\n ...opts,\n } as UseReadContractParameters);\n}\n\n/**\n * Convenience read: just the status enum, when the dapp only needs to\n * branch on PENDING / APPROVED / CLEARED.\n */\nexport function useNominationStatus(\n candidate: `0x${string}` | undefined,\n opts: Partial<UseReadContractParameters> = {},\n) {\n const addrs = useAroAddresses();\n return useReadContract({\n address: addrs?.AroNomination,\n abi: AroNomination_ABI,\n functionName: \"getNominationStatus\",\n args: candidate ? [candidate] : undefined,\n query: {\n enabled: Boolean(addrs?.AroNomination && candidate),\n ...((opts as { query?: unknown }).query as object | undefined),\n },\n ...opts,\n } as UseReadContractParameters);\n}\n\n/** Current vouch threshold (typically 3 per KYC Policy §6.3). */\nexport function useNominationThreshold(opts: Partial<UseReadContractParameters> = {}) {\n const addrs = useAroAddresses();\n return useReadContract({\n address: addrs?.AroNomination,\n abi: AroNomination_ABI,\n functionName: \"threshold\",\n query: {\n enabled: Boolean(addrs?.AroNomination),\n ...((opts as { query?: unknown }).query as object | undefined),\n },\n ...opts,\n } as UseReadContractParameters);\n}\n\n/** Whether `voucher` has already vouched for `candidate`. */\nexport function useHasVouched(\n voucher: `0x${string}` | undefined,\n candidate: `0x${string}` | undefined,\n opts: Partial<UseReadContractParameters> = {},\n) {\n const addrs = useAroAddresses();\n return useReadContract({\n address: addrs?.AroNomination,\n abi: AroNomination_ABI,\n functionName: \"hasVouched\",\n args: voucher && candidate ? [voucher, candidate] : undefined,\n query: {\n enabled: Boolean(addrs?.AroNomination && voucher && candidate),\n ...((opts as { query?: unknown }).query as object | undefined),\n },\n ...opts,\n } as UseReadContractParameters);\n}\n\n/** Write hook returning `writeContractAsync` for nominate/vouch/clear. */\nexport function useNominationWriter() {\n return useWriteContract();\n}\n","import { useMemo } from \"react\";\nimport { useReadContracts } from \"wagmi\";\n\nimport { AroNomination_ABI } from \"../generated/abis.js\";\nimport { AroSBT_ABI } from \"../generated/abis.js\";\nimport { AroTier, NominationStatus } from \"../generated/types.js\";\nimport type { OnboardingState, OnboardingStep } from \"../workflows/onboarding.js\";\nimport { useAroAddresses } from \"./useAroAddresses.js\";\n\n/**\n * The hook the access-gate page reaches for. Batches the three reads it\n * needs (hasSBT, nomination, threshold) into a single multicall and\n * returns a derived OnboardingState matching `describeOnboardingState`\n * from the workflows module — but reactive instead of a one-shot read.\n */\nexport function useMembership(wallet: `0x${string}` | undefined): {\n data?: OnboardingState;\n isLoading: boolean;\n isError: boolean;\n refetch: () => void;\n} {\n const addrs = useAroAddresses();\n\n const reads = useReadContracts({\n contracts:\n addrs && wallet\n ? [\n {\n address: addrs.AroSBT,\n abi: AroSBT_ABI,\n functionName: \"hasSBT\",\n args: [wallet],\n },\n {\n address: addrs.AroNomination,\n abi: AroNomination_ABI,\n functionName: \"getNomination\",\n args: [wallet],\n },\n {\n address: addrs.AroNomination,\n abi: AroNomination_ABI,\n functionName: \"threshold\",\n },\n {\n address: addrs.AroSBT,\n abi: AroSBT_ABI,\n functionName: \"getMemberData\",\n args: [wallet],\n },\n ]\n : [],\n query: { enabled: Boolean(addrs && wallet) },\n });\n\n const data = useMemo<OnboardingState | undefined>(() => {\n if (!wallet) return { step: \"needs-wallet\", membership: { hasSBT: false } };\n if (!reads.data) return undefined;\n\n const [hasSBTResult, nomResult, thresholdResult, memberDataResult] = reads.data;\n const hasSBT = (hasSBTResult?.result as boolean) ?? false;\n\n if (hasSBT) {\n const md = memberDataResult?.result as\n | {\n memberId: bigint;\n issuanceDate: bigint;\n tier: number;\n kycHash: `0x${string}`;\n }\n | undefined;\n return {\n step: \"member\" as OnboardingStep,\n membership: {\n hasSBT: true,\n tier: md?.tier as AroTier | undefined,\n memberId: md?.memberId,\n issuanceDate: md?.issuanceDate,\n kycHash: md?.kycHash,\n },\n };\n }\n\n const nomTuple = nomResult?.result as\n | [`0x${string}`, readonly `0x${string}`[], bigint, number]\n | undefined;\n const threshold = thresholdResult?.result as bigint | undefined;\n\n if (!nomTuple || threshold === undefined) {\n return { step: \"needs-nomination\", membership: { hasSBT: false } };\n }\n\n const [nominator, vouchers, nominatedAt, status] = nomTuple;\n const thresholdN = Number(threshold);\n const voucherCount = vouchers.length;\n const snapshot = {\n status: status as NominationStatus,\n nominator,\n vouchers,\n nominatedAt,\n voucherCount,\n threshold: thresholdN,\n remaining: Math.max(0, thresholdN - voucherCount),\n ready: status === NominationStatus.APPROVED,\n };\n\n let step: OnboardingStep = \"needs-nomination\";\n if (snapshot.status === NominationStatus.PENDING) step = \"needs-vouches\";\n else if (snapshot.status === NominationStatus.APPROVED) step = \"needs-kyc\";\n\n return { step, membership: { hasSBT: false }, nomination: snapshot };\n }, [reads.data, wallet]);\n\n return {\n data,\n isLoading: reads.isLoading,\n isError: reads.isError,\n refetch: reads.refetch,\n };\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,kBAAkB;AASpB,SAAS,kBAAoF;AAClG,QAAM,UAAU,WAAW;AAC3B,SAAO,QAAQ,MAAM;AACnB,QAAI,CAAC,iBAAiB,OAAO,EAAG,QAAO;AACvC,WAAO,UAAU,OAAO;AAAA,EAC1B,GAAG,CAAC,OAAO,CAAC;AACd;AAEO,SAAS,gBAAmC;AACjD,QAAM,UAAU,WAAW;AAC3B,SAAO,iBAAiB,OAAO,IAAI,UAAU;AAC/C;AAEA,SAAS,iBAAiB,IAA8B;AACtD,SAAQ,oBAA0C,SAAS,EAAE;AAC/D;;;ACzBA,SAAS,iBAAiB,wBAAwD;AAS3E,SAAS,UACd,SACA,OAA2C,CAAC,GAC5C;AAC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ChD,SAAS,4BAAsC,QAAO;AAE/D,WAAO,EAAE,MAAM,YAAY,EAAE,QAAQ,MAAM,GAAG,YAAY,SAAS;AAAA,EACrE,GAAG,CAAC,MAAM,MAAM,MAAM,CAAC;AAEvB,SAAO;AAAA,IACL;AAAA,IACA,WAAW,MAAM;AAAA,IACjB,SAAS,MAAM;AAAA,IACf,SAAS,MAAM;AAAA,EACjB;AACF;","names":["useReadContract","useWriteContract","useReadContract","useWriteContract","useMemo","useMemo"]}
1
+ {"version":3,"sources":["../../src/hooks/useAroAddresses.ts","../../src/hooks/useAroSBT.ts","../../src/hooks/useAroNomination.ts","../../src/hooks/useMembership.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useChainId } from \"wagmi\";\n\nimport { addresses, SUPPORTED_CHAIN_IDS, type AroChainId } from \"../generated/addresses.js\";\n\n/**\n * Returns the deployed contract addresses for the chain the user is\n * currently connected to. Returns `null` for chains the SDK does not\n * recognize so the dapp can render a \"switch network\" prompt.\n */\nexport function useAroAddresses(): Record<keyof typeof addresses[AroChainId], `0x${string}`> | null {\n const chainId = useChainId();\n return useMemo(() => {\n if (!isSupportedChain(chainId)) return null;\n return addresses[chainId];\n }, [chainId]);\n}\n\nexport function useAroChainId(): AroChainId | null {\n const chainId = useChainId();\n return isSupportedChain(chainId) ? chainId : null;\n}\n\nfunction isSupportedChain(id: number): id is AroChainId {\n return (SUPPORTED_CHAIN_IDS as readonly number[]).includes(id);\n}\n","import { useReadContract, useWriteContract, type UseReadContractParameters } from \"wagmi\";\n\nimport { AroSBT_ABI } from \"../generated/abis.js\";\nimport { useAroAddresses } from \"./useAroAddresses.js\";\n\n/**\n * Read whether an address holds an SBT. Returns `undefined` while loading\n * and `false` if the address has been confirmed as a non-member.\n */\nexport function useHasSBT(\n account: `0x${string}` | undefined,\n opts: Partial<UseReadContractParameters> = {},\n) {\n const addrs = useAroAddresses();\n return useReadContract({\n address: addrs?.AroSBT,\n abi: AroSBT_ABI,\n functionName: \"hasSBT\",\n args: account ? [account] : undefined,\n query: {\n enabled: Boolean(addrs?.AroSBT && account),\n ...((opts as { query?: unknown }).query as object | undefined),\n },\n ...opts,\n } as UseReadContractParameters);\n}\n\n/**\n * Decoded MemberData for an address. Throws on-chain if the address has\n * no SBT, so the dapp should only call this after `useHasSBT` returns true.\n */\nexport function useMemberData(\n account: `0x${string}` | undefined,\n opts: Partial<UseReadContractParameters> = {},\n) {\n const addrs = useAroAddresses();\n return useReadContract({\n address: addrs?.AroSBT,\n abi: AroSBT_ABI,\n functionName: \"getMemberData\",\n args: account ? [account] : undefined,\n query: {\n enabled: Boolean(addrs?.AroSBT && account),\n ...((opts as { query?: unknown }).query as object | undefined),\n },\n ...opts,\n } as UseReadContractParameters);\n}\n\n/**\n * Admin write hook for minting an SBT. The contract gates this behind\n * ROLE_MINTER, so the caller's wallet must be a holder of that role —\n * the dapp's UI should hide this control for non-admin users.\n */\nexport function useMintSBT() {\n return useWriteContract();\n}\n\n/**\n * Candidate-side write hook for AroSBT.mintWithApproval.\n *\n * The candidate submits an admin-issued EIP-712 voucher (see\n * `signMintApproval` in `../utils/mintApproval`) and its signature; the\n * contract recovers the approver, checks ROLE_MINTER, marks the voucher\n * nullified, and mints the SBT to msg.sender. The candidate's wallet\n * does NOT need any role — the gate is the signature.\n *\n * Usage:\n *\n * ```tsx\n * const addrs = useAroAddresses()\n * const { writeContractAsync } = useMintWithApproval()\n *\n * await writeContractAsync({\n * address: addrs!.AroSBT,\n * abi: AroSBT_ABI,\n * functionName: \"mintWithApproval\",\n * args: [approval, signature],\n * })\n * ```\n */\nexport function useMintWithApproval() {\n return useWriteContract();\n}\n","/**\n * @file Deprecated on-chain nomination hooks.\n *\n * The on-chain `AroNomination` contract is being retired because the\n * on-chain record of nominators and vouchers exposes the social graph of\n * prospective members publicly. The nomination and vouching flow has moved\n * to the admin portal backend (Next.js + Prisma + Postgres); consumers\n * should call its API instead of these hooks.\n *\n * These exports will be removed in a future major release.\n */\n\nimport { useReadContract, useWriteContract, type UseReadContractParameters } from \"wagmi\";\n\nimport { AroNomination_ABI } from \"../generated/abis.js\";\nimport { useAroAddresses } from \"./useAroAddresses.js\";\n\n/**\n * Read the full nomination record for a candidate.\n *\n * @deprecated Use the admin portal nomination API. The on-chain nomination\n * contract is being retired; see the file header for migration notes.\n */\nexport function useNomination(\n candidate: `0x${string}` | undefined,\n opts: Partial<UseReadContractParameters> = {},\n) {\n const addrs = useAroAddresses();\n return useReadContract({\n address: addrs?.AroNomination,\n abi: AroNomination_ABI,\n functionName: \"getNomination\",\n args: candidate ? [candidate] : undefined,\n query: {\n enabled: Boolean(addrs?.AroNomination && candidate),\n ...((opts as { query?: unknown }).query as object | undefined),\n },\n ...opts,\n } as UseReadContractParameters);\n}\n\n/**\n * Convenience read: just the status enum, when the dapp only needs to\n * branch on PENDING / APPROVED / CLEARED.\n *\n * @deprecated Use the admin portal nomination API. See file header.\n */\nexport function useNominationStatus(\n candidate: `0x${string}` | undefined,\n opts: Partial<UseReadContractParameters> = {},\n) {\n const addrs = useAroAddresses();\n return useReadContract({\n address: addrs?.AroNomination,\n abi: AroNomination_ABI,\n functionName: \"getNominationStatus\",\n args: candidate ? [candidate] : undefined,\n query: {\n enabled: Boolean(addrs?.AroNomination && candidate),\n ...((opts as { query?: unknown }).query as object | undefined),\n },\n ...opts,\n } as UseReadContractParameters);\n}\n\n/**\n * Current vouch threshold (typically 3 per KYC Policy §6.3).\n *\n * @deprecated Use the admin portal nomination API. See file header.\n */\nexport function useNominationThreshold(opts: Partial<UseReadContractParameters> = {}) {\n const addrs = useAroAddresses();\n return useReadContract({\n address: addrs?.AroNomination,\n abi: AroNomination_ABI,\n functionName: \"threshold\",\n query: {\n enabled: Boolean(addrs?.AroNomination),\n ...((opts as { query?: unknown }).query as object | undefined),\n },\n ...opts,\n } as UseReadContractParameters);\n}\n\n/**\n * Whether `voucher` has already vouched for `candidate`.\n *\n * @deprecated Use the admin portal nomination API. See file header.\n */\nexport function useHasVouched(\n voucher: `0x${string}` | undefined,\n candidate: `0x${string}` | undefined,\n opts: Partial<UseReadContractParameters> = {},\n) {\n const addrs = useAroAddresses();\n return useReadContract({\n address: addrs?.AroNomination,\n abi: AroNomination_ABI,\n functionName: \"hasVouched\",\n args: voucher && candidate ? [voucher, candidate] : undefined,\n query: {\n enabled: Boolean(addrs?.AroNomination && voucher && candidate),\n ...((opts as { query?: unknown }).query as object | undefined),\n },\n ...opts,\n } as UseReadContractParameters);\n}\n\n/**\n * Write hook returning `writeContractAsync` for nominate/vouch/clear.\n *\n * @deprecated Use the admin portal nomination API. See file header.\n */\nexport function useNominationWriter() {\n return useWriteContract();\n}\n","import { useMemo } from \"react\";\nimport { useReadContracts } from \"wagmi\";\n\nimport { AroNomination_ABI } from \"../generated/abis.js\";\nimport { AroSBT_ABI } from \"../generated/abis.js\";\nimport { AroTier, NominationStatus } from \"../generated/types.js\";\nimport type { OnboardingState, OnboardingStep } from \"../workflows/onboarding.js\";\nimport { useAroAddresses } from \"./useAroAddresses.js\";\n\n/**\n * The hook the access-gate page reaches for. Batches the three reads it\n * needs (hasSBT, nomination, threshold) into a single multicall and\n * returns a derived OnboardingState matching `describeOnboardingState`\n * from the workflows module — but reactive instead of a one-shot read.\n */\nexport function useMembership(wallet: `0x${string}` | undefined): {\n data?: OnboardingState;\n isLoading: boolean;\n isError: boolean;\n refetch: () => void;\n} {\n const addrs = useAroAddresses();\n\n const reads = useReadContracts({\n contracts:\n addrs && wallet\n ? [\n {\n address: addrs.AroSBT,\n abi: AroSBT_ABI,\n functionName: \"hasSBT\",\n args: [wallet],\n },\n {\n address: addrs.AroNomination,\n abi: AroNomination_ABI,\n functionName: \"getNomination\",\n args: [wallet],\n },\n {\n address: addrs.AroNomination,\n abi: AroNomination_ABI,\n functionName: \"threshold\",\n },\n {\n address: addrs.AroSBT,\n abi: AroSBT_ABI,\n functionName: \"getMemberData\",\n args: [wallet],\n },\n ]\n : [],\n query: { enabled: Boolean(addrs && wallet) },\n });\n\n const data = useMemo<OnboardingState | undefined>(() => {\n if (!wallet) return { step: \"needs-wallet\", membership: { hasSBT: false } };\n if (!reads.data) return undefined;\n\n const [hasSBTResult, nomResult, thresholdResult, memberDataResult] = reads.data;\n const hasSBT = (hasSBTResult?.result as boolean) ?? false;\n\n if (hasSBT) {\n const md = memberDataResult?.result as\n | {\n memberId: bigint;\n issuanceDate: bigint;\n tier: bigint; // uint256 since the Tier enum was retired\n kycHash: `0x${string}`;\n }\n | undefined;\n return {\n step: \"member\" as OnboardingStep,\n membership: {\n hasSBT: true,\n tier: md?.tier,\n memberId: md?.memberId,\n issuanceDate: md?.issuanceDate,\n kycHash: md?.kycHash,\n },\n };\n }\n\n const nomTuple = nomResult?.result as\n | [`0x${string}`, readonly `0x${string}`[], bigint, number]\n | undefined;\n const threshold = thresholdResult?.result as bigint | undefined;\n\n if (!nomTuple || threshold === undefined) {\n return { step: \"needs-nomination\", membership: { hasSBT: false } };\n }\n\n const [nominator, vouchers, nominatedAt, status] = nomTuple;\n const thresholdN = Number(threshold);\n const voucherCount = vouchers.length;\n const snapshot = {\n status: status as NominationStatus,\n nominator,\n vouchers,\n nominatedAt,\n voucherCount,\n threshold: thresholdN,\n remaining: Math.max(0, thresholdN - voucherCount),\n ready: status === NominationStatus.APPROVED,\n };\n\n let step: OnboardingStep = \"needs-nomination\";\n if (snapshot.status === NominationStatus.PENDING) step = \"needs-vouches\";\n else if (snapshot.status === NominationStatus.APPROVED) step = \"needs-kyc\";\n\n return { step, membership: { hasSBT: false }, nomination: snapshot };\n }, [reads.data, wallet]);\n\n return {\n data,\n isLoading: reads.isLoading,\n isError: reads.isError,\n refetch: reads.refetch,\n };\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,kBAAkB;AASpB,SAAS,kBAAoF;AAClG,QAAM,UAAU,WAAW;AAC3B,SAAO,QAAQ,MAAM;AACnB,QAAI,CAAC,iBAAiB,OAAO,EAAG,QAAO;AACvC,WAAO,UAAU,OAAO;AAAA,EAC1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