@lit-protocol/vincent-app-sdk 1.0.1 → 1.0.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/CHANGELOG.md +21 -0
- package/dist/CHANGELOG.md +21 -0
- package/dist/package.json +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/toolClient/execute/generateVincentToolSessionSigs.d.ts +8 -0
- package/dist/src/toolClient/execute/generateVincentToolSessionSigs.d.ts.map +1 -0
- package/dist/src/toolClient/execute/generateVincentToolSessionSigs.js +33 -0
- package/dist/src/toolClient/execute/generateVincentToolSessionSigs.js.map +1 -0
- package/dist/src/toolClient/{resultCreators.d.ts → execute/resultCreators.d.ts} +9 -9
- package/dist/src/toolClient/execute/resultCreators.d.ts.map +1 -0
- package/dist/src/toolClient/{resultCreators.js → execute/resultCreators.js} +9 -9
- package/dist/src/toolClient/execute/resultCreators.js.map +1 -0
- package/dist/src/toolClient/execute/types.d.ts +35 -0
- package/dist/src/toolClient/execute/types.d.ts.map +1 -0
- package/dist/src/toolClient/execute/types.js +4 -0
- package/dist/src/toolClient/execute/types.js.map +1 -0
- package/dist/src/toolClient/index.d.ts +5 -1
- package/dist/src/toolClient/index.d.ts.map +1 -1
- package/dist/src/toolClient/index.js +4 -1
- package/dist/src/toolClient/index.js.map +1 -1
- package/dist/src/toolClient/precheck/resultCreators.d.ts +67 -0
- package/dist/src/toolClient/precheck/resultCreators.d.ts.map +1 -0
- package/dist/src/toolClient/precheck/resultCreators.js +55 -0
- package/dist/src/toolClient/precheck/resultCreators.js.map +1 -0
- package/dist/src/toolClient/precheck/runPolicyPrechecks.d.ts +13 -0
- package/dist/src/toolClient/precheck/runPolicyPrechecks.d.ts.map +1 -0
- package/dist/src/toolClient/precheck/runPolicyPrechecks.js +86 -0
- package/dist/src/toolClient/precheck/runPolicyPrechecks.js.map +1 -0
- package/dist/src/toolClient/precheck/types.d.ts +80 -0
- package/dist/src/toolClient/precheck/types.d.ts.map +1 -0
- package/dist/src/toolClient/precheck/types.js +4 -0
- package/dist/src/toolClient/precheck/types.js.map +1 -0
- package/dist/src/toolClient/typeGuards.d.ts +4 -4
- package/dist/src/toolClient/typeGuards.d.ts.map +1 -1
- package/dist/src/toolClient/types.d.ts +5 -35
- package/dist/src/toolClient/types.d.ts.map +1 -1
- package/dist/src/toolClient/types.js +1 -0
- package/dist/src/toolClient/types.js.map +1 -1
- package/dist/src/toolClient/vincentToolClient.d.ts +1 -1
- package/dist/src/toolClient/vincentToolClient.d.ts.map +1 -1
- package/dist/src/toolClient/vincentToolClient.js +36 -119
- package/dist/src/toolClient/vincentToolClient.js.map +1 -1
- package/dist/src/type-inference-verification/tool-client-inference.d.ts.map +1 -1
- package/dist/src/type-inference-verification/tool-client-inference.js +4 -0
- package/dist/src/type-inference-verification/tool-client-inference.js.map +1 -1
- package/dist/src/utils/contracts.d.ts +49 -0
- package/dist/src/utils/contracts.d.ts.map +1 -0
- package/dist/src/utils/contracts.js +92 -0
- package/dist/src/utils/contracts.js.map +1 -0
- package/dist/src/utils/delegation.d.ts +21 -0
- package/dist/src/utils/delegation.d.ts.map +1 -0
- package/dist/src/utils/delegation.js +87 -0
- package/dist/src/utils/delegation.js.map +1 -0
- package/dist/src/utils/index.d.ts +3 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/index.js +6 -0
- package/dist/src/utils/index.js.map +1 -0
- package/dist/src/utils/pkp.d.ts +12 -0
- package/dist/src/utils/pkp.d.ts.map +1 -0
- package/dist/src/utils/pkp.js +19 -0
- package/dist/src/utils/pkp.js.map +1 -0
- package/package.json +2 -2
- package/dist/src/toolClient/resultCreators.d.ts.map +0 -1
- package/dist/src/toolClient/resultCreators.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/utils/contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAW,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,GAAG,2CAAgC,CAAC;AAEjD;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,WAAW,CAAC,KAAK,CAAC;AAE/C,eAAO,MAAM,iBAAiB,8JAGpB,CAAC;AAEX,eAAO,MAAM,YAAY,wtBA8Bf,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,UAAU;;;CAGtB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,UAAU,CAAC;AAUpD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAKnE,CAAC;AAEX;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,mBAKjE"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Contract interaction utilities for Vincent MCP
|
|
4
|
+
*
|
|
5
|
+
* This module provides utilities for interacting with the Vincent Diamond contract
|
|
6
|
+
* on the Lit Network. It includes constants, contract ABIs, and functions for
|
|
7
|
+
* fetching data from the contract.
|
|
8
|
+
*
|
|
9
|
+
* @module contracts
|
|
10
|
+
* @category Vincent MCP
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.VINCENT_ADDRESSES = exports.FACET_ABIS = exports.APP_VIEW_ABI = exports.PUBKEY_ROUTER_ABI = exports.rpc = void 0;
|
|
14
|
+
exports.getContract = getContract;
|
|
15
|
+
const constants_1 = require("@lit-protocol/constants");
|
|
16
|
+
const ethers_1 = require("ethers");
|
|
17
|
+
/**
|
|
18
|
+
* RPC endpoint for interacting with the Lit Network Contracts in Yellowstone
|
|
19
|
+
*/
|
|
20
|
+
exports.rpc = constants_1.LIT_RPC.CHRONICLE_YELLOWSTONE;
|
|
21
|
+
exports.PUBKEY_ROUTER_ABI = [
|
|
22
|
+
'function getEthAddress(uint256 tokenId) public view returns (address)',
|
|
23
|
+
'function getPubkey(uint256 tokenId) public view returns (bytes memory)',
|
|
24
|
+
];
|
|
25
|
+
exports.APP_VIEW_ABI = [
|
|
26
|
+
`function getAppVersion(
|
|
27
|
+
uint256 tokenId,
|
|
28
|
+
uint256 version
|
|
29
|
+
) view returns (
|
|
30
|
+
(
|
|
31
|
+
uint256 id,
|
|
32
|
+
string name,
|
|
33
|
+
string description,
|
|
34
|
+
bool isDeleted,
|
|
35
|
+
uint8 deploymentStatus,
|
|
36
|
+
address manager,
|
|
37
|
+
uint256 latestVersion,
|
|
38
|
+
address[] delegatees,
|
|
39
|
+
string[] authorizedRedirectUris
|
|
40
|
+
) app,
|
|
41
|
+
(
|
|
42
|
+
uint256 version,
|
|
43
|
+
bool enabled,
|
|
44
|
+
uint256[] delegatedAgentPkpTokenIds,
|
|
45
|
+
(
|
|
46
|
+
string toolIpfsCid,
|
|
47
|
+
(
|
|
48
|
+
string policyIpfsCid,
|
|
49
|
+
string[] parameterNames,
|
|
50
|
+
uint8[] parameterTypes
|
|
51
|
+
)[] policies
|
|
52
|
+
)[] tools
|
|
53
|
+
) appVersion
|
|
54
|
+
)`,
|
|
55
|
+
];
|
|
56
|
+
/**
|
|
57
|
+
* ABIs for different facets of the Vincent Diamond contract
|
|
58
|
+
* Each facet provides specific functionality of the contract
|
|
59
|
+
*/
|
|
60
|
+
exports.FACET_ABIS = {
|
|
61
|
+
AppView: exports.APP_VIEW_ABI,
|
|
62
|
+
PubKeyRouter: exports.PUBKEY_ROUTER_ABI,
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Vincent diamond address. This is the main address that redirects to any other contract involved in Vincent system
|
|
66
|
+
* If included in the diamond, the contract should be accessed through it to guarantee the last version is being used
|
|
67
|
+
*/
|
|
68
|
+
const VINCENT_DIAMOND_ADDRESSES = {
|
|
69
|
+
[constants_1.LIT_NETWORK.Datil]: '0x78Cd1d270Ff12BA55e98BDff1f3646426E25D932',
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Mapping of network to Vincent Diamond contract address
|
|
73
|
+
* Used to interact with the correct contract based on the network
|
|
74
|
+
*/
|
|
75
|
+
exports.VINCENT_ADDRESSES = {
|
|
76
|
+
[constants_1.LIT_NETWORK.Datil]: {
|
|
77
|
+
AppView: VINCENT_DIAMOND_ADDRESSES.datil,
|
|
78
|
+
PubKeyRouter: '0xF182d6bEf16Ba77e69372dD096D8B70Bc3d5B475',
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Get a contract instance for a specific facet of the Vincent Diamond
|
|
83
|
+
* @param network The network to connect to
|
|
84
|
+
* @param facet The contract facet to use
|
|
85
|
+
* @returns A contract instance for the specified facet
|
|
86
|
+
*/
|
|
87
|
+
function getContract(network, facet) {
|
|
88
|
+
const abi = exports.FACET_ABIS[facet];
|
|
89
|
+
const provider = new ethers_1.ethers.providers.JsonRpcProvider(exports.rpc);
|
|
90
|
+
return new ethers_1.ethers.Contract(exports.VINCENT_ADDRESSES[network][facet], abi, provider);
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/utils/contracts.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AA6FH,kCAKC;AAhGD,uDAA+D;AAC/D,mCAAgC;AAEhC;;GAEG;AACU,QAAA,GAAG,GAAG,mBAAO,CAAC,qBAAqB,CAAC;AAQpC,QAAA,iBAAiB,GAAG;IAC/B,uEAAuE;IACvE,wEAAwE;CAChE,CAAC;AAEE,QAAA,YAAY,GAAG;IAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA4BI;CACI,CAAC;AAEX;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,OAAO,EAAE,oBAAY;IACrB,YAAY,EAAE,yBAAiB;CAChC,CAAC;AAQF;;;GAGG;AACH,MAAM,yBAAyB,GAAG;IAChC,CAAC,uBAAW,CAAC,KAAK,CAAC,EAAE,4CAA4C;CACzD,CAAC;AAEX;;;GAGG;AACU,QAAA,iBAAiB,GAAmD;IAC/E,CAAC,uBAAW,CAAC,KAAK,CAAC,EAAE;QACnB,OAAO,EAAE,yBAAyB,CAAC,KAAK;QACxC,YAAY,EAAE,4CAA4C;KAC3D;CACO,CAAC;AAEX;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,OAAgB,EAAE,KAAoB;IAChE,MAAM,GAAG,GAAG,kBAAU,CAAC,KAAK,CAAC,CAAC;IAE9B,MAAM,QAAQ,GAAG,IAAI,eAAM,CAAC,SAAS,CAAC,eAAe,CAAC,WAAG,CAAC,CAAC;IAC3D,OAAO,IAAI,eAAM,CAAC,QAAQ,CAAC,yBAAiB,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retrieves PKP Eth addresses for all delegators of a specific app version
|
|
3
|
+
*
|
|
4
|
+
* This function fetches the delegated agent PKP token IDs for a given app version
|
|
5
|
+
* and then retrieves the PKP Eth address for each token ID. This information
|
|
6
|
+
* can be used to identify and interact with the PKPs that are authorized as agents
|
|
7
|
+
* for the application.
|
|
8
|
+
*
|
|
9
|
+
* @param appId - The ID of the Vincent application
|
|
10
|
+
* @param appVersion - The version number of the application
|
|
11
|
+
* @returns An array of PKP Eth addresses
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const pkpEthAddresses = await getDelegatorsAgentPkpAddresses(123, 1);
|
|
16
|
+
* console.log(`Found ${pkpEthAddresses.length} delegator PKPs`);
|
|
17
|
+
* console.log(`First PKP eth address: ${pkpEthAddresses[0]}`);
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function getDelegatorsAgentPkpAddresses(appId: number, appVersion: number): Promise<string[]>;
|
|
21
|
+
//# sourceMappingURL=delegation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegation.d.ts","sourceRoot":"","sources":["../../../src/utils/delegation.ts"],"names":[],"mappings":"AAiEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,8BAA8B,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,qBASrF"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDelegatorsAgentPkpAddresses = getDelegatorsAgentPkpAddresses;
|
|
4
|
+
const constants_1 = require("@lit-protocol/constants");
|
|
5
|
+
const contracts_1 = require("./contracts");
|
|
6
|
+
const pkp_1 = require("./pkp");
|
|
7
|
+
/**
|
|
8
|
+
* Fetches the delegated agent PKP token IDs for a specific app version
|
|
9
|
+
*
|
|
10
|
+
* This function queries the Vincent AppView contract to get the PKP token IDs
|
|
11
|
+
* that have delegated to a specific app version. These token IDs can be used
|
|
12
|
+
* to identify the PKPs that are authorized to act as agents for the app.
|
|
13
|
+
*
|
|
14
|
+
* @param appId - The ID of the Vincent application
|
|
15
|
+
* @param version - The version number of the application
|
|
16
|
+
* @returns An array of BigNumber representing the delegated agent PKP token IDs
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const tokenIds = await fetchDelegatedAgentPKPTokenIds(123, 1);
|
|
21
|
+
* console.log(`App has ${tokenIds.length} delegated agent PKPs`);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
async function fetchDelegatedAgentPKPTokenIds(appId, version) {
|
|
25
|
+
try {
|
|
26
|
+
const contract = (0, contracts_1.getContract)(constants_1.LIT_NETWORK.Datil, 'AppView');
|
|
27
|
+
const appView = await contract.getAppVersion(appId, version);
|
|
28
|
+
return appView.appVersion.delegatedAgentPkpTokenIds;
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
throw new Error(`Error fetching delegated agent PKP token IDs: ${error}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function processWithConcurrency(items, processFn, concurrencyLimit) {
|
|
35
|
+
const results = [];
|
|
36
|
+
let index = 0;
|
|
37
|
+
// Start initial set of promises
|
|
38
|
+
const workers = Array(concurrencyLimit)
|
|
39
|
+
.fill(null)
|
|
40
|
+
.map(async () => {
|
|
41
|
+
while (index < items.length) {
|
|
42
|
+
const currentIndex = index++;
|
|
43
|
+
if (currentIndex >= items.length)
|
|
44
|
+
break;
|
|
45
|
+
try {
|
|
46
|
+
const result = await processFn(items[currentIndex]);
|
|
47
|
+
results[currentIndex] = result;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
// Store the error but don't throw until all are done
|
|
51
|
+
results[currentIndex] = error;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
await Promise.all(workers);
|
|
56
|
+
return results;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Retrieves PKP Eth addresses for all delegators of a specific app version
|
|
60
|
+
*
|
|
61
|
+
* This function fetches the delegated agent PKP token IDs for a given app version
|
|
62
|
+
* and then retrieves the PKP Eth address for each token ID. This information
|
|
63
|
+
* can be used to identify and interact with the PKPs that are authorized as agents
|
|
64
|
+
* for the application.
|
|
65
|
+
*
|
|
66
|
+
* @param appId - The ID of the Vincent application
|
|
67
|
+
* @param appVersion - The version number of the application
|
|
68
|
+
* @returns An array of PKP Eth addresses
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* const pkpEthAddresses = await getDelegatorsAgentPkpAddresses(123, 1);
|
|
73
|
+
* console.log(`Found ${pkpEthAddresses.length} delegator PKPs`);
|
|
74
|
+
* console.log(`First PKP eth address: ${pkpEthAddresses[0]}`);
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
async function getDelegatorsAgentPkpAddresses(appId, appVersion) {
|
|
78
|
+
try {
|
|
79
|
+
const delegators = await fetchDelegatedAgentPKPTokenIds(appId, appVersion);
|
|
80
|
+
const delegatorsPkpEthAddresses = await processWithConcurrency(delegators, pkp_1.getPkpEthAddress, 5);
|
|
81
|
+
return delegatorsPkpEthAddresses;
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
throw new Error(`Error fetching delegators agent PKP info: ${error}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=delegation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegation.js","sourceRoot":"","sources":["../../../src/utils/delegation.ts"],"names":[],"mappings":";;AAoFA,wEASC;AA3FD,uDAAsD;AAEtD,2CAA0C;AAC1C,+BAAyC;AAEzC;;;;;;;;;;;;;;;;GAgBG;AACH,KAAK,UAAU,8BAA8B,CAAC,KAAa,EAAE,OAAe;IAC1E,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAA,uBAAW,EAAC,uBAAW,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAC3D,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAE7D,OAAO,OAAO,CAAC,UAAU,CAAC,yBAA+C,CAAC;IAC5E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,iDAAiD,KAAK,EAAE,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC;AAED,KAAK,UAAU,sBAAsB,CACnC,KAAU,EACV,SAAkC,EA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.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDelegatorsAgentPkpAddresses = void 0;
|
|
4
|
+
const delegation_1 = require("./delegation");
|
|
5
|
+
Object.defineProperty(exports, "getDelegatorsAgentPkpAddresses", { enumerable: true, get: function () { return delegation_1.getDelegatorsAgentPkpAddresses; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,6CAA8D;AAErD,+GAFA,2CAA8B,OAEA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
2
|
+
/**
|
|
3
|
+
* Retrieves PKP Eth Address
|
|
4
|
+
*
|
|
5
|
+
* This function queries the PKP Router contract to get the Ethereum address
|
|
6
|
+
* associated with a PKP token ID.
|
|
7
|
+
*
|
|
8
|
+
* @param pkpTokenId - The PKP token ID as ethers.BigNumber
|
|
9
|
+
* @returns The PKP Eth address
|
|
10
|
+
*/
|
|
11
|
+
export declare function getPkpEthAddress(pkpTokenId: ethers.BigNumber): Promise<string>;
|
|
12
|
+
//# sourceMappingURL=pkp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pkp.d.ts","sourceRoot":"","sources":["../../../src/utils/pkp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAIpF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPkpEthAddress = getPkpEthAddress;
|
|
4
|
+
const constants_1 = require("@lit-protocol/constants");
|
|
5
|
+
const contracts_1 = require("./contracts");
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves PKP Eth Address
|
|
8
|
+
*
|
|
9
|
+
* This function queries the PKP Router contract to get the Ethereum address
|
|
10
|
+
* associated with a PKP token ID.
|
|
11
|
+
*
|
|
12
|
+
* @param pkpTokenId - The PKP token ID as ethers.BigNumber
|
|
13
|
+
* @returns The PKP Eth address
|
|
14
|
+
*/
|
|
15
|
+
async function getPkpEthAddress(pkpTokenId) {
|
|
16
|
+
const pubkeyRouter = (0, contracts_1.getContract)(constants_1.LIT_NETWORK.Datil, 'PubKeyRouter');
|
|
17
|
+
return await pubkeyRouter.getEthAddress(pkpTokenId);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=pkp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pkp.js","sourceRoot":"","sources":["../../../src/utils/pkp.ts"],"names":[],"mappings":";;AAcA,4CAIC;AAlBD,uDAAsD;AAGtD,2CAA0C;AAE1C;;;;;;;;GAQG;AACI,KAAK,UAAU,gBAAgB,CAAC,UAA4B;IACjE,MAAM,YAAY,GAAG,IAAA,uBAAW,EAAC,uBAAW,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;IAEpE,OAAO,MAAM,YAAY,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;AACtD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lit-protocol/vincent-app-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Vincent SDK for browser and backend",
|
|
5
5
|
"author": "Lit Protocol",
|
|
6
6
|
"license": "ISC",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"ethers": "5.8.0",
|
|
29
29
|
"tslib": "^2.8.1",
|
|
30
30
|
"zod": "3.25.64",
|
|
31
|
-
"@lit-protocol/vincent-tool-sdk": "1.0.
|
|
31
|
+
"@lit-protocol/vincent-tool-sdk": "1.0.2"
|
|
32
32
|
},
|
|
33
33
|
"sideEffects": false,
|
|
34
34
|
"files": [
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resultCreators.d.ts","sourceRoot":"","sources":["../../../src/toolClient/resultCreators.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EACV,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EACV,eAAe,EACf,6BAA6B,EAC9B,MAAM,gCAAgC,CAAC;AAExC,wBAAgB,2BAA2B,CAAC,qBAAqB,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3F,iBAAiB,EAAE,KAAK,CAAC,MAAM,qBAAqB,CAAC,EACrD,eAAe,EAAE;KACd,CAAC,IAAI,MAAM,qBAAqB,CAAC,CAAC,EAAE;QACnC,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,SAAS;YACxD,qBAAqB,EAAE,MAAM,MAAM,CAAC;SACrC,GACG,MAAM,SAAS,CAAC,CAAC,OAAO,GACtB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,GACf,KAAK,GACP,KAAK,CAAC;KACX;CACF,GACA;IACD,KAAK,EAAE,IAAI,CAAC;IACZ,iBAAiB,EAAE,KAAK,CAAC,MAAM,qBAAqB,CAAC,CAAC;IACtD,eAAe,EAAE;SACd,CAAC,IAAI,MAAM,qBAAqB,CAAC,CAAC,EAAE;YACnC,MAAM,EAAE,qBAAqB,CAA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AAC,QAAQ,CAAC,CAAC,CAAC;CACpE,GAAG,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAOtC;AAED,wBAAgB,iCAAiC,CAAC,QAAQ,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE;IAC3F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,eAAe,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC,CAAC;CACpE,GAAG,2BAA2B,CAAC,QAAQ,CAAC,CAOxC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resultCreators.js","sourceRoot":"","sources":["../../../src/toolClient/resultCreators.ts"],"names":[],"mappings":";AAAA,uCAAuC;;AAgBvC,kEAiCC;AAED,gEA0DC;AAED,8DASC;AAED,8EAQC;AAED,8DAWC;AAED,8EAUC;AA3ID,SAAgB,2BAA2B,CACzC,iBAAqD,EACrD,eAUC;IAgBD,OAAO;QACL,KAAK,EAAE,IAAI;QACX,iBAAiB;QACjB,eAAe;KAChB,CAAC;AACJ,CAAC;AAED,SAAgB,0BAA0B,CACxC,iBAAqD,EACrD,eAUC,EACD,YAWC;IA4BD,OAAO;QACL,KAAK,EAAE,KAAK;QACZ,iBAAiB;QACjB,eAAe;QACf,YAAY;KACb,CAAC;AACJ,CAAC;AAED,SAAgB,yBAAyB,CAA6C,MAGrF;IACC,OAAO;QACL,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;AACJ,CAAC;AAED,SAAgB,iCAAiC,CAAoC,MAEpF;IACC,OAAO;QACL,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO;KACzB,CAAC;AACJ,CAAC;AAED,SAAgB,yBAAyB,CAA0C,MAIlF;IACC,OAAO;QACL,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,KAAK,EAAE,MAAM,CAAC,OAAO;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;AACJ,CAAC;AAED,SAAgB,iCAAiC,CAAoC,MAGpF;IACC,OAAO;QACL,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,SAAS;QACjB,KAAK,EAAE,MAAM,CAAC,OAAO;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;AACJ,CAAC"}
|