@scallop-io/sui-scallop-sdk 0.44.7 → 0.44.9

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 CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  ## Description
18
18
 
19
- This SDK is used to interact with [sui-lending-protocal](https://github.com/scallop-io/sui-lending-protocol) and is written based on another sui-integrated tool, [sui-kit](https://github.com/scallop-io/sui-kit). It consists of six main functional models, here's a brief introduction to each of them:
19
+ This SDK is used to interact with [sui-lending-protocal](https://github.com/scallop-io/sui-lending-protocol) and is written based on another sui-integrated tool, [sui-kit](https://github.com/scallop-io/sui-kit). It consists of seven main functional models, here's a brief introduction to each of them:
20
20
 
21
21
  - **Scallop**: Provide an entry to quickly create an instance (client, address, query, builder, utils) and complete initialization at the same time.
22
22
 
@@ -30,6 +30,8 @@ This SDK is used to interact with [sui-lending-protocal](https://github.com/scal
30
30
 
31
31
  - **ScallopUtils**: Used to encapsulate some useful methods that will be used when interacting with the scallop contract.
32
32
 
33
+ - **ScallopIndexer**: It is used to query the on-chain index data through the SDK API. It is mainly used in query instances, effectively reducing the number of RPC requests..
34
+
33
35
  ## Pre-requisites
34
36
 
35
37
  - Installation:
@@ -50,6 +52,7 @@ This SDK is used to interact with [sui-lending-protocal](https://github.com/scal
50
52
  const scallopBuilder = await scallopSDK.createScallopBuilder(...);
51
53
  const scallopUtils = await scallopSDK.createScallopUtils(...);
52
54
  const scallopClient = await scallopSDK.createScallopClient(...);
55
+ const scallopIndexer = await scallopSDK.createScallopIndexer();
53
56
 
54
57
  // Or, you can choose to import the class directly to create an instance.
55
58
  import {
@@ -57,6 +60,7 @@ This SDK is used to interact with [sui-lending-protocal](https://github.com/scal
57
60
  ScallopBuilder,
58
61
  ScallopQuery,
59
62
  ScallopUtils,
63
+ ScallopIndexer,
60
64
  ScallopClient,
61
65
  } from '@scallop-io/sui-scallop-sdk'
62
66
 
@@ -65,6 +69,7 @@ This SDK is used to interact with [sui-lending-protocal](https://github.com/scal
65
69
  const ScallopBuilder = new ScallopBuilder(...);
66
70
  const ScallopUtils = new ScallopUtils(...);
67
71
  const scallopClient = new ScallopClient(...);
72
+ const ScallopIndexer = new ScallopIndexer();
68
73
  // Remember to initialize the instance before using it
69
74
  await scallopAddress.read();
70
75
  await ScallopQuery.init();
@@ -82,6 +87,7 @@ Below we will give a brief introduction to these instances respectively, and int
82
87
  - [Use Scallop Address](./document/address.md)
83
88
  - [Use Scallop Builder](./document/builder.md)
84
89
  - [Use Scallop Utils](./document/utils.md)
90
+ - [Use Scallop Indexer](./document/indexer.md)
85
91
 
86
92
  For the original codes, please refer to `test` folder.
87
93
 
@@ -95,6 +101,7 @@ You need to set up the `.env` file before testing. (Reference `.env.example`)
95
101
  pnpm run test:unit test/builder.spec.ts
96
102
  pnpm run test:unit test/query.spec.ts
97
103
  pnpm run test:unit test/utils.spec.ts
104
+ pnpm run test:unit test/indexer.spec.ts
98
105
  ```
99
106
 
100
107
  ## License
@@ -1,4 +1,5 @@
1
1
  export declare const API_BASE_URL = "https://sui.api.scallop.io";
2
+ export declare const SDK_API_BASE_URL = "https://sdk.api.scallop.io";
2
3
  export declare const ADDRESSES_ID = "6462a088a7ace142bb6d7e9b";
3
4
  export declare const PROTOCOL_OBJECT_ID = "0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf";
4
5
  export declare const BORROW_FEE_PROTOCOL_ID = "0xc38f849e81cfe46d4e4320f508ea7dda42934a329d5a6571bb4c3cb6ea63f5da";