@shodai-network/agreements-protocol-evm 0.1.4
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 +201 -0
- package/NOTICE +6 -0
- package/README.md +102 -0
- package/dist/cjs/AgreementEngine.d.ts +219 -0
- package/dist/cjs/AgreementEngine.d.ts.map +1 -0
- package/dist/cjs/AgreementEngine.js +454 -0
- package/dist/cjs/AgreementEngine.js.map +1 -0
- package/dist/cjs/AgreementFactory.d.ts +186 -0
- package/dist/cjs/AgreementFactory.d.ts.map +1 -0
- package/dist/cjs/AgreementFactory.js +541 -0
- package/dist/cjs/AgreementFactory.js.map +1 -0
- package/dist/cjs/deployments.d.ts +37 -0
- package/dist/cjs/deployments.d.ts.map +1 -0
- package/dist/cjs/deployments.js +90 -0
- package/dist/cjs/deployments.js.map +1 -0
- package/dist/cjs/generated/AgreementEngineAbi.d.ts +651 -0
- package/dist/cjs/generated/AgreementEngineAbi.d.ts.map +1 -0
- package/dist/cjs/generated/AgreementEngineAbi.js +842 -0
- package/dist/cjs/generated/AgreementEngineAbi.js.map +1 -0
- package/dist/cjs/generated/AgreementFactoryAbi.d.ts +861 -0
- package/dist/cjs/generated/AgreementFactoryAbi.d.ts.map +1 -0
- package/dist/cjs/generated/AgreementFactoryAbi.js +1117 -0
- package/dist/cjs/generated/AgreementFactoryAbi.js.map +1 -0
- package/dist/cjs/generated/DeploymentsRegistry.d.ts +50 -0
- package/dist/cjs/generated/DeploymentsRegistry.d.ts.map +1 -0
- package/dist/cjs/generated/DeploymentsRegistry.js +54 -0
- package/dist/cjs/generated/DeploymentsRegistry.js.map +1 -0
- package/dist/cjs/index.d.ts +15 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +32 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/payload-builder.d.ts +122 -0
- package/dist/cjs/payload-builder.d.ts.map +1 -0
- package/dist/cjs/payload-builder.js +186 -0
- package/dist/cjs/payload-builder.js.map +1 -0
- package/dist/cjs/rpc-transport.d.ts +3 -0
- package/dist/cjs/rpc-transport.d.ts.map +1 -0
- package/dist/cjs/rpc-transport.js +87 -0
- package/dist/cjs/rpc-transport.js.map +1 -0
- package/dist/cjs/telemetry.d.ts +5 -0
- package/dist/cjs/telemetry.d.ts.map +1 -0
- package/dist/cjs/telemetry.js +54 -0
- package/dist/cjs/telemetry.js.map +1 -0
- package/dist/cjs/transactions.d.ts +25 -0
- package/dist/cjs/transactions.d.ts.map +1 -0
- package/dist/cjs/transactions.js +40 -0
- package/dist/cjs/transactions.js.map +1 -0
- package/dist/cjs/transformer.d.ts +112 -0
- package/dist/cjs/transformer.d.ts.map +1 -0
- package/dist/cjs/transformer.js +498 -0
- package/dist/cjs/transformer.js.map +1 -0
- package/dist/cjs/types.d.ts +311 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +48 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/AgreementEngine.d.ts +219 -0
- package/dist/esm/AgreementEngine.d.ts.map +1 -0
- package/dist/esm/AgreementEngine.js +450 -0
- package/dist/esm/AgreementEngine.js.map +1 -0
- package/dist/esm/AgreementFactory.d.ts +186 -0
- package/dist/esm/AgreementFactory.d.ts.map +1 -0
- package/dist/esm/AgreementFactory.js +537 -0
- package/dist/esm/AgreementFactory.js.map +1 -0
- package/dist/esm/deployments.d.ts +37 -0
- package/dist/esm/deployments.d.ts.map +1 -0
- package/dist/esm/deployments.js +82 -0
- package/dist/esm/deployments.js.map +1 -0
- package/dist/esm/generated/AgreementEngineAbi.d.ts +651 -0
- package/dist/esm/generated/AgreementEngineAbi.d.ts.map +1 -0
- package/dist/esm/generated/AgreementEngineAbi.js +839 -0
- package/dist/esm/generated/AgreementEngineAbi.js.map +1 -0
- package/dist/esm/generated/AgreementFactoryAbi.d.ts +861 -0
- package/dist/esm/generated/AgreementFactoryAbi.d.ts.map +1 -0
- package/dist/esm/generated/AgreementFactoryAbi.js +1114 -0
- package/dist/esm/generated/AgreementFactoryAbi.js.map +1 -0
- package/dist/esm/generated/DeploymentsRegistry.d.ts +50 -0
- package/dist/esm/generated/DeploymentsRegistry.d.ts.map +1 -0
- package/dist/esm/generated/DeploymentsRegistry.js +51 -0
- package/dist/esm/generated/DeploymentsRegistry.js.map +1 -0
- package/dist/esm/index.d.ts +15 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +16 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/payload-builder.d.ts +122 -0
- package/dist/esm/payload-builder.d.ts.map +1 -0
- package/dist/esm/payload-builder.js +173 -0
- package/dist/esm/payload-builder.js.map +1 -0
- package/dist/esm/rpc-transport.d.ts +3 -0
- package/dist/esm/rpc-transport.d.ts.map +1 -0
- package/dist/esm/rpc-transport.js +84 -0
- package/dist/esm/rpc-transport.js.map +1 -0
- package/dist/esm/telemetry.d.ts +5 -0
- package/dist/esm/telemetry.d.ts.map +1 -0
- package/dist/esm/telemetry.js +51 -0
- package/dist/esm/telemetry.js.map +1 -0
- package/dist/esm/transactions.d.ts +25 -0
- package/dist/esm/transactions.d.ts.map +1 -0
- package/dist/esm/transactions.js +36 -0
- package/dist/esm/transactions.js.map +1 -0
- package/dist/esm/transformer.d.ts +112 -0
- package/dist/esm/transformer.d.ts.map +1 -0
- package/dist/esm/transformer.js +480 -0
- package/dist/esm/transformer.js.map +1 -0
- package/dist/esm/types.d.ts +311 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +45 -0
- package/dist/esm/types.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
import { decodeEventLog, encodeAbiParameters, keccak256, stringToHex, } from 'viem';
|
|
3
|
+
import { executeTransaction, readContractResult } from "./transactions.js";
|
|
4
|
+
import { withSdkSpan } from "./telemetry.js";
|
|
5
|
+
import { transformAgreementToOnChainParams } from "./transformer.js";
|
|
6
|
+
import { AgreementFactoryABI } from "./generated/AgreementFactoryAbi.js";
|
|
7
|
+
// Use inlined ABI data (works in both Node.js and browser)
|
|
8
|
+
// ABI is extracted directly from contract artifacts as an array
|
|
9
|
+
const factoryAbi = AgreementFactoryABI;
|
|
10
|
+
// Must match AgreementFactory.sol exactly (PERMIT_WITH_ACTIONS_TYPEHASH)
|
|
11
|
+
const PERMIT_WITH_ACTIONS_TYPE = "PermitAgreementWithActions(string docUri,bytes32 docHash,bytes32 initialState,bytes32 inputDefsHash,bytes32 transitionsHash,bytes32 initVarsHash,bytes32 verifiersHash,bytes32 actionsHash,uint256 nonce,uint256 deadline)";
|
|
12
|
+
const PERMIT_WITH_ACTIONS_TYPEHASH = keccak256(stringToHex(PERMIT_WITH_ACTIONS_TYPE));
|
|
13
|
+
;
|
|
14
|
+
/**
|
|
15
|
+
* Factory for creating new Agreement instances
|
|
16
|
+
*
|
|
17
|
+
* The factory uses EIP-1167 minimal proxy clones where each agreement
|
|
18
|
+
* is deployed as a separate contract. The factory creates clones that
|
|
19
|
+
* point to a shared implementation.
|
|
20
|
+
*/
|
|
21
|
+
export class AgreementFactory {
|
|
22
|
+
/**
|
|
23
|
+
* Create a new AgreementFactory instance
|
|
24
|
+
*
|
|
25
|
+
* @param config - Factory configuration
|
|
26
|
+
* @param config.factoryAddress - The AgreementFactory contract address (required)
|
|
27
|
+
* @param config.chainId - Optional chain ID for reference (can be fetched via getChainId())
|
|
28
|
+
* @param clients.walletClient - Wallet client for creating agreements (must be connected to an account)
|
|
29
|
+
* @param clients.publicClient - Public client for reading receipts / logs
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const factory = new AgreementFactory(
|
|
34
|
+
* { factoryAddress: "0x..." },
|
|
35
|
+
* { publicClient, walletClient }
|
|
36
|
+
* );
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
constructor(config, clients) {
|
|
40
|
+
this.config = config;
|
|
41
|
+
this.clients = clients;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get the current chain ID from the signer's provider
|
|
45
|
+
*
|
|
46
|
+
* @returns The chain ID as a number
|
|
47
|
+
*/
|
|
48
|
+
async getChainId() {
|
|
49
|
+
if (this.chainId !== undefined) {
|
|
50
|
+
return this.chainId;
|
|
51
|
+
}
|
|
52
|
+
const chainId = await this.clients.publicClient.getChainId();
|
|
53
|
+
this.chainId = chainId;
|
|
54
|
+
return chainId;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Internal helper: simulate a contract call, and if the RPC complains about
|
|
58
|
+
* gas price being below the configured minimum, bump gas values and re-simulate.
|
|
59
|
+
*/
|
|
60
|
+
async simulate(functionName, args) {
|
|
61
|
+
const client = this.clients.publicClient;
|
|
62
|
+
const walletClient = this.clients.walletClient;
|
|
63
|
+
const account = walletClient.account;
|
|
64
|
+
if (!account) {
|
|
65
|
+
throw new Error("WalletClient must be connected to an account to simulate/write contracts");
|
|
66
|
+
}
|
|
67
|
+
return await withSdkSpan("evm.simulate_tx", {
|
|
68
|
+
"blockchain.chain_id": this.config.chainId ?? client.chain?.id,
|
|
69
|
+
"blockchain.contract.address": this.config.factoryAddress,
|
|
70
|
+
"blockchain.contract.function_name": functionName,
|
|
71
|
+
}, async () => client.simulateContract({
|
|
72
|
+
account,
|
|
73
|
+
address: this.config.factoryAddress,
|
|
74
|
+
abi: factoryAbi,
|
|
75
|
+
functionName,
|
|
76
|
+
args,
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
parseAgreementDeployedAddress(receipt) {
|
|
80
|
+
let deployedAddress;
|
|
81
|
+
for (const log of receipt.logs) {
|
|
82
|
+
try {
|
|
83
|
+
const decoded = decodeEventLog({
|
|
84
|
+
abi: factoryAbi,
|
|
85
|
+
data: log.data,
|
|
86
|
+
topics: log.topics,
|
|
87
|
+
eventName: 'AgreementDeployed',
|
|
88
|
+
});
|
|
89
|
+
if (decoded.eventName === 'AgreementDeployed') {
|
|
90
|
+
// @ts-expect-error - viem decodes args in a generic way; we know this event has `agreement`
|
|
91
|
+
deployedAddress = decoded.args.agreement;
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
// Not the event we care about, skip
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (!deployedAddress) {
|
|
100
|
+
throw new Error("AgreementDeployed event not found in transaction receipt");
|
|
101
|
+
}
|
|
102
|
+
return deployedAddress;
|
|
103
|
+
}
|
|
104
|
+
hashInputDefs(inputDefs) {
|
|
105
|
+
// Matches: keccak256(abi.encode(inputDefs_))
|
|
106
|
+
return keccak256(encodeAbiParameters([
|
|
107
|
+
{
|
|
108
|
+
type: 'tuple[]',
|
|
109
|
+
name: 'inputDefs',
|
|
110
|
+
components: [
|
|
111
|
+
{ name: 'id', type: 'bytes32' },
|
|
112
|
+
{
|
|
113
|
+
name: 'fields',
|
|
114
|
+
type: 'tuple[]',
|
|
115
|
+
components: [
|
|
116
|
+
{ name: 'fieldId', type: 'bytes32' },
|
|
117
|
+
{ name: 'fType', type: 'uint8' },
|
|
118
|
+
{ name: 'required', type: 'bool' },
|
|
119
|
+
{ name: 'persist', type: 'bool' },
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'conditions',
|
|
124
|
+
type: 'tuple[]',
|
|
125
|
+
components: [
|
|
126
|
+
{ name: 'op', type: 'uint8' },
|
|
127
|
+
{ name: 'fieldId', type: 'bytes32' },
|
|
128
|
+
{ name: 'bytesArg', type: 'bytes' },
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
{ name: 'verifierKeys', type: 'bytes32[]' },
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
], [
|
|
135
|
+
inputDefs.map((d) => ({
|
|
136
|
+
id: d.id,
|
|
137
|
+
fields: d.fields.map((f) => ({
|
|
138
|
+
fieldId: f.fieldId,
|
|
139
|
+
fType: f.fType,
|
|
140
|
+
required: f.required,
|
|
141
|
+
persist: f.persist,
|
|
142
|
+
})),
|
|
143
|
+
conditions: d.conditions.map((c) => ({
|
|
144
|
+
op: c.op,
|
|
145
|
+
fieldId: c.fieldId,
|
|
146
|
+
bytesArg: c.bytesArg,
|
|
147
|
+
})),
|
|
148
|
+
verifierKeys: d.verifierKeys,
|
|
149
|
+
})),
|
|
150
|
+
]));
|
|
151
|
+
}
|
|
152
|
+
hashTransitions(transitions) {
|
|
153
|
+
// Matches: keccak256(abi.encode(transitions_))
|
|
154
|
+
return keccak256(encodeAbiParameters([
|
|
155
|
+
{
|
|
156
|
+
type: 'tuple[]',
|
|
157
|
+
name: 'transitions',
|
|
158
|
+
components: [
|
|
159
|
+
{ name: 'fromState', type: 'bytes32' },
|
|
160
|
+
{ name: 'toState', type: 'bytes32' },
|
|
161
|
+
{ name: 'inputId', type: 'bytes32' },
|
|
162
|
+
],
|
|
163
|
+
},
|
|
164
|
+
], [
|
|
165
|
+
transitions.map((t) => ({
|
|
166
|
+
fromState: t.fromState,
|
|
167
|
+
toState: t.toState,
|
|
168
|
+
inputId: t.inputId,
|
|
169
|
+
})),
|
|
170
|
+
]));
|
|
171
|
+
}
|
|
172
|
+
hashInitVars(initVars) {
|
|
173
|
+
// Matches: keccak256(abi.encode(initVars_))
|
|
174
|
+
return keccak256(encodeAbiParameters([
|
|
175
|
+
{
|
|
176
|
+
type: 'tuple[]',
|
|
177
|
+
name: 'initVars',
|
|
178
|
+
components: [
|
|
179
|
+
{ name: 'id', type: 'bytes32' },
|
|
180
|
+
{ name: 'fType', type: 'uint8' },
|
|
181
|
+
{ name: 'data', type: 'bytes' },
|
|
182
|
+
],
|
|
183
|
+
},
|
|
184
|
+
], [
|
|
185
|
+
initVars.map((v) => ({
|
|
186
|
+
id: v.id,
|
|
187
|
+
fType: v.fType,
|
|
188
|
+
data: v.data,
|
|
189
|
+
})),
|
|
190
|
+
]));
|
|
191
|
+
}
|
|
192
|
+
hashVerifiers(verifiers) {
|
|
193
|
+
// Matches: keccak256(abi.encode(verifiers_))
|
|
194
|
+
return keccak256(encodeAbiParameters([
|
|
195
|
+
{
|
|
196
|
+
type: 'tuple[]',
|
|
197
|
+
name: 'verifiers',
|
|
198
|
+
components: [
|
|
199
|
+
{ name: 'key', type: 'bytes32' },
|
|
200
|
+
{ name: 'verifier', type: 'address' },
|
|
201
|
+
],
|
|
202
|
+
},
|
|
203
|
+
], [
|
|
204
|
+
verifiers.map((v) => ({
|
|
205
|
+
key: v.key,
|
|
206
|
+
verifier: v.verifier,
|
|
207
|
+
})),
|
|
208
|
+
]));
|
|
209
|
+
}
|
|
210
|
+
hashActions(actions) {
|
|
211
|
+
// Matches: keccak256(abi.encode(actions_))
|
|
212
|
+
return keccak256(encodeAbiParameters([
|
|
213
|
+
{
|
|
214
|
+
type: 'tuple[]',
|
|
215
|
+
name: 'actions',
|
|
216
|
+
components: [
|
|
217
|
+
{ name: 'fromState', type: 'bytes32' },
|
|
218
|
+
{ name: 'inputId', type: 'bytes32' },
|
|
219
|
+
{ name: 'target', type: 'address' },
|
|
220
|
+
{ name: 'value', type: 'uint256' },
|
|
221
|
+
{ name: 'data', type: 'bytes' },
|
|
222
|
+
],
|
|
223
|
+
},
|
|
224
|
+
], [
|
|
225
|
+
actions.map((a) => ({
|
|
226
|
+
fromState: a.fromState,
|
|
227
|
+
inputId: a.inputId,
|
|
228
|
+
target: a.target,
|
|
229
|
+
value: a.value,
|
|
230
|
+
data: a.data,
|
|
231
|
+
})),
|
|
232
|
+
]));
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Create a new agreement from an AgreementJson definition
|
|
236
|
+
*
|
|
237
|
+
* @param agreement - The agreement JSON definition
|
|
238
|
+
* @param options - Optional configuration
|
|
239
|
+
* @param options.docUri - Custom document URI (defaults to ipfs://agreement/{id})
|
|
240
|
+
* @param options.initValues - Initialization values for variables referenced in initialize.data
|
|
241
|
+
* @returns The deployed agreement contract address and transaction response
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* const factory = new AgreementFactory(
|
|
246
|
+
* { factoryAddress: "0x..." },
|
|
247
|
+
* { publicClient, walletClient }
|
|
248
|
+
* );
|
|
249
|
+
*
|
|
250
|
+
* const { address, receipt } = await factory.createAgreement(agreementJson, {
|
|
251
|
+
* initValues: {
|
|
252
|
+
* grantorEthAddress: "0x123...",
|
|
253
|
+
* recipientEthAddress: "0x456..."
|
|
254
|
+
* }
|
|
255
|
+
* });
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
async createAgreement(agreement, options) {
|
|
259
|
+
return await withSdkSpan("agreement_factory.create", {
|
|
260
|
+
"blockchain.chain_id": this.config.chainId ?? this.clients.publicClient?.chain?.id,
|
|
261
|
+
"blockchain.contract.address": this.config.factoryAddress,
|
|
262
|
+
"agreement.template_id": agreement.metadata?.templateId,
|
|
263
|
+
}, async () => {
|
|
264
|
+
const params = transformAgreementToOnChainParams(agreement, options?.docUri, options?.initValues);
|
|
265
|
+
const verifiers = options?.verifiers ?? params.verifiers;
|
|
266
|
+
const { request } = await this.simulate('createAgreement', [
|
|
267
|
+
params.docUri,
|
|
268
|
+
params.docHash,
|
|
269
|
+
params.initialState,
|
|
270
|
+
params.inputDefs,
|
|
271
|
+
params.transitions,
|
|
272
|
+
params.initVars,
|
|
273
|
+
verifiers,
|
|
274
|
+
params.actions,
|
|
275
|
+
]);
|
|
276
|
+
const receipt = await executeTransaction(request, this.clients.publicClient, this.clients.walletClient, true);
|
|
277
|
+
return {
|
|
278
|
+
address: this.parseAgreementDeployedAddress(receipt),
|
|
279
|
+
request,
|
|
280
|
+
receipt,
|
|
281
|
+
};
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Read the current permit nonce for a signer address.
|
|
286
|
+
*/
|
|
287
|
+
async getNonce(signer) {
|
|
288
|
+
return await readContractResult(this.clients.publicClient, {
|
|
289
|
+
address: this.config.factoryAddress,
|
|
290
|
+
abi: factoryAbi,
|
|
291
|
+
functionName: 'nonces',
|
|
292
|
+
args: [signer],
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Create an EIP-712 permit signature for creating an agreement via the factory.
|
|
297
|
+
*
|
|
298
|
+
* The permit binds the full agreement creation parameters (docUri/docHash/initialState
|
|
299
|
+
* and hashes of inputDefs/transitions/initVars/verifiers/actions) plus the signer's current nonce + deadline.
|
|
300
|
+
*
|
|
301
|
+
* @param walletClient - viem WalletClient to sign typed data (must be connected to an account)
|
|
302
|
+
* @param agreement - The agreement JSON definition
|
|
303
|
+
* @param deadline - Unix timestamp when the permit expires
|
|
304
|
+
* @param options - Optional configuration (docUri + initValues)
|
|
305
|
+
*/
|
|
306
|
+
async createPermitSignature(walletClient, agreement, deadline, options) {
|
|
307
|
+
const account = walletClient.account;
|
|
308
|
+
if (!account) {
|
|
309
|
+
throw new Error("WalletClient must be connected to an account to sign typed data");
|
|
310
|
+
}
|
|
311
|
+
const signerAddress = account.address;
|
|
312
|
+
const nonce = await this.getNonce(signerAddress);
|
|
313
|
+
const params = transformAgreementToOnChainParams(agreement, options?.docUri, options?.initValues);
|
|
314
|
+
const verifiers = options?.verifiers ?? params.verifiers;
|
|
315
|
+
const inputDefsHash = this.hashInputDefs(params.inputDefs);
|
|
316
|
+
const transitionsHash = this.hashTransitions(params.transitions);
|
|
317
|
+
const initVarsHash = this.hashInitVars(params.initVars);
|
|
318
|
+
const verifiersHash = this.hashVerifiers(verifiers);
|
|
319
|
+
const actionsHash = this.hashActions(params.actions);
|
|
320
|
+
const chainId = await this.clients.publicClient.getChainId();
|
|
321
|
+
const domain = {
|
|
322
|
+
name: "AgreementFactory",
|
|
323
|
+
version: "1",
|
|
324
|
+
chainId,
|
|
325
|
+
verifyingContract: this.config.factoryAddress,
|
|
326
|
+
};
|
|
327
|
+
const types = {
|
|
328
|
+
PermitAgreementWithActions: [
|
|
329
|
+
{ name: "docUri", type: "string" },
|
|
330
|
+
{ name: "docHash", type: "bytes32" },
|
|
331
|
+
{ name: "initialState", type: "bytes32" },
|
|
332
|
+
{ name: "inputDefsHash", type: "bytes32" },
|
|
333
|
+
{ name: "transitionsHash", type: "bytes32" },
|
|
334
|
+
{ name: "initVarsHash", type: "bytes32" },
|
|
335
|
+
{ name: "verifiersHash", type: "bytes32" },
|
|
336
|
+
{ name: "actionsHash", type: "bytes32" },
|
|
337
|
+
{ name: "nonce", type: "uint256" },
|
|
338
|
+
{ name: "deadline", type: "uint256" },
|
|
339
|
+
],
|
|
340
|
+
};
|
|
341
|
+
const message = {
|
|
342
|
+
docUri: params.docUri,
|
|
343
|
+
docHash: params.docHash,
|
|
344
|
+
initialState: params.initialState,
|
|
345
|
+
inputDefsHash,
|
|
346
|
+
transitionsHash,
|
|
347
|
+
initVarsHash,
|
|
348
|
+
verifiersHash,
|
|
349
|
+
actionsHash,
|
|
350
|
+
nonce,
|
|
351
|
+
deadline: BigInt(deadline),
|
|
352
|
+
};
|
|
353
|
+
// Optional sanity check: ensure our local typehash matches the contract's constant.
|
|
354
|
+
// (If this ever fails, the permit string in PERMIT_WITH_ACTIONS_TYPE is wrong.)
|
|
355
|
+
if (!PERMIT_WITH_ACTIONS_TYPEHASH) {
|
|
356
|
+
throw new Error("PERMIT_WITH_ACTIONS_TYPEHASH not initialized");
|
|
357
|
+
}
|
|
358
|
+
const signatureHex = await walletClient.signTypedData({
|
|
359
|
+
account,
|
|
360
|
+
domain,
|
|
361
|
+
types,
|
|
362
|
+
primaryType: "PermitAgreementWithActions",
|
|
363
|
+
message,
|
|
364
|
+
});
|
|
365
|
+
const r = `0x${signatureHex.slice(2, 66)}`;
|
|
366
|
+
const s = `0x${signatureHex.slice(66, 130)}`;
|
|
367
|
+
const v = parseInt(signatureHex.slice(130, 132), 16);
|
|
368
|
+
return { signature: { v, r, s }, signerAddress };
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Create a new agreement using a permit signature, allowing a submitter to create
|
|
372
|
+
* on behalf of the signer (the signer becomes the agreement owner).
|
|
373
|
+
*/
|
|
374
|
+
async createAgreementWithPermit(signer, agreement, deadline, signature, options) {
|
|
375
|
+
return await withSdkSpan("agreement_factory.create_with_permit", {
|
|
376
|
+
"blockchain.chain_id": this.config.chainId ?? this.clients.publicClient?.chain?.id,
|
|
377
|
+
"blockchain.contract.address": this.config.factoryAddress,
|
|
378
|
+
"agreement.template_id": agreement.metadata?.templateId,
|
|
379
|
+
"wallet.signer": signer,
|
|
380
|
+
}, async () => {
|
|
381
|
+
const params = transformAgreementToOnChainParams(agreement, options?.docUri, options?.initValues);
|
|
382
|
+
const verifiers = options?.verifiers ?? params.verifiers;
|
|
383
|
+
const { request } = await this.simulate('createAgreementWithPermit', [
|
|
384
|
+
signer,
|
|
385
|
+
params.docUri,
|
|
386
|
+
params.docHash,
|
|
387
|
+
params.initialState,
|
|
388
|
+
params.inputDefs,
|
|
389
|
+
params.transitions,
|
|
390
|
+
params.initVars,
|
|
391
|
+
verifiers,
|
|
392
|
+
params.actions,
|
|
393
|
+
BigInt(deadline),
|
|
394
|
+
signature.v,
|
|
395
|
+
signature.r,
|
|
396
|
+
signature.s,
|
|
397
|
+
]);
|
|
398
|
+
const receipt = await executeTransaction(request, this.clients.publicClient, this.clients.walletClient, true);
|
|
399
|
+
return {
|
|
400
|
+
address: this.parseAgreementDeployedAddress(receipt),
|
|
401
|
+
request,
|
|
402
|
+
receipt,
|
|
403
|
+
};
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Create a new agreement at a deterministic address
|
|
408
|
+
*
|
|
409
|
+
* @param agreement - The agreement JSON definition
|
|
410
|
+
* @param salt - Salt for deterministic address derivation
|
|
411
|
+
* @param options - Optional configuration
|
|
412
|
+
* @param options.docUri - Custom document URI (defaults to ipfs://agreement/{id})
|
|
413
|
+
* @param options.initValues - Initialization values for variables referenced in initialize.data
|
|
414
|
+
* @returns The deployed agreement contract address and transaction response
|
|
415
|
+
*
|
|
416
|
+
* @example
|
|
417
|
+
* ```typescript
|
|
418
|
+
* const factory = new AgreementFactory(
|
|
419
|
+
* { factoryAddress: "0x..." },
|
|
420
|
+
* { publicClient, walletClient }
|
|
421
|
+
* );
|
|
422
|
+
* const salt = "0x1234...";
|
|
423
|
+
*
|
|
424
|
+
* const { address, receipt } = await factory.createAgreementDeterministic(
|
|
425
|
+
* agreementJson,
|
|
426
|
+
* salt,
|
|
427
|
+
* { initValues: { ... } }
|
|
428
|
+
* );
|
|
429
|
+
* ```
|
|
430
|
+
*/
|
|
431
|
+
async createAgreementDeterministic(agreement, salt, options) {
|
|
432
|
+
return await withSdkSpan("agreement_factory.create_deterministic", {
|
|
433
|
+
"blockchain.chain_id": this.config.chainId ?? this.clients.publicClient?.chain?.id,
|
|
434
|
+
"blockchain.contract.address": this.config.factoryAddress,
|
|
435
|
+
"agreement.template_id": agreement.metadata?.templateId,
|
|
436
|
+
}, async () => {
|
|
437
|
+
const params = transformAgreementToOnChainParams(agreement, options?.docUri, options?.initValues);
|
|
438
|
+
const verifiers = options?.verifiers ?? params.verifiers;
|
|
439
|
+
const deterministicArgs = [
|
|
440
|
+
salt,
|
|
441
|
+
params.docUri,
|
|
442
|
+
params.docHash,
|
|
443
|
+
params.initialState,
|
|
444
|
+
params.inputDefs,
|
|
445
|
+
params.transitions,
|
|
446
|
+
params.initVars,
|
|
447
|
+
verifiers,
|
|
448
|
+
params.actions,
|
|
449
|
+
];
|
|
450
|
+
const { request } = await this.simulate('createAgreementDeterministic', deterministicArgs);
|
|
451
|
+
const receipt = await executeTransaction(request, this.clients.publicClient, this.clients.walletClient, true);
|
|
452
|
+
return {
|
|
453
|
+
address: this.parseAgreementDeployedAddress(receipt),
|
|
454
|
+
request,
|
|
455
|
+
receipt,
|
|
456
|
+
};
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Create a new deterministic agreement using a permit signature.
|
|
461
|
+
* Note: The on-chain permit does NOT bind the salt; the signature authorizes the agreement params.
|
|
462
|
+
*/
|
|
463
|
+
async createAgreementDeterministicWithPermit(signer, salt, agreement, deadline, signature, options) {
|
|
464
|
+
return await withSdkSpan("agreement_factory.create_deterministic_with_permit", {
|
|
465
|
+
"blockchain.chain_id": this.config.chainId ?? this.clients.publicClient?.chain?.id,
|
|
466
|
+
"blockchain.contract.address": this.config.factoryAddress,
|
|
467
|
+
"agreement.template_id": agreement.metadata?.templateId,
|
|
468
|
+
"wallet.signer": signer,
|
|
469
|
+
}, async () => {
|
|
470
|
+
const params = transformAgreementToOnChainParams(agreement, options?.docUri, options?.initValues);
|
|
471
|
+
const verifiers = options?.verifiers ?? params.verifiers;
|
|
472
|
+
const { request } = await this.simulate('createAgreementDeterministicWithPermit', [
|
|
473
|
+
signer,
|
|
474
|
+
salt,
|
|
475
|
+
params.docUri,
|
|
476
|
+
params.docHash,
|
|
477
|
+
params.initialState,
|
|
478
|
+
params.inputDefs,
|
|
479
|
+
params.transitions,
|
|
480
|
+
params.initVars,
|
|
481
|
+
verifiers,
|
|
482
|
+
params.actions,
|
|
483
|
+
BigInt(deadline),
|
|
484
|
+
signature.v,
|
|
485
|
+
signature.r,
|
|
486
|
+
signature.s,
|
|
487
|
+
]);
|
|
488
|
+
const receipt = await executeTransaction(request, this.clients.publicClient, this.clients.walletClient, true);
|
|
489
|
+
return {
|
|
490
|
+
address: this.parseAgreementDeployedAddress(receipt),
|
|
491
|
+
request,
|
|
492
|
+
receipt,
|
|
493
|
+
};
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Predict the address of a deterministic agreement before deployment
|
|
498
|
+
*
|
|
499
|
+
* @param salt The salt that will be used for deployment
|
|
500
|
+
* @returns The predicted agreement address
|
|
501
|
+
*
|
|
502
|
+
* @example
|
|
503
|
+
* ```typescript
|
|
504
|
+
* const factory = new AgreementFactory(
|
|
505
|
+
* { factoryAddress: "0x..." },
|
|
506
|
+
* { publicClient, walletClient }
|
|
507
|
+
* );
|
|
508
|
+
* const predictedAddress = await factory.predictAddress("0x1234...");
|
|
509
|
+
* ```
|
|
510
|
+
*/
|
|
511
|
+
async predictAddress(salt) {
|
|
512
|
+
return await readContractResult(this.clients.publicClient, {
|
|
513
|
+
address: this.config.factoryAddress,
|
|
514
|
+
abi: factoryAbi,
|
|
515
|
+
functionName: 'predictAddress',
|
|
516
|
+
args: [salt],
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Get the factory contract address
|
|
521
|
+
*/
|
|
522
|
+
getAddress() {
|
|
523
|
+
return this.config.factoryAddress;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Get the implementation address that clones point to
|
|
527
|
+
*/
|
|
528
|
+
async getImplementationAddress() {
|
|
529
|
+
return await readContractResult(this.clients.publicClient, {
|
|
530
|
+
address: this.config.factoryAddress,
|
|
531
|
+
abi: factoryAbi,
|
|
532
|
+
functionName: 'implementation',
|
|
533
|
+
args: [],
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
//# sourceMappingURL=AgreementFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgreementFactory.js","sourceRoot":"","sources":["../../src/AgreementFactory.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,OAAO,EAML,cAAc,EACd,mBAAmB,EACnB,SAAS,EACT,WAAW,GACZ,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,iCAAiC,EAAa,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,2DAA2D;AAC3D,gEAAgE;AAChE,MAAM,UAAU,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|
+
factory: string;
|
|
5
|
+
chainId: string;
|
|
6
|
+
network: string;
|
|
7
|
+
deployedAt: string;
|
|
8
|
+
deployer: string;
|
|
9
|
+
}
|
|
10
|
+
export interface DeploymentsRegistry {
|
|
11
|
+
deployments: Record<string, DeploymentInfo>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Get deployment info by chain ID
|
|
15
|
+
*/
|
|
16
|
+
export declare function getDeploymentByChainId(chainId: number | bigint): DeploymentInfo | null;
|
|
17
|
+
/**
|
|
18
|
+
* Get deployment info by network name
|
|
19
|
+
*/
|
|
20
|
+
export declare function getDeploymentByNetwork(network: string): DeploymentInfo | null;
|
|
21
|
+
/**
|
|
22
|
+
* Get FactoryConfig by chain ID
|
|
23
|
+
*/
|
|
24
|
+
export declare function getFactoryConfigByChainId(chainId: number | bigint): FactoryConfig | null;
|
|
25
|
+
/**
|
|
26
|
+
* Get FactoryConfig by network name
|
|
27
|
+
*/
|
|
28
|
+
export declare function getFactoryConfigByNetwork(network: string): FactoryConfig | null;
|
|
29
|
+
/**
|
|
30
|
+
* List all registered deployments
|
|
31
|
+
*/
|
|
32
|
+
export declare function listDeployments(): DeploymentInfo[];
|
|
33
|
+
/**
|
|
34
|
+
* Get all available FactoryConfigs
|
|
35
|
+
*/
|
|
36
|
+
export declare function getAllFactoryConfigs(): FactoryConfig[];
|
|
37
|
+
//# sourceMappingURL=deployments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployments.d.ts","sourceRoot":"","sources":["../../src/deployments.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAO3C,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC7C;AASD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,cAAc,GAAG,IAAI,CAYtF;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAY7E;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,GAAG,IAAI,CAUxF;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAU/E;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,cAAc,EAAE,CAGlD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,aAAa,EAAE,CAMtD"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
import { DeploymentsRegistry } from "./generated/DeploymentsRegistry.js";
|
|
3
|
+
// Use inlined deployments data (works in both Node.js and browser)
|
|
4
|
+
const deploymentsRegistry = DeploymentsRegistry;
|
|
5
|
+
/**
|
|
6
|
+
* Load the deployments registry
|
|
7
|
+
*/
|
|
8
|
+
function loadDeploymentsRegistry() {
|
|
9
|
+
return deploymentsRegistry;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Get deployment info by chain ID
|
|
13
|
+
*/
|
|
14
|
+
export function getDeploymentByChainId(chainId) {
|
|
15
|
+
const registry = loadDeploymentsRegistry();
|
|
16
|
+
const chainIdStr = chainId.toString();
|
|
17
|
+
// Find deployment by chainId
|
|
18
|
+
for (const deployment of Object.values(registry.deployments)) {
|
|
19
|
+
if (deployment.chainId === chainIdStr) {
|
|
20
|
+
return deployment;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get deployment info by network name
|
|
27
|
+
*/
|
|
28
|
+
export function getDeploymentByNetwork(network) {
|
|
29
|
+
const registry = loadDeploymentsRegistry();
|
|
30
|
+
// Find deployment by network name (case-insensitive)
|
|
31
|
+
const networkLower = network.toLowerCase();
|
|
32
|
+
for (const deployment of Object.values(registry.deployments)) {
|
|
33
|
+
if (deployment.network.toLowerCase() === networkLower) {
|
|
34
|
+
return deployment;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get FactoryConfig by chain ID
|
|
41
|
+
*/
|
|
42
|
+
export function getFactoryConfigByChainId(chainId) {
|
|
43
|
+
const deployment = getDeploymentByChainId(chainId);
|
|
44
|
+
if (!deployment) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
factoryAddress: deployment.factory,
|
|
49
|
+
chainId: Number(deployment.chainId),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get FactoryConfig by network name
|
|
54
|
+
*/
|
|
55
|
+
export function getFactoryConfigByNetwork(network) {
|
|
56
|
+
const deployment = getDeploymentByNetwork(network);
|
|
57
|
+
if (!deployment) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
factoryAddress: deployment.factory,
|
|
62
|
+
chainId: Number(deployment.chainId),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* List all registered deployments
|
|
67
|
+
*/
|
|
68
|
+
export function listDeployments() {
|
|
69
|
+
const registry = loadDeploymentsRegistry();
|
|
70
|
+
return Object.values(registry.deployments);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get all available FactoryConfigs
|
|
74
|
+
*/
|
|
75
|
+
export function getAllFactoryConfigs() {
|
|
76
|
+
const deployments = listDeployments();
|
|
77
|
+
return deployments.map((deployment) => ({
|
|
78
|
+
factoryAddress: deployment.factory,
|
|
79
|
+
chainId: Number(deployment.chainId),
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=deployments.js.map
|