@lfdecentralizedtrust/paladin-sdk 1.0.0-rc.0 → 1.0.0-rc.2
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/zeto.js +1 -1
- package/build/interfaces/domains.d.ts +8 -0
- package/build/interfaces/index.d.ts +1 -0
- package/build/interfaces/index.js +1 -0
- package/build/interfaces/privacygroups.d.ts +1 -0
- package/build/interfaces/signpayloads.d.ts +3 -0
- package/build/interfaces/signpayloads.js +7 -0
- package/build/interfaces/states.d.ts +4 -0
- package/build/interfaces/transaction.d.ts +9 -5
- package/build/interfaces/transaction.js +0 -4
- package/build/paladin.d.ts +6 -5
- package/build/paladin.js +4 -0
- package/package.json +3 -3
- package/src/domains/zeto.ts +1 -1
- package/src/interfaces/domains.ts +10 -0
- package/src/interfaces/index.ts +1 -0
- package/src/interfaces/privacygroups.ts +1 -0
- package/src/interfaces/signpayloads.ts +3 -0
- package/src/interfaces/states.ts +5 -0
- package/src/interfaces/transaction.ts +12 -6
- package/src/paladin.ts +25 -9
package/build/domains/zeto.js
CHANGED
|
@@ -143,7 +143,7 @@ class ZetoInstance {
|
|
|
143
143
|
}
|
|
144
144
|
delegateLock(from, data) {
|
|
145
145
|
return new transaction_1.TransactionFuture(this.paladin, this.paladin.sendTransaction({
|
|
146
|
-
type: interfaces_1.TransactionType.
|
|
146
|
+
type: interfaces_1.TransactionType.PUBLIC,
|
|
147
147
|
abi: zetoPublicAbi,
|
|
148
148
|
function: "delegateLock",
|
|
149
149
|
to: this.address,
|
|
@@ -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
|
}
|
|
@@ -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);
|
|
@@ -46,6 +46,7 @@ export interface IPrivacyGroupEVMTXInput extends IPrivacyGroupEVMTX {
|
|
|
46
46
|
export interface IPrivacyGroupEVMCall extends IPrivacyGroupEVMTX {
|
|
47
47
|
domain: string;
|
|
48
48
|
group: string;
|
|
49
|
+
block?: BigNumberish | string;
|
|
49
50
|
dataFormat?: string;
|
|
50
51
|
}
|
|
51
52
|
export interface IPrivacyGroupMessageListener {
|
|
@@ -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 = {}));
|
|
@@ -25,6 +25,7 @@ export interface IStateEncoded {
|
|
|
25
25
|
}
|
|
26
26
|
export interface IState extends IStateBase {
|
|
27
27
|
confirmed?: IStateConfirm;
|
|
28
|
+
read?: IStateRead;
|
|
28
29
|
spent?: IStateSpend;
|
|
29
30
|
locks?: IStateLock[];
|
|
30
31
|
nullifier?: IStateNullifier;
|
|
@@ -44,6 +45,9 @@ export interface IStateInt64Label {
|
|
|
44
45
|
export interface IStateConfirm {
|
|
45
46
|
transaction: string;
|
|
46
47
|
}
|
|
48
|
+
export interface IStateRead {
|
|
49
|
+
transaction: string;
|
|
50
|
+
}
|
|
47
51
|
export interface IStateSpend {
|
|
48
52
|
transaction: string;
|
|
49
53
|
}
|
|
@@ -16,7 +16,11 @@ export interface PublicTxOptions {
|
|
|
16
16
|
maxPriorityFeePerGas?: BigNumberish;
|
|
17
17
|
maxFeePerGas?: BigNumberish;
|
|
18
18
|
}
|
|
19
|
+
export interface PublicCallOptions {
|
|
20
|
+
block?: BigNumberish | string;
|
|
21
|
+
}
|
|
19
22
|
export interface ITransactionBase {
|
|
23
|
+
idempotencyKey?: string;
|
|
20
24
|
type: TransactionType;
|
|
21
25
|
domain?: string;
|
|
22
26
|
function?: string;
|
|
@@ -26,10 +30,12 @@ export interface ITransactionBase {
|
|
|
26
30
|
[key: string]: any;
|
|
27
31
|
};
|
|
28
32
|
}
|
|
33
|
+
export type SubmitMode = "auto" | "external" | "call" | "prepare";
|
|
29
34
|
export interface ITransaction extends ITransactionBase {
|
|
30
35
|
id: string;
|
|
31
36
|
created: string;
|
|
32
37
|
abiReference: string;
|
|
38
|
+
submitMode?: SubmitMode;
|
|
33
39
|
}
|
|
34
40
|
export interface IPreparedTransaction {
|
|
35
41
|
id: string;
|
|
@@ -50,8 +56,10 @@ export interface ITransactionInput extends ITransactionBase {
|
|
|
50
56
|
abiReference?: string;
|
|
51
57
|
abi?: ethers.InterfaceAbi;
|
|
52
58
|
bytecode?: string;
|
|
59
|
+
dependsOn?: string[];
|
|
53
60
|
}
|
|
54
|
-
export interface ITransactionCall extends ITransactionInput {
|
|
61
|
+
export interface ITransactionCall extends ITransactionInput, PublicCallOptions {
|
|
62
|
+
dataFormat?: string;
|
|
55
63
|
}
|
|
56
64
|
export interface ITransactionReceipt {
|
|
57
65
|
blockNumber: number;
|
|
@@ -131,10 +139,6 @@ export interface ITransactionStates {
|
|
|
131
139
|
info?: string[];
|
|
132
140
|
};
|
|
133
141
|
}
|
|
134
|
-
export declare enum TransactionType {
|
|
135
|
-
Private = "private",
|
|
136
|
-
Public = "public"
|
|
137
|
-
}
|
|
138
142
|
export interface IABIDecodedData {
|
|
139
143
|
signature: string;
|
|
140
144
|
definition: ethers.JsonFragment;
|
|
@@ -6,7 +6,3 @@ var TransactionType;
|
|
|
6
6
|
TransactionType["PUBLIC"] = "public";
|
|
7
7
|
TransactionType["PRIVATE"] = "private";
|
|
8
8
|
})(TransactionType || (exports.TransactionType = TransactionType = {}));
|
|
9
|
-
(function (TransactionType) {
|
|
10
|
-
TransactionType["Private"] = "private";
|
|
11
|
-
TransactionType["Public"] = "public";
|
|
12
|
-
})(TransactionType || (exports.TransactionType = TransactionType = {}));
|
package/build/paladin.d.ts
CHANGED
|
@@ -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<
|
|
240
|
-
getDomainByAddress: (address: string) => Promise<
|
|
241
|
-
querySmartContracts: (query: IQuery) => Promise<
|
|
242
|
-
getSmartContractByAddress: (address: string) => Promise<
|
|
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": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.2",
|
|
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"
|
package/src/domains/zeto.ts
CHANGED
|
@@ -208,7 +208,7 @@ export class ZetoInstance {
|
|
|
208
208
|
return new TransactionFuture(
|
|
209
209
|
this.paladin,
|
|
210
210
|
this.paladin.sendTransaction({
|
|
211
|
-
type: TransactionType.
|
|
211
|
+
type: TransactionType.PUBLIC,
|
|
212
212
|
abi: zetoPublicAbi,
|
|
213
213
|
function: "delegateLock",
|
|
214
214
|
to: this.address,
|
|
@@ -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
|
}
|
package/src/interfaces/index.ts
CHANGED
package/src/interfaces/states.ts
CHANGED
|
@@ -29,6 +29,7 @@ export interface IStateEncoded {
|
|
|
29
29
|
|
|
30
30
|
export interface IState extends IStateBase {
|
|
31
31
|
confirmed?: IStateConfirm;
|
|
32
|
+
read?: IStateRead;
|
|
32
33
|
spent?: IStateSpend;
|
|
33
34
|
locks?: IStateLock[];
|
|
34
35
|
nullifier?: IStateNullifier;
|
|
@@ -52,6 +53,10 @@ export interface IStateConfirm {
|
|
|
52
53
|
transaction: string;
|
|
53
54
|
}
|
|
54
55
|
|
|
56
|
+
export interface IStateRead {
|
|
57
|
+
transaction: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
55
60
|
export interface IStateSpend {
|
|
56
61
|
transaction: string;
|
|
57
62
|
}
|
|
@@ -20,7 +20,12 @@ export interface PublicTxOptions {
|
|
|
20
20
|
maxFeePerGas?: BigNumberish;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
export interface PublicCallOptions {
|
|
24
|
+
block?: BigNumberish | string;
|
|
25
|
+
}
|
|
26
|
+
|
|
23
27
|
export interface ITransactionBase {
|
|
28
|
+
idempotencyKey?: string;
|
|
24
29
|
type: TransactionType;
|
|
25
30
|
domain?: string;
|
|
26
31
|
function?: string;
|
|
@@ -31,10 +36,13 @@ export interface ITransactionBase {
|
|
|
31
36
|
};
|
|
32
37
|
}
|
|
33
38
|
|
|
39
|
+
export type SubmitMode = "auto" | "external" | "call" | "prepare";
|
|
40
|
+
|
|
34
41
|
export interface ITransaction extends ITransactionBase {
|
|
35
42
|
id: string;
|
|
36
43
|
created: string;
|
|
37
44
|
abiReference: string;
|
|
45
|
+
submitMode?: SubmitMode;
|
|
38
46
|
}
|
|
39
47
|
|
|
40
48
|
export interface IPreparedTransaction {
|
|
@@ -57,9 +65,12 @@ export interface ITransactionInput extends ITransactionBase {
|
|
|
57
65
|
abiReference?: string;
|
|
58
66
|
abi?: ethers.InterfaceAbi;
|
|
59
67
|
bytecode?: string;
|
|
68
|
+
dependsOn?: string[];
|
|
60
69
|
}
|
|
61
70
|
|
|
62
|
-
export interface ITransactionCall extends ITransactionInput {
|
|
71
|
+
export interface ITransactionCall extends ITransactionInput, PublicCallOptions {
|
|
72
|
+
dataFormat?: string;
|
|
73
|
+
}
|
|
63
74
|
|
|
64
75
|
export interface ITransactionReceipt {
|
|
65
76
|
blockNumber: number;
|
|
@@ -148,11 +159,6 @@ export interface ITransactionStates {
|
|
|
148
159
|
};
|
|
149
160
|
}
|
|
150
161
|
|
|
151
|
-
export enum TransactionType {
|
|
152
|
-
Private = "private",
|
|
153
|
-
Public = "public",
|
|
154
|
-
}
|
|
155
|
-
|
|
156
162
|
export interface IABIDecodedData {
|
|
157
163
|
signature: string;
|
|
158
164
|
definition: ethers.JsonFragment;
|
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<
|
|
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 (
|
|
1125
|
-
|
|
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 (
|
|
1134
|
-
|
|
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 (
|
|
1142
|
-
|
|
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 }
|