@lfdecentralizedtrust/paladin-sdk 0.15.0-rc.0 → 1.0.0-rc.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.
@@ -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": "unlockHash",
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": "lockedInputs",
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
- "internalType": "bytes",
434
- "name": "data",
435
- "type": "bytes"
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
  {
@@ -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: NotoUnlockPublicParams;
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>;
@@ -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,
@@ -1,9 +1,17 @@
1
+ export interface IDomainConfig {
2
+ signingAlgorithms?: Record<string, number>;
3
+ }
1
4
  export interface IDomain {
2
5
  name: string;
3
6
  registryAddress: string;
7
+ config?: IDomainConfig;
8
+ }
9
+ export interface IContractConfig {
10
+ contractConfig?: object;
4
11
  }
5
12
  export interface IDomainSmartContract {
6
13
  domainName: string;
7
14
  domainAddress: string;
8
15
  address: string;
16
+ config?: IContractConfig;
9
17
  }
@@ -8,6 +8,7 @@ export * from "./paladin";
8
8
  export * from "./privacygroups";
9
9
  export * from "./query";
10
10
  export * from "./registry";
11
+ export * from "./signpayloads";
11
12
  export * from "./states";
12
13
  export * from "./transaction";
13
14
  export * from "./transport";
@@ -24,6 +24,7 @@ __exportStar(require("./paladin"), exports);
24
24
  __exportStar(require("./privacygroups"), exports);
25
25
  __exportStar(require("./query"), exports);
26
26
  __exportStar(require("./registry"), exports);
27
+ __exportStar(require("./signpayloads"), exports);
27
28
  __exportStar(require("./states"), exports);
28
29
  __exportStar(require("./transaction"), exports);
29
30
  __exportStar(require("./transport"), exports);
@@ -0,0 +1,3 @@
1
+ export declare enum SignPayloads {
2
+ OPAQUE_TO_RSV = "opaque:rsv"
3
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignPayloads = void 0;
4
+ var SignPayloads;
5
+ (function (SignPayloads) {
6
+ SignPayloads["OPAQUE_TO_RSV"] = "opaque:rsv";
7
+ })(SignPayloads || (exports.SignPayloads = SignPayloads = {}));
@@ -1,6 +1,6 @@
1
1
  import { AxiosInstance } from "axios";
2
2
  import { ethers, InterfaceAbi } from "ethers";
3
- import { ActiveFilter, Algorithms, IABIDecodedData, IBlockchainEventListener, IEthAddress, IEventWithData, IKeyMappingAndVerifier, IKeyQueryEntry, INotoDomainReceipt, IPenteDomainReceipt, IPreparedTransaction, IPrivacyGroup, IPrivacyGroupEVMCall, IPrivacyGroupEVMTXInput, IPrivacyGroupInput, IPrivacyGroupMessageInput, IPrivacyGroupMessageListener, IQuery, IRegistryEntry, IRegistryEntryWithProperties, IRegistryProperty, ISchema, IState, IStoredABI, ITransaction, ITransactionCall, ITransactionInput, ITransactionReceipt, ITransactionReceiptListener, ITransactionStates, IWalletInfo, PaladinConfig, StateStatus, Verifiers } from "./interfaces";
3
+ import { ActiveFilter, Algorithms, IABIDecodedData, IBlockchainEventListener, IDomain, IDomainSmartContract, IEthAddress, IEventWithData, IKeyMappingAndVerifier, IKeyQueryEntry, INotoDomainReceipt, IPenteDomainReceipt, IPreparedTransaction, IPrivacyGroup, IPrivacyGroupEVMCall, IPrivacyGroupEVMTXInput, IPrivacyGroupInput, IPrivacyGroupMessageInput, IPrivacyGroupMessageListener, IQuery, IRegistryEntry, IRegistryEntryWithProperties, IRegistryProperty, ISchema, IState, IStoredABI, ITransaction, ITransactionCall, ITransactionInput, ITransactionReceipt, ITransactionReceiptListener, ITransactionStates, IWalletInfo, PaladinConfig, StateStatus, Verifiers } from "./interfaces";
4
4
  import { PaladinVerifier } from "./verifier";
5
5
  export default class PaladinClient {
6
6
  protected http: AxiosInstance;
@@ -151,6 +151,7 @@ export default class PaladinClient {
151
151
  resolveEthAddress: (identifier: string) => Promise<IEthAddress>;
152
152
  reverseKeyLookup: (algorithm: string, verifierType: string, verifier: string) => Promise<IKeyMappingAndVerifier>;
153
153
  queryKeys: (query: IQuery) => Promise<IKeyQueryEntry[]>;
154
+ sign: (keyIdentifier: string, algorithm: string, verifierType: string, payloadType: string, payload: string) => Promise<string>;
154
155
  };
155
156
  ptx: {
156
157
  sendTransaction: (transaction: ITransactionInput) => Promise<string>;
@@ -236,10 +237,10 @@ export default class PaladinClient {
236
237
  };
237
238
  domain: {
238
239
  listDomains: () => Promise<string[]>;
239
- getDomain: (name: string) => Promise<any>;
240
- getDomainByAddress: (address: string) => Promise<any>;
241
- querySmartContracts: (query: IQuery) => Promise<any[]>;
242
- getSmartContractByAddress: (address: string) => Promise<any>;
240
+ getDomain: (name: string) => Promise<IDomain | undefined>;
241
+ getDomainByAddress: (address: string) => Promise<IDomain | undefined>;
242
+ querySmartContracts: (query: IQuery) => Promise<IDomainSmartContract[]>;
243
+ getSmartContractByAddress: (address: string) => Promise<IDomainSmartContract | undefined>;
243
244
  };
244
245
  bidx: {
245
246
  getBlockByNumber: (number: number) => Promise<any>;
package/build/paladin.js CHANGED
@@ -49,6 +49,10 @@ class PaladinClient {
49
49
  const res = await this.post("keymgr_queryKeys", [query]);
50
50
  return res.data.result;
51
51
  },
52
+ sign: async (keyIdentifier, algorithm, verifierType, payloadType, payload) => {
53
+ const res = await this.post("keymgr_sign", [keyIdentifier, algorithm, verifierType, payloadType, payload]);
54
+ return res.data.result;
55
+ },
52
56
  };
53
57
  this.ptx = {
54
58
  sendTransaction: async (transaction) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lfdecentralizedtrust/paladin-sdk",
3
- "version": "0.15.0-rc.0",
3
+ "version": "1.0.0-rc.1",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -19,12 +19,12 @@
19
19
  "typescript": "^5.6.3"
20
20
  },
21
21
  "dependencies": {
22
- "ethers": "^6.13.4",
23
22
  "uuid": "^11.0.2",
24
23
  "ws": "^8.18.1"
25
24
  },
26
25
  "peerDependencies": {
27
- "axios": "^1.7.7"
26
+ "axios": "^1.7.7",
27
+ "ethers": "^6.13.4"
28
28
  },
29
29
  "repository": {
30
30
  "url": "https://github.com/LFDT-Paladin/paladin"
@@ -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: NotoUnlockPublicParams;
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,
@@ -1,10 +1,20 @@
1
+ export interface IDomainConfig {
2
+ signingAlgorithms?: Record<string, number>;
3
+ }
4
+
1
5
  export interface IDomain {
2
6
  name: string;
3
7
  registryAddress: string;
8
+ config?: IDomainConfig;
9
+ }
10
+
11
+ export interface IContractConfig {
12
+ contractConfig?: object;
4
13
  }
5
14
 
6
15
  export interface IDomainSmartContract {
7
16
  domainName: string;
8
17
  domainAddress: string;
9
18
  address: string;
19
+ config?: IContractConfig;
10
20
  }
@@ -8,6 +8,7 @@ export * from "./paladin";
8
8
  export * from "./privacygroups";
9
9
  export * from "./query";
10
10
  export * from "./registry";
11
+ export * from "./signpayloads";
11
12
  export * from "./states";
12
13
  export * from "./transaction";
13
14
  export * from "./transport";
@@ -0,0 +1,3 @@
1
+ export enum SignPayloads {
2
+ OPAQUE_TO_RSV = "opaque:rsv",
3
+ }
package/src/paladin.ts CHANGED
@@ -5,6 +5,8 @@ import {
5
5
  Algorithms,
6
6
  IABIDecodedData,
7
7
  IBlockchainEventListener,
8
+ IDomain,
9
+ IDomainSmartContract,
8
10
  IEthAddress,
9
11
  IEventWithData,
10
12
  IKeyMappingAndVerifier,
@@ -427,6 +429,14 @@ export default class PaladinClient {
427
429
  );
428
430
  return res.data.result;
429
431
  },
432
+
433
+ sign: async (keyIdentifier: string, algorithm: string, verifierType: string, payloadType: string, payload: string) => {
434
+ const res = await this.post<JsonRpcResult<string>>(
435
+ "keymgr_sign",
436
+ [keyIdentifier, algorithm, verifierType, payloadType, payload]
437
+ );
438
+ return res.data.result;
439
+ },
430
440
  };
431
441
 
432
442
  ptx = {
@@ -1104,7 +1114,7 @@ export default class PaladinClient {
1104
1114
  };
1105
1115
 
1106
1116
  domain = {
1107
- listDomains: async () => {
1117
+ listDomains: async (): Promise<string[]> => {
1108
1118
  const res = await this.post<JsonRpcResult<string[]>>(
1109
1119
  "domain_listDomains",
1110
1120
  []
@@ -1112,8 +1122,8 @@ export default class PaladinClient {
1112
1122
  return res.data.result;
1113
1123
  },
1114
1124
 
1115
- getDomain: async (name: string) => {
1116
- const res = await this.post<JsonRpcResult<any>>(
1125
+ getDomain: async (name: string): Promise<IDomain | undefined> => {
1126
+ const res = await this.post<JsonRpcResult<IDomain>>(
1117
1127
  "domain_getDomain",
1118
1128
  [name],
1119
1129
  { validateStatus: (status) => status < 300 || status === 404 }
@@ -1121,8 +1131,10 @@ export default class PaladinClient {
1121
1131
  return res.status === 404 ? undefined : res.data.result;
1122
1132
  },
1123
1133
 
1124
- getDomainByAddress: async (address: string) => {
1125
- const res = await this.post<JsonRpcResult<any>>(
1134
+ getDomainByAddress: async (
1135
+ address: string
1136
+ ): Promise<IDomain | undefined> => {
1137
+ const res = await this.post<JsonRpcResult<IDomain>>(
1126
1138
  "domain_getDomainByAddress",
1127
1139
  [address],
1128
1140
  { validateStatus: (status) => status < 300 || status === 404 }
@@ -1130,16 +1142,20 @@ export default class PaladinClient {
1130
1142
  return res.status === 404 ? undefined : res.data.result;
1131
1143
  },
1132
1144
 
1133
- querySmartContracts: async (query: IQuery) => {
1134
- const res = await this.post<JsonRpcResult<any[]>>(
1145
+ querySmartContracts: async (
1146
+ query: IQuery
1147
+ ): Promise<IDomainSmartContract[]> => {
1148
+ const res = await this.post<JsonRpcResult<IDomainSmartContract[]>>(
1135
1149
  "domain_querySmartContracts",
1136
1150
  [query]
1137
1151
  );
1138
1152
  return res.data.result;
1139
1153
  },
1140
1154
 
1141
- getSmartContractByAddress: async (address: string) => {
1142
- const res = await this.post<JsonRpcResult<any>>(
1155
+ getSmartContractByAddress: async (
1156
+ address: string
1157
+ ): Promise<IDomainSmartContract | undefined> => {
1158
+ const res = await this.post<JsonRpcResult<IDomainSmartContract>>(
1143
1159
  "domain_getSmartContractByAddress",
1144
1160
  [address],
1145
1161
  { validateStatus: (status) => status < 300 || status === 404 }