@bluefin-exchange/pro-sdk 0.1.14 → 0.1.16
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 +9 -1
- package/dist/example.js +3 -5
- package/dist/src/api.d.ts +195 -181
- package/dist/src/api.js +138 -118
- package/dist/src/configuration.js +1 -1
- package/dist/src/request-signer.js +6 -6
- package/dist/src/sdk.d.ts +1 -1
- package/dist/src/sdk.js +9 -14
- package/example.ts +10 -8
- package/openapitools.json +18 -25
- package/package.json +1 -1
- package/src/.openapi-generator-ignore +3 -0
- package/src/README.md +46 -0
- package/src/api.ts +246 -232
- package/src/configuration.ts +1 -1
- package/src/request-signer.ts +6 -6
- package/src/sdk.ts +9 -14
package/README.md
CHANGED
|
@@ -34,4 +34,12 @@ npm install PATH_TO_GENERATED_PACKAGE --save
|
|
|
34
34
|
Generated via
|
|
35
35
|
```
|
|
36
36
|
openapi-generator generate -i ../resources/bluefin-api.yaml -c ./sdk/openapitools.json -g typescript-axios -o sdk/src --skip-validate-spec
|
|
37
|
-
```
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Examples
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install
|
|
43
|
+
npm install ts-node
|
|
44
|
+
ts-node example.ts
|
|
45
|
+
```
|
package/dist/example.js
CHANGED
|
@@ -11,8 +11,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const index_1 = require("./index");
|
|
13
13
|
const ed25519_1 = require("@mysten/sui/keypairs/ed25519");
|
|
14
|
-
const index_2 = require("./index");
|
|
15
|
-
const index_3 = require("./index");
|
|
16
14
|
const utils_1 = require("@noble/hashes/utils");
|
|
17
15
|
const library_sui_1 = require("@firefly-exchange/library-sui");
|
|
18
16
|
// Configure logging
|
|
@@ -85,8 +83,8 @@ function main() {
|
|
|
85
83
|
// );
|
|
86
84
|
const suiWallet = ed25519_1.Ed25519Keypair.fromSecretKey((0, utils_1.hexToBytes)("3427d19dcf5781f0874c36c78aec22c03acda435d69efcbf249e8821793567a1"));
|
|
87
85
|
logger.info(`Sui Address: ${suiWallet.getPublicKey().toSuiAddress()}`);
|
|
88
|
-
const bfSigner = new
|
|
89
|
-
const client = new
|
|
86
|
+
const bfSigner = new index_1.BluefinRequestSigner((0, index_1.makeAddressableKeyPair)(suiWallet));
|
|
87
|
+
const client = new index_1.BluefinProSdk(bfSigner, "devnet", new library_sui_1.SuiClient({ url: "https://fullnode.testnet.sui.io:443" }));
|
|
90
88
|
yield client.initialize();
|
|
91
89
|
try {
|
|
92
90
|
yield client.deposit("1000");
|
|
@@ -162,7 +160,7 @@ function main() {
|
|
|
162
160
|
side: index_1.OrderSide.Long,
|
|
163
161
|
leverageE9: "1000000000",
|
|
164
162
|
isIsolated: false,
|
|
165
|
-
|
|
163
|
+
expiresAtMillis: Date.now() + 6 * 60 * 1000,
|
|
166
164
|
postOnly: false,
|
|
167
165
|
reduceOnly: false,
|
|
168
166
|
timeInForce: index_1.OrderTimeInForce.Gtt,
|