@avow-finance/spec 0.0.0-stage → 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.
- package/LICENSE +201 -0
- package/README.md +119 -2
- package/dist/agent-connect.d.ts +90 -0
- package/dist/agent-connect.d.ts.map +1 -0
- package/dist/agent-connect.js +102 -0
- package/dist/agent-connect.js.map +1 -0
- package/dist/agent-session.d.ts +791 -0
- package/dist/agent-session.d.ts.map +1 -0
- package/dist/agent-session.js +176 -0
- package/dist/agent-session.js.map +1 -0
- package/dist/ap2.d.ts +79 -0
- package/dist/ap2.d.ts.map +1 -0
- package/dist/ap2.js +151 -0
- package/dist/ap2.js.map +1 -0
- package/dist/api-request.d.ts +144 -0
- package/dist/api-request.d.ts.map +1 -0
- package/dist/api-request.js +246 -0
- package/dist/api-request.js.map +1 -0
- package/dist/api.d.ts +288 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +332 -0
- package/dist/api.js.map +1 -0
- package/dist/canonical.d.ts +22 -0
- package/dist/canonical.d.ts.map +1 -0
- package/dist/canonical.js +66 -0
- package/dist/canonical.js.map +1 -0
- package/dist/commitment-card.d.ts +78 -0
- package/dist/commitment-card.d.ts.map +1 -0
- package/dist/commitment-card.js +224 -0
- package/dist/commitment-card.js.map +1 -0
- package/dist/commitment.d.ts +185 -0
- package/dist/commitment.d.ts.map +1 -0
- package/dist/commitment.js +148 -0
- package/dist/commitment.js.map +1 -0
- package/dist/compute-offers.d.ts +128 -0
- package/dist/compute-offers.d.ts.map +1 -0
- package/dist/compute-offers.js +111 -0
- package/dist/compute-offers.js.map +1 -0
- package/dist/contest.d.ts +88 -0
- package/dist/contest.d.ts.map +1 -0
- package/dist/contest.js +131 -0
- package/dist/contest.js.map +1 -0
- package/dist/demo.d.ts +69 -0
- package/dist/demo.d.ts.map +1 -0
- package/dist/demo.js +152 -0
- package/dist/demo.js.map +1 -0
- package/dist/dependencies.d.ts +308 -0
- package/dist/dependencies.d.ts.map +1 -0
- package/dist/dependencies.js +133 -0
- package/dist/dependencies.js.map +1 -0
- package/dist/eip712.d.ts +1569 -0
- package/dist/eip712.d.ts.map +1 -0
- package/dist/eip712.js +550 -0
- package/dist/eip712.js.map +1 -0
- package/dist/elided-terms.d.ts +37 -0
- package/dist/elided-terms.d.ts.map +1 -0
- package/dist/elided-terms.js +48 -0
- package/dist/elided-terms.js.map +1 -0
- package/dist/erc8183.d.ts +78 -0
- package/dist/erc8183.d.ts.map +1 -0
- package/dist/erc8183.js +88 -0
- package/dist/erc8183.js.map +1 -0
- package/dist/facts.d.ts +70 -0
- package/dist/facts.d.ts.map +1 -0
- package/dist/facts.js +33 -0
- package/dist/facts.js.map +1 -0
- package/dist/gpu-reservation.d.ts +79 -0
- package/dist/gpu-reservation.d.ts.map +1 -0
- package/dist/gpu-reservation.js +135 -0
- package/dist/gpu-reservation.js.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/job-session.d.ts +981 -0
- package/dist/job-session.d.ts.map +1 -0
- package/dist/job-session.js +170 -0
- package/dist/job-session.js.map +1 -0
- package/dist/job-verification.d.ts +244 -0
- package/dist/job-verification.d.ts.map +1 -0
- package/dist/job-verification.js +89 -0
- package/dist/job-verification.js.map +1 -0
- package/dist/job-wording.d.ts +48 -0
- package/dist/job-wording.d.ts.map +1 -0
- package/dist/job-wording.js +134 -0
- package/dist/job-wording.js.map +1 -0
- package/dist/job.d.ts +117 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +166 -0
- package/dist/job.js.map +1 -0
- package/dist/json-fields.d.ts +13 -0
- package/dist/json-fields.d.ts.map +1 -0
- package/dist/json-fields.js +30 -0
- package/dist/json-fields.js.map +1 -0
- package/dist/keychain.d.ts +51 -0
- package/dist/keychain.d.ts.map +1 -0
- package/dist/keychain.js +133 -0
- package/dist/keychain.js.map +1 -0
- package/dist/mailbox.d.ts +1650 -0
- package/dist/mailbox.d.ts.map +1 -0
- package/dist/mailbox.js +87 -0
- package/dist/mailbox.js.map +1 -0
- package/dist/mandate.d.ts +53 -0
- package/dist/mandate.d.ts.map +1 -0
- package/dist/mandate.js +97 -0
- package/dist/mandate.js.map +1 -0
- package/dist/networks.d.ts +18 -0
- package/dist/networks.d.ts.map +1 -0
- package/dist/networks.js +24 -0
- package/dist/networks.js.map +1 -0
- package/dist/profiles.d.ts +31 -0
- package/dist/profiles.d.ts.map +1 -0
- package/dist/profiles.js +33 -0
- package/dist/profiles.js.map +1 -0
- package/dist/rail.d.ts +48 -0
- package/dist/rail.d.ts.map +1 -0
- package/dist/rail.js +28 -0
- package/dist/rail.js.map +1 -0
- package/dist/reasons.d.ts +173 -0
- package/dist/reasons.d.ts.map +1 -0
- package/dist/reasons.js +174 -0
- package/dist/reasons.js.map +1 -0
- package/dist/reference-link.d.ts +23 -0
- package/dist/reference-link.d.ts.map +1 -0
- package/dist/reference-link.js +56 -0
- package/dist/reference-link.js.map +1 -0
- package/dist/references.d.ts +125 -0
- package/dist/references.d.ts.map +1 -0
- package/dist/references.js +108 -0
- package/dist/references.js.map +1 -0
- package/dist/replay.d.ts +30 -0
- package/dist/replay.d.ts.map +1 -0
- package/dist/replay.js +27 -0
- package/dist/replay.js.map +1 -0
- package/dist/sandbox-registration.d.ts +200 -0
- package/dist/sandbox-registration.d.ts.map +1 -0
- package/dist/sandbox-registration.js +172 -0
- package/dist/sandbox-registration.js.map +1 -0
- package/dist/sandbox.d.ts +3478 -0
- package/dist/sandbox.d.ts.map +1 -0
- package/dist/sandbox.js +316 -0
- package/dist/sandbox.js.map +1 -0
- package/dist/session-fields.d.ts +203 -0
- package/dist/session-fields.d.ts.map +1 -0
- package/dist/session-fields.js +43 -0
- package/dist/session-fields.js.map +1 -0
- package/dist/supplier-adapter.d.ts +65 -0
- package/dist/supplier-adapter.d.ts.map +1 -0
- package/dist/supplier-adapter.js +91 -0
- package/dist/supplier-adapter.js.map +1 -0
- package/dist/terms-v1.d.ts +74 -0
- package/dist/terms-v1.d.ts.map +1 -0
- package/dist/terms-v1.js +156 -0
- package/dist/terms-v1.js.map +1 -0
- package/dist/terms.d.ts +341 -0
- package/dist/terms.d.ts.map +1 -0
- package/dist/terms.js +715 -0
- package/dist/terms.js.map +1 -0
- package/dist/test-customer.d.ts +1525 -0
- package/dist/test-customer.d.ts.map +1 -0
- package/dist/test-customer.js +260 -0
- package/dist/test-customer.js.map +1 -0
- package/dist/types.d.ts +272 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +32 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +51 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +66 -0
- package/dist/version.js.map +1 -0
- package/dist/wire.d.ts +2698 -0
- package/dist/wire.d.ts.map +1 -0
- package/dist/wire.js +678 -0
- package/dist/wire.js.map +1 -0
- package/package.json +37 -3
- package/vectors/api-request-v1.json +53 -0
- package/vectors/contest-statement-v1.json +42 -0
- package/vectors/terms-v2.json +398 -0
- package/vectors/terms-v3.json +2103 -0
package/dist/eip712.d.ts
ADDED
|
@@ -0,0 +1,1569 @@
|
|
|
1
|
+
import { type Address, type Hex, type TypedDataDomain } from 'viem';
|
|
2
|
+
import type { ReasonCode } from './reasons.js';
|
|
3
|
+
import type { Mandate, Side } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Every signed message is EIP-712 typed data. The domain names the message type's version, the
|
|
6
|
+
* chain and the buyer's lock, and each message carries a nonce and an expiry, so it can't be
|
|
7
|
+
* replayed on another chain or lock or changed without breaking the signature.
|
|
8
|
+
*/
|
|
9
|
+
export interface AvowDomain {
|
|
10
|
+
chainId: number;
|
|
11
|
+
/** The buyer's lock, which every message for its commitments names. */
|
|
12
|
+
verifyingContract: Address;
|
|
13
|
+
}
|
|
14
|
+
export declare function domain(d: AvowDomain, version: string): TypedDataDomain;
|
|
15
|
+
/** Each side of a commitment by the code the lock stores, takes in calls and logs in its events. */
|
|
16
|
+
export declare const SIDE_CODES: {
|
|
17
|
+
readonly buyer: 0;
|
|
18
|
+
readonly supplier: 1;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The kinds of charge a lock can hold, by the code the lock stores. A commitment's terms carry up
|
|
22
|
+
* to four kinds, and the demo terms use these two.
|
|
23
|
+
*/
|
|
24
|
+
export declare const CHARGE_KINDS: {
|
|
25
|
+
readonly lateCancellation: 0;
|
|
26
|
+
readonly noShow: 1;
|
|
27
|
+
};
|
|
28
|
+
export type ChargeKind = keyof typeof CHARGE_KINDS;
|
|
29
|
+
/** The most reports a lock takes for one commitment, one at a time. */
|
|
30
|
+
export declare const MAX_REPORTS = 2;
|
|
31
|
+
/** Why the supplier account consents to give a reserve back. */
|
|
32
|
+
export declare const RELEASE_REASONS: {
|
|
33
|
+
readonly kept: 1;
|
|
34
|
+
readonly supplierFailed: 2;
|
|
35
|
+
};
|
|
36
|
+
export type ReleaseReason = keyof typeof RELEASE_REASONS;
|
|
37
|
+
/** What a business signs as a `BusinessAction`, by the code the lock reads. */
|
|
38
|
+
export declare const BUSINESS_ACTIONS: {
|
|
39
|
+
readonly contest: 0;
|
|
40
|
+
readonly evidence: 1;
|
|
41
|
+
readonly approveSupplier: 2;
|
|
42
|
+
readonly removeSupplier: 3;
|
|
43
|
+
};
|
|
44
|
+
export type BusinessActionKind = keyof typeof BUSINESS_ACTIONS;
|
|
45
|
+
/** What a supplier account signs as a `SupplierAction`. The demo lock takes only a withdrawal. */
|
|
46
|
+
export declare const SUPPLIER_ACTIONS: {
|
|
47
|
+
readonly withdrawReport: 0;
|
|
48
|
+
};
|
|
49
|
+
export type SupplierActionKind = keyof typeof SUPPLIER_ACTIONS;
|
|
50
|
+
/**
|
|
51
|
+
* Both sides sign the same agreement, which moves a commitment from draft to agreed. The buyer's
|
|
52
|
+
* agent key signs under its mandate, and the supplier's signing key signs for the supplier.
|
|
53
|
+
*/
|
|
54
|
+
export interface TermsAgreement {
|
|
55
|
+
commitmentId: Hex;
|
|
56
|
+
termsHash: Hex;
|
|
57
|
+
category: string;
|
|
58
|
+
buyerBusinessId: string;
|
|
59
|
+
supplierBusinessId: string;
|
|
60
|
+
mandateHash: Hex;
|
|
61
|
+
nonce: bigint;
|
|
62
|
+
/** When the offer lapses. */
|
|
63
|
+
expiry: bigint;
|
|
64
|
+
}
|
|
65
|
+
/** One kind of charge in a commitment's terms: the most it can take, and when it can first be reported. */
|
|
66
|
+
export interface Charge {
|
|
67
|
+
kind: ChargeKind;
|
|
68
|
+
/** Base units of the token, never more than the reserve. */
|
|
69
|
+
most: bigint;
|
|
70
|
+
/** From `freeCancelBy` and before `chargeDeadline`. */
|
|
71
|
+
earliest: bigint;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Avow's approval of the mandate check, which the lock requires before it takes a reserve. It
|
|
75
|
+
* carries every field the lock stores for the commitment, in the lock's order. Amounts are the
|
|
76
|
+
* token's base units, since the lock enforces them. In the demo factory, which has no supplier
|
|
77
|
+
* directory, it also names the supplier's account, signing key and payout.
|
|
78
|
+
*/
|
|
79
|
+
export interface Approval {
|
|
80
|
+
commitmentId: Hex;
|
|
81
|
+
side: Side;
|
|
82
|
+
token: Address;
|
|
83
|
+
amount: bigint;
|
|
84
|
+
/** The supplier's account, on the business's approved list, which consents to releases. */
|
|
85
|
+
supplier: Address;
|
|
86
|
+
/** The supplier's signing key, which accepts reserves and reports charges. */
|
|
87
|
+
supplierSigner: Address;
|
|
88
|
+
/** Where any charge is paid, copied into the commitment. */
|
|
89
|
+
payee: Address;
|
|
90
|
+
freeCancelBy: bigint;
|
|
91
|
+
acceptBy: bigint;
|
|
92
|
+
chargeDeadline: bigint;
|
|
93
|
+
releaseDate: bigint;
|
|
94
|
+
contestWindow: bigint;
|
|
95
|
+
charges: readonly Charge[];
|
|
96
|
+
/** The supplier's share of a confirmed charge still unruled at day 90, in basis points. */
|
|
97
|
+
day90SupplierShareBps: number;
|
|
98
|
+
/** The fallback arbiter from the agreed terms, who can rule from day 30 to day 90. */
|
|
99
|
+
arbiter: Address;
|
|
100
|
+
termsHash: Hex;
|
|
101
|
+
mandateHash: Hex;
|
|
102
|
+
capPerCommitment: bigint;
|
|
103
|
+
capOpenReserves: bigint;
|
|
104
|
+
/**
|
|
105
|
+
* The key the reserve must come from, so the lock can check which key signed (rule 4). The
|
|
106
|
+
* zero address means the account's root key, the administrator's passkey.
|
|
107
|
+
*/
|
|
108
|
+
fundingKey: Address;
|
|
109
|
+
nonce: bigint;
|
|
110
|
+
expiry: bigint;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The supplier's acceptance of a funded reserve, signed by its signing key. It names the digest of
|
|
114
|
+
* Avow's approval that funded the reserve, which covers every term that approval sets for the
|
|
115
|
+
* commitment, and the lock's own settings through the lock's address in its domain. Any change to
|
|
116
|
+
* the approval gives another digest, and the lock refuses the acceptance. The supplier is bound by
|
|
117
|
+
* everything the approval says, so it gets an acceptance to sign from the verifier's
|
|
118
|
+
* `prepareAcceptance`, which checks the approval against the supplier's own terms and the lock
|
|
119
|
+
* first. The lock checks only the signature and the digest, so it takes a correctly signed
|
|
120
|
+
* acceptance however it was built.
|
|
121
|
+
*/
|
|
122
|
+
export interface Acceptance {
|
|
123
|
+
commitmentId: Hex;
|
|
124
|
+
side: Side;
|
|
125
|
+
/** `approvalDigest` of the approval the lock took, which the lock stores and emits as `approvalHash`. */
|
|
126
|
+
approvalHash: Hex;
|
|
127
|
+
termsHash: Hex;
|
|
128
|
+
/** Base units of the token. */
|
|
129
|
+
amount: bigint;
|
|
130
|
+
token: Address;
|
|
131
|
+
acceptBy: bigint;
|
|
132
|
+
nonce: bigint;
|
|
133
|
+
expiry: bigint;
|
|
134
|
+
}
|
|
135
|
+
/** The supplier's report of a charge, signed by its signing key. Avow confirms it or refers it. */
|
|
136
|
+
export interface ChargeReport {
|
|
137
|
+
commitmentId: Hex;
|
|
138
|
+
side: Side;
|
|
139
|
+
kind: ChargeKind;
|
|
140
|
+
/** Base units of the token, within the kind's most. */
|
|
141
|
+
amount: bigint;
|
|
142
|
+
evidenceHash: Hex;
|
|
143
|
+
nonce: bigint;
|
|
144
|
+
expiry: bigint;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* The supplier account's consent to give a reserve back, signed by its root key or an admin key. It
|
|
148
|
+
* names a report count, and the lock takes it only while the commitment's count is that number, so
|
|
149
|
+
* a report filed after the supplier signed for the current count voids it. A consent that names a
|
|
150
|
+
* later count than the commitment has becomes valid once reports reach that count, which is
|
|
151
|
+
* preauthorization, so the verifier's `prepareReleaseConsent` makes the signer confirm it.
|
|
152
|
+
*/
|
|
153
|
+
export interface ReleaseConsent {
|
|
154
|
+
commitmentId: Hex;
|
|
155
|
+
side: Side;
|
|
156
|
+
/** The lock's `reportCount` for the commitment, which counts every report ever filed. */
|
|
157
|
+
reportCount: number;
|
|
158
|
+
reason: ReleaseReason;
|
|
159
|
+
evidenceHash: Hex;
|
|
160
|
+
nonce: bigint;
|
|
161
|
+
expiry: bigint;
|
|
162
|
+
}
|
|
163
|
+
/** One piece of the supplier's evidence on a paused charge, signed by its signing key. */
|
|
164
|
+
export interface SupplierEvidence {
|
|
165
|
+
commitmentId: Hex;
|
|
166
|
+
side: Side;
|
|
167
|
+
/**
|
|
168
|
+
* The supplier's next evidence number on this commitment. Each side numbers its own evidence,
|
|
169
|
+
* so the business's filings never void the supplier's signed evidence.
|
|
170
|
+
*/
|
|
171
|
+
number: number;
|
|
172
|
+
evidenceHash: Hex;
|
|
173
|
+
nonce: bigint;
|
|
174
|
+
expiry: bigint;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* An action the business signs with its root key or an admin key, which any account can send to
|
|
178
|
+
* the lock. Each action reads only its own fields, and the rest are zero. For a change to the
|
|
179
|
+
* approved suppliers, the nonce is the supplier's change count on the lock when the business
|
|
180
|
+
* signs, so a change signed before a later one can't land after it.
|
|
181
|
+
*/
|
|
182
|
+
export interface BusinessAction {
|
|
183
|
+
action: BusinessActionKind;
|
|
184
|
+
commitmentId: Hex;
|
|
185
|
+
side: Side;
|
|
186
|
+
/** A contest names the report it contests. */
|
|
187
|
+
reportNumber: number;
|
|
188
|
+
/** A contest's reason code. */
|
|
189
|
+
reasonCode: number;
|
|
190
|
+
/** The business's next evidence number on the commitment. */
|
|
191
|
+
evidenceNumber: number;
|
|
192
|
+
/** A contest's statement hash, or evidence's hash. */
|
|
193
|
+
dataHash: Hex;
|
|
194
|
+
/** The supplier account to approve or remove. */
|
|
195
|
+
supplier: Address;
|
|
196
|
+
nonce: bigint;
|
|
197
|
+
expiry: bigint;
|
|
198
|
+
}
|
|
199
|
+
/** An action the supplier account signs with its root key or an admin key. */
|
|
200
|
+
export interface SupplierAction {
|
|
201
|
+
supplier: Address;
|
|
202
|
+
action: SupplierActionKind;
|
|
203
|
+
commitmentId: Hex;
|
|
204
|
+
side: Side;
|
|
205
|
+
reportNumber: number;
|
|
206
|
+
nonce: bigint;
|
|
207
|
+
expiry: bigint;
|
|
208
|
+
}
|
|
209
|
+
/** What a supplier receives before it grants capacity, valid for five minutes. */
|
|
210
|
+
export interface SupplierAuthorization {
|
|
211
|
+
commitmentId: Hex;
|
|
212
|
+
termsHash: Hex;
|
|
213
|
+
salt: Hex;
|
|
214
|
+
/** Base units of the token. */
|
|
215
|
+
amount: bigint;
|
|
216
|
+
token: Address;
|
|
217
|
+
buyerBusinessId: string;
|
|
218
|
+
kybReference: string;
|
|
219
|
+
kybTestData: boolean;
|
|
220
|
+
agentKey: Address;
|
|
221
|
+
/** The transaction that authorized the agent's key, where Tempo logged the mandate's hash. */
|
|
222
|
+
agentKeyAuthorizedIn: Hex;
|
|
223
|
+
mandateHash: Hex;
|
|
224
|
+
payee: Address;
|
|
225
|
+
acceptBy: bigint;
|
|
226
|
+
chargeDeadline: bigint;
|
|
227
|
+
releaseDate: bigint;
|
|
228
|
+
nonce: bigint;
|
|
229
|
+
expiry: bigint;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* The administrator's approval of one reserve. It approves only the commitment, terms, amount
|
|
233
|
+
* and supplier it names. The amount is micros of the terms' currency.
|
|
234
|
+
*/
|
|
235
|
+
export interface HumanApproval {
|
|
236
|
+
mandateHash: Hex;
|
|
237
|
+
commitmentId: Hex;
|
|
238
|
+
termsHash: Hex;
|
|
239
|
+
supplier: string;
|
|
240
|
+
payee: Address;
|
|
241
|
+
amount: bigint;
|
|
242
|
+
nonce: bigint;
|
|
243
|
+
expiry: bigint;
|
|
244
|
+
}
|
|
245
|
+
/** The supplier's receipt for a start request Avow timestamped. */
|
|
246
|
+
export interface StartReceipt {
|
|
247
|
+
commitmentId: Hex;
|
|
248
|
+
side: Side;
|
|
249
|
+
startRequestHash: Hex;
|
|
250
|
+
startedAt: bigint;
|
|
251
|
+
nonce: bigint;
|
|
252
|
+
expiry: bigint;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* One request to Avow's API, signed by the key that sends it: an agent key the business enrolled,
|
|
256
|
+
* or a supplier's signing key. The signature names the deployment, the method, the path and the
|
|
257
|
+
* hash of the exact body bytes, so it fits no other request. The domain names the chain and the
|
|
258
|
+
* lock of the business the request concerns. `requestId` names the operation. An identical repeat
|
|
259
|
+
* gets the first answer without repeating anything, and the same id with any other content is
|
|
260
|
+
* refused. A signed request proves who asked for what and when Avow received it, and nothing
|
|
261
|
+
* about what the lock or the chain did after. `signed-requests.md` sets out every rule.
|
|
262
|
+
*/
|
|
263
|
+
export interface ApiRequest {
|
|
264
|
+
/**
|
|
265
|
+
* The deployment the request is for, written as the API's origin in lower case with no trailing
|
|
266
|
+
* slash, such as `https://api.testnet.avow.finance`. Each deployment has its own, so a request for
|
|
267
|
+
* one can't run on another, even on the same chain.
|
|
268
|
+
*/
|
|
269
|
+
audience: string;
|
|
270
|
+
/** `GET` or `POST`. */
|
|
271
|
+
method: string;
|
|
272
|
+
/** The path as sent, such as `/v1/reserve-approvals`, with no query. */
|
|
273
|
+
path: string;
|
|
274
|
+
/** keccak256 of the body's exact bytes, or of no bytes for a request with no body. */
|
|
275
|
+
bodyHash: Hex;
|
|
276
|
+
/** The key's own address. A passkey's signature doesn't name its signer, so the request does. */
|
|
277
|
+
signer: Address;
|
|
278
|
+
/** 32 random bytes the signer picks for each operation. */
|
|
279
|
+
requestId: Hex;
|
|
280
|
+
expiry: bigint;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Avow's timestamp on a signed request it received, such as a business asking to start a job or
|
|
284
|
+
* cancelling one. It's signed with a key Avow uses for nothing else, and names the request by its
|
|
285
|
+
* EIP-712 digest, so it proves when Avow received exactly that request, whoever later holds it. It
|
|
286
|
+
* carries no nonce or expiry, since it states a fact and authorizes nothing.
|
|
287
|
+
*/
|
|
288
|
+
export interface Timestamp {
|
|
289
|
+
/** The digest of the signed `ApiRequest` Avow received. */
|
|
290
|
+
requestHash: Hex;
|
|
291
|
+
/** When Avow received it, in unix seconds by Avow's clock. */
|
|
292
|
+
receivedAt: bigint;
|
|
293
|
+
}
|
|
294
|
+
export declare const MANDATE_TYPES: {
|
|
295
|
+
readonly PaymentLimit: readonly [{
|
|
296
|
+
readonly name: 'token';
|
|
297
|
+
readonly type: 'address';
|
|
298
|
+
}, {
|
|
299
|
+
readonly name: 'amount';
|
|
300
|
+
readonly type: 'uint256';
|
|
301
|
+
}, {
|
|
302
|
+
readonly name: 'period';
|
|
303
|
+
readonly type: 'uint64';
|
|
304
|
+
}];
|
|
305
|
+
readonly Mandate: readonly [{
|
|
306
|
+
readonly name: 'mandateId';
|
|
307
|
+
readonly type: 'bytes32';
|
|
308
|
+
}, {
|
|
309
|
+
readonly name: 'businessId';
|
|
310
|
+
readonly type: 'string';
|
|
311
|
+
}, {
|
|
312
|
+
readonly name: 'agentId';
|
|
313
|
+
readonly type: 'string';
|
|
314
|
+
}, {
|
|
315
|
+
readonly name: 'account';
|
|
316
|
+
readonly type: 'address';
|
|
317
|
+
}, {
|
|
318
|
+
readonly name: 'agentKey';
|
|
319
|
+
readonly type: 'address';
|
|
320
|
+
}, {
|
|
321
|
+
readonly name: 'actions';
|
|
322
|
+
readonly type: 'string[]';
|
|
323
|
+
}, {
|
|
324
|
+
readonly name: 'currency';
|
|
325
|
+
readonly type: 'string';
|
|
326
|
+
}, {
|
|
327
|
+
readonly name: 'capPerCommitment';
|
|
328
|
+
readonly type: 'uint256';
|
|
329
|
+
}, {
|
|
330
|
+
readonly name: 'capOpenReserves';
|
|
331
|
+
readonly type: 'uint256';
|
|
332
|
+
}, {
|
|
333
|
+
readonly name: 'suppliers';
|
|
334
|
+
readonly type: 'string[]';
|
|
335
|
+
}, {
|
|
336
|
+
readonly name: 'categories';
|
|
337
|
+
readonly type: 'string[]';
|
|
338
|
+
}, {
|
|
339
|
+
readonly name: 'paymentLimits';
|
|
340
|
+
readonly type: 'PaymentLimit[]';
|
|
341
|
+
}, {
|
|
342
|
+
readonly name: 'approvalRule';
|
|
343
|
+
readonly type: 'uint8';
|
|
344
|
+
}, {
|
|
345
|
+
readonly name: 'approvalAbove';
|
|
346
|
+
readonly type: 'uint256';
|
|
347
|
+
}, {
|
|
348
|
+
readonly name: 'expiry';
|
|
349
|
+
readonly type: 'uint64';
|
|
350
|
+
}, {
|
|
351
|
+
readonly name: 'nonce';
|
|
352
|
+
readonly type: 'uint256';
|
|
353
|
+
}];
|
|
354
|
+
};
|
|
355
|
+
export declare const TERMS_AGREEMENT_TYPES: {
|
|
356
|
+
readonly TermsAgreement: readonly [{
|
|
357
|
+
readonly name: 'commitmentId';
|
|
358
|
+
readonly type: 'bytes32';
|
|
359
|
+
}, {
|
|
360
|
+
readonly name: 'termsHash';
|
|
361
|
+
readonly type: 'bytes32';
|
|
362
|
+
}, {
|
|
363
|
+
readonly name: 'category';
|
|
364
|
+
readonly type: 'string';
|
|
365
|
+
}, {
|
|
366
|
+
readonly name: 'buyerBusinessId';
|
|
367
|
+
readonly type: 'string';
|
|
368
|
+
}, {
|
|
369
|
+
readonly name: 'supplierBusinessId';
|
|
370
|
+
readonly type: 'string';
|
|
371
|
+
}, {
|
|
372
|
+
readonly name: 'mandateHash';
|
|
373
|
+
readonly type: 'bytes32';
|
|
374
|
+
}, {
|
|
375
|
+
readonly name: 'nonce';
|
|
376
|
+
readonly type: 'uint256';
|
|
377
|
+
}, {
|
|
378
|
+
readonly name: 'expiry';
|
|
379
|
+
readonly type: 'uint64';
|
|
380
|
+
}];
|
|
381
|
+
};
|
|
382
|
+
/** The lock's `Approval`, field for field, as the lock checks it. */
|
|
383
|
+
export declare const APPROVAL_TYPES: {
|
|
384
|
+
readonly Approval: readonly [{
|
|
385
|
+
readonly name: 'commitmentId';
|
|
386
|
+
readonly type: 'bytes32';
|
|
387
|
+
}, {
|
|
388
|
+
readonly name: 'side';
|
|
389
|
+
readonly type: 'uint8';
|
|
390
|
+
}, {
|
|
391
|
+
readonly name: 'token';
|
|
392
|
+
readonly type: 'address';
|
|
393
|
+
}, {
|
|
394
|
+
readonly name: 'amount';
|
|
395
|
+
readonly type: 'uint256';
|
|
396
|
+
}, {
|
|
397
|
+
readonly name: 'supplier';
|
|
398
|
+
readonly type: 'address';
|
|
399
|
+
}, {
|
|
400
|
+
readonly name: 'supplierSigner';
|
|
401
|
+
readonly type: 'address';
|
|
402
|
+
}, {
|
|
403
|
+
readonly name: 'payee';
|
|
404
|
+
readonly type: 'address';
|
|
405
|
+
}, {
|
|
406
|
+
readonly name: 'freeCancelBy';
|
|
407
|
+
readonly type: 'uint64';
|
|
408
|
+
}, {
|
|
409
|
+
readonly name: 'acceptBy';
|
|
410
|
+
readonly type: 'uint64';
|
|
411
|
+
}, {
|
|
412
|
+
readonly name: 'chargeDeadline';
|
|
413
|
+
readonly type: 'uint64';
|
|
414
|
+
}, {
|
|
415
|
+
readonly name: 'releaseDate';
|
|
416
|
+
readonly type: 'uint64';
|
|
417
|
+
}, {
|
|
418
|
+
readonly name: 'contestWindow';
|
|
419
|
+
readonly type: 'uint64';
|
|
420
|
+
}, {
|
|
421
|
+
readonly name: 'charges';
|
|
422
|
+
readonly type: 'Charge[]';
|
|
423
|
+
}, {
|
|
424
|
+
readonly name: 'day90SupplierShareBps';
|
|
425
|
+
readonly type: 'uint16';
|
|
426
|
+
}, {
|
|
427
|
+
readonly name: 'arbiter';
|
|
428
|
+
readonly type: 'address';
|
|
429
|
+
}, {
|
|
430
|
+
readonly name: 'termsHash';
|
|
431
|
+
readonly type: 'bytes32';
|
|
432
|
+
}, {
|
|
433
|
+
readonly name: 'mandateHash';
|
|
434
|
+
readonly type: 'bytes32';
|
|
435
|
+
}, {
|
|
436
|
+
readonly name: 'capPerCommitment';
|
|
437
|
+
readonly type: 'uint256';
|
|
438
|
+
}, {
|
|
439
|
+
readonly name: 'capOpenReserves';
|
|
440
|
+
readonly type: 'uint256';
|
|
441
|
+
}, {
|
|
442
|
+
readonly name: 'fundingKey';
|
|
443
|
+
readonly type: 'address';
|
|
444
|
+
}, {
|
|
445
|
+
readonly name: 'nonce';
|
|
446
|
+
readonly type: 'uint256';
|
|
447
|
+
}, {
|
|
448
|
+
readonly name: 'expiry';
|
|
449
|
+
readonly type: 'uint64';
|
|
450
|
+
}];
|
|
451
|
+
readonly Charge: readonly [{
|
|
452
|
+
readonly name: 'kind';
|
|
453
|
+
readonly type: 'uint8';
|
|
454
|
+
}, {
|
|
455
|
+
readonly name: 'most';
|
|
456
|
+
readonly type: 'uint256';
|
|
457
|
+
}, {
|
|
458
|
+
readonly name: 'earliest';
|
|
459
|
+
readonly type: 'uint64';
|
|
460
|
+
}];
|
|
461
|
+
};
|
|
462
|
+
export declare const ACCEPTANCE_TYPES: {
|
|
463
|
+
readonly Acceptance: readonly [{
|
|
464
|
+
readonly name: 'commitmentId';
|
|
465
|
+
readonly type: 'bytes32';
|
|
466
|
+
}, {
|
|
467
|
+
readonly name: 'side';
|
|
468
|
+
readonly type: 'uint8';
|
|
469
|
+
}, {
|
|
470
|
+
readonly name: 'approvalHash';
|
|
471
|
+
readonly type: 'bytes32';
|
|
472
|
+
}, {
|
|
473
|
+
readonly name: 'termsHash';
|
|
474
|
+
readonly type: 'bytes32';
|
|
475
|
+
}, {
|
|
476
|
+
readonly name: 'amount';
|
|
477
|
+
readonly type: 'uint256';
|
|
478
|
+
}, {
|
|
479
|
+
readonly name: 'token';
|
|
480
|
+
readonly type: 'address';
|
|
481
|
+
}, {
|
|
482
|
+
readonly name: 'acceptBy';
|
|
483
|
+
readonly type: 'uint64';
|
|
484
|
+
}, {
|
|
485
|
+
readonly name: 'nonce';
|
|
486
|
+
readonly type: 'uint256';
|
|
487
|
+
}, {
|
|
488
|
+
readonly name: 'expiry';
|
|
489
|
+
readonly type: 'uint64';
|
|
490
|
+
}];
|
|
491
|
+
};
|
|
492
|
+
export declare const REPORT_TYPES: {
|
|
493
|
+
readonly Report: readonly [{
|
|
494
|
+
readonly name: 'commitmentId';
|
|
495
|
+
readonly type: 'bytes32';
|
|
496
|
+
}, {
|
|
497
|
+
readonly name: 'side';
|
|
498
|
+
readonly type: 'uint8';
|
|
499
|
+
}, {
|
|
500
|
+
readonly name: 'kind';
|
|
501
|
+
readonly type: 'uint8';
|
|
502
|
+
}, {
|
|
503
|
+
readonly name: 'amount';
|
|
504
|
+
readonly type: 'uint256';
|
|
505
|
+
}, {
|
|
506
|
+
readonly name: 'evidenceHash';
|
|
507
|
+
readonly type: 'bytes32';
|
|
508
|
+
}, {
|
|
509
|
+
readonly name: 'nonce';
|
|
510
|
+
readonly type: 'uint256';
|
|
511
|
+
}, {
|
|
512
|
+
readonly name: 'expiry';
|
|
513
|
+
readonly type: 'uint64';
|
|
514
|
+
}];
|
|
515
|
+
};
|
|
516
|
+
export declare const RELEASE_CONSENT_TYPES: {
|
|
517
|
+
readonly ReleaseConsent: readonly [{
|
|
518
|
+
readonly name: 'commitmentId';
|
|
519
|
+
readonly type: 'bytes32';
|
|
520
|
+
}, {
|
|
521
|
+
readonly name: 'side';
|
|
522
|
+
readonly type: 'uint8';
|
|
523
|
+
}, {
|
|
524
|
+
readonly name: 'reportCount';
|
|
525
|
+
readonly type: 'uint8';
|
|
526
|
+
}, {
|
|
527
|
+
readonly name: 'reason';
|
|
528
|
+
readonly type: 'uint8';
|
|
529
|
+
}, {
|
|
530
|
+
readonly name: 'evidenceHash';
|
|
531
|
+
readonly type: 'bytes32';
|
|
532
|
+
}, {
|
|
533
|
+
readonly name: 'nonce';
|
|
534
|
+
readonly type: 'uint256';
|
|
535
|
+
}, {
|
|
536
|
+
readonly name: 'expiry';
|
|
537
|
+
readonly type: 'uint64';
|
|
538
|
+
}];
|
|
539
|
+
};
|
|
540
|
+
export declare const EVIDENCE_TYPES: {
|
|
541
|
+
readonly Evidence: readonly [{
|
|
542
|
+
readonly name: 'commitmentId';
|
|
543
|
+
readonly type: 'bytes32';
|
|
544
|
+
}, {
|
|
545
|
+
readonly name: 'side';
|
|
546
|
+
readonly type: 'uint8';
|
|
547
|
+
}, {
|
|
548
|
+
readonly name: 'number';
|
|
549
|
+
readonly type: 'uint16';
|
|
550
|
+
}, {
|
|
551
|
+
readonly name: 'evidenceHash';
|
|
552
|
+
readonly type: 'bytes32';
|
|
553
|
+
}, {
|
|
554
|
+
readonly name: 'nonce';
|
|
555
|
+
readonly type: 'uint256';
|
|
556
|
+
}, {
|
|
557
|
+
readonly name: 'expiry';
|
|
558
|
+
readonly type: 'uint64';
|
|
559
|
+
}];
|
|
560
|
+
};
|
|
561
|
+
export declare const BUSINESS_ACTION_TYPES: {
|
|
562
|
+
readonly BusinessAction: readonly [{
|
|
563
|
+
readonly name: 'action';
|
|
564
|
+
readonly type: 'uint8';
|
|
565
|
+
}, {
|
|
566
|
+
readonly name: 'commitmentId';
|
|
567
|
+
readonly type: 'bytes32';
|
|
568
|
+
}, {
|
|
569
|
+
readonly name: 'side';
|
|
570
|
+
readonly type: 'uint8';
|
|
571
|
+
}, {
|
|
572
|
+
readonly name: 'reportNumber';
|
|
573
|
+
readonly type: 'uint8';
|
|
574
|
+
}, {
|
|
575
|
+
readonly name: 'reasonCode';
|
|
576
|
+
readonly type: 'uint16';
|
|
577
|
+
}, {
|
|
578
|
+
readonly name: 'evidenceNumber';
|
|
579
|
+
readonly type: 'uint16';
|
|
580
|
+
}, {
|
|
581
|
+
readonly name: 'dataHash';
|
|
582
|
+
readonly type: 'bytes32';
|
|
583
|
+
}, {
|
|
584
|
+
readonly name: 'supplier';
|
|
585
|
+
readonly type: 'address';
|
|
586
|
+
}, {
|
|
587
|
+
readonly name: 'nonce';
|
|
588
|
+
readonly type: 'uint256';
|
|
589
|
+
}, {
|
|
590
|
+
readonly name: 'expiry';
|
|
591
|
+
readonly type: 'uint64';
|
|
592
|
+
}];
|
|
593
|
+
};
|
|
594
|
+
export declare const SUPPLIER_ACTION_TYPES: {
|
|
595
|
+
readonly SupplierAction: readonly [{
|
|
596
|
+
readonly name: 'supplier';
|
|
597
|
+
readonly type: 'address';
|
|
598
|
+
}, {
|
|
599
|
+
readonly name: 'action';
|
|
600
|
+
readonly type: 'uint8';
|
|
601
|
+
}, {
|
|
602
|
+
readonly name: 'commitmentId';
|
|
603
|
+
readonly type: 'bytes32';
|
|
604
|
+
}, {
|
|
605
|
+
readonly name: 'side';
|
|
606
|
+
readonly type: 'uint8';
|
|
607
|
+
}, {
|
|
608
|
+
readonly name: 'reportNumber';
|
|
609
|
+
readonly type: 'uint8';
|
|
610
|
+
}, {
|
|
611
|
+
readonly name: 'nonce';
|
|
612
|
+
readonly type: 'uint256';
|
|
613
|
+
}, {
|
|
614
|
+
readonly name: 'expiry';
|
|
615
|
+
readonly type: 'uint64';
|
|
616
|
+
}];
|
|
617
|
+
};
|
|
618
|
+
export declare const SUPPLIER_AUTHORIZATION_TYPES: {
|
|
619
|
+
readonly SupplierAuthorization: readonly [{
|
|
620
|
+
readonly name: 'commitmentId';
|
|
621
|
+
readonly type: 'bytes32';
|
|
622
|
+
}, {
|
|
623
|
+
readonly name: 'termsHash';
|
|
624
|
+
readonly type: 'bytes32';
|
|
625
|
+
}, {
|
|
626
|
+
readonly name: 'salt';
|
|
627
|
+
readonly type: 'bytes32';
|
|
628
|
+
}, {
|
|
629
|
+
readonly name: 'amount';
|
|
630
|
+
readonly type: 'uint256';
|
|
631
|
+
}, {
|
|
632
|
+
readonly name: 'token';
|
|
633
|
+
readonly type: 'address';
|
|
634
|
+
}, {
|
|
635
|
+
readonly name: 'buyerBusinessId';
|
|
636
|
+
readonly type: 'string';
|
|
637
|
+
}, {
|
|
638
|
+
readonly name: 'kybReference';
|
|
639
|
+
readonly type: 'string';
|
|
640
|
+
}, {
|
|
641
|
+
readonly name: 'kybTestData';
|
|
642
|
+
readonly type: 'bool';
|
|
643
|
+
}, {
|
|
644
|
+
readonly name: 'agentKey';
|
|
645
|
+
readonly type: 'address';
|
|
646
|
+
}, {
|
|
647
|
+
readonly name: 'agentKeyAuthorizedIn';
|
|
648
|
+
readonly type: 'bytes32';
|
|
649
|
+
}, {
|
|
650
|
+
readonly name: 'mandateHash';
|
|
651
|
+
readonly type: 'bytes32';
|
|
652
|
+
}, {
|
|
653
|
+
readonly name: 'payee';
|
|
654
|
+
readonly type: 'address';
|
|
655
|
+
}, {
|
|
656
|
+
readonly name: 'acceptBy';
|
|
657
|
+
readonly type: 'uint64';
|
|
658
|
+
}, {
|
|
659
|
+
readonly name: 'chargeDeadline';
|
|
660
|
+
readonly type: 'uint64';
|
|
661
|
+
}, {
|
|
662
|
+
readonly name: 'releaseDate';
|
|
663
|
+
readonly type: 'uint64';
|
|
664
|
+
}, {
|
|
665
|
+
readonly name: 'nonce';
|
|
666
|
+
readonly type: 'uint256';
|
|
667
|
+
}, {
|
|
668
|
+
readonly name: 'expiry';
|
|
669
|
+
readonly type: 'uint64';
|
|
670
|
+
}];
|
|
671
|
+
};
|
|
672
|
+
export declare const HUMAN_APPROVAL_TYPES: {
|
|
673
|
+
readonly HumanApproval: readonly [{
|
|
674
|
+
readonly name: 'mandateHash';
|
|
675
|
+
readonly type: 'bytes32';
|
|
676
|
+
}, {
|
|
677
|
+
readonly name: 'commitmentId';
|
|
678
|
+
readonly type: 'bytes32';
|
|
679
|
+
}, {
|
|
680
|
+
readonly name: 'termsHash';
|
|
681
|
+
readonly type: 'bytes32';
|
|
682
|
+
}, {
|
|
683
|
+
readonly name: 'supplier';
|
|
684
|
+
readonly type: 'string';
|
|
685
|
+
}, {
|
|
686
|
+
readonly name: 'payee';
|
|
687
|
+
readonly type: 'address';
|
|
688
|
+
}, {
|
|
689
|
+
readonly name: 'amount';
|
|
690
|
+
readonly type: 'uint256';
|
|
691
|
+
}, {
|
|
692
|
+
readonly name: 'nonce';
|
|
693
|
+
readonly type: 'uint256';
|
|
694
|
+
}, {
|
|
695
|
+
readonly name: 'expiry';
|
|
696
|
+
readonly type: 'uint64';
|
|
697
|
+
}];
|
|
698
|
+
};
|
|
699
|
+
export declare const START_RECEIPT_TYPES: {
|
|
700
|
+
readonly StartReceipt: readonly [{
|
|
701
|
+
readonly name: 'commitmentId';
|
|
702
|
+
readonly type: 'bytes32';
|
|
703
|
+
}, {
|
|
704
|
+
readonly name: 'side';
|
|
705
|
+
readonly type: 'uint8';
|
|
706
|
+
}, {
|
|
707
|
+
readonly name: 'startRequestHash';
|
|
708
|
+
readonly type: 'bytes32';
|
|
709
|
+
}, {
|
|
710
|
+
readonly name: 'startedAt';
|
|
711
|
+
readonly type: 'uint64';
|
|
712
|
+
}, {
|
|
713
|
+
readonly name: 'nonce';
|
|
714
|
+
readonly type: 'uint256';
|
|
715
|
+
}, {
|
|
716
|
+
readonly name: 'expiry';
|
|
717
|
+
readonly type: 'uint64';
|
|
718
|
+
}];
|
|
719
|
+
};
|
|
720
|
+
export declare const API_REQUEST_TYPES: {
|
|
721
|
+
readonly ApiRequest: readonly [{
|
|
722
|
+
readonly name: 'audience';
|
|
723
|
+
readonly type: 'string';
|
|
724
|
+
}, {
|
|
725
|
+
readonly name: 'method';
|
|
726
|
+
readonly type: 'string';
|
|
727
|
+
}, {
|
|
728
|
+
readonly name: 'path';
|
|
729
|
+
readonly type: 'string';
|
|
730
|
+
}, {
|
|
731
|
+
readonly name: 'bodyHash';
|
|
732
|
+
readonly type: 'bytes32';
|
|
733
|
+
}, {
|
|
734
|
+
readonly name: 'signer';
|
|
735
|
+
readonly type: 'address';
|
|
736
|
+
}, {
|
|
737
|
+
readonly name: 'requestId';
|
|
738
|
+
readonly type: 'bytes32';
|
|
739
|
+
}, {
|
|
740
|
+
readonly name: 'expiry';
|
|
741
|
+
readonly type: 'uint64';
|
|
742
|
+
}];
|
|
743
|
+
};
|
|
744
|
+
export declare const TIMESTAMP_TYPES: {
|
|
745
|
+
readonly Timestamp: readonly [{
|
|
746
|
+
readonly name: 'requestHash';
|
|
747
|
+
readonly type: 'bytes32';
|
|
748
|
+
}, {
|
|
749
|
+
readonly name: 'receivedAt';
|
|
750
|
+
readonly type: 'uint64';
|
|
751
|
+
}];
|
|
752
|
+
};
|
|
753
|
+
export declare function mandateTypedData(m: Mandate, d: AvowDomain): {
|
|
754
|
+
domain: TypedDataDomain;
|
|
755
|
+
types: {
|
|
756
|
+
readonly PaymentLimit: readonly [{
|
|
757
|
+
readonly name: 'token';
|
|
758
|
+
readonly type: 'address';
|
|
759
|
+
}, {
|
|
760
|
+
readonly name: 'amount';
|
|
761
|
+
readonly type: 'uint256';
|
|
762
|
+
}, {
|
|
763
|
+
readonly name: 'period';
|
|
764
|
+
readonly type: 'uint64';
|
|
765
|
+
}];
|
|
766
|
+
readonly Mandate: readonly [{
|
|
767
|
+
readonly name: 'mandateId';
|
|
768
|
+
readonly type: 'bytes32';
|
|
769
|
+
}, {
|
|
770
|
+
readonly name: 'businessId';
|
|
771
|
+
readonly type: 'string';
|
|
772
|
+
}, {
|
|
773
|
+
readonly name: 'agentId';
|
|
774
|
+
readonly type: 'string';
|
|
775
|
+
}, {
|
|
776
|
+
readonly name: 'account';
|
|
777
|
+
readonly type: 'address';
|
|
778
|
+
}, {
|
|
779
|
+
readonly name: 'agentKey';
|
|
780
|
+
readonly type: 'address';
|
|
781
|
+
}, {
|
|
782
|
+
readonly name: 'actions';
|
|
783
|
+
readonly type: 'string[]';
|
|
784
|
+
}, {
|
|
785
|
+
readonly name: 'currency';
|
|
786
|
+
readonly type: 'string';
|
|
787
|
+
}, {
|
|
788
|
+
readonly name: 'capPerCommitment';
|
|
789
|
+
readonly type: 'uint256';
|
|
790
|
+
}, {
|
|
791
|
+
readonly name: 'capOpenReserves';
|
|
792
|
+
readonly type: 'uint256';
|
|
793
|
+
}, {
|
|
794
|
+
readonly name: 'suppliers';
|
|
795
|
+
readonly type: 'string[]';
|
|
796
|
+
}, {
|
|
797
|
+
readonly name: 'categories';
|
|
798
|
+
readonly type: 'string[]';
|
|
799
|
+
}, {
|
|
800
|
+
readonly name: 'paymentLimits';
|
|
801
|
+
readonly type: 'PaymentLimit[]';
|
|
802
|
+
}, {
|
|
803
|
+
readonly name: 'approvalRule';
|
|
804
|
+
readonly type: 'uint8';
|
|
805
|
+
}, {
|
|
806
|
+
readonly name: 'approvalAbove';
|
|
807
|
+
readonly type: 'uint256';
|
|
808
|
+
}, {
|
|
809
|
+
readonly name: 'expiry';
|
|
810
|
+
readonly type: 'uint64';
|
|
811
|
+
}, {
|
|
812
|
+
readonly name: 'nonce';
|
|
813
|
+
readonly type: 'uint256';
|
|
814
|
+
}];
|
|
815
|
+
};
|
|
816
|
+
primaryType: 'Mandate';
|
|
817
|
+
message: {
|
|
818
|
+
mandateId: `0x${string}`;
|
|
819
|
+
businessId: string;
|
|
820
|
+
agentId: string;
|
|
821
|
+
account: `0x${string}`;
|
|
822
|
+
agentKey: `0x${string}`;
|
|
823
|
+
actions: ("cancel" | "pay" | "reserve" | "start")[];
|
|
824
|
+
currency: "USD";
|
|
825
|
+
capPerCommitment: bigint;
|
|
826
|
+
capOpenReserves: bigint;
|
|
827
|
+
suppliers: string[];
|
|
828
|
+
categories: string[];
|
|
829
|
+
paymentLimits: {
|
|
830
|
+
token: `0x${string}`;
|
|
831
|
+
amount: bigint;
|
|
832
|
+
period: bigint;
|
|
833
|
+
}[];
|
|
834
|
+
approvalRule: 0 | 1 | 2;
|
|
835
|
+
approvalAbove: bigint;
|
|
836
|
+
expiry: bigint;
|
|
837
|
+
nonce: bigint;
|
|
838
|
+
};
|
|
839
|
+
};
|
|
840
|
+
export declare function termsAgreementTypedData(a: TermsAgreement, d: AvowDomain): {
|
|
841
|
+
domain: TypedDataDomain;
|
|
842
|
+
types: {
|
|
843
|
+
readonly TermsAgreement: readonly [{
|
|
844
|
+
readonly name: 'commitmentId';
|
|
845
|
+
readonly type: 'bytes32';
|
|
846
|
+
}, {
|
|
847
|
+
readonly name: 'termsHash';
|
|
848
|
+
readonly type: 'bytes32';
|
|
849
|
+
}, {
|
|
850
|
+
readonly name: 'category';
|
|
851
|
+
readonly type: 'string';
|
|
852
|
+
}, {
|
|
853
|
+
readonly name: 'buyerBusinessId';
|
|
854
|
+
readonly type: 'string';
|
|
855
|
+
}, {
|
|
856
|
+
readonly name: 'supplierBusinessId';
|
|
857
|
+
readonly type: 'string';
|
|
858
|
+
}, {
|
|
859
|
+
readonly name: 'mandateHash';
|
|
860
|
+
readonly type: 'bytes32';
|
|
861
|
+
}, {
|
|
862
|
+
readonly name: 'nonce';
|
|
863
|
+
readonly type: 'uint256';
|
|
864
|
+
}, {
|
|
865
|
+
readonly name: 'expiry';
|
|
866
|
+
readonly type: 'uint64';
|
|
867
|
+
}];
|
|
868
|
+
};
|
|
869
|
+
primaryType: 'TermsAgreement';
|
|
870
|
+
message: {
|
|
871
|
+
commitmentId: Hex;
|
|
872
|
+
termsHash: Hex;
|
|
873
|
+
category: string;
|
|
874
|
+
buyerBusinessId: string;
|
|
875
|
+
supplierBusinessId: string;
|
|
876
|
+
mandateHash: Hex;
|
|
877
|
+
nonce: bigint;
|
|
878
|
+
/** When the offer lapses. */
|
|
879
|
+
expiry: bigint;
|
|
880
|
+
};
|
|
881
|
+
};
|
|
882
|
+
export declare function approvalTypedData(a: Approval, d: AvowDomain): {
|
|
883
|
+
domain: TypedDataDomain;
|
|
884
|
+
types: {
|
|
885
|
+
readonly Approval: readonly [{
|
|
886
|
+
readonly name: 'commitmentId';
|
|
887
|
+
readonly type: 'bytes32';
|
|
888
|
+
}, {
|
|
889
|
+
readonly name: 'side';
|
|
890
|
+
readonly type: 'uint8';
|
|
891
|
+
}, {
|
|
892
|
+
readonly name: 'token';
|
|
893
|
+
readonly type: 'address';
|
|
894
|
+
}, {
|
|
895
|
+
readonly name: 'amount';
|
|
896
|
+
readonly type: 'uint256';
|
|
897
|
+
}, {
|
|
898
|
+
readonly name: 'supplier';
|
|
899
|
+
readonly type: 'address';
|
|
900
|
+
}, {
|
|
901
|
+
readonly name: 'supplierSigner';
|
|
902
|
+
readonly type: 'address';
|
|
903
|
+
}, {
|
|
904
|
+
readonly name: 'payee';
|
|
905
|
+
readonly type: 'address';
|
|
906
|
+
}, {
|
|
907
|
+
readonly name: 'freeCancelBy';
|
|
908
|
+
readonly type: 'uint64';
|
|
909
|
+
}, {
|
|
910
|
+
readonly name: 'acceptBy';
|
|
911
|
+
readonly type: 'uint64';
|
|
912
|
+
}, {
|
|
913
|
+
readonly name: 'chargeDeadline';
|
|
914
|
+
readonly type: 'uint64';
|
|
915
|
+
}, {
|
|
916
|
+
readonly name: 'releaseDate';
|
|
917
|
+
readonly type: 'uint64';
|
|
918
|
+
}, {
|
|
919
|
+
readonly name: 'contestWindow';
|
|
920
|
+
readonly type: 'uint64';
|
|
921
|
+
}, {
|
|
922
|
+
readonly name: 'charges';
|
|
923
|
+
readonly type: 'Charge[]';
|
|
924
|
+
}, {
|
|
925
|
+
readonly name: 'day90SupplierShareBps';
|
|
926
|
+
readonly type: 'uint16';
|
|
927
|
+
}, {
|
|
928
|
+
readonly name: 'arbiter';
|
|
929
|
+
readonly type: 'address';
|
|
930
|
+
}, {
|
|
931
|
+
readonly name: 'termsHash';
|
|
932
|
+
readonly type: 'bytes32';
|
|
933
|
+
}, {
|
|
934
|
+
readonly name: 'mandateHash';
|
|
935
|
+
readonly type: 'bytes32';
|
|
936
|
+
}, {
|
|
937
|
+
readonly name: 'capPerCommitment';
|
|
938
|
+
readonly type: 'uint256';
|
|
939
|
+
}, {
|
|
940
|
+
readonly name: 'capOpenReserves';
|
|
941
|
+
readonly type: 'uint256';
|
|
942
|
+
}, {
|
|
943
|
+
readonly name: 'fundingKey';
|
|
944
|
+
readonly type: 'address';
|
|
945
|
+
}, {
|
|
946
|
+
readonly name: 'nonce';
|
|
947
|
+
readonly type: 'uint256';
|
|
948
|
+
}, {
|
|
949
|
+
readonly name: 'expiry';
|
|
950
|
+
readonly type: 'uint64';
|
|
951
|
+
}];
|
|
952
|
+
readonly Charge: readonly [{
|
|
953
|
+
readonly name: 'kind';
|
|
954
|
+
readonly type: 'uint8';
|
|
955
|
+
}, {
|
|
956
|
+
readonly name: 'most';
|
|
957
|
+
readonly type: 'uint256';
|
|
958
|
+
}, {
|
|
959
|
+
readonly name: 'earliest';
|
|
960
|
+
readonly type: 'uint64';
|
|
961
|
+
}];
|
|
962
|
+
};
|
|
963
|
+
primaryType: 'Approval';
|
|
964
|
+
message: {
|
|
965
|
+
commitmentId: Hex;
|
|
966
|
+
token: Address;
|
|
967
|
+
amount: bigint;
|
|
968
|
+
/** The supplier's account, on the business's approved list, which consents to releases. */
|
|
969
|
+
supplier: Address;
|
|
970
|
+
/** The supplier's signing key, which accepts reserves and reports charges. */
|
|
971
|
+
supplierSigner: Address;
|
|
972
|
+
/** Where any charge is paid, copied into the commitment. */
|
|
973
|
+
payee: Address;
|
|
974
|
+
freeCancelBy: bigint;
|
|
975
|
+
acceptBy: bigint;
|
|
976
|
+
chargeDeadline: bigint;
|
|
977
|
+
releaseDate: bigint;
|
|
978
|
+
contestWindow: bigint;
|
|
979
|
+
/** The supplier's share of a confirmed charge still unruled at day 90, in basis points. */
|
|
980
|
+
day90SupplierShareBps: number;
|
|
981
|
+
/** The fallback arbiter from the agreed terms, who can rule from day 30 to day 90. */
|
|
982
|
+
arbiter: Address;
|
|
983
|
+
termsHash: Hex;
|
|
984
|
+
mandateHash: Hex;
|
|
985
|
+
capPerCommitment: bigint;
|
|
986
|
+
capOpenReserves: bigint;
|
|
987
|
+
/**
|
|
988
|
+
* The key the reserve must come from, so the lock can check which key signed (rule 4). The
|
|
989
|
+
* zero address means the account's root key, the administrator's passkey.
|
|
990
|
+
*/
|
|
991
|
+
fundingKey: Address;
|
|
992
|
+
nonce: bigint;
|
|
993
|
+
expiry: bigint;
|
|
994
|
+
side: 0 | 1;
|
|
995
|
+
charges: {
|
|
996
|
+
kind: 0 | 1;
|
|
997
|
+
most: bigint;
|
|
998
|
+
earliest: bigint;
|
|
999
|
+
}[];
|
|
1000
|
+
};
|
|
1001
|
+
};
|
|
1002
|
+
/**
|
|
1003
|
+
* The digest of an approval as the lock computes it, under the lock's domain. The lock stores it at
|
|
1004
|
+
* the reserve and emits it as `approvalHash`, and the supplier's acceptance names it. The
|
|
1005
|
+
* verifier's `prepareAcceptance` computes it, checks it against the lock's, and checks the
|
|
1006
|
+
* approval's terms against the supplier's own before it builds an acceptance.
|
|
1007
|
+
*/
|
|
1008
|
+
export declare function approvalDigest(a: Approval, d: AvowDomain): Hex;
|
|
1009
|
+
/**
|
|
1010
|
+
* The EIP-712 encoding of an acceptance, with no checks. A supplier gets an acceptance to sign from
|
|
1011
|
+
* the verifier's `prepareAcceptance`, and signs it with `signAcceptance`.
|
|
1012
|
+
*/
|
|
1013
|
+
export declare function acceptanceTypedData(a: Acceptance, d: AvowDomain): {
|
|
1014
|
+
domain: TypedDataDomain;
|
|
1015
|
+
types: {
|
|
1016
|
+
readonly Acceptance: readonly [{
|
|
1017
|
+
readonly name: 'commitmentId';
|
|
1018
|
+
readonly type: 'bytes32';
|
|
1019
|
+
}, {
|
|
1020
|
+
readonly name: 'side';
|
|
1021
|
+
readonly type: 'uint8';
|
|
1022
|
+
}, {
|
|
1023
|
+
readonly name: 'approvalHash';
|
|
1024
|
+
readonly type: 'bytes32';
|
|
1025
|
+
}, {
|
|
1026
|
+
readonly name: 'termsHash';
|
|
1027
|
+
readonly type: 'bytes32';
|
|
1028
|
+
}, {
|
|
1029
|
+
readonly name: 'amount';
|
|
1030
|
+
readonly type: 'uint256';
|
|
1031
|
+
}, {
|
|
1032
|
+
readonly name: 'token';
|
|
1033
|
+
readonly type: 'address';
|
|
1034
|
+
}, {
|
|
1035
|
+
readonly name: 'acceptBy';
|
|
1036
|
+
readonly type: 'uint64';
|
|
1037
|
+
}, {
|
|
1038
|
+
readonly name: 'nonce';
|
|
1039
|
+
readonly type: 'uint256';
|
|
1040
|
+
}, {
|
|
1041
|
+
readonly name: 'expiry';
|
|
1042
|
+
readonly type: 'uint64';
|
|
1043
|
+
}];
|
|
1044
|
+
};
|
|
1045
|
+
primaryType: 'Acceptance';
|
|
1046
|
+
message: {
|
|
1047
|
+
commitmentId: Hex;
|
|
1048
|
+
/** `approvalDigest` of the approval the lock took, which the lock stores and emits as `approvalHash`. */
|
|
1049
|
+
approvalHash: Hex;
|
|
1050
|
+
termsHash: Hex;
|
|
1051
|
+
/** Base units of the token. */
|
|
1052
|
+
amount: bigint;
|
|
1053
|
+
token: Address;
|
|
1054
|
+
acceptBy: bigint;
|
|
1055
|
+
nonce: bigint;
|
|
1056
|
+
expiry: bigint;
|
|
1057
|
+
side: 0 | 1;
|
|
1058
|
+
};
|
|
1059
|
+
};
|
|
1060
|
+
export declare function reportTypedData(r: ChargeReport, d: AvowDomain): {
|
|
1061
|
+
domain: TypedDataDomain;
|
|
1062
|
+
types: {
|
|
1063
|
+
readonly Report: readonly [{
|
|
1064
|
+
readonly name: 'commitmentId';
|
|
1065
|
+
readonly type: 'bytes32';
|
|
1066
|
+
}, {
|
|
1067
|
+
readonly name: 'side';
|
|
1068
|
+
readonly type: 'uint8';
|
|
1069
|
+
}, {
|
|
1070
|
+
readonly name: 'kind';
|
|
1071
|
+
readonly type: 'uint8';
|
|
1072
|
+
}, {
|
|
1073
|
+
readonly name: 'amount';
|
|
1074
|
+
readonly type: 'uint256';
|
|
1075
|
+
}, {
|
|
1076
|
+
readonly name: 'evidenceHash';
|
|
1077
|
+
readonly type: 'bytes32';
|
|
1078
|
+
}, {
|
|
1079
|
+
readonly name: 'nonce';
|
|
1080
|
+
readonly type: 'uint256';
|
|
1081
|
+
}, {
|
|
1082
|
+
readonly name: 'expiry';
|
|
1083
|
+
readonly type: 'uint64';
|
|
1084
|
+
}];
|
|
1085
|
+
};
|
|
1086
|
+
primaryType: 'Report';
|
|
1087
|
+
message: {
|
|
1088
|
+
commitmentId: Hex;
|
|
1089
|
+
/** Base units of the token, within the kind's most. */
|
|
1090
|
+
amount: bigint;
|
|
1091
|
+
evidenceHash: Hex;
|
|
1092
|
+
nonce: bigint;
|
|
1093
|
+
expiry: bigint;
|
|
1094
|
+
side: 0 | 1;
|
|
1095
|
+
kind: 0 | 1;
|
|
1096
|
+
};
|
|
1097
|
+
};
|
|
1098
|
+
export declare function releaseConsentTypedData(c: ReleaseConsent, d: AvowDomain): {
|
|
1099
|
+
domain: TypedDataDomain;
|
|
1100
|
+
types: {
|
|
1101
|
+
readonly ReleaseConsent: readonly [{
|
|
1102
|
+
readonly name: 'commitmentId';
|
|
1103
|
+
readonly type: 'bytes32';
|
|
1104
|
+
}, {
|
|
1105
|
+
readonly name: 'side';
|
|
1106
|
+
readonly type: 'uint8';
|
|
1107
|
+
}, {
|
|
1108
|
+
readonly name: 'reportCount';
|
|
1109
|
+
readonly type: 'uint8';
|
|
1110
|
+
}, {
|
|
1111
|
+
readonly name: 'reason';
|
|
1112
|
+
readonly type: 'uint8';
|
|
1113
|
+
}, {
|
|
1114
|
+
readonly name: 'evidenceHash';
|
|
1115
|
+
readonly type: 'bytes32';
|
|
1116
|
+
}, {
|
|
1117
|
+
readonly name: 'nonce';
|
|
1118
|
+
readonly type: 'uint256';
|
|
1119
|
+
}, {
|
|
1120
|
+
readonly name: 'expiry';
|
|
1121
|
+
readonly type: 'uint64';
|
|
1122
|
+
}];
|
|
1123
|
+
};
|
|
1124
|
+
primaryType: 'ReleaseConsent';
|
|
1125
|
+
message: {
|
|
1126
|
+
commitmentId: Hex;
|
|
1127
|
+
/** The lock's `reportCount` for the commitment, which counts every report ever filed. */
|
|
1128
|
+
reportCount: number;
|
|
1129
|
+
evidenceHash: Hex;
|
|
1130
|
+
nonce: bigint;
|
|
1131
|
+
expiry: bigint;
|
|
1132
|
+
side: 0 | 1;
|
|
1133
|
+
reason: 1 | 2;
|
|
1134
|
+
};
|
|
1135
|
+
};
|
|
1136
|
+
export declare function evidenceTypedData(e: SupplierEvidence, d: AvowDomain): {
|
|
1137
|
+
domain: TypedDataDomain;
|
|
1138
|
+
types: {
|
|
1139
|
+
readonly Evidence: readonly [{
|
|
1140
|
+
readonly name: 'commitmentId';
|
|
1141
|
+
readonly type: 'bytes32';
|
|
1142
|
+
}, {
|
|
1143
|
+
readonly name: 'side';
|
|
1144
|
+
readonly type: 'uint8';
|
|
1145
|
+
}, {
|
|
1146
|
+
readonly name: 'number';
|
|
1147
|
+
readonly type: 'uint16';
|
|
1148
|
+
}, {
|
|
1149
|
+
readonly name: 'evidenceHash';
|
|
1150
|
+
readonly type: 'bytes32';
|
|
1151
|
+
}, {
|
|
1152
|
+
readonly name: 'nonce';
|
|
1153
|
+
readonly type: 'uint256';
|
|
1154
|
+
}, {
|
|
1155
|
+
readonly name: 'expiry';
|
|
1156
|
+
readonly type: 'uint64';
|
|
1157
|
+
}];
|
|
1158
|
+
};
|
|
1159
|
+
primaryType: 'Evidence';
|
|
1160
|
+
message: {
|
|
1161
|
+
commitmentId: Hex;
|
|
1162
|
+
/**
|
|
1163
|
+
* The supplier's next evidence number on this commitment. Each side numbers its own evidence,
|
|
1164
|
+
* so the business's filings never void the supplier's signed evidence.
|
|
1165
|
+
*/
|
|
1166
|
+
number: number;
|
|
1167
|
+
evidenceHash: Hex;
|
|
1168
|
+
nonce: bigint;
|
|
1169
|
+
expiry: bigint;
|
|
1170
|
+
side: 0 | 1;
|
|
1171
|
+
};
|
|
1172
|
+
};
|
|
1173
|
+
export declare function businessActionTypedData(a: BusinessAction, d: AvowDomain): {
|
|
1174
|
+
domain: TypedDataDomain;
|
|
1175
|
+
types: {
|
|
1176
|
+
readonly BusinessAction: readonly [{
|
|
1177
|
+
readonly name: 'action';
|
|
1178
|
+
readonly type: 'uint8';
|
|
1179
|
+
}, {
|
|
1180
|
+
readonly name: 'commitmentId';
|
|
1181
|
+
readonly type: 'bytes32';
|
|
1182
|
+
}, {
|
|
1183
|
+
readonly name: 'side';
|
|
1184
|
+
readonly type: 'uint8';
|
|
1185
|
+
}, {
|
|
1186
|
+
readonly name: 'reportNumber';
|
|
1187
|
+
readonly type: 'uint8';
|
|
1188
|
+
}, {
|
|
1189
|
+
readonly name: 'reasonCode';
|
|
1190
|
+
readonly type: 'uint16';
|
|
1191
|
+
}, {
|
|
1192
|
+
readonly name: 'evidenceNumber';
|
|
1193
|
+
readonly type: 'uint16';
|
|
1194
|
+
}, {
|
|
1195
|
+
readonly name: 'dataHash';
|
|
1196
|
+
readonly type: 'bytes32';
|
|
1197
|
+
}, {
|
|
1198
|
+
readonly name: 'supplier';
|
|
1199
|
+
readonly type: 'address';
|
|
1200
|
+
}, {
|
|
1201
|
+
readonly name: 'nonce';
|
|
1202
|
+
readonly type: 'uint256';
|
|
1203
|
+
}, {
|
|
1204
|
+
readonly name: 'expiry';
|
|
1205
|
+
readonly type: 'uint64';
|
|
1206
|
+
}];
|
|
1207
|
+
};
|
|
1208
|
+
primaryType: 'BusinessAction';
|
|
1209
|
+
message: {
|
|
1210
|
+
commitmentId: Hex;
|
|
1211
|
+
/** A contest names the report it contests. */
|
|
1212
|
+
reportNumber: number;
|
|
1213
|
+
/** A contest's reason code. */
|
|
1214
|
+
reasonCode: number;
|
|
1215
|
+
/** The business's next evidence number on the commitment. */
|
|
1216
|
+
evidenceNumber: number;
|
|
1217
|
+
/** A contest's statement hash, or evidence's hash. */
|
|
1218
|
+
dataHash: Hex;
|
|
1219
|
+
/** The supplier account to approve or remove. */
|
|
1220
|
+
supplier: Address;
|
|
1221
|
+
nonce: bigint;
|
|
1222
|
+
expiry: bigint;
|
|
1223
|
+
action: 0 | 1 | 2 | 3;
|
|
1224
|
+
side: 0 | 1;
|
|
1225
|
+
};
|
|
1226
|
+
};
|
|
1227
|
+
export declare function supplierActionTypedData(a: SupplierAction, d: AvowDomain): {
|
|
1228
|
+
domain: TypedDataDomain;
|
|
1229
|
+
types: {
|
|
1230
|
+
readonly SupplierAction: readonly [{
|
|
1231
|
+
readonly name: 'supplier';
|
|
1232
|
+
readonly type: 'address';
|
|
1233
|
+
}, {
|
|
1234
|
+
readonly name: 'action';
|
|
1235
|
+
readonly type: 'uint8';
|
|
1236
|
+
}, {
|
|
1237
|
+
readonly name: 'commitmentId';
|
|
1238
|
+
readonly type: 'bytes32';
|
|
1239
|
+
}, {
|
|
1240
|
+
readonly name: 'side';
|
|
1241
|
+
readonly type: 'uint8';
|
|
1242
|
+
}, {
|
|
1243
|
+
readonly name: 'reportNumber';
|
|
1244
|
+
readonly type: 'uint8';
|
|
1245
|
+
}, {
|
|
1246
|
+
readonly name: 'nonce';
|
|
1247
|
+
readonly type: 'uint256';
|
|
1248
|
+
}, {
|
|
1249
|
+
readonly name: 'expiry';
|
|
1250
|
+
readonly type: 'uint64';
|
|
1251
|
+
}];
|
|
1252
|
+
};
|
|
1253
|
+
primaryType: 'SupplierAction';
|
|
1254
|
+
message: {
|
|
1255
|
+
supplier: Address;
|
|
1256
|
+
commitmentId: Hex;
|
|
1257
|
+
reportNumber: number;
|
|
1258
|
+
nonce: bigint;
|
|
1259
|
+
expiry: bigint;
|
|
1260
|
+
action: 0;
|
|
1261
|
+
side: 0 | 1;
|
|
1262
|
+
};
|
|
1263
|
+
};
|
|
1264
|
+
/** The business's contest of a report or a pending charge, as a signed action. */
|
|
1265
|
+
export declare function contestAction(args: {
|
|
1266
|
+
commitmentId: Hex;
|
|
1267
|
+
reportNumber: number;
|
|
1268
|
+
reasonCode: number;
|
|
1269
|
+
statementHash: Hex;
|
|
1270
|
+
nonce: bigint;
|
|
1271
|
+
expiry: bigint;
|
|
1272
|
+
}): BusinessAction;
|
|
1273
|
+
/** One piece of the business's evidence on a paused charge, as a signed action. */
|
|
1274
|
+
export declare function evidenceAction(args: {
|
|
1275
|
+
commitmentId: Hex;
|
|
1276
|
+
evidenceNumber: number;
|
|
1277
|
+
evidenceHash: Hex;
|
|
1278
|
+
nonce: bigint;
|
|
1279
|
+
expiry: bigint;
|
|
1280
|
+
}): BusinessAction;
|
|
1281
|
+
/**
|
|
1282
|
+
* A change to the business's approved suppliers, as a signed action. `changeCount` is the lock's
|
|
1283
|
+
* `supplierChanges(supplier)` when the business signs.
|
|
1284
|
+
*/
|
|
1285
|
+
export declare function supplierListAction(args: {
|
|
1286
|
+
supplier: Address;
|
|
1287
|
+
approve: boolean;
|
|
1288
|
+
changeCount: bigint;
|
|
1289
|
+
expiry: bigint;
|
|
1290
|
+
}): BusinessAction;
|
|
1291
|
+
export declare function supplierAuthorizationTypedData(a: SupplierAuthorization, d: AvowDomain): {
|
|
1292
|
+
domain: TypedDataDomain;
|
|
1293
|
+
types: {
|
|
1294
|
+
readonly SupplierAuthorization: readonly [{
|
|
1295
|
+
readonly name: 'commitmentId';
|
|
1296
|
+
readonly type: 'bytes32';
|
|
1297
|
+
}, {
|
|
1298
|
+
readonly name: 'termsHash';
|
|
1299
|
+
readonly type: 'bytes32';
|
|
1300
|
+
}, {
|
|
1301
|
+
readonly name: 'salt';
|
|
1302
|
+
readonly type: 'bytes32';
|
|
1303
|
+
}, {
|
|
1304
|
+
readonly name: 'amount';
|
|
1305
|
+
readonly type: 'uint256';
|
|
1306
|
+
}, {
|
|
1307
|
+
readonly name: 'token';
|
|
1308
|
+
readonly type: 'address';
|
|
1309
|
+
}, {
|
|
1310
|
+
readonly name: 'buyerBusinessId';
|
|
1311
|
+
readonly type: 'string';
|
|
1312
|
+
}, {
|
|
1313
|
+
readonly name: 'kybReference';
|
|
1314
|
+
readonly type: 'string';
|
|
1315
|
+
}, {
|
|
1316
|
+
readonly name: 'kybTestData';
|
|
1317
|
+
readonly type: 'bool';
|
|
1318
|
+
}, {
|
|
1319
|
+
readonly name: 'agentKey';
|
|
1320
|
+
readonly type: 'address';
|
|
1321
|
+
}, {
|
|
1322
|
+
readonly name: 'agentKeyAuthorizedIn';
|
|
1323
|
+
readonly type: 'bytes32';
|
|
1324
|
+
}, {
|
|
1325
|
+
readonly name: 'mandateHash';
|
|
1326
|
+
readonly type: 'bytes32';
|
|
1327
|
+
}, {
|
|
1328
|
+
readonly name: 'payee';
|
|
1329
|
+
readonly type: 'address';
|
|
1330
|
+
}, {
|
|
1331
|
+
readonly name: 'acceptBy';
|
|
1332
|
+
readonly type: 'uint64';
|
|
1333
|
+
}, {
|
|
1334
|
+
readonly name: 'chargeDeadline';
|
|
1335
|
+
readonly type: 'uint64';
|
|
1336
|
+
}, {
|
|
1337
|
+
readonly name: 'releaseDate';
|
|
1338
|
+
readonly type: 'uint64';
|
|
1339
|
+
}, {
|
|
1340
|
+
readonly name: 'nonce';
|
|
1341
|
+
readonly type: 'uint256';
|
|
1342
|
+
}, {
|
|
1343
|
+
readonly name: 'expiry';
|
|
1344
|
+
readonly type: 'uint64';
|
|
1345
|
+
}];
|
|
1346
|
+
};
|
|
1347
|
+
primaryType: 'SupplierAuthorization';
|
|
1348
|
+
message: {
|
|
1349
|
+
commitmentId: Hex;
|
|
1350
|
+
termsHash: Hex;
|
|
1351
|
+
salt: Hex;
|
|
1352
|
+
/** Base units of the token. */
|
|
1353
|
+
amount: bigint;
|
|
1354
|
+
token: Address;
|
|
1355
|
+
buyerBusinessId: string;
|
|
1356
|
+
kybReference: string;
|
|
1357
|
+
kybTestData: boolean;
|
|
1358
|
+
agentKey: Address;
|
|
1359
|
+
/** The transaction that authorized the agent's key, where Tempo logged the mandate's hash. */
|
|
1360
|
+
agentKeyAuthorizedIn: Hex;
|
|
1361
|
+
mandateHash: Hex;
|
|
1362
|
+
payee: Address;
|
|
1363
|
+
acceptBy: bigint;
|
|
1364
|
+
chargeDeadline: bigint;
|
|
1365
|
+
releaseDate: bigint;
|
|
1366
|
+
nonce: bigint;
|
|
1367
|
+
expiry: bigint;
|
|
1368
|
+
};
|
|
1369
|
+
};
|
|
1370
|
+
export declare function humanApprovalTypedData(a: HumanApproval, d: AvowDomain): {
|
|
1371
|
+
domain: TypedDataDomain;
|
|
1372
|
+
types: {
|
|
1373
|
+
readonly HumanApproval: readonly [{
|
|
1374
|
+
readonly name: 'mandateHash';
|
|
1375
|
+
readonly type: 'bytes32';
|
|
1376
|
+
}, {
|
|
1377
|
+
readonly name: 'commitmentId';
|
|
1378
|
+
readonly type: 'bytes32';
|
|
1379
|
+
}, {
|
|
1380
|
+
readonly name: 'termsHash';
|
|
1381
|
+
readonly type: 'bytes32';
|
|
1382
|
+
}, {
|
|
1383
|
+
readonly name: 'supplier';
|
|
1384
|
+
readonly type: 'string';
|
|
1385
|
+
}, {
|
|
1386
|
+
readonly name: 'payee';
|
|
1387
|
+
readonly type: 'address';
|
|
1388
|
+
}, {
|
|
1389
|
+
readonly name: 'amount';
|
|
1390
|
+
readonly type: 'uint256';
|
|
1391
|
+
}, {
|
|
1392
|
+
readonly name: 'nonce';
|
|
1393
|
+
readonly type: 'uint256';
|
|
1394
|
+
}, {
|
|
1395
|
+
readonly name: 'expiry';
|
|
1396
|
+
readonly type: 'uint64';
|
|
1397
|
+
}];
|
|
1398
|
+
};
|
|
1399
|
+
primaryType: 'HumanApproval';
|
|
1400
|
+
message: {
|
|
1401
|
+
mandateHash: Hex;
|
|
1402
|
+
commitmentId: Hex;
|
|
1403
|
+
termsHash: Hex;
|
|
1404
|
+
supplier: string;
|
|
1405
|
+
payee: Address;
|
|
1406
|
+
amount: bigint;
|
|
1407
|
+
nonce: bigint;
|
|
1408
|
+
expiry: bigint;
|
|
1409
|
+
};
|
|
1410
|
+
};
|
|
1411
|
+
export declare function startReceiptTypedData(r: StartReceipt, d: AvowDomain): {
|
|
1412
|
+
domain: TypedDataDomain;
|
|
1413
|
+
types: {
|
|
1414
|
+
readonly StartReceipt: readonly [{
|
|
1415
|
+
readonly name: 'commitmentId';
|
|
1416
|
+
readonly type: 'bytes32';
|
|
1417
|
+
}, {
|
|
1418
|
+
readonly name: 'side';
|
|
1419
|
+
readonly type: 'uint8';
|
|
1420
|
+
}, {
|
|
1421
|
+
readonly name: 'startRequestHash';
|
|
1422
|
+
readonly type: 'bytes32';
|
|
1423
|
+
}, {
|
|
1424
|
+
readonly name: 'startedAt';
|
|
1425
|
+
readonly type: 'uint64';
|
|
1426
|
+
}, {
|
|
1427
|
+
readonly name: 'nonce';
|
|
1428
|
+
readonly type: 'uint256';
|
|
1429
|
+
}, {
|
|
1430
|
+
readonly name: 'expiry';
|
|
1431
|
+
readonly type: 'uint64';
|
|
1432
|
+
}];
|
|
1433
|
+
};
|
|
1434
|
+
primaryType: 'StartReceipt';
|
|
1435
|
+
message: {
|
|
1436
|
+
commitmentId: Hex;
|
|
1437
|
+
startRequestHash: Hex;
|
|
1438
|
+
startedAt: bigint;
|
|
1439
|
+
nonce: bigint;
|
|
1440
|
+
expiry: bigint;
|
|
1441
|
+
side: 0 | 1;
|
|
1442
|
+
};
|
|
1443
|
+
};
|
|
1444
|
+
export declare function apiRequestTypedData(r: ApiRequest, d: AvowDomain): {
|
|
1445
|
+
domain: TypedDataDomain;
|
|
1446
|
+
types: {
|
|
1447
|
+
readonly ApiRequest: readonly [{
|
|
1448
|
+
readonly name: 'audience';
|
|
1449
|
+
readonly type: 'string';
|
|
1450
|
+
}, {
|
|
1451
|
+
readonly name: 'method';
|
|
1452
|
+
readonly type: 'string';
|
|
1453
|
+
}, {
|
|
1454
|
+
readonly name: 'path';
|
|
1455
|
+
readonly type: 'string';
|
|
1456
|
+
}, {
|
|
1457
|
+
readonly name: 'bodyHash';
|
|
1458
|
+
readonly type: 'bytes32';
|
|
1459
|
+
}, {
|
|
1460
|
+
readonly name: 'signer';
|
|
1461
|
+
readonly type: 'address';
|
|
1462
|
+
}, {
|
|
1463
|
+
readonly name: 'requestId';
|
|
1464
|
+
readonly type: 'bytes32';
|
|
1465
|
+
}, {
|
|
1466
|
+
readonly name: 'expiry';
|
|
1467
|
+
readonly type: 'uint64';
|
|
1468
|
+
}];
|
|
1469
|
+
};
|
|
1470
|
+
primaryType: 'ApiRequest';
|
|
1471
|
+
message: {
|
|
1472
|
+
/**
|
|
1473
|
+
* The deployment the request is for, written as the API's origin in lower case with no trailing
|
|
1474
|
+
* slash, such as `https://api.testnet.avow.finance`. Each deployment has its own, so a request for
|
|
1475
|
+
* one can't run on another, even on the same chain.
|
|
1476
|
+
*/
|
|
1477
|
+
audience: string;
|
|
1478
|
+
/** `GET` or `POST`. */
|
|
1479
|
+
method: string;
|
|
1480
|
+
/** The path as sent, such as `/v1/reserve-approvals`, with no query. */
|
|
1481
|
+
path: string;
|
|
1482
|
+
/** keccak256 of the body's exact bytes, or of no bytes for a request with no body. */
|
|
1483
|
+
bodyHash: Hex;
|
|
1484
|
+
/** The key's own address. A passkey's signature doesn't name its signer, so the request does. */
|
|
1485
|
+
signer: Address;
|
|
1486
|
+
/** 32 random bytes the signer picks for each operation. */
|
|
1487
|
+
requestId: Hex;
|
|
1488
|
+
expiry: bigint;
|
|
1489
|
+
};
|
|
1490
|
+
};
|
|
1491
|
+
export declare function timestampTypedData(t: Timestamp, d: AvowDomain): {
|
|
1492
|
+
domain: TypedDataDomain;
|
|
1493
|
+
types: {
|
|
1494
|
+
readonly Timestamp: readonly [{
|
|
1495
|
+
readonly name: 'requestHash';
|
|
1496
|
+
readonly type: 'bytes32';
|
|
1497
|
+
}, {
|
|
1498
|
+
readonly name: 'receivedAt';
|
|
1499
|
+
readonly type: 'uint64';
|
|
1500
|
+
}];
|
|
1501
|
+
};
|
|
1502
|
+
primaryType: 'Timestamp';
|
|
1503
|
+
message: {
|
|
1504
|
+
/** The digest of the signed `ApiRequest` Avow received. */
|
|
1505
|
+
requestHash: Hex;
|
|
1506
|
+
/** When Avow received it, in unix seconds by Avow's clock. */
|
|
1507
|
+
receivedAt: bigint;
|
|
1508
|
+
};
|
|
1509
|
+
};
|
|
1510
|
+
/**
|
|
1511
|
+
* The mandate's hash, bound into the agent key's authorization on Tempo as its witness. It
|
|
1512
|
+
* includes the domain, so a mandate for one lock or chain can't stand in for another.
|
|
1513
|
+
*/
|
|
1514
|
+
export declare function mandateHash(m: Mandate, d: AvowDomain): Hex;
|
|
1515
|
+
export type AvowTypedData = ReturnType<typeof mandateTypedData> | ReturnType<typeof termsAgreementTypedData> | ReturnType<typeof approvalTypedData> | ReturnType<typeof supplierAuthorizationTypedData> | ReturnType<typeof humanApprovalTypedData> | ReturnType<typeof startReceiptTypedData> | ReturnType<typeof apiRequestTypedData> | ReturnType<typeof timestampTypedData> | ReturnType<typeof acceptanceTypedData> | ReturnType<typeof reportTypedData> | ReturnType<typeof releaseConsentTypedData> | ReturnType<typeof evidenceTypedData> | ReturnType<typeof businessActionTypedData> | ReturnType<typeof supplierActionTypedData>;
|
|
1516
|
+
export type MessageType = AvowTypedData['primaryType'];
|
|
1517
|
+
/** The EIP-712 digest a signer signs. */
|
|
1518
|
+
export declare function digestOf(td: AvowTypedData): Hex;
|
|
1519
|
+
/**
|
|
1520
|
+
* Checks a signature over a digest. The default recovers a secp256k1 signer. A passkey or an
|
|
1521
|
+
* admin key signing for a Tempo account goes through the keychain's verifier instead, so callers
|
|
1522
|
+
* that accept those pass their own check.
|
|
1523
|
+
*/
|
|
1524
|
+
export type SignatureCheck = (args: {
|
|
1525
|
+
signer: Address;
|
|
1526
|
+
digest: Hex;
|
|
1527
|
+
signature: Hex;
|
|
1528
|
+
}) => Promise<boolean>;
|
|
1529
|
+
export declare function isSignedBy(typedData: AvowTypedData, signature: Hex, signer: Address, check?: SignatureCheck): Promise<boolean>;
|
|
1530
|
+
/**
|
|
1531
|
+
* How a signed message travels as data. Its version, chain and lock make up the EIP-712 domain, and
|
|
1532
|
+
* `schemaVersion` is the message type's own version (`MESSAGE_VERSIONS`).
|
|
1533
|
+
*/
|
|
1534
|
+
export interface Signed<T> {
|
|
1535
|
+
type: MessageType;
|
|
1536
|
+
schemaVersion: string;
|
|
1537
|
+
chainId: number;
|
|
1538
|
+
lock: Address;
|
|
1539
|
+
message: T;
|
|
1540
|
+
signature: Hex;
|
|
1541
|
+
}
|
|
1542
|
+
/**
|
|
1543
|
+
* A terms agreement both sides signed. The buyer's agent key and the supplier's signing key each
|
|
1544
|
+
* sign the same EIP-712 message, so it travels with two signatures in place of one.
|
|
1545
|
+
*/
|
|
1546
|
+
export type SignedAgreement = Omit<Signed<TermsAgreement>, 'signature'> & {
|
|
1547
|
+
/** The buyer's agent key, signing under its mandate. */
|
|
1548
|
+
buyerSignature: Hex;
|
|
1549
|
+
/** The supplier's signing key. */
|
|
1550
|
+
supplierSignature: Hex;
|
|
1551
|
+
};
|
|
1552
|
+
/**
|
|
1553
|
+
* Checks a signed message's envelope before its signature. The lock is checked when the reader
|
|
1554
|
+
* already knows it, and a supplier who learns the lock from the message checks it on-chain.
|
|
1555
|
+
*/
|
|
1556
|
+
export declare function checkEnvelope(env: Pick<Signed<unknown>, 'type' | 'schemaVersion' | 'chainId' | 'lock'>, expected: {
|
|
1557
|
+
type: MessageType;
|
|
1558
|
+
chainId: number;
|
|
1559
|
+
lock?: Address;
|
|
1560
|
+
}): ReasonCode | null;
|
|
1561
|
+
/**
|
|
1562
|
+
* A replay guard's key for one exact message: its type and EIP-712 digest. The digest covers the
|
|
1563
|
+
* chain, the lock, the commitment and every field, so two different messages never share a key,
|
|
1564
|
+
* whatever nonces their signers chose.
|
|
1565
|
+
*/
|
|
1566
|
+
export declare function messageKey(td: AvowTypedData): string;
|
|
1567
|
+
/** A replay guard's key for something a commitment may have only once, such as an authorization. */
|
|
1568
|
+
export declare function commitmentKey(type: MessageType, d: AvowDomain, commitmentId: Hex): string;
|
|
1569
|
+
//# sourceMappingURL=eip712.d.ts.map
|