Skip to content

Commit 7a5d4f2

Browse files
committed
feat: migration to v7
1 parent 4c911fc commit 7a5d4f2

File tree

76 files changed

+14791
-21438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+14791
-21438
lines changed

btc-trigger/nodejs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"test": "npx @dotenvx/dotenvx run -- mocha test/**/*.spec.ts"
88
},
99
"dependencies": {
10-
"@lit-protocol/constants": "^6.11.0",
11-
"@lit-protocol/lit-node-client": "^6.11.0",
10+
"@lit-protocol/constants": "^7.0.0-alpha.9",
11+
"@lit-protocol/lit-node-client": "^7.0.0-alpha.9",
1212
"@mempool/mempool.js": "^2.3.0",
1313
"@simplewebauthn/browser": "^10.0.0",
1414
"@types/elliptic": "^6.4.18",

btc-trigger/nodejs/src/index.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { LitNodeClient } from "@lit-protocol/lit-node-client";
2-
import { LitNetwork, LIT_RPC, } from "@lit-protocol/constants";
2+
import { LIT_NETWORK, LIT_RPC, LIT_ABILITY } from "@lit-protocol/constants";
33
import {
44
createSiweMessageWithRecaps,
55
generateAuthSig,
6-
LitAbility,
76
LitActionResource,
87
LitPKPResource,
98
} from "@lit-protocol/auth-helpers";
@@ -26,7 +25,7 @@ const PKP_PUBLIC_KEY = getEnv("PKP_PUBLIC_KEY");
2625
const ETHEREUM_PRIVATE_KEY = getEnv("ETHEREUM_PRIVATE_KEY");
2726
const BTC_DESTINATION_ADDRESS = getEnv("BTC_DESTINATION_ADDRESS");
2827
const BROADCAST_URL = getEnv("BROADCAST_URL");
29-
const LIT_NETWORK = process.env["LIT_NETWORK"] as LIT_NETWORKS_KEYS || LitNetwork.Datil;
28+
const SELECTED_LIT_NETWORK = process.env["LIT_NETWORK"] as LIT_NETWORKS_KEYS || LIT_NETWORK.Datil;
3029
const LIT_CAPACITY_CREDIT_TOKEN_ID = process.env["LIT_CAPACITY_CREDIT_TOKEN_ID"];
3130

3231
const ethersWallet = new ethers.Wallet(
@@ -44,14 +43,14 @@ export const executeBtcSigning = async () => {
4443

4544
try {
4645
litNodeClient = new LitNodeClient({
47-
litNetwork: LIT_NETWORK,
46+
litNetwork: SELECTED_LIT_NETWORK,
4847
debug: false,
4948
});
5049
await litNodeClient.connect();
5150

5251
const litContracts = new LitContracts({
5352
signer: ethersWallet,
54-
network: LIT_NETWORK,
53+
network: SELECTED_LIT_NETWORK,
5554
debug: false,
5655
});
5756
await litContracts.connect();
@@ -87,11 +86,11 @@ export const executeBtcSigning = async () => {
8786
resourceAbilityRequests: [
8887
{
8988
resource: new LitPKPResource("*"),
90-
ability: LitAbility.PKPSigning,
89+
ability: LIT_ABILITY.PKPSigning,
9190
},
9291
{
9392
resource: new LitActionResource("*"),
94-
ability: LitAbility.LitActionExecution,
93+
ability: LIT_ABILITY.LitActionExecution,
9594
},
9695
],
9796
authNeededCallback: async ({

btc-trigger/nodejs/yarn.lock

Lines changed: 5089 additions & 3880 deletions
Large diffs are not rendered by default.

conditional-signing/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
1414
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
15-
"@lit-protocol/lit-node-client": "^6.11.0",
15+
"@lit-protocol/lit-node-client": "^7.0.0-alpha.9",
1616
"@simplewebauthn/browser": "^10.0.0",
1717
"@vitejs/plugin-react-swc": "^3.7.0",
1818
"react": "^18.3.1",

conditional-signing/browser/src/conditionalSigning.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11

22
import { LitNodeClient } from "@lit-protocol/lit-node-client";
3-
import { LitNetwork } from "@lit-protocol/constants";
3+
import { LIT_NETWORK, LIT_ABILITY } from "@lit-protocol/constants";
44
import {
55
createSiweMessage,
66
generateAuthSig,
7-
LitAbility,
87
LitActionResource,
98
} from "@lit-protocol/auth-helpers";
109
import { LitContracts } from "@lit-protocol/contracts-sdk";
@@ -16,7 +15,7 @@ import { getEnv } from "./utils";
1615
const LIT_PKP_PUBLIC_KEY = import.meta.env["VITE_LIT_PKP_PUBLIC_KEY"];
1716
const LIT_CAPACITY_CREDIT_TOKEN_ID = import.meta.env["VITE_LIT_CAPACITY_CREDIT_TOKEN_ID"];
1817
const CHAIN_TO_CHECK_CONDITION_ON = getEnv("VITE_CHAIN_TO_CHECK_CONDITION_ON");
19-
const LIT_NETWORK = LitNetwork.DatilTest;
18+
const SELECTED_LIT_NETWORK = LIT_NETWORK.DatilTest;
2019

2120
export const conditionalSigning = async() => {
2221
let litNodeClient: LitNodeClient;
@@ -36,7 +35,7 @@ export const conditionalSigning = async() => {
3635

3736
console.log("🔄 Connecting to the Lit network...");
3837
litNodeClient = new LitNodeClient({
39-
litNetwork: LIT_NETWORK,
38+
litNetwork: SELECTED_LIT_NETWORK,
4039
debug: false,
4140
});
4241
await litNodeClient.connect();
@@ -45,7 +44,7 @@ export const conditionalSigning = async() => {
4544
console.log("🔄 Connecting LitContracts client to network...");
4645
const litContracts = new LitContracts({
4746
signer: ethersSigner,
48-
network: LIT_NETWORK,
47+
network: SELECTED_LIT_NETWORK,
4948
debug: false,
5049
});
5150
await litContracts.connect();
@@ -101,7 +100,7 @@ export const conditionalSigning = async() => {
101100
resourceAbilityRequests: [
102101
{
103102
resource: new LitActionResource("*"),
104-
ability: LitAbility.LitActionExecution,
103+
ability: LIT_ABILITY.LitActionExecution,
105104
},
106105
],
107106
authNeededCallback: async ({
@@ -149,7 +148,7 @@ export const conditionalSigning = async() => {
149148
resources: [
150149
{
151150
resource: new LitActionResource("*"),
152-
ability: LitAbility.LitActionExecution,
151+
ability: LIT_ABILITY.LitActionExecution,
153152
},
154153
],
155154
litNodeClient: litNodeClient,

conditional-signing/nodejs/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
},
1111
"dependencies": {
1212
"@dotenvx/dotenvx": "^0.37.1",
13-
"@lit-protocol/auth-helpers": "^6.11.0",
14-
"@lit-protocol/constants": "^6.11.0",
15-
"@lit-protocol/contracts-sdk": "^6.11.0",
16-
"@lit-protocol/lit-node-client": "^6.11.0",
13+
"@lit-protocol/auth-helpers": "^7.0.0-alpha.9",
14+
"@lit-protocol/constants": "^7.0.0-alpha.9",
15+
"@lit-protocol/contracts-sdk": "^7.0.0-alpha.9",
16+
"@lit-protocol/lit-node-client": "^7.0.0-alpha.9",
1717
"ethers": "5.7.2"
1818
},
1919
"devDependencies": {

conditional-signing/nodejs/src/index.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { LitNodeClient } from "@lit-protocol/lit-node-client";
2-
import { LitNetwork, LIT_RPC } from "@lit-protocol/constants";
2+
import { LIT_NETWORK, LIT_RPC, LIT_ABILITY } from "@lit-protocol/constants";
33
import {
44
createSiweMessage,
55
generateAuthSig,
6-
LitAbility,
76
LitActionResource,
87
} from "@lit-protocol/auth-helpers";
98
import { LitContracts } from "@lit-protocol/contracts-sdk";
@@ -16,7 +15,6 @@ const ETHEREUM_PRIVATE_KEY = getEnv("ETHEREUM_PRIVATE_KEY");
1615
const CHAIN_TO_CHECK_CONDITION_ON = getEnv("CHAIN_TO_CHECK_CONDITION_ON");
1716
const LIT_PKP_PUBLIC_KEY = process.env["LIT_PKP_PUBLIC_KEY"];
1817
const LIT_CAPACITY_CREDIT_TOKEN_ID = process.env["LIT_CAPACITY_CREDIT_TOKEN_ID"];
19-
const LIT_NETWORK = LitNetwork.DatilTest;
2018

2119
export const conditionalSigning = async () => {
2220
let litNodeClient: LitNodeClient;
@@ -36,7 +34,7 @@ export const conditionalSigning = async () => {
3634

3735
console.log("🔄 Connecting to the Lit network...");
3836
litNodeClient = new LitNodeClient({
39-
litNetwork: LIT_NETWORK,
37+
litNetwork: LIT_NETWORK.DatilTest,
4038
debug: false,
4139
});
4240
await litNodeClient.connect();
@@ -45,7 +43,7 @@ export const conditionalSigning = async () => {
4543
console.log("🔄 Connecting LitContracts client to network...");
4644
const litContracts = new LitContracts({
4745
signer: ethersWallet,
48-
network: LIT_NETWORK,
46+
network: LIT_NETWORK.DatilTest,
4947
debug: false,
5048
});
5149
await litContracts.connect();
@@ -101,7 +99,7 @@ export const conditionalSigning = async () => {
10199
resourceAbilityRequests: [
102100
{
103101
resource: new LitActionResource("*"),
104-
ability: LitAbility.LitActionExecution,
102+
ability: LIT_ABILITY.LitActionExecution,
105103
},
106104
],
107105
authNeededCallback: async ({
@@ -149,7 +147,7 @@ export const conditionalSigning = async () => {
149147
resources: [
150148
{
151149
resource: new LitActionResource("*"),
152-
ability: LitAbility.LitActionExecution,
150+
ability: LIT_ABILITY.LitActionExecution,
153151
},
154152
],
155153
litNodeClient: litNodeClient,

0 commit comments

Comments
 (0)