@invisi-labs/protocol 1.1.7 → 1.2.1
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/README.md +5 -0
- package/dist/chunk-7SS2YSEF.js +199 -0
- package/dist/chunk-7SS2YSEF.js.map +1 -0
- package/dist/{chunk-BYJ4LXCJ.js → chunk-HHJLFLVJ.js} +616 -714
- package/dist/chunk-HHJLFLVJ.js.map +1 -0
- package/dist/chunk-MVQQD5W5.js +487 -0
- package/dist/chunk-MVQQD5W5.js.map +1 -0
- package/dist/chunk-Z2XPYNMC.js +446 -0
- package/dist/chunk-Z2XPYNMC.js.map +1 -0
- package/dist/contracts.cjs +615 -713
- package/dist/contracts.cjs.map +1 -1
- package/dist/contracts.d.cts +5 -5
- package/dist/contracts.d.ts +5 -5
- package/dist/contracts.js +1 -1
- package/dist/credit.cjs +3367 -0
- package/dist/credit.cjs.map +1 -0
- package/dist/credit.d.cts +252 -0
- package/dist/credit.d.ts +252 -0
- package/dist/credit.js +53 -0
- package/dist/credit.js.map +1 -0
- package/dist/index.cjs +6054 -6053
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +89 -893
- package/dist/index.d.ts +89 -893
- package/dist/index.js +2956 -3762
- package/dist/index.js.map +1 -1
- package/dist/note.cjs +3456 -0
- package/dist/note.cjs.map +1 -0
- package/dist/note.d.cts +232 -0
- package/dist/note.d.ts +232 -0
- package/dist/note.js +43 -0
- package/dist/note.js.map +1 -0
- package/dist/provenance.cjs +558 -0
- package/dist/provenance.cjs.map +1 -0
- package/dist/provenance.d.cts +188 -0
- package/dist/provenance.d.ts +188 -0
- package/dist/provenance.js +499 -0
- package/dist/provenance.js.map +1 -0
- package/dist/{types-Bvakbfeb.d.cts → types-CUnFzl5S.d.cts} +530 -590
- package/dist/{types-Bvakbfeb.d.ts → types-CUnFzl5S.d.ts} +530 -590
- package/dist/validation-8g0SQVE5.d.ts +235 -0
- package/dist/validation-MgURYiNF.d.cts +235 -0
- package/package.json +20 -5
- package/dist/chunk-BYJ4LXCJ.js.map +0 -1
package/dist/note.d.cts
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { k as TransactRequest, e as CrossTreeTransactParams, D as Delivery, F as FundingParams, j as ShieldParams, S as ShieldOutput } from './types-CUnFzl5S.cjs';
|
|
2
|
+
import { F as FundingInput, D as DeploymentContext, T as TransactionContext } from './validation-MgURYiNF.cjs';
|
|
3
|
+
import { Hex, Address } from '@invisi-labs/primitives';
|
|
4
|
+
|
|
5
|
+
interface BuildTransactAggregateCalldataParams {
|
|
6
|
+
context: DeploymentContext & {
|
|
7
|
+
now?: bigint;
|
|
8
|
+
};
|
|
9
|
+
proof: Hex;
|
|
10
|
+
requests: readonly TransactRequest[];
|
|
11
|
+
caller?: Address;
|
|
12
|
+
}
|
|
13
|
+
declare function buildTransactAggregateCalldata(p: BuildTransactAggregateCalldataParams): {
|
|
14
|
+
data: Hex;
|
|
15
|
+
capacity: number;
|
|
16
|
+
approvalRequirements: {
|
|
17
|
+
token: Address;
|
|
18
|
+
payer: Address;
|
|
19
|
+
amount: bigint;
|
|
20
|
+
}[];
|
|
21
|
+
};
|
|
22
|
+
type AggregateMemberInput = Pick<TransactRequest, "params" | "deliveries"> & {
|
|
23
|
+
funding?: FundingInput;
|
|
24
|
+
};
|
|
25
|
+
/** Atomic aggregate funding binds the member statement rather than the aggregate proof bytes. */
|
|
26
|
+
declare function aggregateMemberRequestHash(c: TransactionContext, r: AggregateMemberInput): Hex;
|
|
27
|
+
/** Router adapter business words (58 per member), not the aggregate circuit statement. */
|
|
28
|
+
declare function aggregatePublicInputs(c: TransactionContext, requests: readonly AggregateMemberInput[]): `0x${string}`[];
|
|
29
|
+
declare function encodeAggregateFundingTypedData(c: TransactionContext, r: AggregateMemberInput): {
|
|
30
|
+
domain: {
|
|
31
|
+
name: string;
|
|
32
|
+
version: string;
|
|
33
|
+
chainId: bigint;
|
|
34
|
+
verifyingContract: Hex;
|
|
35
|
+
};
|
|
36
|
+
primaryType: "FundTransact";
|
|
37
|
+
types: {
|
|
38
|
+
FundTransact: readonly [{
|
|
39
|
+
readonly name: "requestHash";
|
|
40
|
+
readonly type: "bytes32";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "payer";
|
|
43
|
+
readonly type: "address";
|
|
44
|
+
}, {
|
|
45
|
+
readonly name: "amount";
|
|
46
|
+
readonly type: "uint256";
|
|
47
|
+
}, {
|
|
48
|
+
readonly name: "sigNonce";
|
|
49
|
+
readonly type: "uint256";
|
|
50
|
+
}, {
|
|
51
|
+
readonly name: "deadline";
|
|
52
|
+
readonly type: "uint256";
|
|
53
|
+
}];
|
|
54
|
+
};
|
|
55
|
+
message: {
|
|
56
|
+
requestHash: `0x${string}`;
|
|
57
|
+
payer: `0x${string}`;
|
|
58
|
+
amount: bigint;
|
|
59
|
+
sigNonce: bigint;
|
|
60
|
+
deadline: bigint;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
declare const TRANSACT_CAPACITIES: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190];
|
|
65
|
+
type TransactCapacity = (typeof TRANSACT_CAPACITIES)[number];
|
|
66
|
+
declare function selectTransactCapacity(inputs: number, outputs: number): TransactCapacity;
|
|
67
|
+
type TransactRequestParams = CrossTreeTransactParams;
|
|
68
|
+
declare function normalizeTransactRequest(c: TransactionContext, p: TransactRequestParams, cs: readonly Delivery[], funding?: FundingInput): {
|
|
69
|
+
capacity: 5 | 3 | 1 | 2 | 8 | 4 | 7 | 6 | 9 | 10 | 130 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 | 110 | 120 | 140 | 150 | 160 | 170 | 180 | 190;
|
|
70
|
+
sources: {
|
|
71
|
+
treeId: bigint;
|
|
72
|
+
merkleRoot: `0x${string}`;
|
|
73
|
+
}[];
|
|
74
|
+
nullifiers: `0x${string}`[];
|
|
75
|
+
noteCommitments: `0x${string}`[];
|
|
76
|
+
inputCount: number;
|
|
77
|
+
outputCount: number;
|
|
78
|
+
sourceCount: number;
|
|
79
|
+
inputTreeIds: bigint[];
|
|
80
|
+
merkleRoots: bigint[];
|
|
81
|
+
slotValues: bigint[];
|
|
82
|
+
deliveries: Delivery[];
|
|
83
|
+
deliveriesHash: `0x${string}`;
|
|
84
|
+
withdrawalAddress: `0x${string}`;
|
|
85
|
+
withdrawalAmount: bigint;
|
|
86
|
+
feeRecipient: `0x${string}`;
|
|
87
|
+
feeAmount: bigint;
|
|
88
|
+
deadline: bigint;
|
|
89
|
+
depositAmount: bigint;
|
|
90
|
+
depositPayer: `0x${string}`;
|
|
91
|
+
funding: FundingParams;
|
|
92
|
+
chainId: bigint;
|
|
93
|
+
protocolAddress: Hex;
|
|
94
|
+
tokenAddress: Hex;
|
|
95
|
+
now?: bigint;
|
|
96
|
+
timestamp?: bigint;
|
|
97
|
+
};
|
|
98
|
+
declare function transactPublicInputs(c: TransactionContext, p: TransactRequestParams, cs: readonly Delivery[], f?: FundingInput): `0x${string}`[];
|
|
99
|
+
|
|
100
|
+
interface BuildTransactCalldataParams {
|
|
101
|
+
context: TransactionContext;
|
|
102
|
+
proof: Hex;
|
|
103
|
+
params: TransactRequestParams;
|
|
104
|
+
deliveries: readonly Delivery[];
|
|
105
|
+
funding?: FundingInput;
|
|
106
|
+
caller?: Address;
|
|
107
|
+
}
|
|
108
|
+
declare function buildTransactCalldata(p: BuildTransactCalldataParams): {
|
|
109
|
+
data: `0x${string}`;
|
|
110
|
+
capacity: 5 | 3 | 1 | 2 | 8 | 4 | 7 | 6 | 9 | 10 | 130 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 | 110 | 120 | 140 | 150 | 160 | 170 | 180 | 190;
|
|
111
|
+
approveAmount: bigint;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
declare function encodeTransactTypedData(c: TransactionContext, p: TransactRequestParams, deliveries: readonly Delivery[], f?: FundingInput): {
|
|
115
|
+
domain: {
|
|
116
|
+
name: string;
|
|
117
|
+
version: string;
|
|
118
|
+
chainId: bigint;
|
|
119
|
+
verifyingContract: `0x${string}`;
|
|
120
|
+
};
|
|
121
|
+
types: {
|
|
122
|
+
readonly WalletAuthorization: readonly [{
|
|
123
|
+
readonly name: "operation";
|
|
124
|
+
readonly type: "bytes32";
|
|
125
|
+
}, {
|
|
126
|
+
readonly name: "statementHash";
|
|
127
|
+
readonly type: "bytes32";
|
|
128
|
+
}];
|
|
129
|
+
};
|
|
130
|
+
primaryType: "WalletAuthorization";
|
|
131
|
+
message: {
|
|
132
|
+
operation: `0x${string}`;
|
|
133
|
+
statementHash: `0x${string}`;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
declare function transactFundingRequestHash(proof: Hex, p: TransactRequestParams, cs: readonly Delivery[]): `0x${string}`;
|
|
137
|
+
declare function encodeTransactFundingTypedData(c: TransactionContext, proof: Hex, p: TransactRequestParams, cs: readonly Delivery[], funding: FundingInput): {
|
|
138
|
+
domain: {
|
|
139
|
+
name: string;
|
|
140
|
+
version: string;
|
|
141
|
+
chainId: bigint;
|
|
142
|
+
verifyingContract: Hex;
|
|
143
|
+
};
|
|
144
|
+
primaryType: "FundTransact";
|
|
145
|
+
types: {
|
|
146
|
+
FundTransact: readonly [{
|
|
147
|
+
readonly name: "requestHash";
|
|
148
|
+
readonly type: "bytes32";
|
|
149
|
+
}, {
|
|
150
|
+
readonly name: "payer";
|
|
151
|
+
readonly type: "address";
|
|
152
|
+
}, {
|
|
153
|
+
readonly name: "amount";
|
|
154
|
+
readonly type: "uint256";
|
|
155
|
+
}, {
|
|
156
|
+
readonly name: "sigNonce";
|
|
157
|
+
readonly type: "uint256";
|
|
158
|
+
}, {
|
|
159
|
+
readonly name: "deadline";
|
|
160
|
+
readonly type: "uint256";
|
|
161
|
+
}];
|
|
162
|
+
};
|
|
163
|
+
message: {
|
|
164
|
+
requestHash: `0x${string}`;
|
|
165
|
+
payer: `0x${string}`;
|
|
166
|
+
amount: bigint;
|
|
167
|
+
sigNonce: bigint;
|
|
168
|
+
deadline: bigint;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
interface BuildShieldCalldataParams {
|
|
173
|
+
context: TransactionContext;
|
|
174
|
+
params: ShieldParams;
|
|
175
|
+
outputs: readonly ShieldOutput[];
|
|
176
|
+
deliveries: readonly Delivery[];
|
|
177
|
+
funding: FundingInput;
|
|
178
|
+
caller?: Address;
|
|
179
|
+
}
|
|
180
|
+
declare function validateShieldRequest(p: BuildShieldCalldataParams): Promise<FundingParams>;
|
|
181
|
+
declare function encodeShieldFundingTypedData(p: BuildShieldCalldataParams): Promise<{
|
|
182
|
+
domain: {
|
|
183
|
+
name: string;
|
|
184
|
+
version: string;
|
|
185
|
+
chainId: bigint;
|
|
186
|
+
verifyingContract: Hex;
|
|
187
|
+
};
|
|
188
|
+
primaryType: "FundShield";
|
|
189
|
+
types: {
|
|
190
|
+
FundShield: readonly [{
|
|
191
|
+
readonly name: "requestHash";
|
|
192
|
+
readonly type: "bytes32";
|
|
193
|
+
}, {
|
|
194
|
+
readonly name: "payer";
|
|
195
|
+
readonly type: "address";
|
|
196
|
+
}, {
|
|
197
|
+
readonly name: "amount";
|
|
198
|
+
readonly type: "uint256";
|
|
199
|
+
}, {
|
|
200
|
+
readonly name: "sigNonce";
|
|
201
|
+
readonly type: "uint256";
|
|
202
|
+
}, {
|
|
203
|
+
readonly name: "deadline";
|
|
204
|
+
readonly type: "uint256";
|
|
205
|
+
}];
|
|
206
|
+
};
|
|
207
|
+
message: {
|
|
208
|
+
requestHash: `0x${string}`;
|
|
209
|
+
payer: `0x${string}`;
|
|
210
|
+
amount: bigint;
|
|
211
|
+
sigNonce: bigint;
|
|
212
|
+
deadline: bigint;
|
|
213
|
+
};
|
|
214
|
+
}>;
|
|
215
|
+
declare function buildShieldCalldata(p: BuildShieldCalldataParams): Promise<{
|
|
216
|
+
data: Hex;
|
|
217
|
+
approveAmount: bigint;
|
|
218
|
+
}>;
|
|
219
|
+
declare function shieldFundingRequestHash(params: ShieldParams, outputs: readonly ShieldOutput[], cs: readonly Delivery[]): Hex;
|
|
220
|
+
|
|
221
|
+
interface AggregateRoute {
|
|
222
|
+
kind: "dedicated" | "mixed";
|
|
223
|
+
capacity: number;
|
|
224
|
+
count: number;
|
|
225
|
+
name: string;
|
|
226
|
+
publicInputCount: number;
|
|
227
|
+
}
|
|
228
|
+
declare const AGGREGATE_ROUTES: readonly AggregateRoute[];
|
|
229
|
+
/** Select the canonical immutable route without reordering requests or changing member capacities. */
|
|
230
|
+
declare function selectAggregateRoute(capacities: readonly number[]): AggregateRoute;
|
|
231
|
+
|
|
232
|
+
export { AGGREGATE_ROUTES, type AggregateMemberInput, type AggregateRoute, type BuildShieldCalldataParams, type BuildTransactAggregateCalldataParams, type BuildTransactCalldataParams, TRANSACT_CAPACITIES, type TransactCapacity, type TransactRequestParams, aggregateMemberRequestHash, aggregatePublicInputs, buildShieldCalldata, buildTransactAggregateCalldata, buildTransactCalldata, encodeAggregateFundingTypedData, encodeShieldFundingTypedData, encodeTransactFundingTypedData, encodeTransactTypedData, normalizeTransactRequest, selectAggregateRoute, selectTransactCapacity, shieldFundingRequestHash, transactFundingRequestHash, transactPublicInputs, validateShieldRequest };
|
package/dist/note.d.ts
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { k as TransactRequest, e as CrossTreeTransactParams, D as Delivery, F as FundingParams, j as ShieldParams, S as ShieldOutput } from './types-CUnFzl5S.js';
|
|
2
|
+
import { F as FundingInput, D as DeploymentContext, T as TransactionContext } from './validation-8g0SQVE5.js';
|
|
3
|
+
import { Hex, Address } from '@invisi-labs/primitives';
|
|
4
|
+
|
|
5
|
+
interface BuildTransactAggregateCalldataParams {
|
|
6
|
+
context: DeploymentContext & {
|
|
7
|
+
now?: bigint;
|
|
8
|
+
};
|
|
9
|
+
proof: Hex;
|
|
10
|
+
requests: readonly TransactRequest[];
|
|
11
|
+
caller?: Address;
|
|
12
|
+
}
|
|
13
|
+
declare function buildTransactAggregateCalldata(p: BuildTransactAggregateCalldataParams): {
|
|
14
|
+
data: Hex;
|
|
15
|
+
capacity: number;
|
|
16
|
+
approvalRequirements: {
|
|
17
|
+
token: Address;
|
|
18
|
+
payer: Address;
|
|
19
|
+
amount: bigint;
|
|
20
|
+
}[];
|
|
21
|
+
};
|
|
22
|
+
type AggregateMemberInput = Pick<TransactRequest, "params" | "deliveries"> & {
|
|
23
|
+
funding?: FundingInput;
|
|
24
|
+
};
|
|
25
|
+
/** Atomic aggregate funding binds the member statement rather than the aggregate proof bytes. */
|
|
26
|
+
declare function aggregateMemberRequestHash(c: TransactionContext, r: AggregateMemberInput): Hex;
|
|
27
|
+
/** Router adapter business words (58 per member), not the aggregate circuit statement. */
|
|
28
|
+
declare function aggregatePublicInputs(c: TransactionContext, requests: readonly AggregateMemberInput[]): `0x${string}`[];
|
|
29
|
+
declare function encodeAggregateFundingTypedData(c: TransactionContext, r: AggregateMemberInput): {
|
|
30
|
+
domain: {
|
|
31
|
+
name: string;
|
|
32
|
+
version: string;
|
|
33
|
+
chainId: bigint;
|
|
34
|
+
verifyingContract: Hex;
|
|
35
|
+
};
|
|
36
|
+
primaryType: "FundTransact";
|
|
37
|
+
types: {
|
|
38
|
+
FundTransact: readonly [{
|
|
39
|
+
readonly name: "requestHash";
|
|
40
|
+
readonly type: "bytes32";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "payer";
|
|
43
|
+
readonly type: "address";
|
|
44
|
+
}, {
|
|
45
|
+
readonly name: "amount";
|
|
46
|
+
readonly type: "uint256";
|
|
47
|
+
}, {
|
|
48
|
+
readonly name: "sigNonce";
|
|
49
|
+
readonly type: "uint256";
|
|
50
|
+
}, {
|
|
51
|
+
readonly name: "deadline";
|
|
52
|
+
readonly type: "uint256";
|
|
53
|
+
}];
|
|
54
|
+
};
|
|
55
|
+
message: {
|
|
56
|
+
requestHash: `0x${string}`;
|
|
57
|
+
payer: `0x${string}`;
|
|
58
|
+
amount: bigint;
|
|
59
|
+
sigNonce: bigint;
|
|
60
|
+
deadline: bigint;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
declare const TRANSACT_CAPACITIES: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190];
|
|
65
|
+
type TransactCapacity = (typeof TRANSACT_CAPACITIES)[number];
|
|
66
|
+
declare function selectTransactCapacity(inputs: number, outputs: number): TransactCapacity;
|
|
67
|
+
type TransactRequestParams = CrossTreeTransactParams;
|
|
68
|
+
declare function normalizeTransactRequest(c: TransactionContext, p: TransactRequestParams, cs: readonly Delivery[], funding?: FundingInput): {
|
|
69
|
+
capacity: 5 | 3 | 1 | 2 | 8 | 4 | 7 | 6 | 9 | 10 | 130 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 | 110 | 120 | 140 | 150 | 160 | 170 | 180 | 190;
|
|
70
|
+
sources: {
|
|
71
|
+
treeId: bigint;
|
|
72
|
+
merkleRoot: `0x${string}`;
|
|
73
|
+
}[];
|
|
74
|
+
nullifiers: `0x${string}`[];
|
|
75
|
+
noteCommitments: `0x${string}`[];
|
|
76
|
+
inputCount: number;
|
|
77
|
+
outputCount: number;
|
|
78
|
+
sourceCount: number;
|
|
79
|
+
inputTreeIds: bigint[];
|
|
80
|
+
merkleRoots: bigint[];
|
|
81
|
+
slotValues: bigint[];
|
|
82
|
+
deliveries: Delivery[];
|
|
83
|
+
deliveriesHash: `0x${string}`;
|
|
84
|
+
withdrawalAddress: `0x${string}`;
|
|
85
|
+
withdrawalAmount: bigint;
|
|
86
|
+
feeRecipient: `0x${string}`;
|
|
87
|
+
feeAmount: bigint;
|
|
88
|
+
deadline: bigint;
|
|
89
|
+
depositAmount: bigint;
|
|
90
|
+
depositPayer: `0x${string}`;
|
|
91
|
+
funding: FundingParams;
|
|
92
|
+
chainId: bigint;
|
|
93
|
+
protocolAddress: Hex;
|
|
94
|
+
tokenAddress: Hex;
|
|
95
|
+
now?: bigint;
|
|
96
|
+
timestamp?: bigint;
|
|
97
|
+
};
|
|
98
|
+
declare function transactPublicInputs(c: TransactionContext, p: TransactRequestParams, cs: readonly Delivery[], f?: FundingInput): `0x${string}`[];
|
|
99
|
+
|
|
100
|
+
interface BuildTransactCalldataParams {
|
|
101
|
+
context: TransactionContext;
|
|
102
|
+
proof: Hex;
|
|
103
|
+
params: TransactRequestParams;
|
|
104
|
+
deliveries: readonly Delivery[];
|
|
105
|
+
funding?: FundingInput;
|
|
106
|
+
caller?: Address;
|
|
107
|
+
}
|
|
108
|
+
declare function buildTransactCalldata(p: BuildTransactCalldataParams): {
|
|
109
|
+
data: `0x${string}`;
|
|
110
|
+
capacity: 5 | 3 | 1 | 2 | 8 | 4 | 7 | 6 | 9 | 10 | 130 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 | 110 | 120 | 140 | 150 | 160 | 170 | 180 | 190;
|
|
111
|
+
approveAmount: bigint;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
declare function encodeTransactTypedData(c: TransactionContext, p: TransactRequestParams, deliveries: readonly Delivery[], f?: FundingInput): {
|
|
115
|
+
domain: {
|
|
116
|
+
name: string;
|
|
117
|
+
version: string;
|
|
118
|
+
chainId: bigint;
|
|
119
|
+
verifyingContract: `0x${string}`;
|
|
120
|
+
};
|
|
121
|
+
types: {
|
|
122
|
+
readonly WalletAuthorization: readonly [{
|
|
123
|
+
readonly name: "operation";
|
|
124
|
+
readonly type: "bytes32";
|
|
125
|
+
}, {
|
|
126
|
+
readonly name: "statementHash";
|
|
127
|
+
readonly type: "bytes32";
|
|
128
|
+
}];
|
|
129
|
+
};
|
|
130
|
+
primaryType: "WalletAuthorization";
|
|
131
|
+
message: {
|
|
132
|
+
operation: `0x${string}`;
|
|
133
|
+
statementHash: `0x${string}`;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
declare function transactFundingRequestHash(proof: Hex, p: TransactRequestParams, cs: readonly Delivery[]): `0x${string}`;
|
|
137
|
+
declare function encodeTransactFundingTypedData(c: TransactionContext, proof: Hex, p: TransactRequestParams, cs: readonly Delivery[], funding: FundingInput): {
|
|
138
|
+
domain: {
|
|
139
|
+
name: string;
|
|
140
|
+
version: string;
|
|
141
|
+
chainId: bigint;
|
|
142
|
+
verifyingContract: Hex;
|
|
143
|
+
};
|
|
144
|
+
primaryType: "FundTransact";
|
|
145
|
+
types: {
|
|
146
|
+
FundTransact: readonly [{
|
|
147
|
+
readonly name: "requestHash";
|
|
148
|
+
readonly type: "bytes32";
|
|
149
|
+
}, {
|
|
150
|
+
readonly name: "payer";
|
|
151
|
+
readonly type: "address";
|
|
152
|
+
}, {
|
|
153
|
+
readonly name: "amount";
|
|
154
|
+
readonly type: "uint256";
|
|
155
|
+
}, {
|
|
156
|
+
readonly name: "sigNonce";
|
|
157
|
+
readonly type: "uint256";
|
|
158
|
+
}, {
|
|
159
|
+
readonly name: "deadline";
|
|
160
|
+
readonly type: "uint256";
|
|
161
|
+
}];
|
|
162
|
+
};
|
|
163
|
+
message: {
|
|
164
|
+
requestHash: `0x${string}`;
|
|
165
|
+
payer: `0x${string}`;
|
|
166
|
+
amount: bigint;
|
|
167
|
+
sigNonce: bigint;
|
|
168
|
+
deadline: bigint;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
interface BuildShieldCalldataParams {
|
|
173
|
+
context: TransactionContext;
|
|
174
|
+
params: ShieldParams;
|
|
175
|
+
outputs: readonly ShieldOutput[];
|
|
176
|
+
deliveries: readonly Delivery[];
|
|
177
|
+
funding: FundingInput;
|
|
178
|
+
caller?: Address;
|
|
179
|
+
}
|
|
180
|
+
declare function validateShieldRequest(p: BuildShieldCalldataParams): Promise<FundingParams>;
|
|
181
|
+
declare function encodeShieldFundingTypedData(p: BuildShieldCalldataParams): Promise<{
|
|
182
|
+
domain: {
|
|
183
|
+
name: string;
|
|
184
|
+
version: string;
|
|
185
|
+
chainId: bigint;
|
|
186
|
+
verifyingContract: Hex;
|
|
187
|
+
};
|
|
188
|
+
primaryType: "FundShield";
|
|
189
|
+
types: {
|
|
190
|
+
FundShield: readonly [{
|
|
191
|
+
readonly name: "requestHash";
|
|
192
|
+
readonly type: "bytes32";
|
|
193
|
+
}, {
|
|
194
|
+
readonly name: "payer";
|
|
195
|
+
readonly type: "address";
|
|
196
|
+
}, {
|
|
197
|
+
readonly name: "amount";
|
|
198
|
+
readonly type: "uint256";
|
|
199
|
+
}, {
|
|
200
|
+
readonly name: "sigNonce";
|
|
201
|
+
readonly type: "uint256";
|
|
202
|
+
}, {
|
|
203
|
+
readonly name: "deadline";
|
|
204
|
+
readonly type: "uint256";
|
|
205
|
+
}];
|
|
206
|
+
};
|
|
207
|
+
message: {
|
|
208
|
+
requestHash: `0x${string}`;
|
|
209
|
+
payer: `0x${string}`;
|
|
210
|
+
amount: bigint;
|
|
211
|
+
sigNonce: bigint;
|
|
212
|
+
deadline: bigint;
|
|
213
|
+
};
|
|
214
|
+
}>;
|
|
215
|
+
declare function buildShieldCalldata(p: BuildShieldCalldataParams): Promise<{
|
|
216
|
+
data: Hex;
|
|
217
|
+
approveAmount: bigint;
|
|
218
|
+
}>;
|
|
219
|
+
declare function shieldFundingRequestHash(params: ShieldParams, outputs: readonly ShieldOutput[], cs: readonly Delivery[]): Hex;
|
|
220
|
+
|
|
221
|
+
interface AggregateRoute {
|
|
222
|
+
kind: "dedicated" | "mixed";
|
|
223
|
+
capacity: number;
|
|
224
|
+
count: number;
|
|
225
|
+
name: string;
|
|
226
|
+
publicInputCount: number;
|
|
227
|
+
}
|
|
228
|
+
declare const AGGREGATE_ROUTES: readonly AggregateRoute[];
|
|
229
|
+
/** Select the canonical immutable route without reordering requests or changing member capacities. */
|
|
230
|
+
declare function selectAggregateRoute(capacities: readonly number[]): AggregateRoute;
|
|
231
|
+
|
|
232
|
+
export { AGGREGATE_ROUTES, type AggregateMemberInput, type AggregateRoute, type BuildShieldCalldataParams, type BuildTransactAggregateCalldataParams, type BuildTransactCalldataParams, TRANSACT_CAPACITIES, type TransactCapacity, type TransactRequestParams, aggregateMemberRequestHash, aggregatePublicInputs, buildShieldCalldata, buildTransactAggregateCalldata, buildTransactCalldata, encodeAggregateFundingTypedData, encodeShieldFundingTypedData, encodeTransactFundingTypedData, encodeTransactTypedData, normalizeTransactRequest, selectAggregateRoute, selectTransactCapacity, shieldFundingRequestHash, transactFundingRequestHash, transactPublicInputs, validateShieldRequest };
|
package/dist/note.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AGGREGATE_ROUTES,
|
|
3
|
+
TRANSACT_CAPACITIES,
|
|
4
|
+
aggregateMemberRequestHash,
|
|
5
|
+
aggregatePublicInputs,
|
|
6
|
+
buildShieldCalldata,
|
|
7
|
+
buildTransactAggregateCalldata,
|
|
8
|
+
buildTransactCalldata,
|
|
9
|
+
encodeAggregateFundingTypedData,
|
|
10
|
+
encodeShieldFundingTypedData,
|
|
11
|
+
encodeTransactFundingTypedData,
|
|
12
|
+
encodeTransactTypedData,
|
|
13
|
+
normalizeTransactRequest,
|
|
14
|
+
selectAggregateRoute,
|
|
15
|
+
selectTransactCapacity,
|
|
16
|
+
shieldFundingRequestHash,
|
|
17
|
+
transactFundingRequestHash,
|
|
18
|
+
transactPublicInputs,
|
|
19
|
+
validateShieldRequest
|
|
20
|
+
} from "./chunk-MVQQD5W5.js";
|
|
21
|
+
import "./chunk-7SS2YSEF.js";
|
|
22
|
+
import "./chunk-HHJLFLVJ.js";
|
|
23
|
+
export {
|
|
24
|
+
AGGREGATE_ROUTES,
|
|
25
|
+
TRANSACT_CAPACITIES,
|
|
26
|
+
aggregateMemberRequestHash,
|
|
27
|
+
aggregatePublicInputs,
|
|
28
|
+
buildShieldCalldata,
|
|
29
|
+
buildTransactAggregateCalldata,
|
|
30
|
+
buildTransactCalldata,
|
|
31
|
+
encodeAggregateFundingTypedData,
|
|
32
|
+
encodeShieldFundingTypedData,
|
|
33
|
+
encodeTransactFundingTypedData,
|
|
34
|
+
encodeTransactTypedData,
|
|
35
|
+
normalizeTransactRequest,
|
|
36
|
+
selectAggregateRoute,
|
|
37
|
+
selectTransactCapacity,
|
|
38
|
+
shieldFundingRequestHash,
|
|
39
|
+
transactFundingRequestHash,
|
|
40
|
+
transactPublicInputs,
|
|
41
|
+
validateShieldRequest
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=note.js.map
|
package/dist/note.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|