@layerzerolabs/onesig-model 0.2.113 → 0.2.115
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/.turbo/turbo-build.log +51 -47
- package/.turbo/turbo-lint.log +1 -1
- package/dist/{BPXJBTYZ.js → 55LR37BZ.js} +3 -3
- package/dist/{BPXJBTYZ.js.map → 55LR37BZ.js.map} +1 -1
- package/dist/{S4JTB5O3.js → JDS2GCUD.js} +5 -3
- package/dist/JDS2GCUD.js.map +1 -0
- package/dist/P7VEODD3.js +353 -0
- package/dist/P7VEODD3.js.map +1 -0
- package/dist/{QFF6AT3B.js → TS6JM3WN.js} +3 -3
- package/dist/{QFF6AT3B.js.map → TS6JM3WN.js.map} +1 -1
- package/dist/index.js +4 -3
- package/dist/model/index.js +4 -3
- package/dist/model/onesig-bundle/calls/index.d.ts +303 -1
- package/dist/model/onesig-bundle/calls/index.d.ts.map +1 -1
- package/dist/model/onesig-bundle/calls/index.js +2 -1
- package/dist/model/onesig-bundle/calls/onesig-canton-call.d.ts +516 -0
- package/dist/model/onesig-bundle/calls/onesig-canton-call.d.ts.map +1 -0
- package/dist/model/onesig-bundle/calls/onesig-canton-call.js +4 -0
- package/dist/model/onesig-bundle/calls/onesig-canton-call.js.map +1 -0
- package/dist/model/onesig-bundle/index.js +4 -3
- package/dist/model/onesig-bundle/onesig-entity.d.ts +302 -1
- package/dist/model/onesig-bundle/onesig-entity.d.ts.map +1 -1
- package/dist/model/onesig-bundle/onesig-entity.js +4 -3
- package/dist/model/onesig-bundle/onesig-leaf.d.ts +302 -1
- package/dist/model/onesig-bundle/onesig-leaf.d.ts.map +1 -1
- package/dist/model/onesig-bundle/onesig-leaf.js +3 -2
- package/package.json +3 -3
- package/src/model/onesig-bundle/calls/index.ts +3 -0
- package/src/model/onesig-bundle/calls/onesig-canton-call.ts +429 -0
- package/dist/S4JTB5O3.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerzerolabs/onesig-model",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.115",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"tsup": "^8.4.0",
|
|
20
20
|
"vitest": "^3.2.6",
|
|
21
|
-
"@layerzerolabs/tsup-configuration": "0.2.
|
|
22
|
-
"@layerzerolabs/typescript-configuration": "0.2.
|
|
21
|
+
"@layerzerolabs/tsup-configuration": "0.2.115",
|
|
22
|
+
"@layerzerolabs/typescript-configuration": "0.2.115"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
+
import { oneSigCantonCallSchema } from './onesig-canton-call';
|
|
3
4
|
import { oneSigEVMCallSchema } from './onesig-evm-call';
|
|
4
5
|
import { oneSigSolanaCallSchema } from './onesig-solana-call';
|
|
5
6
|
import { oneSigStarknetCallSchema } from './onesig-starknet-call';
|
|
@@ -12,10 +13,12 @@ export const oneSigCallSchema = z.union([
|
|
|
12
13
|
oneSigStarknetCallSchema,
|
|
13
14
|
oneSigStellarCallSchema,
|
|
14
15
|
oneSigTONCallSchema,
|
|
16
|
+
oneSigCantonCallSchema,
|
|
15
17
|
]);
|
|
16
18
|
|
|
17
19
|
export type OneSigCall = z.infer<typeof oneSigCallSchema>;
|
|
18
20
|
|
|
21
|
+
export * from './onesig-canton-call';
|
|
19
22
|
export * from './onesig-evm-call';
|
|
20
23
|
export * from './onesig-solana-call';
|
|
21
24
|
export * from './onesig-starknet-call';
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A 64-bit integer field (nonce / threshold / count / signed DAML `Int`). A
|
|
5
|
+
* `number` must be a safe integer — larger values have already lost precision as
|
|
6
|
+
* a float, so a bigint is required for values beyond `MAX_SAFE_INTEGER`.
|
|
7
|
+
*
|
|
8
|
+
* Defined locally so this public model package depends only on `zod`; the Canton
|
|
9
|
+
* VM client (`@layerzerolabs/common-canton`, restricted) keeps its own
|
|
10
|
+
* structurally-identical copy for on-ledger serde.
|
|
11
|
+
*/
|
|
12
|
+
const IntLikeSchema = z
|
|
13
|
+
.union([z.bigint(), z.number()])
|
|
14
|
+
.refine((value) => typeof value === 'bigint' || Number.isSafeInteger(value), {
|
|
15
|
+
message: 'number must be a safe integer; pass a bigint for values beyond MAX_SAFE_INTEGER',
|
|
16
|
+
});
|
|
17
|
+
type IntLike = z.infer<typeof IntLikeSchema>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Discriminant of {@link OneSigCantonCall}. The enum value is the DAML `OneSigCall`
|
|
21
|
+
* constructor name (also the tag used in the Canton submission JSON), defined here
|
|
22
|
+
* once so it is never hardcoded at a call site.
|
|
23
|
+
*/
|
|
24
|
+
export enum OneSigCantonCallTag {
|
|
25
|
+
SetSigner = 'OpSetSigner',
|
|
26
|
+
SetThreshold = 'OpSetThreshold',
|
|
27
|
+
SetExecutor = 'OpSetExecutor',
|
|
28
|
+
SetExecutorRequired = 'OpSetExecutorRequired',
|
|
29
|
+
SetSeed = 'OpSetSeed',
|
|
30
|
+
CreateRequest = 'OpCreateRequest',
|
|
31
|
+
CreateOAppRequest = 'OpCreateOAppRequest',
|
|
32
|
+
AddToBlacklist = 'OpAddToBlacklist',
|
|
33
|
+
RemoveFromBlacklist = 'OpRemoveFromBlacklist',
|
|
34
|
+
AddToWhitelist = 'OpAddToWhitelist',
|
|
35
|
+
RemoveFromWhitelist = 'OpRemoveFromWhitelist',
|
|
36
|
+
SetAllowlistMode = 'OpSetAllowlistMode',
|
|
37
|
+
RateLimiterSetDefault = 'OpRateLimiterSetDefault',
|
|
38
|
+
RateLimiterSetEidOverride = 'OpRateLimiterSetEidOverride',
|
|
39
|
+
RateLimiterRemoveEidOverride = 'OpRateLimiterRemoveEidOverride',
|
|
40
|
+
RateLimiterSetGlobalFlags = 'OpRateLimiterSetGlobalFlags',
|
|
41
|
+
RateLimiterSetAddressExemption = 'OpRateLimiterSetAddressExemption',
|
|
42
|
+
RateLimiterSetState = 'OpRateLimiterSetState',
|
|
43
|
+
PauseLocalTransfers = 'OpPauseLocalTransfers',
|
|
44
|
+
UnpauseLocalTransfers = 'OpUnpauseLocalTransfers',
|
|
45
|
+
PauseDstEids = 'OpPauseDstEids',
|
|
46
|
+
UnpauseDstEids = 'OpUnpauseDstEids',
|
|
47
|
+
SetLedgerTimeValidityPeriod = 'OpSetLedgerTimeValidityPeriod',
|
|
48
|
+
SetPeer = 'OpSetPeer',
|
|
49
|
+
SetFeeBps = 'OpSetFeeBps',
|
|
50
|
+
SetFeeDeposit = 'OpSetFeeDeposit',
|
|
51
|
+
SetEnforcedOptions = 'OpSetEnforcedOptions',
|
|
52
|
+
RemoveEnforcedOption = 'OpRemoveEnforcedOption',
|
|
53
|
+
SetCostAsserts = 'OpSetCostAsserts',
|
|
54
|
+
RemoveCostAsserts = 'OpRemoveCostAsserts',
|
|
55
|
+
SetTransferRule = 'OpSetTransferRule',
|
|
56
|
+
SetOfferExpiryDelayPeriod = 'OpSetOfferExpiryDelayPeriod',
|
|
57
|
+
SetObservers = 'OpSetObservers',
|
|
58
|
+
SetRequestFactory = 'OpSetRequestFactory',
|
|
59
|
+
GrantRoles = 'OpGrantRoles',
|
|
60
|
+
RevokeRoles = 'OpRevokeRoles',
|
|
61
|
+
SetMinFee = 'OpSetMinFee',
|
|
62
|
+
SetProtocolLedgerTimeValidityPeriod = 'OpSetProtocolLedgerTimeValidityPeriod',
|
|
63
|
+
SetOneSigLedgerTimeValidityPeriod = 'OpSetOneSigLedgerTimeValidityPeriod',
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A Canton party, represented off-chain by its party-id text (`partyToText`),
|
|
68
|
+
* e.g. `Alice::1220<fingerprint>`. This is the value hashed into the leaf, so it
|
|
69
|
+
* must be the exact on-ledger party id. The Canton SDK imports this for
|
|
70
|
+
* chain-local use.
|
|
71
|
+
*/
|
|
72
|
+
export const CantonPartyIdSchema = z.string();
|
|
73
|
+
export type CantonPartyId = z.infer<typeof CantonPartyIdSchema>;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* A DAML `Decimal` (Numeric 10) argument. Accepts a string (recommended, exact)
|
|
77
|
+
* or a JS number; encoded via `formatDamlDecimal` to match DAML `show`.
|
|
78
|
+
*/
|
|
79
|
+
export const DecimalLikeSchema = z.union([z.string(), z.number()]);
|
|
80
|
+
export type DecimalLike = z.infer<typeof DecimalLikeSchema>;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* A DAML `Time` / `RelTime`, represented off-chain as whole **microseconds**
|
|
84
|
+
* (since the unix epoch for `Time`; a duration for `RelTime`). Microseconds are
|
|
85
|
+
* DAML's native precision, so an `IntLike` here reproduces the on-ledger value
|
|
86
|
+
* losslessly (unlike a JS `Date`, which is millisecond-precision).
|
|
87
|
+
*/
|
|
88
|
+
export const CantonMicrosSchema = IntLikeSchema;
|
|
89
|
+
export type CantonMicros = IntLike;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Identifies the OApp a config call targets, mirroring DAML `AppUID.Types.OAppId`.
|
|
93
|
+
* Signed into the leaf and checked on-ledger against the supplied config.
|
|
94
|
+
*/
|
|
95
|
+
export const CantonOAppIdSchema = z.object({
|
|
96
|
+
admin: CantonPartyIdSchema,
|
|
97
|
+
id: z.string(),
|
|
98
|
+
});
|
|
99
|
+
export type CantonOAppId = z.infer<typeof CantonOAppIdSchema>;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* A rate-limiter config entry (DAML `RateLimitConfigEntry`): the four enable
|
|
103
|
+
* flags followed by the outbound/inbound limits and windows.
|
|
104
|
+
*/
|
|
105
|
+
export const RateLimitConfigEntrySchema = z.object({
|
|
106
|
+
outboundEnabled: z.boolean(),
|
|
107
|
+
inboundEnabled: z.boolean(),
|
|
108
|
+
netAccountingEnabled: z.boolean(),
|
|
109
|
+
addressExemptionEnabled: z.boolean(),
|
|
110
|
+
outboundLimit: IntLikeSchema,
|
|
111
|
+
inboundLimit: IntLikeSchema,
|
|
112
|
+
outboundWindow: IntLikeSchema,
|
|
113
|
+
inboundWindow: IntLikeSchema,
|
|
114
|
+
});
|
|
115
|
+
export type RateLimitConfigEntry = z.infer<typeof RateLimitConfigEntrySchema>;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Cost-assert parameters for a destination eid (DAML `CostAssertConfig`).
|
|
119
|
+
* `nativeCap` is optional: `null`/omitted encodes as DAML `None`.
|
|
120
|
+
*/
|
|
121
|
+
export const CostAssertConfigSchema = z.object({
|
|
122
|
+
maxPriceRatio: DecimalLikeSchema,
|
|
123
|
+
maxGasPrice: IntLikeSchema,
|
|
124
|
+
gasPriceScale: IntLikeSchema,
|
|
125
|
+
nativeDecimalShift: IntLikeSchema,
|
|
126
|
+
nativeCap: IntLikeSchema.nullish(),
|
|
127
|
+
minFee: DecimalLikeSchema,
|
|
128
|
+
});
|
|
129
|
+
export type CostAssertConfig = z.infer<typeof CostAssertConfigSchema>;
|
|
130
|
+
|
|
131
|
+
/** One enforced-option entry (DAML `EnforcedOptionParam`): eid, msgType, hex options. */
|
|
132
|
+
export const EnforcedOptionParamSchema = z.object({
|
|
133
|
+
eid: IntLikeSchema,
|
|
134
|
+
msgType: IntLikeSchema,
|
|
135
|
+
options: z.string(),
|
|
136
|
+
});
|
|
137
|
+
export type EnforcedOptionParam = z.infer<typeof EnforcedOptionParamSchema>;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* A protocol-scoped contract identity (DAML `Scope`): category, instance id, and
|
|
141
|
+
* the authorizing admin party.
|
|
142
|
+
*/
|
|
143
|
+
export const CantonScopeSchema = z.object({
|
|
144
|
+
category: z.string(),
|
|
145
|
+
id: z.string(),
|
|
146
|
+
admin: CantonPartyIdSchema,
|
|
147
|
+
});
|
|
148
|
+
export type CantonScope = z.infer<typeof CantonScopeSchema>;
|
|
149
|
+
|
|
150
|
+
/** One `(roleName, party)` RBAC assignment (DAML `RoleAssignment`). */
|
|
151
|
+
export const CantonRoleAssignmentSchema = z.object({
|
|
152
|
+
roleName: z.string(),
|
|
153
|
+
party: CantonPartyIdSchema,
|
|
154
|
+
});
|
|
155
|
+
export type CantonRoleAssignment = z.infer<typeof CantonRoleAssignmentSchema>;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Allowlist mode, mirroring DAML `AllowlistMode`. Kept as a TS enum so call sites
|
|
159
|
+
* can reference the members (`CantonAllowlistMode.Open`); `CantonAllowlistModeSchema`
|
|
160
|
+
* validates the same values.
|
|
161
|
+
*/
|
|
162
|
+
export enum CantonAllowlistMode {
|
|
163
|
+
Open = 'Open',
|
|
164
|
+
Blacklist = 'Blacklist',
|
|
165
|
+
Whitelist = 'Whitelist',
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export const CantonAllowlistModeSchema = z.enum(CantonAllowlistMode);
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* The encodable subset of DAML `AnyValue` used inside a `CantonCallContext`. Contract
|
|
172
|
+
* ids and other non-reproducible values are intentionally absent: they cannot be
|
|
173
|
+
* reproduced off-chain and are rejected by the on-ledger encoder, so they must
|
|
174
|
+
* never appear in a signed context.
|
|
175
|
+
*
|
|
176
|
+
* `AnyValue` is recursive (`list` / `map` nest further values), so the type is
|
|
177
|
+
* declared explicitly and the schema is annotated with it and built via `z.lazy`.
|
|
178
|
+
*/
|
|
179
|
+
export type AnyValue =
|
|
180
|
+
| { type: 'text'; value: string }
|
|
181
|
+
| { type: 'int'; value: IntLike }
|
|
182
|
+
| { type: 'decimal'; value: string | number }
|
|
183
|
+
| { type: 'bool'; value: boolean }
|
|
184
|
+
| { type: 'party'; value: CantonPartyId }
|
|
185
|
+
| { type: 'list'; value: AnyValue[] }
|
|
186
|
+
| { type: 'map'; value: Record<string, AnyValue> };
|
|
187
|
+
|
|
188
|
+
export const AnyValueSchema: z.ZodType<AnyValue> = z.lazy(() =>
|
|
189
|
+
z.union([
|
|
190
|
+
z.object({ type: z.literal('text'), value: z.string() }),
|
|
191
|
+
z.object({ type: z.literal('int'), value: IntLikeSchema }),
|
|
192
|
+
z.object({ type: z.literal('decimal'), value: z.union([z.string(), z.number()]) }),
|
|
193
|
+
z.object({ type: z.literal('bool'), value: z.boolean() }),
|
|
194
|
+
z.object({ type: z.literal('party'), value: CantonPartyIdSchema }),
|
|
195
|
+
z.object({ type: z.literal('list'), value: z.array(AnyValueSchema) }),
|
|
196
|
+
z.object({ type: z.literal('map'), value: z.record(z.string(), AnyValueSchema) }),
|
|
197
|
+
]),
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
/** `argName => argValue` (DAML `CallArgs`). */
|
|
201
|
+
export const CantonCallArgsSchema = z.record(z.string(), AnyValueSchema);
|
|
202
|
+
export type CantonCallArgs = z.infer<typeof CantonCallArgsSchema>;
|
|
203
|
+
|
|
204
|
+
/** `fnSig => CallArgs` (DAML `CallFnArgs`). */
|
|
205
|
+
export const CantonCallFnArgsSchema = z.record(z.string(), CantonCallArgsSchema);
|
|
206
|
+
export type CantonCallFnArgs = z.infer<typeof CantonCallFnArgsSchema>;
|
|
207
|
+
|
|
208
|
+
/** `target.address => CallFnArgs` (DAML `CallContractArgs`; key is the address text). */
|
|
209
|
+
export const CantonCallContractArgsSchema = z.record(z.string(), CantonCallFnArgsSchema);
|
|
210
|
+
export type CantonCallContractArgs = z.infer<typeof CantonCallContractArgsSchema>;
|
|
211
|
+
|
|
212
|
+
/** `target.name => CallContractArgs` (DAML `CallTargetArgs`). */
|
|
213
|
+
export const CantonCallTargetArgsSchema = z.record(z.string(), CantonCallContractArgsSchema);
|
|
214
|
+
export type CantonCallTargetArgs = z.infer<typeof CantonCallTargetArgsSchema>;
|
|
215
|
+
|
|
216
|
+
/** `caller.address => CallTargetArgs` (DAML `CallCallerArgs`; key is the address text). */
|
|
217
|
+
export const CantonCallCallerArgsSchema = z.record(z.string(), CantonCallTargetArgsSchema);
|
|
218
|
+
export type CantonCallCallerArgs = z.infer<typeof CantonCallCallerArgsSchema>;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* The six-level nested call context, mirroring DAML `Call.CallContext`:
|
|
222
|
+
* caller.name => caller.address => target.name => target.address => fnSig => argName => argValue
|
|
223
|
+
* Address-keyed levels (caller.address, target.address) use the address text as
|
|
224
|
+
* the key; only text addresses are encodable.
|
|
225
|
+
*/
|
|
226
|
+
export const cantonCallContextSchema = z.record(z.string(), CantonCallCallerArgsSchema);
|
|
227
|
+
export type CantonCallContext = z.infer<typeof cantonCallContextSchema>;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Flat SDK representation of a signed OneSig call. Field names mirror the DAML
|
|
231
|
+
* `OneSigCall` constructors. This is the value hashed into the Merkle leaf — it is
|
|
232
|
+
* NOT the Canton submission (DAML-LF JSON) shape, which is built separately.
|
|
233
|
+
*/
|
|
234
|
+
export const oneSigCantonCallSchema = z.discriminatedUnion('tag', [
|
|
235
|
+
z.object({
|
|
236
|
+
tag: z.literal(OneSigCantonCallTag.SetSigner),
|
|
237
|
+
signer: z.string().regex(/^0x[0-9a-f]{40}$/),
|
|
238
|
+
active: z.boolean(),
|
|
239
|
+
}),
|
|
240
|
+
z.object({ tag: z.literal(OneSigCantonCallTag.SetThreshold), newThreshold: IntLikeSchema }),
|
|
241
|
+
z.object({
|
|
242
|
+
tag: z.literal(OneSigCantonCallTag.SetExecutor),
|
|
243
|
+
executor: CantonPartyIdSchema,
|
|
244
|
+
active: z.boolean(),
|
|
245
|
+
}),
|
|
246
|
+
z.object({ tag: z.literal(OneSigCantonCallTag.SetExecutorRequired), required: z.boolean() }),
|
|
247
|
+
z.object({ tag: z.literal(OneSigCantonCallTag.SetSeed), newSeed: z.string() }),
|
|
248
|
+
z.object({
|
|
249
|
+
tag: z.literal(OneSigCantonCallTag.CreateRequest),
|
|
250
|
+
callContext: cantonCallContextSchema,
|
|
251
|
+
callbackContext: cantonCallContextSchema,
|
|
252
|
+
requestObservers: z.array(CantonPartyIdSchema),
|
|
253
|
+
feeAmount: z.union([z.string(), z.number()]),
|
|
254
|
+
dso: CantonPartyIdSchema,
|
|
255
|
+
}),
|
|
256
|
+
z.object({
|
|
257
|
+
tag: z.literal(OneSigCantonCallTag.AddToBlacklist),
|
|
258
|
+
oappId: CantonOAppIdSchema,
|
|
259
|
+
parties: z.array(CantonPartyIdSchema),
|
|
260
|
+
}),
|
|
261
|
+
z.object({
|
|
262
|
+
tag: z.literal(OneSigCantonCallTag.RemoveFromBlacklist),
|
|
263
|
+
oappId: CantonOAppIdSchema,
|
|
264
|
+
parties: z.array(CantonPartyIdSchema),
|
|
265
|
+
}),
|
|
266
|
+
z.object({
|
|
267
|
+
tag: z.literal(OneSigCantonCallTag.AddToWhitelist),
|
|
268
|
+
oappId: CantonOAppIdSchema,
|
|
269
|
+
parties: z.array(CantonPartyIdSchema),
|
|
270
|
+
}),
|
|
271
|
+
z.object({
|
|
272
|
+
tag: z.literal(OneSigCantonCallTag.RemoveFromWhitelist),
|
|
273
|
+
oappId: CantonOAppIdSchema,
|
|
274
|
+
parties: z.array(CantonPartyIdSchema),
|
|
275
|
+
}),
|
|
276
|
+
z.object({
|
|
277
|
+
tag: z.literal(OneSigCantonCallTag.SetAllowlistMode),
|
|
278
|
+
oappId: CantonOAppIdSchema,
|
|
279
|
+
newMode: CantonAllowlistModeSchema,
|
|
280
|
+
}),
|
|
281
|
+
z.object({
|
|
282
|
+
tag: z.literal(OneSigCantonCallTag.CreateOAppRequest),
|
|
283
|
+
oappId: CantonOAppIdSchema,
|
|
284
|
+
callContext: cantonCallContextSchema,
|
|
285
|
+
callbackContext: cantonCallContextSchema,
|
|
286
|
+
requestObservers: z.array(CantonPartyIdSchema),
|
|
287
|
+
feeAmount: DecimalLikeSchema,
|
|
288
|
+
dso: CantonPartyIdSchema,
|
|
289
|
+
}),
|
|
290
|
+
z.object({
|
|
291
|
+
tag: z.literal(OneSigCantonCallTag.RateLimiterSetDefault),
|
|
292
|
+
oappId: CantonOAppIdSchema,
|
|
293
|
+
newDefaultConfig: RateLimitConfigEntrySchema,
|
|
294
|
+
}),
|
|
295
|
+
z.object({
|
|
296
|
+
tag: z.literal(OneSigCantonCallTag.RateLimiterSetEidOverride),
|
|
297
|
+
oappId: CantonOAppIdSchema,
|
|
298
|
+
eid: IntLikeSchema,
|
|
299
|
+
newConfig: RateLimitConfigEntrySchema,
|
|
300
|
+
}),
|
|
301
|
+
z.object({
|
|
302
|
+
tag: z.literal(OneSigCantonCallTag.RateLimiterRemoveEidOverride),
|
|
303
|
+
oappId: CantonOAppIdSchema,
|
|
304
|
+
eid: IntLikeSchema,
|
|
305
|
+
}),
|
|
306
|
+
z.object({
|
|
307
|
+
tag: z.literal(OneSigCantonCallTag.RateLimiterSetGlobalFlags),
|
|
308
|
+
oappId: CantonOAppIdSchema,
|
|
309
|
+
newUseGlobalState: z.boolean(),
|
|
310
|
+
newIsGloballyDisabled: z.boolean(),
|
|
311
|
+
}),
|
|
312
|
+
z.object({
|
|
313
|
+
tag: z.literal(OneSigCantonCallTag.RateLimiterSetAddressExemption),
|
|
314
|
+
oappId: CantonOAppIdSchema,
|
|
315
|
+
user: CantonPartyIdSchema,
|
|
316
|
+
isExempt: z.boolean(),
|
|
317
|
+
}),
|
|
318
|
+
z.object({
|
|
319
|
+
tag: z.literal(OneSigCantonCallTag.RateLimiterSetState),
|
|
320
|
+
oappId: CantonOAppIdSchema,
|
|
321
|
+
eid: IntLikeSchema,
|
|
322
|
+
outboundUsage: IntLikeSchema,
|
|
323
|
+
inboundUsage: IntLikeSchema,
|
|
324
|
+
lastUpdated: CantonMicrosSchema,
|
|
325
|
+
}),
|
|
326
|
+
z.object({
|
|
327
|
+
tag: z.literal(OneSigCantonCallTag.PauseLocalTransfers),
|
|
328
|
+
oappId: CantonOAppIdSchema,
|
|
329
|
+
}),
|
|
330
|
+
z.object({
|
|
331
|
+
tag: z.literal(OneSigCantonCallTag.UnpauseLocalTransfers),
|
|
332
|
+
oappId: CantonOAppIdSchema,
|
|
333
|
+
}),
|
|
334
|
+
z.object({
|
|
335
|
+
tag: z.literal(OneSigCantonCallTag.PauseDstEids),
|
|
336
|
+
oappId: CantonOAppIdSchema,
|
|
337
|
+
dstEids: z.array(IntLikeSchema),
|
|
338
|
+
}),
|
|
339
|
+
z.object({
|
|
340
|
+
tag: z.literal(OneSigCantonCallTag.UnpauseDstEids),
|
|
341
|
+
oappId: CantonOAppIdSchema,
|
|
342
|
+
dstEids: z.array(IntLikeSchema),
|
|
343
|
+
}),
|
|
344
|
+
z.object({
|
|
345
|
+
tag: z.literal(OneSigCantonCallTag.SetLedgerTimeValidityPeriod),
|
|
346
|
+
oappId: CantonOAppIdSchema,
|
|
347
|
+
newLedgerTimeValidityPeriod: CantonMicrosSchema,
|
|
348
|
+
}),
|
|
349
|
+
z.object({
|
|
350
|
+
tag: z.literal(OneSigCantonCallTag.SetPeer),
|
|
351
|
+
oappId: CantonOAppIdSchema,
|
|
352
|
+
eid: IntLikeSchema,
|
|
353
|
+
peer: z.string(),
|
|
354
|
+
}),
|
|
355
|
+
z.object({
|
|
356
|
+
tag: z.literal(OneSigCantonCallTag.SetFeeBps),
|
|
357
|
+
oappId: CantonOAppIdSchema,
|
|
358
|
+
dstEid: IntLikeSchema,
|
|
359
|
+
feeBps: IntLikeSchema,
|
|
360
|
+
}),
|
|
361
|
+
z.object({
|
|
362
|
+
tag: z.literal(OneSigCantonCallTag.SetFeeDeposit),
|
|
363
|
+
oappId: CantonOAppIdSchema,
|
|
364
|
+
newFeeDeposit: CantonPartyIdSchema,
|
|
365
|
+
}),
|
|
366
|
+
z.object({
|
|
367
|
+
tag: z.literal(OneSigCantonCallTag.SetEnforcedOptions),
|
|
368
|
+
oappId: CantonOAppIdSchema,
|
|
369
|
+
params: z.array(EnforcedOptionParamSchema),
|
|
370
|
+
}),
|
|
371
|
+
z.object({
|
|
372
|
+
tag: z.literal(OneSigCantonCallTag.RemoveEnforcedOption),
|
|
373
|
+
oappId: CantonOAppIdSchema,
|
|
374
|
+
eid: IntLikeSchema,
|
|
375
|
+
msgType: IntLikeSchema,
|
|
376
|
+
}),
|
|
377
|
+
z.object({
|
|
378
|
+
tag: z.literal(OneSigCantonCallTag.SetCostAsserts),
|
|
379
|
+
oappId: CantonOAppIdSchema,
|
|
380
|
+
eid: IntLikeSchema,
|
|
381
|
+
config: CostAssertConfigSchema,
|
|
382
|
+
}),
|
|
383
|
+
z.object({
|
|
384
|
+
tag: z.literal(OneSigCantonCallTag.RemoveCostAsserts),
|
|
385
|
+
oappId: CantonOAppIdSchema,
|
|
386
|
+
eid: IntLikeSchema,
|
|
387
|
+
}),
|
|
388
|
+
z.object({ tag: z.literal(OneSigCantonCallTag.SetTransferRule), oappId: CantonOAppIdSchema }),
|
|
389
|
+
z.object({
|
|
390
|
+
tag: z.literal(OneSigCantonCallTag.SetOfferExpiryDelayPeriod),
|
|
391
|
+
oappId: CantonOAppIdSchema,
|
|
392
|
+
newOfferExpiryDelayPeriod: CantonMicrosSchema,
|
|
393
|
+
}),
|
|
394
|
+
z.object({
|
|
395
|
+
tag: z.literal(OneSigCantonCallTag.SetObservers),
|
|
396
|
+
oappId: CantonOAppIdSchema,
|
|
397
|
+
newObservers: z.array(CantonPartyIdSchema),
|
|
398
|
+
}),
|
|
399
|
+
z.object({
|
|
400
|
+
tag: z.literal(OneSigCantonCallTag.SetRequestFactory),
|
|
401
|
+
oappId: CantonOAppIdSchema,
|
|
402
|
+
expectedHandler: CantonPartyIdSchema,
|
|
403
|
+
}),
|
|
404
|
+
z.object({
|
|
405
|
+
tag: z.literal(OneSigCantonCallTag.GrantRoles),
|
|
406
|
+
scope: CantonScopeSchema,
|
|
407
|
+
assignments: z.array(CantonRoleAssignmentSchema),
|
|
408
|
+
}),
|
|
409
|
+
z.object({
|
|
410
|
+
tag: z.literal(OneSigCantonCallTag.RevokeRoles),
|
|
411
|
+
scope: CantonScopeSchema,
|
|
412
|
+
assignments: z.array(CantonRoleAssignmentSchema),
|
|
413
|
+
}),
|
|
414
|
+
z.object({
|
|
415
|
+
tag: z.literal(OneSigCantonCallTag.SetMinFee),
|
|
416
|
+
scope: CantonScopeSchema,
|
|
417
|
+
newMinFee: DecimalLikeSchema,
|
|
418
|
+
}),
|
|
419
|
+
z.object({
|
|
420
|
+
tag: z.literal(OneSigCantonCallTag.SetProtocolLedgerTimeValidityPeriod),
|
|
421
|
+
scope: CantonScopeSchema,
|
|
422
|
+
newLedgerTimeValidityPeriod: CantonMicrosSchema,
|
|
423
|
+
}),
|
|
424
|
+
z.object({
|
|
425
|
+
tag: z.literal(OneSigCantonCallTag.SetOneSigLedgerTimeValidityPeriod),
|
|
426
|
+
newLedgerTimeValidityPeriod: CantonMicrosSchema,
|
|
427
|
+
}),
|
|
428
|
+
]);
|
|
429
|
+
export type OneSigCantonCall = z.infer<typeof oneSigCantonCallSchema>;
|
package/dist/S4JTB5O3.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/model/onesig-bundle/calls/index.ts"],"names":["oneSigCallSchema","z","union","oneSigEVMCallSchema","oneSigSolanaCallSchema","oneSigStarknetCallSchema","oneSigStellarCallSchema","oneSigTONCallSchema"],"mappings":";;;;;;;AAQO,IAAMA,gBAAAA,GAAmBC,EAAEC,KAAAA,CAAM;AACpCC,EAAAA,mBAAAA;AACAC,EAAAA,sBAAAA;AACAC,EAAAA,wBAAAA;AACAC,EAAAA,uBAAAA;AACAC,EAAAA;AACH,CAAA","file":"S4JTB5O3.js","sourcesContent":["import { z } from 'zod';\n\nimport { oneSigEVMCallSchema } from './onesig-evm-call';\nimport { oneSigSolanaCallSchema } from './onesig-solana-call';\nimport { oneSigStarknetCallSchema } from './onesig-starknet-call';\nimport { oneSigStellarCallSchema } from './onesig-stellar-call';\nimport { oneSigTONCallSchema } from './onesig-ton-call';\n\nexport const oneSigCallSchema = z.union([\n oneSigEVMCallSchema,\n oneSigSolanaCallSchema,\n oneSigStarknetCallSchema,\n oneSigStellarCallSchema,\n oneSigTONCallSchema,\n]);\n\nexport type OneSigCall = z.infer<typeof oneSigCallSchema>;\n\nexport * from './onesig-evm-call';\nexport * from './onesig-solana-call';\nexport * from './onesig-starknet-call';\nexport * from './onesig-stellar-call';\nexport * from './onesig-ton-call';\n"]}
|