-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for custom config #50
base: main
Are you sure you want to change the base?
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ import { | |
TokenMetadata, | ||
FTStorageBalance, | ||
RefFiViewFunctionOptions, | ||
Config, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused, please remove |
||
} from './types'; | ||
import { AccountView, CodeResult } from 'near-api-js/lib/providers/provider'; | ||
import { Transaction } from './types'; | ||
|
@@ -47,11 +48,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(); | ||
}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,3 +139,15 @@ export interface FTStorageBalance { | |
total: string; | ||
available: string; | ||
} | ||
|
||
export type Config = { | ||
networkId: string; | ||
nodeUrl: string; | ||
walletUrl: string; | ||
WRAP_NEAR_CONTRACT_ID: string; | ||
REF_FI_CONTRACT_ID: string; | ||
REF_TOKEN_ID: string; | ||
indexerUrl: string; | ||
explorerUrl: string; | ||
REF_DCL_SWAP_CONTRACT_ID: string; | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused, please remove |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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'; | ||
|
@@ -289,7 +288,7 @@ export const WalletSelectorTransactions = ( | |
}; | ||
}); | ||
|
||
return { transactions: parsedTransactions } as SignAndSendTransactionsParams; | ||
return { transactions: parsedTransactions }; | ||
}; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we sure about this one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It was deleted and I can't run There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice |
||
export const separateRoutes = ( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused, please remove