@ref-finance/ref-sdk 1.3.3 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/constant.d.ts +1 -1
- package/dist/ref-sdk.cjs.development.js +29 -6
- package/dist/ref-sdk.cjs.development.js.map +1 -1
- package/dist/ref-sdk.cjs.production.min.js +1 -1
- package/dist/ref-sdk.cjs.production.min.js.map +1 -1
- package/dist/ref-sdk.esm.js +29 -6
- package/dist/ref-sdk.esm.js.map +1 -1
- package/dist/ref-sdk.umd.development.js +29 -6
- package/dist/ref-sdk.umd.development.js.map +1 -1
- package/dist/ref-sdk.umd.production.min.js +1 -1
- package/dist/ref-sdk.umd.production.min.js.map +1 -1
- package/dist/ref.d.ts +1 -1
- package/package.json +1 -1
|
@@ -16,11 +16,16 @@
|
|
|
16
16
|
var STORAGE_TO_REGISTER_WITH_MFT = '0.1';
|
|
17
17
|
var ONE_YOCTO_NEAR = '0.000000000000000000000001';
|
|
18
18
|
var ENV = '';
|
|
19
|
-
|
|
19
|
+
var INDEXER_URL = '';
|
|
20
|
+
function getConfig(env, indexerUrl) {
|
|
20
21
|
if (env === void 0) {
|
|
21
22
|
env = ENV || process.env.NEAR_ENV || process.env.REACT_APP_REF_SDK_ENV;
|
|
22
23
|
}
|
|
24
|
+
if (indexerUrl === void 0) {
|
|
25
|
+
indexerUrl = INDEXER_URL;
|
|
26
|
+
}
|
|
23
27
|
ENV = env;
|
|
28
|
+
INDEXER_URL = indexerUrl;
|
|
24
29
|
switch (env) {
|
|
25
30
|
case 'mainnet':
|
|
26
31
|
return {
|
|
@@ -30,7 +35,7 @@
|
|
|
30
35
|
WRAP_NEAR_CONTRACT_ID: 'wrap.near',
|
|
31
36
|
REF_FI_CONTRACT_ID: 'v2.ref-finance.near',
|
|
32
37
|
REF_TOKEN_ID: 'token.v2.ref-finance.near',
|
|
33
|
-
indexerUrl: 'https://indexer.ref.finance',
|
|
38
|
+
indexerUrl: indexerUrl || 'https://indexer.ref.finance',
|
|
34
39
|
explorerUrl: 'https://testnet.nearblocks.io',
|
|
35
40
|
REF_DCL_SWAP_CONTRACT_ID: 'dclv2.ref-labs.near'
|
|
36
41
|
};
|
|
@@ -39,7 +44,7 @@
|
|
|
39
44
|
networkId: 'testnet',
|
|
40
45
|
nodeUrl: 'https://rpc.testnet.near.org',
|
|
41
46
|
walletUrl: 'https://wallet.testnet.near.org',
|
|
42
|
-
indexerUrl: 'https://testnet-indexer.ref-finance.com',
|
|
47
|
+
indexerUrl: indexerUrl || 'https://testnet-indexer.ref-finance.com',
|
|
43
48
|
WRAP_NEAR_CONTRACT_ID: 'wrap.testnet',
|
|
44
49
|
REF_FI_CONTRACT_ID: 'ref-finance-101.testnet',
|
|
45
50
|
REF_TOKEN_ID: 'ref.fakes.testnet',
|
|
@@ -54,7 +59,7 @@
|
|
|
54
59
|
REF_FI_CONTRACT_ID: 'v2.ref-finance.near',
|
|
55
60
|
WRAP_NEAR_CONTRACT_ID: 'wrap.near',
|
|
56
61
|
REF_TOKEN_ID: 'token.v2.ref-finance.near',
|
|
57
|
-
indexerUrl: 'https://indexer.ref.finance',
|
|
62
|
+
indexerUrl: indexerUrl || 'https://indexer.ref.finance',
|
|
58
63
|
explorerUrl: 'https://nearblocks.io',
|
|
59
64
|
REF_DCL_SWAP_CONTRACT_ID: 'dclv2.ref-labs.near'
|
|
60
65
|
};
|
|
@@ -3899,11 +3904,11 @@
|
|
|
3899
3904
|
keyStore: /*#__PURE__*/getKeyStore(),
|
|
3900
3905
|
headers: {}
|
|
3901
3906
|
}, /*#__PURE__*/getConfig()));
|
|
3902
|
-
var init_env = function init_env(env) {
|
|
3907
|
+
var init_env = function init_env(env, indexerUrl) {
|
|
3903
3908
|
near = new nearApiJs.Near(_extends({
|
|
3904
3909
|
keyStore: getKeyStore(),
|
|
3905
3910
|
headers: {}
|
|
3906
|
-
}, getConfig(env)));
|
|
3911
|
+
}, getConfig(env, indexerUrl)));
|
|
3907
3912
|
return switchEnv();
|
|
3908
3913
|
};
|
|
3909
3914
|
var refFiViewFunction = /*#__PURE__*/function () {
|
|
@@ -7543,6 +7548,24 @@
|
|
|
7543
7548
|
reference_hash: null,
|
|
7544
7549
|
decimals: 6,
|
|
7545
7550
|
id: 'usdt.tether-token.near'
|
|
7551
|
+
}, {
|
|
7552
|
+
spec: 'ft-1.0.0',
|
|
7553
|
+
name: 'NEAT',
|
|
7554
|
+
symbol: 'NEAT',
|
|
7555
|
+
icon: "data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' rx='4.8' fill='%23202020'/%3E%3Crect width='40' height='40' rx='4.8' fill='url(%23paint0_linear_1_5571)'/%3E%3Crect x='10.4' y='12.6001' width='4.8' height='4.8' fill='white'/%3E%3Crect x='15.2' y='12.6001' width='4.8' height='4.8' fill='white'/%3E%3Crect x='24.8' y='12.6001' width='4.8' height='4.8' fill='white'/%3E%3Crect x='10.4' y='17.4001' width='4.8' height='4.8' fill='white'/%3E%3Crect x='24.8' y='17.4001' width='4.8' height='4.8' fill='white'/%3E%3Crect x='10.4' y='22.2002' width='4.8' height='4.8' fill='white'/%3E%3Crect x='24.8' y='22.2002' width='4.8' height='4.8' fill='white'/%3E%3Crect x='20' y='22.2002' width='4.8' height='4.8' fill='white'/%3E%3Crect x='17.6' y='17.4001' width='4.8' height='4.8' fill='white'/%3E%3Cdefs%3E%3ClinearGradient id='paint0_linear_1_5571' x1='20' y1='0' x2='20' y2='40' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23262626'/%3E%3Cstop offset='1' stop-color='%23121212'/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E%0A",
|
|
7556
|
+
reference: null,
|
|
7557
|
+
reference_hash: null,
|
|
7558
|
+
decimals: 8,
|
|
7559
|
+
id: 'neat.nrc-20.near'
|
|
7560
|
+
}, {
|
|
7561
|
+
spec: 'ft-1.0.0',
|
|
7562
|
+
name: 'USMeme',
|
|
7563
|
+
symbol: 'USM',
|
|
7564
|
+
icon: 'https://storage.herewallet.app/upload/13151331-8f9c-4851-8038-36794688c693.jpg',
|
|
7565
|
+
reference: null,
|
|
7566
|
+
reference_hash: null,
|
|
7567
|
+
decimals: 8,
|
|
7568
|
+
id: 'usmeme.tg'
|
|
7546
7569
|
}];
|
|
7547
7570
|
function getDefaultTokenList() {
|
|
7548
7571
|
var env = getConfig().networkId;
|