@nullclear/shared 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +8 -2
- package/dist/index.cjs +206 -0
- package/dist/index.d.cts +414 -0
- package/dist/index.d.mts +378 -0
- package/dist/index.d.ts +414 -0
- package/dist/index.js +163 -0
- package/dist/index.mjs +154 -0
- package/package.json +38 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nullclear-Protocol
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @nullclear/shared
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Core shared constants, CAIP-2 network configurations, ABIs, and cryptographic schemas for the NullClear protocol.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
- **Networks (`chains.ts`)**: Base Mainnet (8453) & Base Sepolia (84532) contract addresses.
|
|
7
|
+
- **ERC-8004 ABIs (`erc8004-abi.ts`)**: Official viem `parseAbi` definitions for Identity and Reputation Registries.
|
|
8
|
+
- **x402 V2 Types (`x402-types.ts`)**: Payment options, signatures, EIP-3009 typed data schemas, and Base64 helpers.
|
|
9
|
+
- **EIP-712 KYA Schemas (`eip712-kya.ts`)**: Corporate Mandate and Arbiter Clearing Attestation schemas.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
ARBITER_ATTESTATION_TYPES: () => ARBITER_ATTESTATION_TYPES,
|
|
24
|
+
ARBITER_DOMAIN: () => ARBITER_DOMAIN,
|
|
25
|
+
BASE_MAINNET: () => BASE_MAINNET,
|
|
26
|
+
BASE_SEPOLIA: () => BASE_SEPOLIA,
|
|
27
|
+
CAIP2_TO_CHAIN_ID: () => CAIP2_TO_CHAIN_ID,
|
|
28
|
+
EIP3009_ABI: () => EIP3009_ABI,
|
|
29
|
+
EIP3009_TYPES: () => EIP3009_TYPES,
|
|
30
|
+
ERC8004_IDENTITY_ABI: () => ERC8004_IDENTITY_ABI,
|
|
31
|
+
ERC8004_REPUTATION_ABI: () => ERC8004_REPUTATION_ABI,
|
|
32
|
+
KYA_DOMAIN: () => KYA_DOMAIN,
|
|
33
|
+
KYA_MANDATE_TYPES: () => KYA_MANDATE_TYPES,
|
|
34
|
+
NULLCLEAR_ARBITER_ADDRESS: () => NULLCLEAR_ARBITER_ADDRESS,
|
|
35
|
+
NULLCLEAR_TREASURY_ADDRESS: () => NULLCLEAR_TREASURY_ADDRESS,
|
|
36
|
+
SUPPORTED_CHAINS: () => SUPPORTED_CHAINS,
|
|
37
|
+
decodeBase64Json: () => decodeBase64Json,
|
|
38
|
+
encodeBase64Json: () => encodeBase64Json,
|
|
39
|
+
getChainConfig: () => getChainConfig
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(index_exports);
|
|
42
|
+
|
|
43
|
+
// src/chains.ts
|
|
44
|
+
var NULLCLEAR_TREASURY_ADDRESS = "0xB586eFcCa41dF27ad3873BEcA54da0c30bf04d5c";
|
|
45
|
+
var NULLCLEAR_ARBITER_ADDRESS = "0xfd74fF802EA0E735514C070AF04E0D6528deD145";
|
|
46
|
+
var BASE_MAINNET = {
|
|
47
|
+
name: "Base Mainnet",
|
|
48
|
+
chainId: 8453,
|
|
49
|
+
caip2: "eip155:8453",
|
|
50
|
+
erc8004Identity: "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",
|
|
51
|
+
erc8004Reputation: "0x8004BAa17C55a88189AE136b182e5fdA19dE9b63",
|
|
52
|
+
usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
53
|
+
usdcDomain: {
|
|
54
|
+
name: "USD Coin",
|
|
55
|
+
version: "2",
|
|
56
|
+
chainId: 8453,
|
|
57
|
+
verifyingContract: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
|
|
58
|
+
},
|
|
59
|
+
rpcUrl: "https://mainnet.base.org",
|
|
60
|
+
blockExplorer: "https://basescan.org"
|
|
61
|
+
};
|
|
62
|
+
var BASE_SEPOLIA = {
|
|
63
|
+
name: "Base Sepolia",
|
|
64
|
+
chainId: 84532,
|
|
65
|
+
caip2: "eip155:84532",
|
|
66
|
+
erc8004Identity: "0x8004A818BFB912233c491871b3d84c89A494BD9e",
|
|
67
|
+
erc8004Reputation: "0x8004B663056A597Dffe9eCcC1965A193B7388713",
|
|
68
|
+
usdc: "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
|
|
69
|
+
usdcDomain: {
|
|
70
|
+
name: "USDC",
|
|
71
|
+
version: "2",
|
|
72
|
+
chainId: 84532,
|
|
73
|
+
verifyingContract: "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
|
|
74
|
+
},
|
|
75
|
+
rpcUrl: "https://sepolia.base.org",
|
|
76
|
+
blockExplorer: "https://sepolia.basescan.org"
|
|
77
|
+
};
|
|
78
|
+
var SUPPORTED_CHAINS = {
|
|
79
|
+
8453: BASE_MAINNET,
|
|
80
|
+
84532: BASE_SEPOLIA
|
|
81
|
+
};
|
|
82
|
+
var CAIP2_TO_CHAIN_ID = {
|
|
83
|
+
"eip155:8453": 8453,
|
|
84
|
+
"eip155:84532": 84532
|
|
85
|
+
};
|
|
86
|
+
function getChainConfig(chainIdOrCaip2) {
|
|
87
|
+
let chainId;
|
|
88
|
+
if (typeof chainIdOrCaip2 === "string") {
|
|
89
|
+
if (chainIdOrCaip2.startsWith("eip155:")) {
|
|
90
|
+
chainId = CAIP2_TO_CHAIN_ID[chainIdOrCaip2] ?? parseInt(chainIdOrCaip2.slice(7), 10);
|
|
91
|
+
} else {
|
|
92
|
+
chainId = parseInt(chainIdOrCaip2, 10);
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
chainId = chainIdOrCaip2;
|
|
96
|
+
}
|
|
97
|
+
const config = SUPPORTED_CHAINS[chainId];
|
|
98
|
+
if (!config) {
|
|
99
|
+
throw new Error(`Unsupported chain ID or CAIP-2 identifier: ${chainIdOrCaip2}`);
|
|
100
|
+
}
|
|
101
|
+
return config;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// src/erc8004-abi.ts
|
|
105
|
+
var import_viem = require("viem");
|
|
106
|
+
var ERC8004_IDENTITY_ABI = (0, import_viem.parseAbi)([
|
|
107
|
+
"function register(string agentURI) external returns (uint256 agentId)",
|
|
108
|
+
"function ownerOf(uint256 tokenId) external view returns (address)",
|
|
109
|
+
"function tokenURI(uint256 tokenId) external view returns (string)",
|
|
110
|
+
"function getAgentWallet(uint256 agentId) external view returns (address)",
|
|
111
|
+
"event Registered(uint256 indexed agentId, string agentURI, address indexed owner)"
|
|
112
|
+
]);
|
|
113
|
+
var ERC8004_REPUTATION_ABI = (0, import_viem.parseAbi)([
|
|
114
|
+
"function giveFeedback(uint256 agentId, int128 value, uint8 valueDecimals, string tag1, string tag2, string endpoint, string feedbackURI, bytes32 feedbackHash) external",
|
|
115
|
+
"function getSummary(uint256 agentId, address[] clientAddresses, string tag1, string tag2) external view returns (uint64 count, int128 summaryValue, uint8 summaryValueDecimals)",
|
|
116
|
+
"function readFeedback(uint256 agentId, address clientAddress, uint64 feedbackIndex) external view returns (int128 value, uint8 valueDecimals, string tag1, string tag2, bool isRevoked)",
|
|
117
|
+
"event NewFeedback(uint256 indexed agentId, address indexed clientAddress, uint64 feedbackIndex, int128 value, uint8 valueDecimals, string indexed indexedTag1, string tag1, string tag2, string endpoint, string feedbackURI, bytes32 feedbackHash)"
|
|
118
|
+
]);
|
|
119
|
+
|
|
120
|
+
// src/x402-types.ts
|
|
121
|
+
var import_viem2 = require("viem");
|
|
122
|
+
var EIP3009_ABI = (0, import_viem2.parseAbi)([
|
|
123
|
+
"function transferWithAuthorization(address from, address to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce, uint8 v, bytes32 r, bytes32 s) external"
|
|
124
|
+
]);
|
|
125
|
+
var EIP3009_TYPES = {
|
|
126
|
+
TransferWithAuthorization: [
|
|
127
|
+
{ name: "from", type: "address" },
|
|
128
|
+
{ name: "to", type: "address" },
|
|
129
|
+
{ name: "value", type: "uint256" },
|
|
130
|
+
{ name: "validAfter", type: "uint256" },
|
|
131
|
+
{ name: "validBefore", type: "uint256" },
|
|
132
|
+
{ name: "nonce", type: "bytes32" }
|
|
133
|
+
]
|
|
134
|
+
};
|
|
135
|
+
function encodeBase64Json(obj) {
|
|
136
|
+
const json = JSON.stringify(obj);
|
|
137
|
+
if (typeof Buffer !== "undefined") {
|
|
138
|
+
return Buffer.from(json, "utf-8").toString("base64");
|
|
139
|
+
}
|
|
140
|
+
return btoa(unescape(encodeURIComponent(json)));
|
|
141
|
+
}
|
|
142
|
+
function decodeBase64Json(base64) {
|
|
143
|
+
let json;
|
|
144
|
+
if (typeof Buffer !== "undefined") {
|
|
145
|
+
json = Buffer.from(base64, "base64").toString("utf-8");
|
|
146
|
+
} else {
|
|
147
|
+
json = decodeURIComponent(escape(atob(base64)));
|
|
148
|
+
}
|
|
149
|
+
return JSON.parse(json);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// src/eip712-kya.ts
|
|
153
|
+
var KYA_MANDATE_TYPES = {
|
|
154
|
+
CorporateMandate: [
|
|
155
|
+
{ name: "corporateEntity", type: "string" },
|
|
156
|
+
{ name: "entityRegistrationNumber", type: "string" },
|
|
157
|
+
{ name: "agentId", type: "string" },
|
|
158
|
+
{ name: "agentWallet", type: "address" },
|
|
159
|
+
{ name: "maxTxLimitUsd", type: "uint256" },
|
|
160
|
+
{ name: "liabilityCoverageUsd", type: "uint256" },
|
|
161
|
+
{ name: "validUntil", type: "uint256" },
|
|
162
|
+
{ name: "jurisdiction", type: "string" }
|
|
163
|
+
]
|
|
164
|
+
};
|
|
165
|
+
var KYA_DOMAIN = {
|
|
166
|
+
name: "NullClear KYA Registry",
|
|
167
|
+
version: "1",
|
|
168
|
+
chainId: 8453
|
|
169
|
+
};
|
|
170
|
+
var ARBITER_ATTESTATION_TYPES = {
|
|
171
|
+
ClearingAttestation: [
|
|
172
|
+
{ name: "clearingId", type: "string" },
|
|
173
|
+
{ name: "buyer", type: "address" },
|
|
174
|
+
{ name: "sellerAgentId", type: "string" },
|
|
175
|
+
{ name: "amountAtomic", type: "uint256" },
|
|
176
|
+
{ name: "feeAtomic", type: "uint256" },
|
|
177
|
+
{ name: "responseHash", type: "bytes32" },
|
|
178
|
+
{ name: "timestamp", type: "uint256" },
|
|
179
|
+
{ name: "cleared", type: "bool" }
|
|
180
|
+
]
|
|
181
|
+
};
|
|
182
|
+
var ARBITER_DOMAIN = {
|
|
183
|
+
name: "NullClear Arbiter",
|
|
184
|
+
version: "1",
|
|
185
|
+
chainId: 8453
|
|
186
|
+
};
|
|
187
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
188
|
+
0 && (module.exports = {
|
|
189
|
+
ARBITER_ATTESTATION_TYPES,
|
|
190
|
+
ARBITER_DOMAIN,
|
|
191
|
+
BASE_MAINNET,
|
|
192
|
+
BASE_SEPOLIA,
|
|
193
|
+
CAIP2_TO_CHAIN_ID,
|
|
194
|
+
EIP3009_ABI,
|
|
195
|
+
EIP3009_TYPES,
|
|
196
|
+
ERC8004_IDENTITY_ABI,
|
|
197
|
+
ERC8004_REPUTATION_ABI,
|
|
198
|
+
KYA_DOMAIN,
|
|
199
|
+
KYA_MANDATE_TYPES,
|
|
200
|
+
NULLCLEAR_ARBITER_ADDRESS,
|
|
201
|
+
NULLCLEAR_TREASURY_ADDRESS,
|
|
202
|
+
SUPPORTED_CHAINS,
|
|
203
|
+
decodeBase64Json,
|
|
204
|
+
encodeBase64Json,
|
|
205
|
+
getChainConfig
|
|
206
|
+
});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
interface ChainConfig {
|
|
2
|
+
name: string;
|
|
3
|
+
chainId: number;
|
|
4
|
+
caip2: `eip155:${number}`;
|
|
5
|
+
erc8004Identity: `0x${string}`;
|
|
6
|
+
erc8004Reputation: `0x${string}`;
|
|
7
|
+
usdc: `0x${string}`;
|
|
8
|
+
usdcDomain: {
|
|
9
|
+
name: string;
|
|
10
|
+
version: string;
|
|
11
|
+
chainId: number;
|
|
12
|
+
verifyingContract: `0x${string}`;
|
|
13
|
+
};
|
|
14
|
+
rpcUrl: string;
|
|
15
|
+
blockExplorer: string;
|
|
16
|
+
}
|
|
17
|
+
declare const NULLCLEAR_TREASURY_ADDRESS: "0xB586eFcCa41dF27ad3873BEcA54da0c30bf04d5c";
|
|
18
|
+
declare const NULLCLEAR_ARBITER_ADDRESS: "0xfd74fF802EA0E735514C070AF04E0D6528deD145";
|
|
19
|
+
declare const BASE_MAINNET: ChainConfig;
|
|
20
|
+
declare const BASE_SEPOLIA: ChainConfig;
|
|
21
|
+
declare const SUPPORTED_CHAINS: Record<number, ChainConfig>;
|
|
22
|
+
declare const CAIP2_TO_CHAIN_ID: Record<string, number>;
|
|
23
|
+
declare function getChainConfig(chainIdOrCaip2: number | string): ChainConfig;
|
|
24
|
+
|
|
25
|
+
declare const ERC8004_IDENTITY_ABI: readonly [{
|
|
26
|
+
readonly name: "register";
|
|
27
|
+
readonly type: "function";
|
|
28
|
+
readonly stateMutability: "nonpayable";
|
|
29
|
+
readonly inputs: readonly [{
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly name: "agentURI";
|
|
32
|
+
}];
|
|
33
|
+
readonly outputs: readonly [{
|
|
34
|
+
readonly type: "uint256";
|
|
35
|
+
readonly name: "agentId";
|
|
36
|
+
}];
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "ownerOf";
|
|
39
|
+
readonly type: "function";
|
|
40
|
+
readonly stateMutability: "view";
|
|
41
|
+
readonly inputs: readonly [{
|
|
42
|
+
readonly type: "uint256";
|
|
43
|
+
readonly name: "tokenId";
|
|
44
|
+
}];
|
|
45
|
+
readonly outputs: readonly [{
|
|
46
|
+
readonly type: "address";
|
|
47
|
+
}];
|
|
48
|
+
}, {
|
|
49
|
+
readonly name: "tokenURI";
|
|
50
|
+
readonly type: "function";
|
|
51
|
+
readonly stateMutability: "view";
|
|
52
|
+
readonly inputs: readonly [{
|
|
53
|
+
readonly type: "uint256";
|
|
54
|
+
readonly name: "tokenId";
|
|
55
|
+
}];
|
|
56
|
+
readonly outputs: readonly [{
|
|
57
|
+
readonly type: "string";
|
|
58
|
+
}];
|
|
59
|
+
}, {
|
|
60
|
+
readonly name: "getAgentWallet";
|
|
61
|
+
readonly type: "function";
|
|
62
|
+
readonly stateMutability: "view";
|
|
63
|
+
readonly inputs: readonly [{
|
|
64
|
+
readonly type: "uint256";
|
|
65
|
+
readonly name: "agentId";
|
|
66
|
+
}];
|
|
67
|
+
readonly outputs: readonly [{
|
|
68
|
+
readonly type: "address";
|
|
69
|
+
}];
|
|
70
|
+
}, {
|
|
71
|
+
readonly name: "Registered";
|
|
72
|
+
readonly type: "event";
|
|
73
|
+
readonly inputs: readonly [{
|
|
74
|
+
readonly type: "uint256";
|
|
75
|
+
readonly name: "agentId";
|
|
76
|
+
readonly indexed: true;
|
|
77
|
+
}, {
|
|
78
|
+
readonly type: "string";
|
|
79
|
+
readonly name: "agentURI";
|
|
80
|
+
}, {
|
|
81
|
+
readonly type: "address";
|
|
82
|
+
readonly name: "owner";
|
|
83
|
+
readonly indexed: true;
|
|
84
|
+
}];
|
|
85
|
+
}];
|
|
86
|
+
declare const ERC8004_REPUTATION_ABI: readonly [{
|
|
87
|
+
readonly name: "giveFeedback";
|
|
88
|
+
readonly type: "function";
|
|
89
|
+
readonly stateMutability: "nonpayable";
|
|
90
|
+
readonly inputs: readonly [{
|
|
91
|
+
readonly type: "uint256";
|
|
92
|
+
readonly name: "agentId";
|
|
93
|
+
}, {
|
|
94
|
+
readonly type: "int128";
|
|
95
|
+
readonly name: "value";
|
|
96
|
+
}, {
|
|
97
|
+
readonly type: "uint8";
|
|
98
|
+
readonly name: "valueDecimals";
|
|
99
|
+
}, {
|
|
100
|
+
readonly type: "string";
|
|
101
|
+
readonly name: "tag1";
|
|
102
|
+
}, {
|
|
103
|
+
readonly type: "string";
|
|
104
|
+
readonly name: "tag2";
|
|
105
|
+
}, {
|
|
106
|
+
readonly type: "string";
|
|
107
|
+
readonly name: "endpoint";
|
|
108
|
+
}, {
|
|
109
|
+
readonly type: "string";
|
|
110
|
+
readonly name: "feedbackURI";
|
|
111
|
+
}, {
|
|
112
|
+
readonly type: "bytes32";
|
|
113
|
+
readonly name: "feedbackHash";
|
|
114
|
+
}];
|
|
115
|
+
readonly outputs: readonly [];
|
|
116
|
+
}, {
|
|
117
|
+
readonly name: "getSummary";
|
|
118
|
+
readonly type: "function";
|
|
119
|
+
readonly stateMutability: "view";
|
|
120
|
+
readonly inputs: readonly [{
|
|
121
|
+
readonly type: "uint256";
|
|
122
|
+
readonly name: "agentId";
|
|
123
|
+
}, {
|
|
124
|
+
readonly type: "address[]";
|
|
125
|
+
readonly name: "clientAddresses";
|
|
126
|
+
}, {
|
|
127
|
+
readonly type: "string";
|
|
128
|
+
readonly name: "tag1";
|
|
129
|
+
}, {
|
|
130
|
+
readonly type: "string";
|
|
131
|
+
readonly name: "tag2";
|
|
132
|
+
}];
|
|
133
|
+
readonly outputs: readonly [{
|
|
134
|
+
readonly type: "uint64";
|
|
135
|
+
readonly name: "count";
|
|
136
|
+
}, {
|
|
137
|
+
readonly type: "int128";
|
|
138
|
+
readonly name: "summaryValue";
|
|
139
|
+
}, {
|
|
140
|
+
readonly type: "uint8";
|
|
141
|
+
readonly name: "summaryValueDecimals";
|
|
142
|
+
}];
|
|
143
|
+
}, {
|
|
144
|
+
readonly name: "readFeedback";
|
|
145
|
+
readonly type: "function";
|
|
146
|
+
readonly stateMutability: "view";
|
|
147
|
+
readonly inputs: readonly [{
|
|
148
|
+
readonly type: "uint256";
|
|
149
|
+
readonly name: "agentId";
|
|
150
|
+
}, {
|
|
151
|
+
readonly type: "address";
|
|
152
|
+
readonly name: "clientAddress";
|
|
153
|
+
}, {
|
|
154
|
+
readonly type: "uint64";
|
|
155
|
+
readonly name: "feedbackIndex";
|
|
156
|
+
}];
|
|
157
|
+
readonly outputs: readonly [{
|
|
158
|
+
readonly type: "int128";
|
|
159
|
+
readonly name: "value";
|
|
160
|
+
}, {
|
|
161
|
+
readonly type: "uint8";
|
|
162
|
+
readonly name: "valueDecimals";
|
|
163
|
+
}, {
|
|
164
|
+
readonly type: "string";
|
|
165
|
+
readonly name: "tag1";
|
|
166
|
+
}, {
|
|
167
|
+
readonly type: "string";
|
|
168
|
+
readonly name: "tag2";
|
|
169
|
+
}, {
|
|
170
|
+
readonly type: "bool";
|
|
171
|
+
readonly name: "isRevoked";
|
|
172
|
+
}];
|
|
173
|
+
}, {
|
|
174
|
+
readonly name: "NewFeedback";
|
|
175
|
+
readonly type: "event";
|
|
176
|
+
readonly inputs: readonly [{
|
|
177
|
+
readonly type: "uint256";
|
|
178
|
+
readonly name: "agentId";
|
|
179
|
+
readonly indexed: true;
|
|
180
|
+
}, {
|
|
181
|
+
readonly type: "address";
|
|
182
|
+
readonly name: "clientAddress";
|
|
183
|
+
readonly indexed: true;
|
|
184
|
+
}, {
|
|
185
|
+
readonly type: "uint64";
|
|
186
|
+
readonly name: "feedbackIndex";
|
|
187
|
+
}, {
|
|
188
|
+
readonly type: "int128";
|
|
189
|
+
readonly name: "value";
|
|
190
|
+
}, {
|
|
191
|
+
readonly type: "uint8";
|
|
192
|
+
readonly name: "valueDecimals";
|
|
193
|
+
}, {
|
|
194
|
+
readonly type: "string";
|
|
195
|
+
readonly name: "indexedTag1";
|
|
196
|
+
readonly indexed: true;
|
|
197
|
+
}, {
|
|
198
|
+
readonly type: "string";
|
|
199
|
+
readonly name: "tag1";
|
|
200
|
+
}, {
|
|
201
|
+
readonly type: "string";
|
|
202
|
+
readonly name: "tag2";
|
|
203
|
+
}, {
|
|
204
|
+
readonly type: "string";
|
|
205
|
+
readonly name: "endpoint";
|
|
206
|
+
}, {
|
|
207
|
+
readonly type: "string";
|
|
208
|
+
readonly name: "feedbackURI";
|
|
209
|
+
}, {
|
|
210
|
+
readonly type: "bytes32";
|
|
211
|
+
readonly name: "feedbackHash";
|
|
212
|
+
}];
|
|
213
|
+
}];
|
|
214
|
+
|
|
215
|
+
declare const EIP3009_ABI: readonly [{
|
|
216
|
+
readonly name: "transferWithAuthorization";
|
|
217
|
+
readonly type: "function";
|
|
218
|
+
readonly stateMutability: "nonpayable";
|
|
219
|
+
readonly inputs: readonly [{
|
|
220
|
+
readonly type: "address";
|
|
221
|
+
readonly name: "from";
|
|
222
|
+
}, {
|
|
223
|
+
readonly type: "address";
|
|
224
|
+
readonly name: "to";
|
|
225
|
+
}, {
|
|
226
|
+
readonly type: "uint256";
|
|
227
|
+
readonly name: "value";
|
|
228
|
+
}, {
|
|
229
|
+
readonly type: "uint256";
|
|
230
|
+
readonly name: "validAfter";
|
|
231
|
+
}, {
|
|
232
|
+
readonly type: "uint256";
|
|
233
|
+
readonly name: "validBefore";
|
|
234
|
+
}, {
|
|
235
|
+
readonly type: "bytes32";
|
|
236
|
+
readonly name: "nonce";
|
|
237
|
+
}, {
|
|
238
|
+
readonly type: "uint8";
|
|
239
|
+
readonly name: "v";
|
|
240
|
+
}, {
|
|
241
|
+
readonly type: "bytes32";
|
|
242
|
+
readonly name: "r";
|
|
243
|
+
}, {
|
|
244
|
+
readonly type: "bytes32";
|
|
245
|
+
readonly name: "s";
|
|
246
|
+
}];
|
|
247
|
+
readonly outputs: readonly [];
|
|
248
|
+
}];
|
|
249
|
+
interface X402PaymentOption {
|
|
250
|
+
scheme: "exact";
|
|
251
|
+
network: "eip155:8453" | "eip155:84532";
|
|
252
|
+
amount: string;
|
|
253
|
+
asset: `0x${string}`;
|
|
254
|
+
payTo: `0x${string}`;
|
|
255
|
+
maxTimeoutSeconds: number;
|
|
256
|
+
extra?: {
|
|
257
|
+
name?: string;
|
|
258
|
+
version?: string;
|
|
259
|
+
feePayer?: `0x${string}`;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
interface X402PaymentRequired {
|
|
263
|
+
x402Version: 2;
|
|
264
|
+
error?: string;
|
|
265
|
+
resource: {
|
|
266
|
+
url: string;
|
|
267
|
+
description?: string;
|
|
268
|
+
mimeType?: string;
|
|
269
|
+
};
|
|
270
|
+
accepts: X402PaymentOption[];
|
|
271
|
+
}
|
|
272
|
+
interface EIP3009Authorization {
|
|
273
|
+
from: `0x${string}`;
|
|
274
|
+
to: `0x${string}`;
|
|
275
|
+
value: string;
|
|
276
|
+
validAfter: string;
|
|
277
|
+
validBefore: string;
|
|
278
|
+
nonce: `0x${string}`;
|
|
279
|
+
}
|
|
280
|
+
interface X402PaymentSignaturePayload {
|
|
281
|
+
x402Version: 2;
|
|
282
|
+
resource?: {
|
|
283
|
+
url: string;
|
|
284
|
+
mimeType?: string;
|
|
285
|
+
};
|
|
286
|
+
accepted: X402PaymentOption;
|
|
287
|
+
payload: {
|
|
288
|
+
signature: `0x${string}`;
|
|
289
|
+
authorization: EIP3009Authorization;
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
declare const EIP3009_TYPES: {
|
|
293
|
+
readonly TransferWithAuthorization: readonly [{
|
|
294
|
+
readonly name: "from";
|
|
295
|
+
readonly type: "address";
|
|
296
|
+
}, {
|
|
297
|
+
readonly name: "to";
|
|
298
|
+
readonly type: "address";
|
|
299
|
+
}, {
|
|
300
|
+
readonly name: "value";
|
|
301
|
+
readonly type: "uint256";
|
|
302
|
+
}, {
|
|
303
|
+
readonly name: "validAfter";
|
|
304
|
+
readonly type: "uint256";
|
|
305
|
+
}, {
|
|
306
|
+
readonly name: "validBefore";
|
|
307
|
+
readonly type: "uint256";
|
|
308
|
+
}, {
|
|
309
|
+
readonly name: "nonce";
|
|
310
|
+
readonly type: "bytes32";
|
|
311
|
+
}];
|
|
312
|
+
};
|
|
313
|
+
interface X402PaymentResponse {
|
|
314
|
+
success: boolean;
|
|
315
|
+
transaction?: `0x${string}`;
|
|
316
|
+
network: "eip155:8453" | "eip155:84532";
|
|
317
|
+
payer: `0x${string}`;
|
|
318
|
+
errorReason?: string;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Universal base64 encoder that works in Node.js, Cloudflare Workers, and Browser
|
|
322
|
+
*/
|
|
323
|
+
declare function encodeBase64Json(obj: unknown): string;
|
|
324
|
+
/**
|
|
325
|
+
* Universal base64 decoder that works in Node.js, Cloudflare Workers, and Browser
|
|
326
|
+
*/
|
|
327
|
+
declare function decodeBase64Json<T>(base64: string): T;
|
|
328
|
+
|
|
329
|
+
interface KYAMandate {
|
|
330
|
+
corporateEntity: string;
|
|
331
|
+
entityRegistrationNumber: string;
|
|
332
|
+
agentId: string;
|
|
333
|
+
agentWallet: `0x${string}`;
|
|
334
|
+
maxTxLimitUsd: number;
|
|
335
|
+
liabilityCoverageUsd: number;
|
|
336
|
+
validUntil: number;
|
|
337
|
+
jurisdiction: string;
|
|
338
|
+
}
|
|
339
|
+
declare const KYA_MANDATE_TYPES: {
|
|
340
|
+
readonly CorporateMandate: readonly [{
|
|
341
|
+
readonly name: "corporateEntity";
|
|
342
|
+
readonly type: "string";
|
|
343
|
+
}, {
|
|
344
|
+
readonly name: "entityRegistrationNumber";
|
|
345
|
+
readonly type: "string";
|
|
346
|
+
}, {
|
|
347
|
+
readonly name: "agentId";
|
|
348
|
+
readonly type: "string";
|
|
349
|
+
}, {
|
|
350
|
+
readonly name: "agentWallet";
|
|
351
|
+
readonly type: "address";
|
|
352
|
+
}, {
|
|
353
|
+
readonly name: "maxTxLimitUsd";
|
|
354
|
+
readonly type: "uint256";
|
|
355
|
+
}, {
|
|
356
|
+
readonly name: "liabilityCoverageUsd";
|
|
357
|
+
readonly type: "uint256";
|
|
358
|
+
}, {
|
|
359
|
+
readonly name: "validUntil";
|
|
360
|
+
readonly type: "uint256";
|
|
361
|
+
}, {
|
|
362
|
+
readonly name: "jurisdiction";
|
|
363
|
+
readonly type: "string";
|
|
364
|
+
}];
|
|
365
|
+
};
|
|
366
|
+
declare const KYA_DOMAIN: {
|
|
367
|
+
readonly name: "NullClear KYA Registry";
|
|
368
|
+
readonly version: "1";
|
|
369
|
+
readonly chainId: 8453;
|
|
370
|
+
};
|
|
371
|
+
interface ClearingAttestation {
|
|
372
|
+
clearingId: string;
|
|
373
|
+
buyer: `0x${string}`;
|
|
374
|
+
sellerAgentId: string;
|
|
375
|
+
amountAtomic: string;
|
|
376
|
+
feeAtomic: string;
|
|
377
|
+
responseHash: `0x${string}`;
|
|
378
|
+
timestamp: number;
|
|
379
|
+
cleared: boolean;
|
|
380
|
+
}
|
|
381
|
+
declare const ARBITER_ATTESTATION_TYPES: {
|
|
382
|
+
readonly ClearingAttestation: readonly [{
|
|
383
|
+
readonly name: "clearingId";
|
|
384
|
+
readonly type: "string";
|
|
385
|
+
}, {
|
|
386
|
+
readonly name: "buyer";
|
|
387
|
+
readonly type: "address";
|
|
388
|
+
}, {
|
|
389
|
+
readonly name: "sellerAgentId";
|
|
390
|
+
readonly type: "string";
|
|
391
|
+
}, {
|
|
392
|
+
readonly name: "amountAtomic";
|
|
393
|
+
readonly type: "uint256";
|
|
394
|
+
}, {
|
|
395
|
+
readonly name: "feeAtomic";
|
|
396
|
+
readonly type: "uint256";
|
|
397
|
+
}, {
|
|
398
|
+
readonly name: "responseHash";
|
|
399
|
+
readonly type: "bytes32";
|
|
400
|
+
}, {
|
|
401
|
+
readonly name: "timestamp";
|
|
402
|
+
readonly type: "uint256";
|
|
403
|
+
}, {
|
|
404
|
+
readonly name: "cleared";
|
|
405
|
+
readonly type: "bool";
|
|
406
|
+
}];
|
|
407
|
+
};
|
|
408
|
+
declare const ARBITER_DOMAIN: {
|
|
409
|
+
readonly name: "NullClear Arbiter";
|
|
410
|
+
readonly version: "1";
|
|
411
|
+
readonly chainId: 8453;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
export { ARBITER_ATTESTATION_TYPES, ARBITER_DOMAIN, BASE_MAINNET, BASE_SEPOLIA, CAIP2_TO_CHAIN_ID, type ChainConfig, type ClearingAttestation, type EIP3009Authorization, EIP3009_ABI, EIP3009_TYPES, ERC8004_IDENTITY_ABI, ERC8004_REPUTATION_ABI, type KYAMandate, KYA_DOMAIN, KYA_MANDATE_TYPES, NULLCLEAR_ARBITER_ADDRESS, NULLCLEAR_TREASURY_ADDRESS, SUPPORTED_CHAINS, type X402PaymentOption, type X402PaymentRequired, type X402PaymentResponse, type X402PaymentSignaturePayload, decodeBase64Json, encodeBase64Json, getChainConfig };
|