Skip to content

Commit f559ea2

Browse files
fix: Remove npx-import usage, as it broke aliased imports in the bundled worker bin
1 parent b3279d9 commit f559ea2

File tree

4 files changed

+24
-102
lines changed

4 files changed

+24
-102
lines changed

packages/dca-backend/package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@
5050
"@lit-protocol/lit-node-client": "^7.3.0",
5151
"@lit-protocol/types": "^7.3.0",
5252
"@lit-protocol/vincent-app-sdk": "2.2.3",
53-
"@lit-protocol/vincent-contracts-sdk": "^1.0.1",
53+
"@lit-protocol/vincent-contracts-sdk": "^2.0.0",
5454
"@lit-protocol/vincent-scaffold-sdk": "1.1.9-mma",
55+
"@lit-protocol/vincent-ability-erc20-approval": "3.1.0",
56+
"@lit-protocol/vincent-ability-uniswap-swap-v5": "npm:@lit-protocol/vincent-ability-uniswap-swap@5.0.0",
57+
"@lit-protocol/vincent-ability-uniswap-swap-v8": "npm:@lit-protocol/vincent-ability-uniswap-swap@8.0.0",
5558
"@noble/secp256k1": "^2.2.3",
5659
"@sentry/cli": "^2.52.0",
5760
"@sentry/node": "^10.5.0",
@@ -65,21 +68,16 @@
6568
"helmet": "^8.1.0",
6669
"mongoose": "^8.10.1",
6770
"node-cache": "^5.1.2",
68-
"npx-import": "^1.1.4",
6971
"semver": "^7.7.2",
7072
"tslib": "^2.8.1"
7173
},
7274
"devDependencies": {
7375
"@jest/globals": "^29.7.0",
74-
"@lit-protocol/vincent-ability-erc20-approval": "3.1.0",
75-
"@lit-protocol/vincent-ability-uniswap-swap-v5": "npm:@lit-protocol/vincent-ability-uniswap-swap@5.0.0",
76-
"@lit-protocol/vincent-ability-uniswap-swap-v8": "npm:@lit-protocol/vincent-ability-uniswap-swap@8.0.0",
7776
"@types/cors": "^2.8.17",
7877
"@types/express": "^5.0.1",
7978
"@types/jest": "^29.5.14",
8079
"@types/semver": "^7.7.0",
8180
"ethers": "^5.8.0",
82-
"ethers-v6": "npm:ethers@6.15.0",
8381
"jest": "^29.7.0",
8482
"ts-jest": "^29.3.0",
8583
"unbuild": "^3.5.0",

packages/dca-backend/src/lib/agenda/jobs/executeDCASwap/v1/vincentAbilities.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { npxImport } from 'npx-import';
2-
31
import { LitNodeClient } from '@lit-protocol/lit-node-client';
2+
import { bundledVincentAbility as erc20ApprovalBundledVincentAbility } from '@lit-protocol/vincent-ability-erc20-approval';
3+
import {
4+
bundledVincentAbility as uniswapSwapBundledVincentAbility,
5+
getSignedUniswapQuote as getSignedUniswapQuoteAction,
6+
} from '@lit-protocol/vincent-ability-uniswap-swap-v5';
47
import { getVincentAbilityClient } from '@lit-protocol/vincent-app-sdk/abilityClient';
58

69
import { delegateeSigner } from '../utils/signer';
710

811
import type { QuoteParams } from '@lit-protocol/vincent-ability-uniswap-swap-v5';
912

10-
type Erc20Ability = typeof import('@lit-protocol/vincent-ability-erc20-approval');
11-
type UniswapAbility = typeof import('@lit-protocol/vincent-ability-uniswap-swap-v5');
12-
1313
const litNodeClient = new LitNodeClient({
1414
debug: true,
1515
litNetwork: 'datil',
@@ -21,10 +21,6 @@ export async function getSignedUniswapQuote(quoteParams: QuoteParams) {
2121
await litNodeClient.connect();
2222
}
2323

24-
const { getSignedUniswapQuote: getSignedUniswapQuoteAction } = await npxImport<UniswapAbility>(
25-
'@lit-protocol/vincent-ability-uniswap-swap@5.0.0'
26-
);
27-
2824
return getSignedUniswapQuoteAction({
2925
litNodeClient,
3026
quoteParams,
@@ -33,18 +29,13 @@ export async function getSignedUniswapQuote(quoteParams: QuoteParams) {
3329
}
3430

3531
export async function getErc20ApprovalToolClient() {
36-
const { bundledVincentAbility: erc20ApprovalBundledVincentAbility } =
37-
await npxImport<Erc20Ability>('@lit-protocol/vincent-ability-erc20-approval@3.1.0');
38-
3932
return getVincentAbilityClient({
4033
bundledVincentAbility: erc20ApprovalBundledVincentAbility,
4134
ethersSigner: delegateeSigner,
4235
});
4336
}
4437

4538
export async function getUniswapToolClient() {
46-
const { bundledVincentAbility: uniswapSwapBundledVincentAbility } =
47-
await npxImport<UniswapAbility>('@lit-protocol/vincent-uniswap-swap@5.0.0');
4839
return getVincentAbilityClient({
4940
bundledVincentAbility: uniswapSwapBundledVincentAbility,
5041
ethersSigner: delegateeSigner,

packages/dca-backend/src/lib/agenda/jobs/executeDCASwap/v2/vincentAbilities.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
import { npxImport } from 'npx-import';
2-
31
import { LitNodeClient } from '@lit-protocol/lit-node-client';
2+
import {
3+
bundledVincentAbility as uniswapSwapBundledVincentAbility,
4+
getSignedUniswapQuote as getSignedUniswapQuoteAction,
5+
} from '@lit-protocol/vincent-ability-uniswap-swap-v8';
46
import { getVincentAbilityClient } from '@lit-protocol/vincent-app-sdk/abilityClient';
57

68
import { delegateeSigner } from '../utils/signer';
79

810
import type { QuoteParams } from '@lit-protocol/vincent-ability-uniswap-swap-v8';
911

10-
type UniswapAbility = typeof import('@lit-protocol/vincent-ability-uniswap-swap-v8');
11-
1212
const litNodeClient = new LitNodeClient({
1313
debug: true,
1414
litNetwork: 'datil',
1515
});
1616

17-
const UNISWAP_PKG_VER = '8.0.0';
18-
1917
export async function getSignedUniswapQuote(
2018
quoteParams: QuoteParams
2119
): Promise<ReturnType<typeof getSignedUniswapQuoteAction>> {
@@ -24,10 +22,6 @@ export async function getSignedUniswapQuote(
2422
await litNodeClient.connect();
2523
}
2624

27-
const { getSignedUniswapQuote: getSignedUniswapQuoteAction } = await npxImport<UniswapAbility>(
28-
`@lit-protocol/vincent-ability-uniswap-swap@${UNISWAP_PKG_VER}`
29-
);
30-
3125
return getSignedUniswapQuoteAction({
3226
litNodeClient,
3327
quoteParams,
@@ -36,9 +30,6 @@ export async function getSignedUniswapQuote(
3630
}
3731

3832
export async function getUniswapAbilityClient() {
39-
const { bundledVincentAbility: uniswapSwapBundledVincentAbility } =
40-
await npxImport<UniswapAbility>(`@lit-protocol/vincent-uniswap-swap@${UNISWAP_PKG_VER}`);
41-
4233
return getVincentAbilityClient({
4334
bundledVincentAbility: uniswapSwapBundledVincentAbility,
4435
ethersSigner: delegateeSigner,

pnpm-lock.yaml

Lines changed: 11 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)