@lfdecentralizedtrust/paladin-sdk 1.0.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.
- 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/signpayloads.d.ts +3 -0
- package/build/interfaces/signpayloads.js +7 -0
- package/build/paladin.d.ts +6 -5
- package/build/paladin.js +4 -0
- package/package.json +3 -3
- package/src/interfaces/domains.ts +10 -0
- package/src/interfaces/index.ts +1 -0
- package/src/interfaces/signpayloads.ts +3 -0
- package/src/paladin.ts +25 -9
|
@@ -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);
|
|
@@ -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 = {}));
|
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.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"
|
|
@@ -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/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 }
|