lampamazaza-new-contract-types 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +95 -0
- package/dist/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/index.cjs +19 -0
- package/dist/index.d.cts +987 -0
- package/dist/index.d.ts +987 -0
- package/dist/index.js +18 -0
- package/dist/standard-schema.cjs +50 -0
- package/dist/standard-schema.d.cts +16 -0
- package/dist/standard-schema.d.ts +16 -0
- package/dist/standard-schema.js +49 -0
- package/dist/validate.cjs +150 -0
- package/dist/validate.d.cts +61 -0
- package/dist/validate.d.ts +61 -0
- package/dist/validate.js +94 -0
- package/package.json +73 -0
- package/schemas/intents.schema.json +24283 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,987 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by gen-defuse-types.ts.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* NEAR Account Identifier.
|
|
8
|
+
*
|
|
9
|
+
* This is a unique, syntactically valid, human-readable account identifier on the NEAR network.
|
|
10
|
+
*
|
|
11
|
+
* [See the crate-level docs for information about validation.](index.html#account-id-rules)
|
|
12
|
+
*
|
|
13
|
+
* Also see [Error kind precedence](AccountId#error-kind-precedence).
|
|
14
|
+
*
|
|
15
|
+
* ## Examples
|
|
16
|
+
*
|
|
17
|
+
* ``` use near_account_id::AccountId;
|
|
18
|
+
*
|
|
19
|
+
* let alice: AccountId = "alice.near".parse().unwrap();
|
|
20
|
+
*
|
|
21
|
+
* assert!("ƒelicia.near".parse::<AccountId>().is_err()); // (ƒ is not f) ```
|
|
22
|
+
*
|
|
23
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
24
|
+
* via the `definition` "AccountId".
|
|
25
|
+
*/
|
|
26
|
+
type AccountId = string;
|
|
27
|
+
/**
|
|
28
|
+
* Account identifier. This is the human readable UTF-8 string which is used internally to index accounts on the network and their respective state.
|
|
29
|
+
*
|
|
30
|
+
* This is the "referenced" version of the account ID. It is to [`AccountId`] what [`str`] is to [`String`], and works quite similarly to [`Path`]. Like with [`str`] and [`Path`], you can't have a value of type `AccountIdRef`, but you can have a reference like `&AccountIdRef` or `&mut AccountIdRef`.
|
|
31
|
+
*
|
|
32
|
+
* This type supports zero-copy deserialization offered by [`serde`](https://docs.rs/serde/), but cannot do the same for [`borsh`](https://docs.rs/borsh/) since the latter does not support zero-copy.
|
|
33
|
+
*
|
|
34
|
+
* # Examples ``` use near_account_id::{AccountId, AccountIdRef}; use std::convert::{TryFrom, TryInto};
|
|
35
|
+
*
|
|
36
|
+
* // Construction let alice = AccountIdRef::new("alice.near").unwrap(); assert!(AccountIdRef::new("invalid.").is_err()); ```
|
|
37
|
+
*
|
|
38
|
+
* [`FromStr`]: std::str::FromStr [`Path`]: std::path::Path
|
|
39
|
+
*
|
|
40
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
41
|
+
* via the `definition` "AccountIdRef".
|
|
42
|
+
*/
|
|
43
|
+
type AccountIdRef = string;
|
|
44
|
+
/**
|
|
45
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
46
|
+
* via the `definition` "Deadline".
|
|
47
|
+
*/
|
|
48
|
+
type Deadline = string;
|
|
49
|
+
/**
|
|
50
|
+
* 1 pip == 1/100th of bip == 0.0001%
|
|
51
|
+
*
|
|
52
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
53
|
+
* via the `definition` "Pips".
|
|
54
|
+
*/
|
|
55
|
+
type Pips = number;
|
|
56
|
+
/**
|
|
57
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
58
|
+
* via the `definition` "Intent".
|
|
59
|
+
*/
|
|
60
|
+
type Intent = IntentAddPublicKey | IntentRemovePublicKey | IntentTransfer | IntentFtWithdraw | IntentNftWithdraw | IntentMtWithdraw | IntentNativeWithdraw | IntentStorageDeposit | IntentTokenDiff | IntentSetAuthByPredecessorId | IntentAuthCall;
|
|
61
|
+
/**
|
|
62
|
+
* See [ERC-191](https://github.com/ethereum/ercs/blob/master/ERCS/erc-191.md)
|
|
63
|
+
*
|
|
64
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
65
|
+
* via the `definition` "Erc191Payload".
|
|
66
|
+
*/
|
|
67
|
+
type Erc191Payload = string;
|
|
68
|
+
/**
|
|
69
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
70
|
+
* via the `definition` "InvariantViolated".
|
|
71
|
+
*/
|
|
72
|
+
type InvariantViolated = InvariantViolatedUnmatchedDeltas | InvariantViolatedOverflow;
|
|
73
|
+
/**
|
|
74
|
+
* Assuming wallets want to interact with Intents protocol, besides preparing the data in a certain form, they have to have the capability to sign raw messages (off-chain signatures) using an algorithm we understand. This enum solves that problem.
|
|
75
|
+
*
|
|
76
|
+
* For example, because we support ERC-191 and know how to verify messages with that standard, we can allow wallets, like Metamask, sign messages to perform intents without having to support new cryptographic primitives and signing standards.
|
|
77
|
+
*
|
|
78
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
79
|
+
* via the `definition` "MultiPayload".
|
|
80
|
+
*/
|
|
81
|
+
type MultiPayload = MultiPayloadNep413 | MultiPayloadErc191 | MultiPayloadTip191 | MultiPayloadRawEd25519 | MultiPayloadWebauthn | MultiPayloadTonConnect | MultiPayloadSep53;
|
|
82
|
+
/**
|
|
83
|
+
* See [TIP-191](https://github.com/tronprotocol/tips/blob/master/tip-191.md)
|
|
84
|
+
*
|
|
85
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
86
|
+
* via the `definition` "Tip191Payload".
|
|
87
|
+
*/
|
|
88
|
+
type Tip191Payload = string;
|
|
89
|
+
/**
|
|
90
|
+
* See <https://docs.tonconsole.com/academy/sign-data#choosing-the-right-format>
|
|
91
|
+
*
|
|
92
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
93
|
+
* via the `definition` "TonConnectPayloadSchema".
|
|
94
|
+
*/
|
|
95
|
+
type TonConnectPayloadSchema = TonConnectPayloadSchemaText | TonConnectPayloadSchemaBinary | TonConnectPayloadSchemaCell;
|
|
96
|
+
/**
|
|
97
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
98
|
+
* via the `definition` "PickFirst(DateTimeint64)".
|
|
99
|
+
*/
|
|
100
|
+
type PickFirstDateTimeint64 = string | number;
|
|
101
|
+
/**
|
|
102
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
103
|
+
* via the `definition` "TonConnectPayloadSchema__Parsed".
|
|
104
|
+
*/
|
|
105
|
+
type TonConnectPayloadSchema__Parsed = {
|
|
106
|
+
text: {
|
|
107
|
+
original: string;
|
|
108
|
+
parsed: DefusePayloadFor_DefuseIntents;
|
|
109
|
+
};
|
|
110
|
+
type: "text";
|
|
111
|
+
} | TonConnectPayloadSchemaBinary | TonConnectPayloadSchemaCell;
|
|
112
|
+
/**
|
|
113
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
114
|
+
* via the `definition` "MultiPayloadNarrowed".
|
|
115
|
+
*/
|
|
116
|
+
type MultiPayloadNarrowed = {
|
|
117
|
+
standard: "nep413";
|
|
118
|
+
payload: Nep413Payload;
|
|
119
|
+
} | {
|
|
120
|
+
standard: "erc191";
|
|
121
|
+
payload: Erc191Payload;
|
|
122
|
+
} | {
|
|
123
|
+
standard: "tip191";
|
|
124
|
+
payload: Tip191Payload;
|
|
125
|
+
} | {
|
|
126
|
+
standard: "raw_ed25519";
|
|
127
|
+
payload: string;
|
|
128
|
+
} | {
|
|
129
|
+
standard: "webauthn";
|
|
130
|
+
payload: string;
|
|
131
|
+
} | {
|
|
132
|
+
standard: "ton_connect";
|
|
133
|
+
payload: TonConnectPayloadSchema;
|
|
134
|
+
} | {
|
|
135
|
+
standard: "sep53";
|
|
136
|
+
payload: string;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
140
|
+
* via the `definition` "MultiPayload__Parsed".
|
|
141
|
+
*/
|
|
142
|
+
type MultiPayload__Parsed = MultiPayloadNep413__Parsed | MultiPayloadErc191__Parsed | MultiPayloadTip191__Parsed | MultiPayloadRawEd25519__Parsed | MultiPayloadWebauthn__Parsed | MultiPayloadTonConnect__Parsed | MultiPayloadSep53__Parsed;
|
|
143
|
+
/**
|
|
144
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
145
|
+
* via the `definition` "MultiPayloadNarrowed__Parsed".
|
|
146
|
+
*/
|
|
147
|
+
type MultiPayloadNarrowed__Parsed = {
|
|
148
|
+
standard: "nep413";
|
|
149
|
+
payload: Nep413Payload__Parsed;
|
|
150
|
+
} | {
|
|
151
|
+
standard: "erc191";
|
|
152
|
+
payload: {
|
|
153
|
+
original: string;
|
|
154
|
+
parsed: DefusePayloadFor_DefuseIntents;
|
|
155
|
+
};
|
|
156
|
+
} | {
|
|
157
|
+
standard: "tip191";
|
|
158
|
+
payload: {
|
|
159
|
+
original: string;
|
|
160
|
+
parsed: DefusePayloadFor_DefuseIntents;
|
|
161
|
+
};
|
|
162
|
+
} | {
|
|
163
|
+
standard: "raw_ed25519";
|
|
164
|
+
payload: {
|
|
165
|
+
original: string;
|
|
166
|
+
parsed: DefusePayloadFor_DefuseIntents;
|
|
167
|
+
};
|
|
168
|
+
} | {
|
|
169
|
+
standard: "webauthn";
|
|
170
|
+
payload: {
|
|
171
|
+
original: string;
|
|
172
|
+
parsed: DefusePayloadFor_DefuseIntents;
|
|
173
|
+
};
|
|
174
|
+
} | {
|
|
175
|
+
standard: "ton_connect";
|
|
176
|
+
payload: TonConnectPayloadSchema__Parsed;
|
|
177
|
+
} | {
|
|
178
|
+
standard: "sep53";
|
|
179
|
+
payload: {
|
|
180
|
+
original: string;
|
|
181
|
+
parsed: DefusePayloadFor_DefuseIntents;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
interface NEARIntentsSchema {
|
|
185
|
+
[k: string]: unknown;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Call [`.on_auth`](::defuse_auth_call::AuthCallee::on_auth) with `signer_id` of intent.
|
|
189
|
+
*
|
|
190
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
191
|
+
* via the `definition` "AuthCall".
|
|
192
|
+
*/
|
|
193
|
+
interface AuthCall {
|
|
194
|
+
/**
|
|
195
|
+
* Optionally, attach deposit to [`.on_auth`](::defuse_auth_call::AuthCallee::on_auth) call. The amount will be subtracted from user's NEP-141 `wNEAR` balance.
|
|
196
|
+
*
|
|
197
|
+
* NOTE: the `wNEAR` will not be refunded in case of fail.
|
|
198
|
+
*/
|
|
199
|
+
attached_deposit?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Callee for [`.on_auth`](::defuse_auth_call::AuthCallee::on_auth)
|
|
202
|
+
*/
|
|
203
|
+
contract_id: AccountId;
|
|
204
|
+
/**
|
|
205
|
+
* Optional minimum gas required for created promise to succeed. By default, only [`MIN_GAS_DEFAULT`](AuthCall::MIN_GAS_DEFAULT) is required.
|
|
206
|
+
*
|
|
207
|
+
* Remaining gas will be distributed evenly across all Function Call Promises created during execution of current receipt.
|
|
208
|
+
*/
|
|
209
|
+
min_gas?: string | null;
|
|
210
|
+
/**
|
|
211
|
+
* `msg` to pass in [`.on_auth`](::defuse_auth_call::AuthCallee::on_auth)
|
|
212
|
+
*/
|
|
213
|
+
msg: string;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
217
|
+
* via the `definition` "DefuseConfig".
|
|
218
|
+
*/
|
|
219
|
+
interface DefuseConfig {
|
|
220
|
+
fees: FeesConfig;
|
|
221
|
+
roles: RolesConfig;
|
|
222
|
+
wnear_id: AccountId;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
226
|
+
* via the `definition` "FeesConfig".
|
|
227
|
+
*/
|
|
228
|
+
interface FeesConfig {
|
|
229
|
+
fee: Pips;
|
|
230
|
+
fee_collector: AccountId;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
234
|
+
* via the `definition` "RolesConfig".
|
|
235
|
+
*/
|
|
236
|
+
interface RolesConfig {
|
|
237
|
+
admins: {
|
|
238
|
+
[k: string]: AccountId[];
|
|
239
|
+
};
|
|
240
|
+
grantees: {
|
|
241
|
+
[k: string]: AccountId[];
|
|
242
|
+
};
|
|
243
|
+
super_admins: AccountId[];
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
247
|
+
* via the `definition` "DefusePayload_for_DefuseIntents".
|
|
248
|
+
*/
|
|
249
|
+
interface DefusePayloadFor_DefuseIntents {
|
|
250
|
+
deadline: Deadline;
|
|
251
|
+
/**
|
|
252
|
+
* Sequence of intents to execute in given order. Empty list is also a valid sequence, i.e. it doesn't do anything, but still invalidates the `nonce` for the signer WARNING: Promises created by different intents are executed concurrently and does not rely on the order of the intents in this structure
|
|
253
|
+
*/
|
|
254
|
+
intents?: Intent[];
|
|
255
|
+
nonce: string;
|
|
256
|
+
signer_id: AccountId;
|
|
257
|
+
verifying_contract: AccountId;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* See [`AddPublicKey`]
|
|
261
|
+
*
|
|
262
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
263
|
+
* via the `definition` "IntentAddPublicKey".
|
|
264
|
+
*/
|
|
265
|
+
interface IntentAddPublicKey {
|
|
266
|
+
intent: "add_public_key";
|
|
267
|
+
public_key: string;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* See [`RemovePublicKey`]
|
|
271
|
+
*
|
|
272
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
273
|
+
* via the `definition` "IntentRemovePublicKey".
|
|
274
|
+
*/
|
|
275
|
+
interface IntentRemovePublicKey {
|
|
276
|
+
intent: "remove_public_key";
|
|
277
|
+
public_key: string;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* See [`Transfer`]
|
|
281
|
+
*
|
|
282
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
283
|
+
* via the `definition` "IntentTransfer".
|
|
284
|
+
*/
|
|
285
|
+
interface IntentTransfer {
|
|
286
|
+
intent: "transfer";
|
|
287
|
+
memo?: string | null;
|
|
288
|
+
receiver_id: AccountId;
|
|
289
|
+
tokens: {
|
|
290
|
+
[k: string]: string;
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* See [`FtWithdraw`]
|
|
295
|
+
*
|
|
296
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
297
|
+
* via the `definition` "IntentFtWithdraw".
|
|
298
|
+
*/
|
|
299
|
+
interface IntentFtWithdraw {
|
|
300
|
+
amount: string;
|
|
301
|
+
intent: "ft_withdraw";
|
|
302
|
+
memo?: string | null;
|
|
303
|
+
/**
|
|
304
|
+
* Optional minimum required Near gas for created Promise to succeed: * `ft_transfer`: minimum: 15TGas, default: 15TGas * `ft_transfer_call`: minimum: 30TGas, default: 50TGas
|
|
305
|
+
*
|
|
306
|
+
* Remaining gas will be distributed evenly across all Function Call Promises created during execution of current receipt.
|
|
307
|
+
*/
|
|
308
|
+
min_gas?: string | null;
|
|
309
|
+
/**
|
|
310
|
+
* Message to pass to `ft_transfer_call`. Otherwise, `ft_transfer` will be used. NOTE: No refund will be made in case of insufficient `storage_deposit` on `token` for `receiver_id`
|
|
311
|
+
*/
|
|
312
|
+
msg?: string | null;
|
|
313
|
+
receiver_id: AccountId;
|
|
314
|
+
/**
|
|
315
|
+
* Optionally make `storage_deposit` for `receiver_id` on `token`. The amount will be subtracted from user's NEP-141 `wNEAR` balance. NOTE: the `wNEAR` will not be refunded in case of fail
|
|
316
|
+
*/
|
|
317
|
+
storage_deposit?: string | null;
|
|
318
|
+
token: AccountId;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* See [`NftWithdraw`]
|
|
322
|
+
*
|
|
323
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
324
|
+
* via the `definition` "IntentNftWithdraw".
|
|
325
|
+
*/
|
|
326
|
+
interface IntentNftWithdraw {
|
|
327
|
+
intent: "nft_withdraw";
|
|
328
|
+
memo?: string | null;
|
|
329
|
+
/**
|
|
330
|
+
* Optional minimum required Near gas for created Promise to succeed: * `nft_transfer`: minimum: 15TGas, default: 15TGas * `nft_transfer_call`: minimum: 30TGas, default: 50TGas
|
|
331
|
+
*
|
|
332
|
+
* Remaining gas will be distributed evenly across all Function Call Promises created during execution of current receipt.
|
|
333
|
+
*/
|
|
334
|
+
min_gas?: string | null;
|
|
335
|
+
/**
|
|
336
|
+
* Message to pass to `nft_transfer_call`. Otherwise, `nft_transfer` will be used. NOTE: No refund will be made in case of insufficient `storage_deposit` on `token` for `receiver_id`
|
|
337
|
+
*/
|
|
338
|
+
msg?: string | null;
|
|
339
|
+
receiver_id: AccountId;
|
|
340
|
+
/**
|
|
341
|
+
* Optionally make `storage_deposit` for `receiver_id` on `token`. The amount will be subtracted from user's NEP-141 `wNEAR` balance. NOTE: the `wNEAR` will not be refunded in case of fail
|
|
342
|
+
*/
|
|
343
|
+
storage_deposit?: string | null;
|
|
344
|
+
token: AccountId;
|
|
345
|
+
token_id: string;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* See [`MtWithdraw`]
|
|
349
|
+
*
|
|
350
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
351
|
+
* via the `definition` "IntentMtWithdraw".
|
|
352
|
+
*/
|
|
353
|
+
interface IntentMtWithdraw {
|
|
354
|
+
amounts: string[];
|
|
355
|
+
intent: "mt_withdraw";
|
|
356
|
+
memo?: string | null;
|
|
357
|
+
/**
|
|
358
|
+
* Optional minimum required Near gas for created Promise to succeed: * `mt_batch_transfer`: minimum: 15TGas, default: 15TGas * `mt_batch_transfer_call`: minimum: 35TGas, default: 50TGas
|
|
359
|
+
*
|
|
360
|
+
* Remaining gas will be distributed evenly across all Function Call Promises created during execution of current receipt.
|
|
361
|
+
*/
|
|
362
|
+
min_gas?: string | null;
|
|
363
|
+
/**
|
|
364
|
+
* Message to pass to `mt_batch_transfer_call`. Otherwise, `mt_batch_transfer` will be used. NOTE: No refund will be made in case of insufficient `storage_deposit` on `token` for `receiver_id`
|
|
365
|
+
*/
|
|
366
|
+
msg?: string | null;
|
|
367
|
+
receiver_id: AccountId;
|
|
368
|
+
/**
|
|
369
|
+
* Optionally make `storage_deposit` for `receiver_id` on `token`. The amount will be subtracted from user's NEP-141 `wNEAR` balance. NOTE: the `wNEAR` will not be refunded in case of fail
|
|
370
|
+
*/
|
|
371
|
+
storage_deposit?: string | null;
|
|
372
|
+
token: AccountId;
|
|
373
|
+
token_ids: string[];
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* See [`NativeWithdraw`]
|
|
377
|
+
*
|
|
378
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
379
|
+
* via the `definition` "IntentNativeWithdraw".
|
|
380
|
+
*/
|
|
381
|
+
interface IntentNativeWithdraw {
|
|
382
|
+
amount: string;
|
|
383
|
+
intent: "native_withdraw";
|
|
384
|
+
receiver_id: AccountId;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* See [`StorageDeposit`]
|
|
388
|
+
*
|
|
389
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
390
|
+
* via the `definition` "IntentStorageDeposit".
|
|
391
|
+
*/
|
|
392
|
+
interface IntentStorageDeposit {
|
|
393
|
+
amount: string;
|
|
394
|
+
contract_id: AccountId;
|
|
395
|
+
deposit_for_account_id: AccountId;
|
|
396
|
+
intent: "storage_deposit";
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* See [`TokenDiff`]
|
|
400
|
+
*
|
|
401
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
402
|
+
* via the `definition` "IntentTokenDiff".
|
|
403
|
+
*/
|
|
404
|
+
interface IntentTokenDiff {
|
|
405
|
+
diff: {
|
|
406
|
+
[k: string]: string;
|
|
407
|
+
};
|
|
408
|
+
intent: "token_diff";
|
|
409
|
+
memo?: string | null;
|
|
410
|
+
referral?: AccountId | null;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* See [`SetAuthByPredecessorId`]
|
|
414
|
+
*
|
|
415
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
416
|
+
* via the `definition` "IntentSetAuthByPredecessorId".
|
|
417
|
+
*/
|
|
418
|
+
interface IntentSetAuthByPredecessorId {
|
|
419
|
+
enabled: boolean;
|
|
420
|
+
intent: "set_auth_by_predecessor_id";
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* See [`AuthCall`]
|
|
424
|
+
*
|
|
425
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
426
|
+
* via the `definition` "IntentAuthCall".
|
|
427
|
+
*/
|
|
428
|
+
interface IntentAuthCall {
|
|
429
|
+
/**
|
|
430
|
+
* Optionally, attach deposit to [`.on_auth`](::defuse_auth_call::AuthCallee::on_auth) call. The amount will be subtracted from user's NEP-141 `wNEAR` balance.
|
|
431
|
+
*
|
|
432
|
+
* NOTE: the `wNEAR` will not be refunded in case of fail.
|
|
433
|
+
*/
|
|
434
|
+
attached_deposit?: string;
|
|
435
|
+
/**
|
|
436
|
+
* Callee for [`.on_auth`](::defuse_auth_call::AuthCallee::on_auth)
|
|
437
|
+
*/
|
|
438
|
+
contract_id: AccountId;
|
|
439
|
+
intent: "auth_call";
|
|
440
|
+
/**
|
|
441
|
+
* Optional minimum gas required for created promise to succeed. By default, only [`MIN_GAS_DEFAULT`](AuthCall::MIN_GAS_DEFAULT) is required.
|
|
442
|
+
*
|
|
443
|
+
* Remaining gas will be distributed evenly across all Function Call Promises created during execution of current receipt.
|
|
444
|
+
*/
|
|
445
|
+
min_gas?: string | null;
|
|
446
|
+
/**
|
|
447
|
+
* `msg` to pass in [`.on_auth`](::defuse_auth_call::AuthCallee::on_auth)
|
|
448
|
+
*/
|
|
449
|
+
msg: string;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Withdraw given FT tokens from the intents contract to a given external account id (external being outside of intents).
|
|
453
|
+
*
|
|
454
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
455
|
+
* via the `definition` "FtWithdraw".
|
|
456
|
+
*/
|
|
457
|
+
interface FtWithdraw {
|
|
458
|
+
amount: string;
|
|
459
|
+
memo?: string | null;
|
|
460
|
+
/**
|
|
461
|
+
* Optional minimum required Near gas for created Promise to succeed: * `ft_transfer`: minimum: 15TGas, default: 15TGas * `ft_transfer_call`: minimum: 30TGas, default: 50TGas
|
|
462
|
+
*
|
|
463
|
+
* Remaining gas will be distributed evenly across all Function Call Promises created during execution of current receipt.
|
|
464
|
+
*/
|
|
465
|
+
min_gas?: string | null;
|
|
466
|
+
/**
|
|
467
|
+
* Message to pass to `ft_transfer_call`. Otherwise, `ft_transfer` will be used. NOTE: No refund will be made in case of insufficient `storage_deposit` on `token` for `receiver_id`
|
|
468
|
+
*/
|
|
469
|
+
msg?: string | null;
|
|
470
|
+
receiver_id: AccountId;
|
|
471
|
+
/**
|
|
472
|
+
* Optionally make `storage_deposit` for `receiver_id` on `token`. The amount will be subtracted from user's NEP-141 `wNEAR` balance. NOTE: the `wNEAR` will not be refunded in case of fail
|
|
473
|
+
*/
|
|
474
|
+
storage_deposit?: string | null;
|
|
475
|
+
token: AccountId;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
479
|
+
* via the `definition` "IntentEvent_for_AccountEvent_for_NonceEvent".
|
|
480
|
+
*/
|
|
481
|
+
interface IntentEventFor_AccountEventFor_NonceEvent {
|
|
482
|
+
account_id: AccountIdRef;
|
|
483
|
+
intent_hash: string;
|
|
484
|
+
nonce: string;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
488
|
+
* via the `definition` "InvariantViolatedUnmatchedDeltas".
|
|
489
|
+
*/
|
|
490
|
+
interface InvariantViolatedUnmatchedDeltas {
|
|
491
|
+
error: "unmatched_deltas";
|
|
492
|
+
unmatched_deltas: {
|
|
493
|
+
[k: string]: string;
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
498
|
+
* via the `definition` "InvariantViolatedOverflow".
|
|
499
|
+
*/
|
|
500
|
+
interface InvariantViolatedOverflow {
|
|
501
|
+
error: "overflow";
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Withdraw given MT tokens (i.e. [NEP-245](https://github.com/near/NEPs/blob/master/neps/nep-0245.md)) from the intents contract to a given to an external account id (external being outside of intents).
|
|
505
|
+
*
|
|
506
|
+
* If `msg` is given, `mt_batch_transfer_call()` will be used to transfer to the `receiver_id`. Otherwise, `mt_batch_transfer()` will be used.
|
|
507
|
+
*
|
|
508
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
509
|
+
* via the `definition` "MtWithdraw".
|
|
510
|
+
*/
|
|
511
|
+
interface MtWithdraw {
|
|
512
|
+
amounts: string[];
|
|
513
|
+
memo?: string | null;
|
|
514
|
+
/**
|
|
515
|
+
* Optional minimum required Near gas for created Promise to succeed: * `mt_batch_transfer`: minimum: 15TGas, default: 15TGas * `mt_batch_transfer_call`: minimum: 35TGas, default: 50TGas
|
|
516
|
+
*
|
|
517
|
+
* Remaining gas will be distributed evenly across all Function Call Promises created during execution of current receipt.
|
|
518
|
+
*/
|
|
519
|
+
min_gas?: string | null;
|
|
520
|
+
/**
|
|
521
|
+
* Message to pass to `mt_batch_transfer_call`. Otherwise, `mt_batch_transfer` will be used. NOTE: No refund will be made in case of insufficient `storage_deposit` on `token` for `receiver_id`
|
|
522
|
+
*/
|
|
523
|
+
msg?: string | null;
|
|
524
|
+
receiver_id: AccountId;
|
|
525
|
+
/**
|
|
526
|
+
* Optionally make `storage_deposit` for `receiver_id` on `token`. The amount will be subtracted from user's NEP-141 `wNEAR` balance. NOTE: the `wNEAR` will not be refunded in case of fail
|
|
527
|
+
*/
|
|
528
|
+
storage_deposit?: string | null;
|
|
529
|
+
token: AccountId;
|
|
530
|
+
token_ids: string[];
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* NEP-413: The standard for message signing in Near Protocol. For more details, refer to [NEP-413](https://github.com/near/NEPs/blob/master/neps/nep-0413.md).
|
|
534
|
+
*
|
|
535
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
536
|
+
* via the `definition` "MultiPayloadNep413".
|
|
537
|
+
*/
|
|
538
|
+
interface MultiPayloadNep413 {
|
|
539
|
+
payload: Nep413Payload;
|
|
540
|
+
public_key: string;
|
|
541
|
+
signature: string;
|
|
542
|
+
standard: "nep413";
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* See [NEP-413](https://github.com/near/NEPs/blob/master/neps/nep-0413.md)
|
|
546
|
+
*
|
|
547
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
548
|
+
* via the `definition` "Nep413Payload".
|
|
549
|
+
*/
|
|
550
|
+
interface Nep413Payload {
|
|
551
|
+
callbackUrl?: string | null;
|
|
552
|
+
message: string;
|
|
553
|
+
nonce: string;
|
|
554
|
+
recipient: string;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* ERC-191: The standard for message signing in Ethereum, commonly used with `personal_sign()`. For more details, refer to [EIP-191](https://eips.ethereum.org/EIPS/eip-191).
|
|
558
|
+
*
|
|
559
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
560
|
+
* via the `definition` "MultiPayloadErc191".
|
|
561
|
+
*/
|
|
562
|
+
interface MultiPayloadErc191 {
|
|
563
|
+
payload: Erc191Payload;
|
|
564
|
+
/**
|
|
565
|
+
* There is no public key member because the public key can be recovered via `ecrecover()` knowing the data and the signature
|
|
566
|
+
*/
|
|
567
|
+
signature: string;
|
|
568
|
+
standard: "erc191";
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* TIP-191: The standard for message signing in Tron. For more details, refer to [TIP-191](https://github.com/tronprotocol/tips/blob/master/tip-191.md).
|
|
572
|
+
*
|
|
573
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
574
|
+
* via the `definition` "MultiPayloadTip191".
|
|
575
|
+
*/
|
|
576
|
+
interface MultiPayloadTip191 {
|
|
577
|
+
payload: Tip191Payload;
|
|
578
|
+
/**
|
|
579
|
+
* There is no public key member because the public key can be recovered via `ecrecover()` knowing the data and the signature
|
|
580
|
+
*/
|
|
581
|
+
signature: string;
|
|
582
|
+
standard: "tip191";
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Raw Ed25519: The standard used by Solana Phantom wallets for message signing. For more details, refer to [Phantom Wallet's documentation](https://docs.phantom.com/solana/signing-a-message).
|
|
586
|
+
*
|
|
587
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
588
|
+
* via the `definition` "MultiPayloadRawEd25519".
|
|
589
|
+
*/
|
|
590
|
+
interface MultiPayloadRawEd25519 {
|
|
591
|
+
payload: string;
|
|
592
|
+
public_key: string;
|
|
593
|
+
signature: string;
|
|
594
|
+
standard: "raw_ed25519";
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* [COSE ES256 (-7) algorithm](https://www.iana.org/assignments/cose/cose.xhtml#algorithms): NIST P-256 curve (a.k.a secp256r1) over SHA-256
|
|
598
|
+
*
|
|
599
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
600
|
+
* via the `definition` "MultiPayloadWebauthn".
|
|
601
|
+
*/
|
|
602
|
+
interface MultiPayloadWebauthn {
|
|
603
|
+
/**
|
|
604
|
+
* Base64Url-encoded [authenticatorData](https://w3c.github.io/webauthn/#authenticator-data)
|
|
605
|
+
*/
|
|
606
|
+
authenticator_data: string;
|
|
607
|
+
/**
|
|
608
|
+
* Serialized [clientDataJSON](https://w3c.github.io/webauthn/#dom-authenticatorresponse-clientdatajson)
|
|
609
|
+
*/
|
|
610
|
+
client_data_json: string;
|
|
611
|
+
payload: string;
|
|
612
|
+
standard: "webauthn";
|
|
613
|
+
public_key: string;
|
|
614
|
+
signature: string;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* TonConnect: The standard for data signing in TON blockchain platform. For more details, refer to [TonConnect documentation](https://docs.tonconsole.com/academy/sign-data).
|
|
618
|
+
*
|
|
619
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
620
|
+
* via the `definition` "MultiPayloadTonConnect".
|
|
621
|
+
*/
|
|
622
|
+
interface MultiPayloadTonConnect {
|
|
623
|
+
/**
|
|
624
|
+
* Wallet address in either [Raw](https://docs.ton.org/v3/documentation/smart-contracts/addresses/address-formats#raw-address) representation or [user-friendly](https://docs.ton.org/v3/documentation/smart-contracts/addresses/address-formats#user-friendly-address) format
|
|
625
|
+
*/
|
|
626
|
+
address: string;
|
|
627
|
+
/**
|
|
628
|
+
* dApp domain
|
|
629
|
+
*/
|
|
630
|
+
domain: string;
|
|
631
|
+
payload: TonConnectPayloadSchema;
|
|
632
|
+
public_key: string;
|
|
633
|
+
signature: string;
|
|
634
|
+
standard: "ton_connect";
|
|
635
|
+
/**
|
|
636
|
+
* UNIX timestamp (in seconds or RFC3339) at the time of singing
|
|
637
|
+
*/
|
|
638
|
+
timestamp: PickFirstDateTimeint64;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
642
|
+
* via the `definition` "TonConnectPayloadSchemaText".
|
|
643
|
+
*/
|
|
644
|
+
interface TonConnectPayloadSchemaText {
|
|
645
|
+
text: string;
|
|
646
|
+
type: "text";
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
650
|
+
* via the `definition` "TonConnectPayloadSchemaBinary".
|
|
651
|
+
*/
|
|
652
|
+
interface TonConnectPayloadSchemaBinary {
|
|
653
|
+
bytes: string;
|
|
654
|
+
type: "binary";
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
658
|
+
* via the `definition` "TonConnectPayloadSchemaCell".
|
|
659
|
+
*/
|
|
660
|
+
interface TonConnectPayloadSchemaCell {
|
|
661
|
+
cell: string;
|
|
662
|
+
schema_crc: number;
|
|
663
|
+
type: "cell";
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* SEP-53: The standard for signing data off-chain for Stellar accounts. See [SEP-53](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0053.md)
|
|
667
|
+
*
|
|
668
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
669
|
+
* via the `definition` "MultiPayloadSep53".
|
|
670
|
+
*/
|
|
671
|
+
interface MultiPayloadSep53 {
|
|
672
|
+
payload: string;
|
|
673
|
+
public_key: string;
|
|
674
|
+
signature: string;
|
|
675
|
+
standard: "sep53";
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* Withdraw native tokens (NEAR) from the intents contract to a given external account id (external being outside of intents). This will subtract from the account's wNEAR balance, and will be sent to the account specified as native NEAR. NOTE: the `wNEAR` will not be refunded in case of fail (e.g. `receiver_id` account does not exist).
|
|
679
|
+
*
|
|
680
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
681
|
+
* via the `definition` "NativeWithdraw".
|
|
682
|
+
*/
|
|
683
|
+
interface NativeWithdraw {
|
|
684
|
+
amount: string;
|
|
685
|
+
receiver_id: AccountId;
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
689
|
+
* via the `definition` "Nep413DefuseMessage_for_DefuseIntents".
|
|
690
|
+
*/
|
|
691
|
+
interface Nep413DefuseMessageFor_DefuseIntents {
|
|
692
|
+
deadline: Deadline;
|
|
693
|
+
/**
|
|
694
|
+
* Sequence of intents to execute in given order. Empty list is also a valid sequence, i.e. it doesn't do anything, but still invalidates the `nonce` for the signer WARNING: Promises created by different intents are executed concurrently and does not rely on the order of the intents in this structure
|
|
695
|
+
*/
|
|
696
|
+
intents?: Intent[];
|
|
697
|
+
signer_id: AccountId;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Withdraw given NFT tokens from the intents contract to a given external account id (external being outside of intents).
|
|
701
|
+
*
|
|
702
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
703
|
+
* via the `definition` "NftWithdraw".
|
|
704
|
+
*/
|
|
705
|
+
interface NftWithdraw {
|
|
706
|
+
memo?: string | null;
|
|
707
|
+
/**
|
|
708
|
+
* Optional minimum required Near gas for created Promise to succeed: * `nft_transfer`: minimum: 15TGas, default: 15TGas * `nft_transfer_call`: minimum: 30TGas, default: 50TGas
|
|
709
|
+
*
|
|
710
|
+
* Remaining gas will be distributed evenly across all Function Call Promises created during execution of current receipt.
|
|
711
|
+
*/
|
|
712
|
+
min_gas?: string | null;
|
|
713
|
+
/**
|
|
714
|
+
* Message to pass to `nft_transfer_call`. Otherwise, `nft_transfer` will be used. NOTE: No refund will be made in case of insufficient `storage_deposit` on `token` for `receiver_id`
|
|
715
|
+
*/
|
|
716
|
+
msg?: string | null;
|
|
717
|
+
receiver_id: AccountId;
|
|
718
|
+
/**
|
|
719
|
+
* Optionally make `storage_deposit` for `receiver_id` on `token`. The amount will be subtracted from user's NEP-141 `wNEAR` balance. NOTE: the `wNEAR` will not be refunded in case of fail
|
|
720
|
+
*/
|
|
721
|
+
storage_deposit?: string | null;
|
|
722
|
+
token: AccountId;
|
|
723
|
+
token_id: string;
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Collects super admin accounts and accounts that have been granted permissions defined by `AccessControlRole`.
|
|
727
|
+
*
|
|
728
|
+
* # Data structure
|
|
729
|
+
*
|
|
730
|
+
* Assume `AccessControlRole` is derived for the following enum, which is then passed as `role` attribute to `AccessControllable`.
|
|
731
|
+
*
|
|
732
|
+
* ```rust pub enum Role { PauseManager, UnpauseManager, } ```
|
|
733
|
+
*
|
|
734
|
+
* Then the returned data has the following structure:
|
|
735
|
+
*
|
|
736
|
+
* ```ignore PermissionedAccounts { super_admins: vec!["acc1.near", "acc2.near"], roles: HashMap::from([ ("PauseManager", PermissionedAccountsPerRole { admins: vec!["acc3.near", "acc4.near"], grantees: vec!["acc5.near", "acc6.near"], }), ("UnpauseManager", PermissionedAccountsPerRole { admins: vec!["acc7.near", "acc8.near"], grantees: vec!["acc9.near", "acc10.near"], }), ]) } ```
|
|
737
|
+
*
|
|
738
|
+
* # Uniqueness and ordering
|
|
739
|
+
*
|
|
740
|
+
* Account ids returned in vectors are unique but not ordered.
|
|
741
|
+
*
|
|
742
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
743
|
+
* via the `definition` "PermissionedAccounts".
|
|
744
|
+
*/
|
|
745
|
+
interface PermissionedAccounts {
|
|
746
|
+
/**
|
|
747
|
+
* The admins and grantees of all roles.
|
|
748
|
+
*/
|
|
749
|
+
roles: {
|
|
750
|
+
[k: string]: PermissionedAccountsPerRole;
|
|
751
|
+
};
|
|
752
|
+
/**
|
|
753
|
+
* The accounts that have super admin permissions.
|
|
754
|
+
*/
|
|
755
|
+
super_admins: AccountId[];
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* Collects all admins and grantees of a role.
|
|
759
|
+
*
|
|
760
|
+
* # Uniqueness and ordering
|
|
761
|
+
*
|
|
762
|
+
* Account ids returned in vectors are unique but not ordered.
|
|
763
|
+
*
|
|
764
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
765
|
+
* via the `definition` "PermissionedAccountsPerRole".
|
|
766
|
+
*/
|
|
767
|
+
interface PermissionedAccountsPerRole {
|
|
768
|
+
/**
|
|
769
|
+
* The accounts that have admin permissions for the role.
|
|
770
|
+
*/
|
|
771
|
+
admins: AccountId[];
|
|
772
|
+
/**
|
|
773
|
+
* The accounts that have been granted the role.
|
|
774
|
+
*/
|
|
775
|
+
grantees: AccountId[];
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
779
|
+
* via the `definition` "SimulationOutput".
|
|
780
|
+
*/
|
|
781
|
+
interface SimulationOutput {
|
|
782
|
+
intents_executed: IntentEventFor_AccountEventFor_NonceEvent[];
|
|
783
|
+
/**
|
|
784
|
+
* Unmatched token deltas needed to keep the invariant. If not empty, can be used along with fee to calculate `token_diff` closure.
|
|
785
|
+
*/
|
|
786
|
+
invariant_violated?: InvariantViolated | null;
|
|
787
|
+
logs: string[];
|
|
788
|
+
min_deadline: Deadline;
|
|
789
|
+
/**
|
|
790
|
+
* Additional info about current state
|
|
791
|
+
*/
|
|
792
|
+
state: StateOutput;
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
796
|
+
* via the `definition` "StateOutput".
|
|
797
|
+
*/
|
|
798
|
+
interface StateOutput {
|
|
799
|
+
current_salt: string;
|
|
800
|
+
fee: Pips;
|
|
801
|
+
}
|
|
802
|
+
/**
|
|
803
|
+
* Make [NEP-145](https://nomicon.io/Standards/StorageManagement#nep-145) `storage_deposit` for an `account_id` on `contract_id`. The `amount` will be subtracted from user's NEP-141 `wNEAR` balance. NOTE: the `wNEAR` will not be refunded in any case.
|
|
804
|
+
*
|
|
805
|
+
* WARNING: use this intent only if paying storage_deposit is not a prerequisite for other intents to succeed. If some intent (e.g. ft_withdraw) requires storage_deposit, then use storage_deposit field of corresponding intent instead of adding a separate `StorageDeposit` intent. This is due to the fact that intents that fire `Promise`s are not guaranteed to be executed sequentially, in the order of the provided intents in `DefuseIntents`.
|
|
806
|
+
*
|
|
807
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
808
|
+
* via the `definition` "StorageDeposit".
|
|
809
|
+
*/
|
|
810
|
+
interface StorageDeposit {
|
|
811
|
+
amount: string;
|
|
812
|
+
contract_id: AccountId;
|
|
813
|
+
deposit_for_account_id: AccountId;
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
817
|
+
* via the `definition` "Token".
|
|
818
|
+
*/
|
|
819
|
+
interface Token {
|
|
820
|
+
owner_id?: AccountId | null;
|
|
821
|
+
token_id: string;
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
825
|
+
* via the `definition` "Nep413DefusePayload".
|
|
826
|
+
*/
|
|
827
|
+
interface Nep413DefusePayload {
|
|
828
|
+
deadline: Deadline;
|
|
829
|
+
signer_id: AccountId;
|
|
830
|
+
/**
|
|
831
|
+
* Sequence of intents to execute in given order. Empty list is also a valid sequence, i.e. it doesn't do anything, but still invalidates the `nonce` for the signer WARNING: Promises created by different intents are executed concurrently and does not rely on the order of the intents in this structure
|
|
832
|
+
*/
|
|
833
|
+
intents?: Intent[];
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* See [NEP-413](https://github.com/near/NEPs/blob/master/neps/nep-0413.md)
|
|
837
|
+
*
|
|
838
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
839
|
+
* via the `definition` "Nep413Payload__Parsed".
|
|
840
|
+
*/
|
|
841
|
+
interface Nep413Payload__Parsed {
|
|
842
|
+
callbackUrl?: string | null;
|
|
843
|
+
message: {
|
|
844
|
+
original: string;
|
|
845
|
+
parsed: Nep413DefusePayload;
|
|
846
|
+
};
|
|
847
|
+
nonce: string;
|
|
848
|
+
recipient: string;
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* NEP-413: The standard for message signing in Near Protocol. For more details, refer to [NEP-413](https://github.com/near/NEPs/blob/master/neps/nep-0413.md).
|
|
852
|
+
*
|
|
853
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
854
|
+
* via the `definition` "MultiPayloadNep413__Parsed".
|
|
855
|
+
*/
|
|
856
|
+
interface MultiPayloadNep413__Parsed {
|
|
857
|
+
payload: Nep413Payload__Parsed;
|
|
858
|
+
public_key: string;
|
|
859
|
+
signature: string;
|
|
860
|
+
standard: "nep413";
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* ERC-191: The standard for message signing in Ethereum, commonly used with `personal_sign()`. For more details, refer to [EIP-191](https://eips.ethereum.org/EIPS/eip-191).
|
|
864
|
+
*
|
|
865
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
866
|
+
* via the `definition` "MultiPayloadErc191__Parsed".
|
|
867
|
+
*/
|
|
868
|
+
interface MultiPayloadErc191__Parsed {
|
|
869
|
+
payload: {
|
|
870
|
+
original: string;
|
|
871
|
+
parsed: DefusePayloadFor_DefuseIntents;
|
|
872
|
+
};
|
|
873
|
+
/**
|
|
874
|
+
* There is no public key member because the public key can be recovered via `ecrecover()` knowing the data and the signature
|
|
875
|
+
*/
|
|
876
|
+
signature: string;
|
|
877
|
+
standard: "erc191";
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* TIP-191: The standard for message signing in Tron. For more details, refer to [TIP-191](https://github.com/tronprotocol/tips/blob/master/tip-191.md).
|
|
881
|
+
*
|
|
882
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
883
|
+
* via the `definition` "MultiPayloadTip191__Parsed".
|
|
884
|
+
*/
|
|
885
|
+
interface MultiPayloadTip191__Parsed {
|
|
886
|
+
payload: {
|
|
887
|
+
original: string;
|
|
888
|
+
parsed: DefusePayloadFor_DefuseIntents;
|
|
889
|
+
};
|
|
890
|
+
/**
|
|
891
|
+
* There is no public key member because the public key can be recovered via `ecrecover()` knowing the data and the signature
|
|
892
|
+
*/
|
|
893
|
+
signature: string;
|
|
894
|
+
standard: "tip191";
|
|
895
|
+
}
|
|
896
|
+
/**
|
|
897
|
+
* Raw Ed25519: The standard used by Solana Phantom wallets for message signing. For more details, refer to [Phantom Wallet's documentation](https://docs.phantom.com/solana/signing-a-message).
|
|
898
|
+
*
|
|
899
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
900
|
+
* via the `definition` "MultiPayloadRawEd25519__Parsed".
|
|
901
|
+
*/
|
|
902
|
+
interface MultiPayloadRawEd25519__Parsed {
|
|
903
|
+
payload: {
|
|
904
|
+
original: string;
|
|
905
|
+
parsed: DefusePayloadFor_DefuseIntents;
|
|
906
|
+
};
|
|
907
|
+
public_key: string;
|
|
908
|
+
signature: string;
|
|
909
|
+
standard: "raw_ed25519";
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* [COSE ES256 (-7) algorithm](https://www.iana.org/assignments/cose/cose.xhtml#algorithms): NIST P-256 curve (a.k.a secp256r1) over SHA-256
|
|
913
|
+
*
|
|
914
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
915
|
+
* via the `definition` "MultiPayloadWebauthn__Parsed".
|
|
916
|
+
*/
|
|
917
|
+
interface MultiPayloadWebauthn__Parsed {
|
|
918
|
+
/**
|
|
919
|
+
* Base64Url-encoded [authenticatorData](https://w3c.github.io/webauthn/#authenticator-data)
|
|
920
|
+
*/
|
|
921
|
+
authenticator_data: string;
|
|
922
|
+
/**
|
|
923
|
+
* Serialized [clientDataJSON](https://w3c.github.io/webauthn/#dom-authenticatorresponse-clientdatajson)
|
|
924
|
+
*/
|
|
925
|
+
client_data_json: string;
|
|
926
|
+
payload: {
|
|
927
|
+
original: string;
|
|
928
|
+
parsed: DefusePayloadFor_DefuseIntents;
|
|
929
|
+
};
|
|
930
|
+
standard: "webauthn";
|
|
931
|
+
public_key: string;
|
|
932
|
+
signature: string;
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* TonConnect: The standard for data signing in TON blockchain platform. For more details, refer to [TonConnect documentation](https://docs.tonconsole.com/academy/sign-data).
|
|
936
|
+
*
|
|
937
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
938
|
+
* via the `definition` "MultiPayloadTonConnect__Parsed".
|
|
939
|
+
*/
|
|
940
|
+
interface MultiPayloadTonConnect__Parsed {
|
|
941
|
+
/**
|
|
942
|
+
* Wallet address in either [Raw](https://docs.ton.org/v3/documentation/smart-contracts/addresses/address-formats#raw-address) representation or [user-friendly](https://docs.ton.org/v3/documentation/smart-contracts/addresses/address-formats#user-friendly-address) format
|
|
943
|
+
*/
|
|
944
|
+
address: string;
|
|
945
|
+
/**
|
|
946
|
+
* dApp domain
|
|
947
|
+
*/
|
|
948
|
+
domain: string;
|
|
949
|
+
payload: TonConnectPayloadSchema__Parsed;
|
|
950
|
+
public_key: string;
|
|
951
|
+
signature: string;
|
|
952
|
+
standard: "ton_connect";
|
|
953
|
+
/**
|
|
954
|
+
* UNIX timestamp (in seconds or RFC3339) at the time of singing
|
|
955
|
+
*/
|
|
956
|
+
timestamp: PickFirstDateTimeint64;
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* SEP-53: The standard for signing data off-chain for Stellar accounts. See [SEP-53](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0053.md)
|
|
960
|
+
*
|
|
961
|
+
* This interface was referenced by `NEARIntentsSchema`'s JSON-Schema
|
|
962
|
+
* via the `definition` "MultiPayloadSep53__Parsed".
|
|
963
|
+
*/
|
|
964
|
+
interface MultiPayloadSep53__Parsed {
|
|
965
|
+
payload: {
|
|
966
|
+
original: string;
|
|
967
|
+
parsed: DefusePayloadFor_DefuseIntents;
|
|
968
|
+
};
|
|
969
|
+
public_key: string;
|
|
970
|
+
signature: string;
|
|
971
|
+
standard: "sep53";
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Enum of supported intent standards.
|
|
975
|
+
* Generated from the MultiPayload schema variants.
|
|
976
|
+
*/
|
|
977
|
+
declare enum IntentStandardEnum {
|
|
978
|
+
NEP413 = "nep413",
|
|
979
|
+
ERC191 = "erc191",
|
|
980
|
+
TIP191 = "tip191",
|
|
981
|
+
RAW_ED25519 = "raw_ed25519",
|
|
982
|
+
WEBAUTHN = "webauthn",
|
|
983
|
+
TON_CONNECT = "ton_connect",
|
|
984
|
+
SEP53 = "sep53",
|
|
985
|
+
}
|
|
986
|
+
//#endregion
|
|
987
|
+
export { AccountId, AccountIdRef, AuthCall, Deadline, DefuseConfig, DefusePayloadFor_DefuseIntents, Erc191Payload, FeesConfig, FtWithdraw, Intent, IntentAddPublicKey, IntentAuthCall, IntentEventFor_AccountEventFor_NonceEvent, IntentFtWithdraw, IntentMtWithdraw, IntentNativeWithdraw, IntentNftWithdraw, IntentRemovePublicKey, IntentSetAuthByPredecessorId, IntentStandardEnum, IntentStorageDeposit, IntentTokenDiff, IntentTransfer, InvariantViolated, InvariantViolatedOverflow, InvariantViolatedUnmatchedDeltas, MtWithdraw, MultiPayload, MultiPayloadErc191, MultiPayloadErc191__Parsed, MultiPayloadNarrowed, MultiPayloadNarrowed__Parsed, MultiPayloadNep413, MultiPayloadNep413__Parsed, MultiPayloadRawEd25519, MultiPayloadRawEd25519__Parsed, MultiPayloadSep53, MultiPayloadSep53__Parsed, MultiPayloadTip191, MultiPayloadTip191__Parsed, MultiPayloadTonConnect, MultiPayloadTonConnect__Parsed, MultiPayloadWebauthn, MultiPayloadWebauthn__Parsed, MultiPayload__Parsed, NEARIntentsSchema, NativeWithdraw, Nep413DefuseMessageFor_DefuseIntents, Nep413DefusePayload, Nep413Payload, Nep413Payload__Parsed, NftWithdraw, PermissionedAccounts, PermissionedAccountsPerRole, PickFirstDateTimeint64, Pips, RolesConfig, SimulationOutput, StateOutput, StorageDeposit, Tip191Payload, Token, TonConnectPayloadSchema, TonConnectPayloadSchemaBinary, TonConnectPayloadSchemaCell, TonConnectPayloadSchemaText, TonConnectPayloadSchema__Parsed };
|