@lfdecentralizedtrust/paladin-sdk 0.14.0 → 1.0.0-rc.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/build/domains/abis/INoto.json +85 -22
- package/build/domains/abis/INotoPrivate.json +76 -32
- package/build/domains/noto.d.ts +14 -1
- package/build/domains/noto.js +40 -0
- package/package.json +1 -1
- package/src/domains/noto.ts +65 -1
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
"name": "txId",
|
|
13
13
|
"type": "bytes32"
|
|
14
14
|
},
|
|
15
|
+
{
|
|
16
|
+
"indexed": false,
|
|
17
|
+
"internalType": "bytes32",
|
|
18
|
+
"name": "lockId",
|
|
19
|
+
"type": "bytes32"
|
|
20
|
+
},
|
|
15
21
|
{
|
|
16
22
|
"indexed": false,
|
|
17
23
|
"internalType": "bytes32[]",
|
|
@@ -55,6 +61,12 @@
|
|
|
55
61
|
"name": "txId",
|
|
56
62
|
"type": "bytes32"
|
|
57
63
|
},
|
|
64
|
+
{
|
|
65
|
+
"indexed": false,
|
|
66
|
+
"internalType": "bytes32",
|
|
67
|
+
"name": "lockId",
|
|
68
|
+
"type": "bytes32"
|
|
69
|
+
},
|
|
58
70
|
{
|
|
59
71
|
"indexed": false,
|
|
60
72
|
"internalType": "bytes32",
|
|
@@ -129,6 +141,12 @@
|
|
|
129
141
|
"name": "txId",
|
|
130
142
|
"type": "bytes32"
|
|
131
143
|
},
|
|
144
|
+
{
|
|
145
|
+
"indexed": false,
|
|
146
|
+
"internalType": "bytes32",
|
|
147
|
+
"name": "lockId",
|
|
148
|
+
"type": "bytes32"
|
|
149
|
+
},
|
|
132
150
|
{
|
|
133
151
|
"indexed": false,
|
|
134
152
|
"internalType": "address",
|
|
@@ -172,6 +190,24 @@
|
|
|
172
190
|
{
|
|
173
191
|
"anonymous": false,
|
|
174
192
|
"inputs": [
|
|
193
|
+
{
|
|
194
|
+
"indexed": false,
|
|
195
|
+
"internalType": "bytes32",
|
|
196
|
+
"name": "txId",
|
|
197
|
+
"type": "bytes32"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"indexed": false,
|
|
201
|
+
"internalType": "bytes32",
|
|
202
|
+
"name": "lockId",
|
|
203
|
+
"type": "bytes32"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"indexed": false,
|
|
207
|
+
"internalType": "bytes32",
|
|
208
|
+
"name": "unlockTxId",
|
|
209
|
+
"type": "bytes32"
|
|
210
|
+
},
|
|
175
211
|
{
|
|
176
212
|
"indexed": false,
|
|
177
213
|
"internalType": "bytes32[]",
|
|
@@ -228,7 +264,7 @@
|
|
|
228
264
|
},
|
|
229
265
|
{
|
|
230
266
|
"internalType": "bytes32",
|
|
231
|
-
"name": "
|
|
267
|
+
"name": "lockId",
|
|
232
268
|
"type": "bytes32"
|
|
233
269
|
},
|
|
234
270
|
{
|
|
@@ -343,6 +379,21 @@
|
|
|
343
379
|
},
|
|
344
380
|
{
|
|
345
381
|
"inputs": [
|
|
382
|
+
{
|
|
383
|
+
"internalType": "bytes32",
|
|
384
|
+
"name": "txId",
|
|
385
|
+
"type": "bytes32"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"internalType": "bytes32",
|
|
389
|
+
"name": "lockId",
|
|
390
|
+
"type": "bytes32"
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
"internalType": "bytes32",
|
|
394
|
+
"name": "unlockTxId",
|
|
395
|
+
"type": "bytes32"
|
|
396
|
+
},
|
|
346
397
|
{
|
|
347
398
|
"internalType": "bytes32[]",
|
|
348
399
|
"name": "lockedInputs",
|
|
@@ -410,29 +461,41 @@
|
|
|
410
461
|
"type": "bytes32"
|
|
411
462
|
},
|
|
412
463
|
{
|
|
413
|
-
"internalType": "bytes32
|
|
414
|
-
"name": "
|
|
415
|
-
"type": "bytes32
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
"internalType": "bytes32[]",
|
|
419
|
-
"name": "lockedOutputs",
|
|
420
|
-
"type": "bytes32[]"
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
"internalType": "bytes32[]",
|
|
424
|
-
"name": "outputs",
|
|
425
|
-
"type": "bytes32[]"
|
|
426
|
-
},
|
|
427
|
-
{
|
|
428
|
-
"internalType": "bytes",
|
|
429
|
-
"name": "signature",
|
|
430
|
-
"type": "bytes"
|
|
464
|
+
"internalType": "bytes32",
|
|
465
|
+
"name": "lockId",
|
|
466
|
+
"type": "bytes32"
|
|
431
467
|
},
|
|
432
468
|
{
|
|
433
|
-
"
|
|
434
|
-
|
|
435
|
-
|
|
469
|
+
"components": [
|
|
470
|
+
{
|
|
471
|
+
"internalType": "bytes32[]",
|
|
472
|
+
"name": "lockedInputs",
|
|
473
|
+
"type": "bytes32[]"
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
"internalType": "bytes32[]",
|
|
477
|
+
"name": "lockedOutputs",
|
|
478
|
+
"type": "bytes32[]"
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
"internalType": "bytes32[]",
|
|
482
|
+
"name": "outputs",
|
|
483
|
+
"type": "bytes32[]"
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"internalType": "bytes",
|
|
487
|
+
"name": "signature",
|
|
488
|
+
"type": "bytes"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"internalType": "bytes",
|
|
492
|
+
"name": "data",
|
|
493
|
+
"type": "bytes"
|
|
494
|
+
}
|
|
495
|
+
],
|
|
496
|
+
"internalType": "struct INoto.UnlockParams",
|
|
497
|
+
"name": "params",
|
|
498
|
+
"type": "tuple"
|
|
436
499
|
}
|
|
437
500
|
],
|
|
438
501
|
"name": "unlock",
|
|
@@ -73,6 +73,54 @@
|
|
|
73
73
|
"stateMutability": "nonpayable",
|
|
74
74
|
"type": "function"
|
|
75
75
|
},
|
|
76
|
+
{
|
|
77
|
+
"inputs": [
|
|
78
|
+
{
|
|
79
|
+
"internalType": "uint256",
|
|
80
|
+
"name": "amount",
|
|
81
|
+
"type": "uint256"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"internalType": "bytes",
|
|
85
|
+
"name": "data",
|
|
86
|
+
"type": "bytes"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"name": "createLock",
|
|
90
|
+
"outputs": [],
|
|
91
|
+
"stateMutability": "nonpayable",
|
|
92
|
+
"type": "function"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"inputs": [
|
|
96
|
+
{
|
|
97
|
+
"components": [
|
|
98
|
+
{
|
|
99
|
+
"internalType": "string",
|
|
100
|
+
"name": "to",
|
|
101
|
+
"type": "string"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"internalType": "uint256",
|
|
105
|
+
"name": "amount",
|
|
106
|
+
"type": "uint256"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"internalType": "struct INotoPrivate.UnlockRecipient[]",
|
|
110
|
+
"name": "recipients",
|
|
111
|
+
"type": "tuple[]"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"internalType": "bytes",
|
|
115
|
+
"name": "data",
|
|
116
|
+
"type": "bytes"
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"name": "createMintLock",
|
|
120
|
+
"outputs": [],
|
|
121
|
+
"stateMutability": "nonpayable",
|
|
122
|
+
"type": "function"
|
|
123
|
+
},
|
|
76
124
|
{
|
|
77
125
|
"inputs": [],
|
|
78
126
|
"name": "decimals",
|
|
@@ -93,38 +141,6 @@
|
|
|
93
141
|
"name": "lockId",
|
|
94
142
|
"type": "bytes32"
|
|
95
143
|
},
|
|
96
|
-
{
|
|
97
|
-
"components": [
|
|
98
|
-
{
|
|
99
|
-
"internalType": "bytes32[]",
|
|
100
|
-
"name": "lockedInputs",
|
|
101
|
-
"type": "bytes32[]"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"internalType": "bytes32[]",
|
|
105
|
-
"name": "lockedOutputs",
|
|
106
|
-
"type": "bytes32[]"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"internalType": "bytes32[]",
|
|
110
|
-
"name": "outputs",
|
|
111
|
-
"type": "bytes32[]"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"internalType": "bytes",
|
|
115
|
-
"name": "signature",
|
|
116
|
-
"type": "bytes"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"internalType": "bytes",
|
|
120
|
-
"name": "data",
|
|
121
|
-
"type": "bytes"
|
|
122
|
-
}
|
|
123
|
-
],
|
|
124
|
-
"internalType": "struct INotoPrivate.UnlockPublicParams",
|
|
125
|
-
"name": "unlock",
|
|
126
|
-
"type": "tuple"
|
|
127
|
-
},
|
|
128
144
|
{
|
|
129
145
|
"internalType": "address",
|
|
130
146
|
"name": "delegate",
|
|
@@ -195,6 +211,34 @@
|
|
|
195
211
|
"stateMutability": "view",
|
|
196
212
|
"type": "function"
|
|
197
213
|
},
|
|
214
|
+
{
|
|
215
|
+
"inputs": [
|
|
216
|
+
{
|
|
217
|
+
"internalType": "bytes32",
|
|
218
|
+
"name": "lockId",
|
|
219
|
+
"type": "bytes32"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"internalType": "string",
|
|
223
|
+
"name": "from",
|
|
224
|
+
"type": "string"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"internalType": "uint256",
|
|
228
|
+
"name": "amount",
|
|
229
|
+
"type": "uint256"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"internalType": "bytes",
|
|
233
|
+
"name": "data",
|
|
234
|
+
"type": "bytes"
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
"name": "prepareBurnUnlock",
|
|
238
|
+
"outputs": [],
|
|
239
|
+
"stateMutability": "nonpayable",
|
|
240
|
+
"type": "function"
|
|
241
|
+
},
|
|
198
242
|
{
|
|
199
243
|
"inputs": [
|
|
200
244
|
{
|
package/build/domains/noto.d.ts
CHANGED
|
@@ -54,6 +54,16 @@ export interface NotoLockParams {
|
|
|
54
54
|
amount: string | number;
|
|
55
55
|
data: string;
|
|
56
56
|
}
|
|
57
|
+
export interface NotoCreateMintLockParams {
|
|
58
|
+
recipients: UnlockRecipient[];
|
|
59
|
+
data: string;
|
|
60
|
+
}
|
|
61
|
+
export interface NotoPrepareBurnUnlockParams {
|
|
62
|
+
lockId: string;
|
|
63
|
+
from: PaladinVerifier;
|
|
64
|
+
amount: string | number;
|
|
65
|
+
data: string;
|
|
66
|
+
}
|
|
57
67
|
export interface NotoUnlockParams {
|
|
58
68
|
lockId: string;
|
|
59
69
|
from: PaladinVerifier;
|
|
@@ -66,7 +76,7 @@ export interface UnlockRecipient {
|
|
|
66
76
|
}
|
|
67
77
|
export interface NotoDelegateLockParams {
|
|
68
78
|
lockId: string;
|
|
69
|
-
unlock
|
|
79
|
+
unlock?: NotoUnlockPublicParams;
|
|
70
80
|
delegate: string;
|
|
71
81
|
data: string;
|
|
72
82
|
}
|
|
@@ -108,9 +118,12 @@ export declare class NotoInstance {
|
|
|
108
118
|
burn(from: PaladinVerifier, data: NotoBurnParams): TransactionFuture;
|
|
109
119
|
burnFrom(from: PaladinVerifier, data: NotoBurnFromParams): TransactionFuture;
|
|
110
120
|
lock(from: PaladinVerifier, data: NotoLockParams): TransactionFuture;
|
|
121
|
+
createLock(from: PaladinVerifier, data: NotoLockParams): TransactionFuture;
|
|
122
|
+
createMintLock(from: PaladinVerifier, data: NotoCreateMintLockParams): TransactionFuture;
|
|
111
123
|
unlock(from: PaladinVerifier, data: NotoUnlockParams): TransactionFuture;
|
|
112
124
|
unlockAsDelegate(from: PaladinVerifier, data: NotoUnlockPublicParams): TransactionFuture;
|
|
113
125
|
prepareUnlock(from: PaladinVerifier, data: NotoUnlockParams): TransactionFuture;
|
|
126
|
+
prepareBurnUnlock(from: PaladinVerifier, data: NotoPrepareBurnUnlockParams): TransactionFuture;
|
|
114
127
|
delegateLock(from: PaladinVerifier, data: NotoDelegateLockParams): TransactionFuture;
|
|
115
128
|
encodeUnlock(data: NotoUnlockPublicParams): string;
|
|
116
129
|
balanceOf(from: PaladinVerifier, data: NotoBalanceOfParams): Promise<NotoBalanceOfResult>;
|
package/build/domains/noto.js
CHANGED
|
@@ -203,6 +203,7 @@ class NotoInstance {
|
|
|
203
203
|
}
|
|
204
204
|
}));
|
|
205
205
|
}
|
|
206
|
+
// @deprecated - use createLock instead
|
|
206
207
|
lock(from, data) {
|
|
207
208
|
return new transaction_1.TransactionFuture(this.paladin, this.paladin.sendTransaction({
|
|
208
209
|
type: interfaces_1.TransactionType.PRIVATE,
|
|
@@ -213,6 +214,32 @@ class NotoInstance {
|
|
|
213
214
|
data,
|
|
214
215
|
}));
|
|
215
216
|
}
|
|
217
|
+
createLock(from, data) {
|
|
218
|
+
return new transaction_1.TransactionFuture(this.paladin, this.paladin.sendTransaction({
|
|
219
|
+
type: interfaces_1.TransactionType.PRIVATE,
|
|
220
|
+
abi: notoPrivateJSON.abi,
|
|
221
|
+
function: "createLock",
|
|
222
|
+
to: this.address,
|
|
223
|
+
from: from.lookup,
|
|
224
|
+
data,
|
|
225
|
+
}));
|
|
226
|
+
}
|
|
227
|
+
createMintLock(from, data) {
|
|
228
|
+
return new transaction_1.TransactionFuture(this.paladin, this.paladin.sendTransaction({
|
|
229
|
+
type: interfaces_1.TransactionType.PRIVATE,
|
|
230
|
+
abi: notoPrivateJSON.abi,
|
|
231
|
+
function: "createMintLock",
|
|
232
|
+
to: this.address,
|
|
233
|
+
from: from.lookup,
|
|
234
|
+
data: {
|
|
235
|
+
...data,
|
|
236
|
+
recipients: data.recipients.map((recipient) => ({
|
|
237
|
+
to: recipient.to.lookup,
|
|
238
|
+
amount: recipient.amount,
|
|
239
|
+
})),
|
|
240
|
+
},
|
|
241
|
+
}));
|
|
242
|
+
}
|
|
216
243
|
unlock(from, data) {
|
|
217
244
|
return new transaction_1.TransactionFuture(this.paladin, this.paladin.sendTransaction({
|
|
218
245
|
type: interfaces_1.TransactionType.PRIVATE,
|
|
@@ -257,6 +284,19 @@ class NotoInstance {
|
|
|
257
284
|
},
|
|
258
285
|
}));
|
|
259
286
|
}
|
|
287
|
+
prepareBurnUnlock(from, data) {
|
|
288
|
+
return new transaction_1.TransactionFuture(this.paladin, this.paladin.sendTransaction({
|
|
289
|
+
type: interfaces_1.TransactionType.PRIVATE,
|
|
290
|
+
abi: notoPrivateJSON.abi,
|
|
291
|
+
function: "prepareBurnUnlock",
|
|
292
|
+
to: this.address,
|
|
293
|
+
from: from.lookup,
|
|
294
|
+
data: {
|
|
295
|
+
...data,
|
|
296
|
+
from: data.from.lookup,
|
|
297
|
+
},
|
|
298
|
+
}));
|
|
299
|
+
}
|
|
260
300
|
delegateLock(from, data) {
|
|
261
301
|
return new transaction_1.TransactionFuture(this.paladin, this.paladin.sendTransaction({
|
|
262
302
|
type: interfaces_1.TransactionType.PRIVATE,
|
package/package.json
CHANGED
package/src/domains/noto.ts
CHANGED
|
@@ -117,6 +117,18 @@ export interface NotoLockParams {
|
|
|
117
117
|
data: string;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
export interface NotoCreateMintLockParams {
|
|
121
|
+
recipients: UnlockRecipient[];
|
|
122
|
+
data: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface NotoPrepareBurnUnlockParams {
|
|
126
|
+
lockId: string;
|
|
127
|
+
from: PaladinVerifier;
|
|
128
|
+
amount: string | number;
|
|
129
|
+
data: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
120
132
|
export interface NotoUnlockParams {
|
|
121
133
|
lockId: string;
|
|
122
134
|
from: PaladinVerifier;
|
|
@@ -131,7 +143,7 @@ export interface UnlockRecipient {
|
|
|
131
143
|
|
|
132
144
|
export interface NotoDelegateLockParams {
|
|
133
145
|
lockId: string;
|
|
134
|
-
unlock
|
|
146
|
+
unlock?: NotoUnlockPublicParams; // Required for V0, omitted for V1
|
|
135
147
|
delegate: string;
|
|
136
148
|
data: string;
|
|
137
149
|
}
|
|
@@ -308,6 +320,7 @@ export class NotoInstance {
|
|
|
308
320
|
);
|
|
309
321
|
}
|
|
310
322
|
|
|
323
|
+
// @deprecated - use createLock instead
|
|
311
324
|
lock(from: PaladinVerifier, data: NotoLockParams) {
|
|
312
325
|
return new TransactionFuture(
|
|
313
326
|
this.paladin,
|
|
@@ -322,6 +335,40 @@ export class NotoInstance {
|
|
|
322
335
|
);
|
|
323
336
|
}
|
|
324
337
|
|
|
338
|
+
createLock(from: PaladinVerifier, data: NotoLockParams) {
|
|
339
|
+
return new TransactionFuture(
|
|
340
|
+
this.paladin,
|
|
341
|
+
this.paladin.sendTransaction({
|
|
342
|
+
type: TransactionType.PRIVATE,
|
|
343
|
+
abi: notoPrivateJSON.abi,
|
|
344
|
+
function: "createLock",
|
|
345
|
+
to: this.address,
|
|
346
|
+
from: from.lookup,
|
|
347
|
+
data,
|
|
348
|
+
})
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
createMintLock(from: PaladinVerifier, data: NotoCreateMintLockParams) {
|
|
353
|
+
return new TransactionFuture(
|
|
354
|
+
this.paladin,
|
|
355
|
+
this.paladin.sendTransaction({
|
|
356
|
+
type: TransactionType.PRIVATE,
|
|
357
|
+
abi: notoPrivateJSON.abi,
|
|
358
|
+
function: "createMintLock",
|
|
359
|
+
to: this.address,
|
|
360
|
+
from: from.lookup,
|
|
361
|
+
data: {
|
|
362
|
+
...data,
|
|
363
|
+
recipients: data.recipients.map((recipient) => ({
|
|
364
|
+
to: recipient.to.lookup,
|
|
365
|
+
amount: recipient.amount,
|
|
366
|
+
})),
|
|
367
|
+
},
|
|
368
|
+
})
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
|
|
325
372
|
unlock(from: PaladinVerifier, data: NotoUnlockParams) {
|
|
326
373
|
return new TransactionFuture(
|
|
327
374
|
this.paladin,
|
|
@@ -378,6 +425,23 @@ export class NotoInstance {
|
|
|
378
425
|
);
|
|
379
426
|
}
|
|
380
427
|
|
|
428
|
+
prepareBurnUnlock(from: PaladinVerifier, data: NotoPrepareBurnUnlockParams) {
|
|
429
|
+
return new TransactionFuture(
|
|
430
|
+
this.paladin,
|
|
431
|
+
this.paladin.sendTransaction({
|
|
432
|
+
type: TransactionType.PRIVATE,
|
|
433
|
+
abi: notoPrivateJSON.abi,
|
|
434
|
+
function: "prepareBurnUnlock",
|
|
435
|
+
to: this.address,
|
|
436
|
+
from: from.lookup,
|
|
437
|
+
data: {
|
|
438
|
+
...data,
|
|
439
|
+
from: data.from.lookup,
|
|
440
|
+
},
|
|
441
|
+
})
|
|
442
|
+
);
|
|
443
|
+
}
|
|
444
|
+
|
|
381
445
|
delegateLock(from: PaladinVerifier, data: NotoDelegateLockParams) {
|
|
382
446
|
return new TransactionFuture(
|
|
383
447
|
this.paladin,
|