sacredrealm-sdk 1.0.3 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sacredrealm-sdk",
3
- "version": "1.0.3",
3
+ "version": "1.0.7",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
@@ -23,7 +23,7 @@
23
23
  "@walletconnect/web3-provider": "^1.7.5",
24
24
  "ethers": "^5.6.1",
25
25
  "graphql": "^16.3.0",
26
- "sacredrealm-core": "^1.0.3"
26
+ "sacredrealm-core": "^1.0.7"
27
27
  },
28
28
  "devDependencies": {
29
29
  "tsdx": "^0.14.1"
package/src/constant.ts CHANGED
@@ -7,14 +7,16 @@ export function token(env?: string) {
7
7
  ST: '0x',
8
8
  SR: '0x',
9
9
  BUSD: '0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56',
10
+ WBNB: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',
10
11
  }
11
12
  } else {
12
13
  return {
13
- SB: '0x',
14
- SN: '0x',
14
+ SB: '0xa844b28aBf7aF74438131A1aF642Ef0CCAa8C166',
15
+ SN: '0xb2761cd8EFD9f436Efa1b205dEB1dC957300Ede5',
15
16
  ST: '0x',
16
- SR: '0x',
17
- BUSD: '0x6Cbb3Ef5A8c9743a1e2148d6DCA69f3ba26BC8C5',
17
+ SR: '0x7c3323f3d283b46514600cD9AD3F5e821F679b7f',
18
+ BUSD: '0x78867BbEeF44f2326bF8DDd1941a4439382EF2A7',
19
+ WBNB: '0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd',
18
20
  };
19
21
  }
20
22
  };
@@ -23,10 +25,18 @@ export function contract(env?: string) {
23
25
  const environment = env || process.env.NODE_ENV;
24
26
  if (environment === 'production') {
25
27
  return {
28
+ Inviting: '0x',
29
+ STStaking: '0x',
30
+ BondDepository: '0x',
31
+ SRDeposit: '0x',
26
32
  PancakeRouter: '0x10ED43C718714eb63d5aA57B78B54704E256024E',
27
33
  };
28
34
  } else {
29
35
  return {
36
+ Inviting: '0x',
37
+ STStaking: '0x',
38
+ BondDepository: '0x',
39
+ SRDeposit: '0x2e8d3785b157104Fa0cF8436499367A64bE0caf1',
30
40
  PancakeRouter: '0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3',
31
41
  };
32
42
  }
package/src/index.ts CHANGED
@@ -1,2 +1,5 @@
1
+ export * from './pool';
1
2
  export * from './token';
2
- export * from './constant';
3
+ export * from './tool';
4
+ export * from './constant';
5
+ export * from './utils';
@@ -0,0 +1,7 @@
1
+ import { BondDepository__factory } from 'sacredrealm-core/typechain-types'
2
+ import { rpcProvider } from '../utils';
3
+ import { contract } from '../constant';
4
+
5
+ export function bondDepository() {
6
+ return BondDepository__factory.connect(contract().BondDepository, rpcProvider);
7
+ }
@@ -0,0 +1 @@
1
+ export * from './BondDepository';
@@ -0,0 +1,6 @@
1
+ import { ERC20__factory } from 'sacredrealm-core/typechain-types'
2
+ import { rpcProvider } from '../utils';
3
+
4
+ export function erc20(tokenAddr: string) {
5
+ return ERC20__factory.connect(tokenAddr, rpcProvider);
6
+ }
@@ -1,3 +1,4 @@
1
+ export * from './ERC20';
1
2
  export * from './SB';
2
3
  export * from './SN';
3
4
  export * from './ST';
@@ -0,0 +1,7 @@
1
+ import { SRDeposit__factory } from 'sacredrealm-core/typechain-types'
2
+ import { rpcProvider } from '../utils';
3
+ import { contract } from '../constant';
4
+
5
+ export function srDeposit() {
6
+ return SRDeposit__factory.connect(contract().SRDeposit, rpcProvider);
7
+ }
@@ -0,0 +1 @@
1
+ export * from './SRDeposit';
package/src/utils.ts CHANGED
@@ -4,6 +4,7 @@ import { token, network } from './constant';
4
4
 
5
5
  export const util = utils;
6
6
  export const constant = constants;
7
+ export const bn = BigNumber;
7
8
 
8
9
  export const rpcProvider = new ethers.providers.JsonRpcProvider(network().rpcUrls[0]);
9
10
  let web3Provider = newWeb3Provider(localStorage.getItem('walletType'));
@@ -103,7 +104,7 @@ export function getRandomNumber(snId: number, slot: string, base: number, range:
103
104
  }
104
105
 
105
106
  export function getSourceUrl(attr: number[]) {
106
- const cdn = '//cdn.sealemlab.io/nft';
107
+ const cdn = '//cdn.sealemlab.com/nft';
107
108
 
108
109
  const starArr = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11'];
109
110
  const snClassArr = ['Gl', 'As', 'Wi', 'Fi'];