@aromedia/contracts-sdk 0.2.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 (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +121 -0
  3. package/dist/chains.cjs +67 -0
  4. package/dist/chains.cjs.map +1 -0
  5. package/dist/chains.d.cts +826 -0
  6. package/dist/chains.d.ts +826 -0
  7. package/dist/chains.js +23 -0
  8. package/dist/chains.js.map +1 -0
  9. package/dist/chunk-7I5N3BGV.js +271 -0
  10. package/dist/chunk-7I5N3BGV.js.map +1 -0
  11. package/dist/chunk-BYPGUFYV.js +50 -0
  12. package/dist/chunk-BYPGUFYV.js.map +1 -0
  13. package/dist/chunk-FWZ7XKFC.js +91 -0
  14. package/dist/chunk-FWZ7XKFC.js.map +1 -0
  15. package/dist/chunk-J6YVU3VA.js +35 -0
  16. package/dist/chunk-J6YVU3VA.js.map +1 -0
  17. package/dist/chunk-TZQHQLNY.js +7213 -0
  18. package/dist/chunk-TZQHQLNY.js.map +1 -0
  19. package/dist/generated/abis.cjs +7244 -0
  20. package/dist/generated/abis.cjs.map +1 -0
  21. package/dist/generated/abis.d.cts +11005 -0
  22. package/dist/generated/abis.d.ts +11005 -0
  23. package/dist/generated/abis.js +21 -0
  24. package/dist/generated/abis.js.map +1 -0
  25. package/dist/generated/addresses.cjs +119 -0
  26. package/dist/generated/addresses.cjs.map +1 -0
  27. package/dist/generated/addresses.d.cts +18 -0
  28. package/dist/generated/addresses.d.ts +18 -0
  29. package/dist/generated/addresses.js +15 -0
  30. package/dist/generated/addresses.js.map +1 -0
  31. package/dist/hooks/index.cjs +2005 -0
  32. package/dist/hooks/index.cjs.map +1 -0
  33. package/dist/hooks/index.d.cts +63 -0
  34. package/dist/hooks/index.d.ts +63 -0
  35. package/dist/hooks/index.js +218 -0
  36. package/dist/hooks/index.js.map +1 -0
  37. package/dist/index.cjs +7884 -0
  38. package/dist/index.cjs.map +1 -0
  39. package/dist/index.d.cts +42 -0
  40. package/dist/index.d.ts +42 -0
  41. package/dist/index.js +258 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/onboarding-BHpAJaNW.d.cts +302 -0
  44. package/dist/onboarding-DxL_LpM3.d.ts +302 -0
  45. package/dist/workflows/index.cjs +1988 -0
  46. package/dist/workflows/index.cjs.map +1 -0
  47. package/dist/workflows/index.d.cts +72 -0
  48. package/dist/workflows/index.d.ts +72 -0
  49. package/dist/workflows/index.js +25 -0
  50. package/dist/workflows/index.js.map +1 -0
  51. package/package.json +120 -0
@@ -0,0 +1,72 @@
1
+ export { M as MembershipStatus, q as MintSBTOpts, s as NominationSnapshot, O as OnboardingState, v as OnboardingStep, x as checkMembershipStatus, y as clearNomination, K as describeOnboardingState, L as getNominationSnapshot, P as mintSBTForApproved, Q as nominateCandidate, T as vouchForCandidate } from '../onboarding-BHpAJaNW.cjs';
2
+ import { Hex } from 'viem';
3
+ import '../generated/addresses.cjs';
4
+ import '../generated/abis.cjs';
5
+
6
+ /**
7
+ * KYC hash computation as required by the ARO KYC/AML/CFT Policy §6.2.
8
+ *
9
+ * The on-chain `kycHash` (bytes32) is a keccak256 over a deterministic
10
+ * serialization of the verified identity payload returned by the KYC
11
+ * provider (Didit, per MEMO-KYC-PROVIDER). Storing only the hash on-chain
12
+ * gives us tamper-evidence without ever exposing PII on a public ledger.
13
+ *
14
+ * Why deterministic serialization: the same identity payload must hash to
15
+ * the same value across processes, languages, and timezones — JSON object
16
+ * key order is otherwise implementation-dependent, which would silently
17
+ * change the hash and break audit-trail equivalence.
18
+ *
19
+ * The serializer:
20
+ * • Sorts object keys recursively.
21
+ * • Coerces undefined → null so it survives JSON.stringify.
22
+ * • Refuses functions, symbols, bigints, and class instances.
23
+ */
24
+ interface KycPayload {
25
+ /** Provider's verification session id (e.g. Didit `session_id`). */
26
+ sessionId: string;
27
+ /** Provider name — lets us roll over to a different vendor later. */
28
+ provider: string;
29
+ /** Verification status returned by the provider. */
30
+ status: string;
31
+ /** ISO-8601 timestamp of the provider's verification decision. */
32
+ verifiedAt: string;
33
+ /** Wallet address the verification is bound to. */
34
+ walletAddress: `0x${string}`;
35
+ /** Anything else the provider returned that we want anchored on-chain. */
36
+ attributes?: Record<string, JsonScalar | JsonScalar[]>;
37
+ }
38
+ type JsonScalar = string | number | boolean | null;
39
+ /**
40
+ * Compute the bytes32 hash stored on-chain in AroSBT.MemberData.kycHash.
41
+ *
42
+ * @param payload Verified identity payload from the KYC provider.
43
+ * @returns Hex-encoded keccak256 (`0x...`, 66 chars).
44
+ */
45
+ declare function computeKycHash(payload: KycPayload): Hex;
46
+
47
+ /**
48
+ * Normalized representation of a KYC verification result. Whatever vendor
49
+ * the dapp uses, results should be mapped into this shape before hashing
50
+ * so the on-chain hash is vendor-stable.
51
+ */
52
+ interface NormalizedKycResult {
53
+ /** Vendor name — "didit" today. */
54
+ provider: string;
55
+ /** Vendor session id. */
56
+ sessionId: string;
57
+ /** Pass-through status string from the vendor. */
58
+ status: "verified" | "failed" | "pending" | "expired";
59
+ /** ISO-8601 timestamp from the vendor's verification decision. */
60
+ verifiedAt: string;
61
+ /** Wallet the verification is bound to. */
62
+ walletAddress: `0x${string}`;
63
+ /** Optional extras the dapp wants anchored on-chain. */
64
+ attributes?: Record<string, string | number | boolean | null>;
65
+ }
66
+ /**
67
+ * Hash a normalized KYC result for SBT minting. Wrapper around
68
+ * `computeKycHash` that enforces the shape we expect from the dapp.
69
+ */
70
+ declare function hashKycResult(result: NormalizedKycResult): `0x${string}`;
71
+
72
+ export { type KycPayload, type NormalizedKycResult, computeKycHash, hashKycResult };
@@ -0,0 +1,72 @@
1
+ export { M as MembershipStatus, q as MintSBTOpts, s as NominationSnapshot, O as OnboardingState, v as OnboardingStep, x as checkMembershipStatus, y as clearNomination, K as describeOnboardingState, L as getNominationSnapshot, P as mintSBTForApproved, Q as nominateCandidate, T as vouchForCandidate } from '../onboarding-DxL_LpM3.js';
2
+ import { Hex } from 'viem';
3
+ import '../generated/addresses.js';
4
+ import '../generated/abis.js';
5
+
6
+ /**
7
+ * KYC hash computation as required by the ARO KYC/AML/CFT Policy §6.2.
8
+ *
9
+ * The on-chain `kycHash` (bytes32) is a keccak256 over a deterministic
10
+ * serialization of the verified identity payload returned by the KYC
11
+ * provider (Didit, per MEMO-KYC-PROVIDER). Storing only the hash on-chain
12
+ * gives us tamper-evidence without ever exposing PII on a public ledger.
13
+ *
14
+ * Why deterministic serialization: the same identity payload must hash to
15
+ * the same value across processes, languages, and timezones — JSON object
16
+ * key order is otherwise implementation-dependent, which would silently
17
+ * change the hash and break audit-trail equivalence.
18
+ *
19
+ * The serializer:
20
+ * • Sorts object keys recursively.
21
+ * • Coerces undefined → null so it survives JSON.stringify.
22
+ * • Refuses functions, symbols, bigints, and class instances.
23
+ */
24
+ interface KycPayload {
25
+ /** Provider's verification session id (e.g. Didit `session_id`). */
26
+ sessionId: string;
27
+ /** Provider name — lets us roll over to a different vendor later. */
28
+ provider: string;
29
+ /** Verification status returned by the provider. */
30
+ status: string;
31
+ /** ISO-8601 timestamp of the provider's verification decision. */
32
+ verifiedAt: string;
33
+ /** Wallet address the verification is bound to. */
34
+ walletAddress: `0x${string}`;
35
+ /** Anything else the provider returned that we want anchored on-chain. */
36
+ attributes?: Record<string, JsonScalar | JsonScalar[]>;
37
+ }
38
+ type JsonScalar = string | number | boolean | null;
39
+ /**
40
+ * Compute the bytes32 hash stored on-chain in AroSBT.MemberData.kycHash.
41
+ *
42
+ * @param payload Verified identity payload from the KYC provider.
43
+ * @returns Hex-encoded keccak256 (`0x...`, 66 chars).
44
+ */
45
+ declare function computeKycHash(payload: KycPayload): Hex;
46
+
47
+ /**
48
+ * Normalized representation of a KYC verification result. Whatever vendor
49
+ * the dapp uses, results should be mapped into this shape before hashing
50
+ * so the on-chain hash is vendor-stable.
51
+ */
52
+ interface NormalizedKycResult {
53
+ /** Vendor name — "didit" today. */
54
+ provider: string;
55
+ /** Vendor session id. */
56
+ sessionId: string;
57
+ /** Pass-through status string from the vendor. */
58
+ status: "verified" | "failed" | "pending" | "expired";
59
+ /** ISO-8601 timestamp from the vendor's verification decision. */
60
+ verifiedAt: string;
61
+ /** Wallet the verification is bound to. */
62
+ walletAddress: `0x${string}`;
63
+ /** Optional extras the dapp wants anchored on-chain. */
64
+ attributes?: Record<string, string | number | boolean | null>;
65
+ }
66
+ /**
67
+ * Hash a normalized KYC result for SBT minting. Wrapper around
68
+ * `computeKycHash` that enforces the shape we expect from the dapp.
69
+ */
70
+ declare function hashKycResult(result: NormalizedKycResult): `0x${string}`;
71
+
72
+ export { type KycPayload, type NormalizedKycResult, computeKycHash, hashKycResult };
@@ -0,0 +1,25 @@
1
+ import {
2
+ checkMembershipStatus,
3
+ clearNomination,
4
+ computeKycHash,
5
+ describeOnboardingState,
6
+ getNominationSnapshot,
7
+ hashKycResult,
8
+ mintSBTForApproved,
9
+ nominateCandidate,
10
+ vouchForCandidate
11
+ } from "../chunk-7I5N3BGV.js";
12
+ import "../chunk-BYPGUFYV.js";
13
+ import "../chunk-TZQHQLNY.js";
14
+ export {
15
+ checkMembershipStatus,
16
+ clearNomination,
17
+ computeKycHash,
18
+ describeOnboardingState,
19
+ getNominationSnapshot,
20
+ hashKycResult,
21
+ mintSBTForApproved,
22
+ nominateCandidate,
23
+ vouchForCandidate
24
+ };
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json ADDED
@@ -0,0 +1,120 @@
1
+ {
2
+ "name": "@aromedia/contracts-sdk",
3
+ "version": "0.2.0",
4
+ "description": "TypeScript SDK for the Aro Media on-chain ecosystem (SBT identity, nomination, RWA, registry, multisig, forced transfer).",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "main": "./dist/index.cjs",
9
+ "module": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js",
15
+ "require": "./dist/index.cjs"
16
+ },
17
+ "./hooks": {
18
+ "types": "./dist/hooks/index.d.ts",
19
+ "import": "./dist/hooks/index.js",
20
+ "require": "./dist/hooks/index.cjs"
21
+ },
22
+ "./abis": {
23
+ "types": "./dist/abis.d.ts",
24
+ "import": "./dist/abis.js",
25
+ "require": "./dist/abis.cjs"
26
+ },
27
+ "./addresses": {
28
+ "types": "./dist/addresses.d.ts",
29
+ "import": "./dist/addresses.js",
30
+ "require": "./dist/addresses.cjs"
31
+ },
32
+ "./chains": {
33
+ "types": "./dist/chains.d.ts",
34
+ "import": "./dist/chains.js",
35
+ "require": "./dist/chains.cjs"
36
+ },
37
+ "./workflows": {
38
+ "types": "./dist/workflows/index.d.ts",
39
+ "import": "./dist/workflows/index.js",
40
+ "require": "./dist/workflows/index.cjs"
41
+ },
42
+ "./package.json": "./package.json"
43
+ },
44
+ "files": [
45
+ "dist",
46
+ "README.md",
47
+ "LICENSE"
48
+ ],
49
+ "scripts": {
50
+ "generate": "tsx scripts/generate.ts",
51
+ "build": "tsup --config ./tsup.config.json src/index.ts src/hooks/index.ts src/generated/abis.ts src/generated/addresses.ts src/chains.ts src/workflows/index.ts --format esm,cjs --dts --sourcemap --target es2022 --external react --external wagmi --external @tanstack/react-query --external viem",
52
+ "dev": "tsup --config ./tsup.config.json src/index.ts --format esm --watch",
53
+ "typecheck": "tsc --noEmit",
54
+ "clean": "rimraf dist",
55
+ "changeset": "changeset",
56
+ "version": "changeset version",
57
+ "release": "npm run build && changeset publish",
58
+ "prepare": "npm run build",
59
+ "prepublishOnly": "npm run build"
60
+ },
61
+ "dependencies": {},
62
+ "peerDependencies": {
63
+ "@tanstack/react-query": "^5",
64
+ "react": "^18 || ^19",
65
+ "viem": "^2.21.0",
66
+ "wagmi": "^2 || ^3"
67
+ },
68
+ "peerDependenciesMeta": {
69
+ "react": {
70
+ "optional": true
71
+ },
72
+ "wagmi": {
73
+ "optional": true
74
+ },
75
+ "@tanstack/react-query": {
76
+ "optional": true
77
+ }
78
+ },
79
+ "devDependencies": {
80
+ "@changesets/changelog-github": "^0.5.0",
81
+ "@changesets/cli": "^2.27.0",
82
+ "@tanstack/react-query": "^5.0.0",
83
+ "@types/node": "^20.19.41",
84
+ "@types/react": "^19.0.0",
85
+ "react": "^19.0.0",
86
+ "rimraf": "^6.0.1",
87
+ "tsup": "^8.3.0",
88
+ "tsx": "^4.19.0",
89
+ "typescript": "^5.5.0",
90
+ "viem": "^2.21.0",
91
+ "wagmi": "^3.6.10"
92
+ },
93
+ "publishConfig": {
94
+ "access": "public",
95
+ "provenance": true
96
+ },
97
+ "repository": {
98
+ "type": "git",
99
+ "url": "https://github.com/aromediainc/contracts-sdk.git"
100
+ },
101
+ "homepage": "https://github.com/aromediainc/contracts-sdk#readme",
102
+ "bugs": {
103
+ "url": "https://github.com/aromediainc/contracts-sdk/issues"
104
+ },
105
+ "keywords": [
106
+ "aro",
107
+ "aromedia",
108
+ "ethereum",
109
+ "viem",
110
+ "wagmi",
111
+ "sbt",
112
+ "rwa",
113
+ "soulbound",
114
+ "erc-5192",
115
+ "kyc"
116
+ ],
117
+ "engines": {
118
+ "node": ">=18"
119
+ }
120
+ }