Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ export function getConfig(
env: string | undefined = ENV ||
process.env.NEAR_ENV ||
process.env.REACT_APP_REF_SDK_ENV,
indexerUrl: string | undefined = INDEXER_URL
) {
indexerUrl: string | undefined = INDEXER_URL,
nodeUrl: string | undefined = ""
) {
ENV = env;
INDEXER_URL = indexerUrl;
switch (env) {
case 'mainnet':
return {
networkId: 'mainnet',
nodeUrl: 'https://rpc.mainnet.near.org',
nodeUrl: nodeUrl || 'https://rpc.mainnet.near.org',
walletUrl: 'https://wallet.near.org',
WRAP_NEAR_CONTRACT_ID: 'wrap.near',
REF_FI_CONTRACT_ID: 'v2.ref-finance.near',
Expand All @@ -34,7 +35,7 @@ export function getConfig(
case 'testnet':
return {
networkId: 'testnet',
nodeUrl: 'https://rpc.testnet.near.org',
nodeUrl: nodeUrl || 'https://rpc.testnet.near.org',
walletUrl: 'https://wallet.testnet.near.org',
indexerUrl: indexerUrl || 'https://testnet-indexer.ref-finance.com',
WRAP_NEAR_CONTRACT_ID: 'wrap.testnet',
Expand All @@ -46,7 +47,7 @@ export function getConfig(
case 'dev':
return {
networkId: 'testnet',
nodeUrl: 'https://rpc.testnet.near.org',
nodeUrl: nodeUrl || 'https://rpc.testnet.near.org',
walletUrl: 'https://wallet.testnet.near.org',
indexerUrl: indexerUrl || 'https://dev-indexer.ref-finance.com',
WRAP_NEAR_CONTRACT_ID: 'wrap.testnet',
Expand All @@ -58,7 +59,7 @@ export function getConfig(
default:
return {
networkId: 'mainnet',
nodeUrl: 'https://rpc.mainnet.near.org',
nodeUrl: nodeUrl || 'https://rpc.mainnet.near.org',
walletUrl: 'https://wallet.near.org',
REF_FI_CONTRACT_ID: 'v2.ref-finance.near',
WRAP_NEAR_CONTRACT_ID: 'wrap.near',
Expand Down
4 changes: 2 additions & 2 deletions src/ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ let near = new Near({
headers: {},
...getConfig(),
});
export const init_env = (env: string, indexerUrl?: string) => {
export const init_env = (env: string, indexerUrl?: string, nodeUrl?: string) => {
near = new Near({
keyStore: getKeyStore(),
headers: {},
...getConfig(env, indexerUrl),
...getConfig(env, indexerUrl, nodeUrl),
});
return switchEnv();
};
Expand Down
3 changes: 1 addition & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
STORAGE_TO_REGISTER_WITH_MFT,
} from './constant';
import Big from 'big.js';
import { SignAndSendTransactionsParams } from '@near-wallet-selector/core/lib/wallet';
import { TokenMetadata } from './types';
import { PoolMode } from './v1-swap/swap';
import { getSwappedAmount } from './stable-swap';
Expand Down Expand Up @@ -289,7 +288,7 @@ export const WalletSelectorTransactions = (
};
});

return { transactions: parsedTransactions } as SignAndSendTransactionsParams;
return { transactions: parsedTransactions } ;
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure about this one?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Module '"@near-wallet-selector/core/lib/wallet"' has no exported member 'SignAndSendTransactionsParams'.ts(2305)

It was deleted and I can't run npm install it with this line:
near/wallet-selector@65ea358#diff-cf1e42785f014c407e1c8f9672f2d13774005ebee6c4b8b65927b56e0f72ecb0L46

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

export const separateRoutes = (
Expand Down