Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lyomagma
Copy link

No description provided.

@lyomagma lyomagma changed the title feat: PRT add support for custom config Add support for custom config Sep 22, 2024
src/constant.ts Outdated
indexerUrl: string | undefined = INDEXER_URL
) {
indexerUrl: string | undefined = INDEXER_URL,
custom_config: Config | undefined = CONFIG

Choose a reason for hiding this comment

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

Use camelCase, not snake case

src/constant.ts Outdated
@@ -10,12 +10,19 @@ export const FT_MINIMUM_STORAGE_BALANCE_LARGE = "12500000000000000000000"
export const ONE_YOCTO_NEAR = '0.000000000000000000000001';
let ENV: string | undefined = '';
let INDEXER_URL: string | undefined = '';
let CONFIG: Config | undefined = undefined;

Choose a reason for hiding this comment

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

Why do you need this for?

Copy link
Author

Choose a reason for hiding this comment

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

I thought it should be like the INDEXER_URL, changed.

Copy link
Author

Choose a reason for hiding this comment

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

ok this is needed so it can get no value

@lyomagma lyomagma requested a review from shleikes September 22, 2024 13:16
src/constant.ts Outdated
@@ -1,4 +1,4 @@
import { TokenMetadata } from './types';
import { Config, TokenMetadata } from './types';

Choose a reason for hiding this comment

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

Unused, please remove

src/ref.ts Outdated
@@ -21,6 +21,7 @@ import {
TokenMetadata,
FTStorageBalance,
RefFiViewFunctionOptions,
Config,

Choose a reason for hiding this comment

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

Unused, please remove

src/types.ts Outdated
Comment on lines 142 to 153

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;
};

Choose a reason for hiding this comment

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

Unused, please remove

@@ -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

@lyomagma lyomagma requested a review from shleikes September 22, 2024 14:33
@@ -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.

Nice

@carina-akaia
Copy link

GM @shleikes, can we have this functionality available anytime soon? I'm integrating Ref SDK into Potlock's funding stack and we already have our own multi-env configuration which I'd like to map to the SDK config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants