sacredrealm-sdk 1.0.2 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sacredrealm-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.6",
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.2"
26
+ "sacredrealm-core": "^1.0.4"
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
17
  SR: '0x',
17
- BUSD: '0x6Cbb3Ef5A8c9743a1e2148d6DCA69f3ba26BC8C5',
18
+ BUSD: '0x78867BbEeF44f2326bF8DDd1941a4439382EF2A7',
19
+ WBNB: '0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd',
18
20
  };
19
21
  }
20
22
  };
@@ -23,10 +25,12 @@ export function contract(env?: string) {
23
25
  const environment = env || process.env.NODE_ENV;
24
26
  if (environment === 'production') {
25
27
  return {
28
+ BondDepository: '0x',
26
29
  PancakeRouter: '0x10ED43C718714eb63d5aA57B78B54704E256024E',
27
30
  };
28
31
  } else {
29
32
  return {
33
+ BondDepository: '0x',
30
34
  PancakeRouter: '0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3',
31
35
  };
32
36
  }
package/src/index.ts CHANGED
@@ -1,2 +1,4 @@
1
+ export * from './pool';
1
2
  export * from './token';
2
- export * from './constant';
3
+ export * from './constant';
4
+ 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';
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'];