Skip to content

Commit 024cc73

Browse files
authored
Merge pull request elizaOS#2016 from elizaOS/fix-near-slippage-env-conflict
fix: remove near-solana slippage env conflict
2 parents 8bbdafb + 3aabc33 commit 024cc73

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ MVX_NETWORK= # must be one of mainnet, devnet, testnet
359359
NEAR_WALLET_SECRET_KEY=
360360
NEAR_WALLET_PUBLIC_KEY=
361361
NEAR_ADDRESS=
362-
SLIPPAGE=1
362+
NEAR_SLIPPAGE=1
363363
NEAR_RPC_URL=https://rpc.testnet.near.org
364364
NEAR_NETWORK=testnet # or mainnet
365365

packages/plugin-near/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ NEAR_WALLET_PUBLIC_KEY=your-wallet-public-key
3535
NEAR_ADDRESS=your-account.near
3636
NEAR_NETWORK=testnet # mainnet or testnet
3737
NEAR_RPC_URL=https://rpc.testnet.near.org
38-
SLIPPAGE=0.01 # 1% slippage tolerance
38+
NEAR_SLIPPAGE=0.01 # 1% slippage tolerance
3939
```
4040

4141
## Usage

packages/plugin-near/src/environment.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const nearEnvSchema = z.object({
88
NEAR_WALLET_SECRET_KEY: z.string().min(1, "Wallet secret key is required"),
99
NEAR_WALLET_PUBLIC_KEY: z.string().min(1, "Wallet public key is required"),
1010
NEAR_ADDRESS: z.string().min(1, "Near address is required"),
11-
SLIPPAGE: z.string().min(1, "Slippage is required"),
11+
NEAR_SLIPPAGE: z.string().min(1, "Slippage is required"),
1212
NEAR_RPC_URL: z.string().min(1, "RPC URL is required"),
1313
networkId: z.string(),
1414
nodeUrl: z.string(),
@@ -86,7 +86,7 @@ export async function validateNearConfig(
8686
process.env.NEAR_WALLET_PUBLIC_KEY,
8787
NEAR_ADDRESS:
8888
runtime.getSetting("NEAR_ADDRESS") || process.env.NEAR_ADDRESS,
89-
SLIPPAGE: runtime.getSetting("SLIPPAGE") || process.env.SLIPPAGE,
89+
NEAR_SLIPPAGE: runtime.getSetting("NEAR_SLIPPAGE") || process.env.NEAR_SLIPPAGE,
9090
NEAR_RPC_URL: runtime.getSetting("NEAR_RPC_URL") || process.env.NEAR_RPC_URL,
9191
...envConfig, // Spread the environment-specific config
9292
};

packages/plugin-near/src/providers/wallet.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const PROVIDER_CONFIG = {
2020
explorerUrl: `https://${process.env.NEAR_NETWORK || "testnet"}.nearblocks.io`,
2121
MAX_RETRIES: 3,
2222
RETRY_DELAY: 2000,
23-
SLIPPAGE: process.env.SLIPPAGE ? parseInt(process.env.SLIPPAGE) : 1,
23+
SLIPPAGE: process.env.NEAR_SLIPPAGE ? parseInt(process.env.NEAR_SLIPPAGE) : 1,
2424
};
2525

2626
export interface NearToken {

0 commit comments

Comments
 (0)