aftermath-ts-sdk 1.2.56 → 1.2.58
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/dist/general/providers/aftermath.d.ts +4 -0
- package/dist/general/providers/aftermath.d.ts.map +1 -1
- package/dist/general/providers/aftermath.js +4 -0
- package/dist/general/providers/aftermathApi.d.ts +4 -0
- package/dist/general/providers/aftermathApi.d.ts.map +1 -1
- package/dist/general/providers/aftermathApi.js +4 -0
- package/dist/general/types/configTypes.d.ts +8 -0
- package/dist/general/types/configTypes.d.ts.map +1 -1
- package/dist/general/utils/caller.d.ts.map +1 -1
- package/dist/general/utils/casting.d.ts +0 -2
- package/dist/general/utils/casting.d.ts.map +1 -1
- package/dist/general/utils/casting.js +0 -2
- package/dist/packages/dca/api/dcaApi.d.ts +2 -0
- package/dist/packages/dca/api/dcaApi.d.ts.map +1 -1
- package/dist/packages/dca/api/dcaApi.js +6 -3
- package/dist/packages/dca/dca.d.ts +5 -4
- package/dist/packages/dca/dca.d.ts.map +1 -1
- package/dist/packages/dca/dca.js +13 -11
- package/dist/packages/dca/dcaTypes.d.ts +30 -40
- package/dist/packages/dca/dcaTypes.d.ts.map +1 -1
- package/dist/packages/farms/farmsStakedPosition.d.ts.map +1 -1
- package/dist/packages/farms/farmsStakedPosition.js +38 -1
- package/dist/packages/farms/farmsStakingPool.js +1 -1
- package/dist/packages/limitOrders/api/limitOrdersApi.d.ts +12 -0
- package/dist/packages/limitOrders/api/limitOrdersApi.d.ts.map +1 -0
- package/dist/packages/limitOrders/api/limitOrdersApi.js +25 -0
- package/dist/packages/limitOrders/index.d.ts +2 -0
- package/dist/packages/limitOrders/index.d.ts.map +1 -0
- package/dist/packages/limitOrders/index.js +17 -0
- package/dist/packages/limitOrders/limitOrders.d.ts +56 -0
- package/dist/packages/limitOrders/limitOrders.d.ts.map +1 -0
- package/dist/packages/limitOrders/limitOrders.js +102 -0
- package/dist/packages/limitOrders/limitOrdersTypes.d.ts +69 -0
- package/dist/packages/limitOrders/limitOrdersTypes.d.ts.map +1 -0
- package/dist/packages/userData/api/userDataApi.d.ts +6 -0
- package/dist/packages/userData/api/userDataApi.d.ts.map +1 -0
- package/dist/packages/userData/api/userDataApi.js +12 -0
- package/dist/packages/userData/index.d.ts +2 -0
- package/dist/packages/userData/index.d.ts.map +1 -0
- package/dist/packages/userData/index.js +17 -0
- package/dist/packages/userData/userData.d.ts +35 -0
- package/dist/packages/userData/userData.d.ts.map +1 -0
- package/dist/packages/userData/userData.js +65 -0
- package/dist/packages/userData/userDataTypes.d.ts +10 -0
- package/dist/packages/userData/userDataTypes.d.ts.map +1 -0
- package/dist/packages/userData/userDataTypes.js +2 -0
- package/package.json +1 -1
- package/dist/packages/dca/api/dcaApiCasting.d.ts +0 -11
- package/dist/packages/dca/api/dcaApiCasting.d.ts.map +0 -1
- package/dist/packages/dca/api/dcaApiCasting.js +0 -186
- package/dist/packages/dca/api/dcaApiCastingTypes.d.ts +0 -142
- package/dist/packages/dca/api/dcaApiCastingTypes.d.ts.map +0 -1
- /package/dist/packages/{dca/api/dcaApiCastingTypes.js → limitOrders/limitOrdersTypes.js} +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LimitOrdersApi = void 0;
|
|
4
|
+
const eventsApiHelpers_1 = require("../../../general/apiHelpers/eventsApiHelpers");
|
|
5
|
+
class LimitOrdersApi {
|
|
6
|
+
// =========================================================================
|
|
7
|
+
// Constructor
|
|
8
|
+
// =========================================================================
|
|
9
|
+
constructor(Provider) {
|
|
10
|
+
this.Provider = Provider;
|
|
11
|
+
// =========================================================================
|
|
12
|
+
// Events
|
|
13
|
+
// =========================================================================
|
|
14
|
+
this.createdOrderEventType = () => eventsApiHelpers_1.EventsApiHelpers.createEventType(this.addresses.packages.limitOrdersInitial, "events", "CreatedOrderEventV1");
|
|
15
|
+
const addresses = this.Provider.addresses.limitOrders;
|
|
16
|
+
if (!addresses) {
|
|
17
|
+
throw new Error("not all required addresses have been set in provider");
|
|
18
|
+
}
|
|
19
|
+
this.addresses = addresses;
|
|
20
|
+
this.eventTypes = {
|
|
21
|
+
createdOrder: this.createdOrderEventType(),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.LimitOrdersApi = LimitOrdersApi;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/limitOrders/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./limitOrders"), exports);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { CallerConfig, ObjectId } from "../../types";
|
|
2
|
+
import { Caller } from "../../general/utils/caller";
|
|
3
|
+
import { SuiAddress } from "../../types";
|
|
4
|
+
import { ApiLimitOrdersCreateOrderTransactionBody, ApiLimitOrdersCancelOrderTransactionBody, LimitOrderObject, ApiLimitOrdersActiveOrdersOwnedBody } from "./limitOrdersTypes";
|
|
5
|
+
import { Transaction } from "@mysten/sui/transactions";
|
|
6
|
+
export declare class LimitOrders extends Caller {
|
|
7
|
+
static readonly constants: {
|
|
8
|
+
gasAmount: bigint;
|
|
9
|
+
};
|
|
10
|
+
constructor(config?: CallerConfig);
|
|
11
|
+
/**
|
|
12
|
+
* Fetches the API for dollar cost averaging active orders list.
|
|
13
|
+
* @async
|
|
14
|
+
* @param { LimitOrderObject } inputs - An object containing the walletAddress.
|
|
15
|
+
* @returns { Promise<LimitOrderObject[]> } A promise that resolves to object with array of fetched events for active limit orders
|
|
16
|
+
*/
|
|
17
|
+
getActiveLimitOrders(inputs: ApiLimitOrdersActiveOrdersOwnedBody): Promise<LimitOrderObject[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Fetches the API for limit cost finished orders list.
|
|
20
|
+
* @async
|
|
21
|
+
* @param { LimitOrderObject } inputs - An object containing the walletAddress.
|
|
22
|
+
* @returns { Promise<LimitOrderObject[]> } A promise that resolves to object with array of fetched events for past limit orders
|
|
23
|
+
*/
|
|
24
|
+
getPastLimitOrders(inputs: {
|
|
25
|
+
walletAddress: SuiAddress;
|
|
26
|
+
}): Promise<LimitOrderObject[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Fetches the API transaction for creating Limit order.
|
|
29
|
+
* @param { ApiLimitOrdersCreateOrderTransactionBody } inputs - The inputs for the transaction.
|
|
30
|
+
* @returns { Promise<Transaction> } A promise that resolves with the API transaction.
|
|
31
|
+
*/
|
|
32
|
+
getCreateLimitOrderTx(inputs: ApiLimitOrdersCreateOrderTransactionBody): Promise<Transaction>;
|
|
33
|
+
/**
|
|
34
|
+
* Fetches the API for canceling Limit order.
|
|
35
|
+
* @param inputs - The inputs for the transaction.
|
|
36
|
+
* @returns { Promise<boolean> } A promise that resolves with transaction execution status.
|
|
37
|
+
*/
|
|
38
|
+
cancelLimitOrder(inputs: ApiLimitOrdersCancelOrderTransactionBody): Promise<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Method for getting the cancellation limit order message to sign.
|
|
41
|
+
* @param inputs - The inputs for the message.
|
|
42
|
+
* @returns Message to sign.
|
|
43
|
+
*/
|
|
44
|
+
cancelLimitOrdersMessageToSign(inputs: {
|
|
45
|
+
orderIds: ObjectId[];
|
|
46
|
+
}): {
|
|
47
|
+
action: string;
|
|
48
|
+
order_object_ids: string[];
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Method for getting a minimum allowable order size.
|
|
52
|
+
* @returns Minimum order size in usd.
|
|
53
|
+
*/
|
|
54
|
+
getMinOrderSizeUsd(): Promise<number | undefined>;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=limitOrders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limitOrders.d.ts","sourceRoot":"","sources":["../../../src/packages/limitOrders/limitOrders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAY,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAEN,wCAAwC,EACxC,wCAAwC,EACxC,gBAAgB,EAChB,mCAAmC,EACnC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,qBAAa,WAAY,SAAQ,MAAM;IAKtC,gBAAuB,SAAS;;MAE9B;gBAMU,MAAM,CAAC,EAAE,YAAY;IAQjC;;;;;OAKG;IAEU,oBAAoB,CAChC,MAAM,EAAE,mCAAmC;IAQ5C;;;;;OAKG;IAEU,kBAAkB,CAAC,MAAM,EAAE;QAAE,aAAa,EAAE,UAAU,CAAA;KAAE;IAWrE;;;;OAIG;IAEU,qBAAqB,CACjC,MAAM,EAAE,wCAAwC,GAC9C,OAAO,CAAC,WAAW,CAAC;IAOvB;;;;OAIG;IAEU,gBAAgB,CAC5B,MAAM,EAAE,wCAAwC,GAC9C,OAAO,CAAC,OAAO,CAAC;IAWnB;;;;OAIG;IAEI,8BAA8B,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA;KAAE,GAAG;QACxE,MAAM,EAAE,MAAM,CAAC;QACf,gBAAgB,EAAE,MAAM,EAAE,CAAC;KAC3B;IAWD;;;OAGG;IAEU,kBAAkB;CAG/B"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LimitOrders = void 0;
|
|
13
|
+
const caller_1 = require("../../general/utils/caller");
|
|
14
|
+
class LimitOrders extends caller_1.Caller {
|
|
15
|
+
// =========================================================================
|
|
16
|
+
// Constructor
|
|
17
|
+
// =========================================================================
|
|
18
|
+
constructor(config) {
|
|
19
|
+
super(config, "limit-orders");
|
|
20
|
+
}
|
|
21
|
+
// =========================================================================
|
|
22
|
+
// Class Objects
|
|
23
|
+
// =========================================================================
|
|
24
|
+
/**
|
|
25
|
+
* Fetches the API for dollar cost averaging active orders list.
|
|
26
|
+
* @async
|
|
27
|
+
* @param { LimitOrderObject } inputs - An object containing the walletAddress.
|
|
28
|
+
* @returns { Promise<LimitOrderObject[]> } A promise that resolves to object with array of fetched events for active limit orders
|
|
29
|
+
*/
|
|
30
|
+
getActiveLimitOrders(inputs) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
return this.fetchApi("active", inputs);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Fetches the API for limit cost finished orders list.
|
|
37
|
+
* @async
|
|
38
|
+
* @param { LimitOrderObject } inputs - An object containing the walletAddress.
|
|
39
|
+
* @returns { Promise<LimitOrderObject[]> } A promise that resolves to object with array of fetched events for past limit orders
|
|
40
|
+
*/
|
|
41
|
+
getPastLimitOrders(inputs) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return this.fetchApi("past", inputs);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
// =========================================================================
|
|
47
|
+
// Transactions
|
|
48
|
+
// =========================================================================
|
|
49
|
+
/**
|
|
50
|
+
* Fetches the API transaction for creating Limit order.
|
|
51
|
+
* @param { ApiLimitOrdersCreateOrderTransactionBody } inputs - The inputs for the transaction.
|
|
52
|
+
* @returns { Promise<Transaction> } A promise that resolves with the API transaction.
|
|
53
|
+
*/
|
|
54
|
+
getCreateLimitOrderTx(inputs) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
return this.fetchApiTransaction("transactions/create-order", inputs);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Fetches the API for canceling Limit order.
|
|
61
|
+
* @param inputs - The inputs for the transaction.
|
|
62
|
+
* @returns { Promise<boolean> } A promise that resolves with transaction execution status.
|
|
63
|
+
*/
|
|
64
|
+
cancelLimitOrder(inputs) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
return this.fetchApi(`cancel`, inputs);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
// =========================================================================
|
|
70
|
+
// Interactions
|
|
71
|
+
// =========================================================================
|
|
72
|
+
/**
|
|
73
|
+
* Method for getting the cancellation limit order message to sign.
|
|
74
|
+
* @param inputs - The inputs for the message.
|
|
75
|
+
* @returns Message to sign.
|
|
76
|
+
*/
|
|
77
|
+
cancelLimitOrdersMessageToSign(inputs) {
|
|
78
|
+
return {
|
|
79
|
+
action: "CANCEL_LIMIT_ORDERS",
|
|
80
|
+
order_object_ids: inputs.orderIds,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
// =========================================================================
|
|
84
|
+
// Configuration
|
|
85
|
+
// =========================================================================
|
|
86
|
+
/**
|
|
87
|
+
* Method for getting a minimum allowable order size.
|
|
88
|
+
* @returns Minimum order size in usd.
|
|
89
|
+
*/
|
|
90
|
+
getMinOrderSizeUsd() {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
return this.fetchApi("min-order-size-usd", {});
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.LimitOrders = LimitOrders;
|
|
97
|
+
// =========================================================================
|
|
98
|
+
// Constants
|
|
99
|
+
// =========================================================================
|
|
100
|
+
LimitOrders.constants = {
|
|
101
|
+
gasAmount: BigInt(50000000),
|
|
102
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ObjectId, SuiAddress } from "../../types";
|
|
2
|
+
import { CoinType } from "../coin/coinTypes";
|
|
3
|
+
import { Balance, Timestamp, TransactionDigest } from "../../general/types/generalTypes";
|
|
4
|
+
export interface LimitOrdersIntegratorFeeData {
|
|
5
|
+
feeBps: number;
|
|
6
|
+
feeRecipient: SuiAddress;
|
|
7
|
+
}
|
|
8
|
+
export interface ApiLimitOrdersCreateOrderTransactionBody {
|
|
9
|
+
walletAddress: SuiAddress;
|
|
10
|
+
allocateCoinType: CoinType;
|
|
11
|
+
allocateCoinAmount: Balance;
|
|
12
|
+
buyCoinType: CoinType;
|
|
13
|
+
customRecipient?: SuiAddress;
|
|
14
|
+
expiryDurationMs: number;
|
|
15
|
+
isSponsoredTx?: boolean;
|
|
16
|
+
integratorFee?: LimitOrdersIntegratorFeeData;
|
|
17
|
+
outputToInputExchangeRate: number;
|
|
18
|
+
outputToInputStopLossExchangeRate?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ApiLimitOrdersSubOrdersBody {
|
|
21
|
+
orderPrice: Balance;
|
|
22
|
+
ordersAmount: number;
|
|
23
|
+
}
|
|
24
|
+
export interface ApiLimitLaddersOrdersBody {
|
|
25
|
+
price: Balance;
|
|
26
|
+
quantity: Balance;
|
|
27
|
+
}
|
|
28
|
+
export interface ApiLimitOrdersCancelOrderTransactionBody {
|
|
29
|
+
walletAddress: SuiAddress;
|
|
30
|
+
bytes: string;
|
|
31
|
+
signature: string;
|
|
32
|
+
}
|
|
33
|
+
export type LimitOrdersOrderStatus = "Active" | "Canceled" | "Failed" | "Filled" | "Expired" | "StopLossTriggered";
|
|
34
|
+
export interface LimitOrderObject {
|
|
35
|
+
objectId: ObjectId;
|
|
36
|
+
allocatedCoin: {
|
|
37
|
+
coin: CoinType;
|
|
38
|
+
amount: Balance;
|
|
39
|
+
};
|
|
40
|
+
buyCoin: {
|
|
41
|
+
coin: CoinType;
|
|
42
|
+
amount: Balance;
|
|
43
|
+
};
|
|
44
|
+
currentAmountSold: Balance;
|
|
45
|
+
currentAmountBought: Balance;
|
|
46
|
+
recipient: SuiAddress;
|
|
47
|
+
created: {
|
|
48
|
+
timestamp: Timestamp;
|
|
49
|
+
txnDigest: TransactionDigest;
|
|
50
|
+
};
|
|
51
|
+
finished?: {
|
|
52
|
+
timestamp: Timestamp;
|
|
53
|
+
txnDigest: TransactionDigest;
|
|
54
|
+
};
|
|
55
|
+
expiryTimestamp: Timestamp;
|
|
56
|
+
status: LimitOrdersOrderStatus;
|
|
57
|
+
error?: string;
|
|
58
|
+
integratorFee?: LimitOrdersIntegratorFeeData;
|
|
59
|
+
outputToInputStopLossExchangeRate?: number;
|
|
60
|
+
}
|
|
61
|
+
export interface ApiLimitOrdersPastOrdersOwnedBody {
|
|
62
|
+
walletAddress: SuiAddress;
|
|
63
|
+
}
|
|
64
|
+
export interface ApiLimitOrdersActiveOrdersOwnedBody {
|
|
65
|
+
walletAddress: SuiAddress;
|
|
66
|
+
bytes: string;
|
|
67
|
+
signature: string;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=limitOrdersTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limitOrdersTypes.d.ts","sourceRoot":"","sources":["../../../src/packages/limitOrders/limitOrdersTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACN,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,MAAM,kCAAkC,CAAC;AAM1C,MAAM,WAAW,4BAA4B;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,UAAU,CAAC;CACzB;AAMD,MAAM,WAAW,wCAAwC;IACxD,aAAa,EAAE,UAAU,CAAC;IAC1B,gBAAgB,EAAE,QAAQ,CAAC;IAC3B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,QAAQ,CAAC;IACtB,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,4BAA4B,CAAC;IAC7C,yBAAyB,EAAE,MAAM,CAAC;IAClC,iCAAiC,CAAC,EAAE,MAAM,CAAC;CAC3C;AAED,MAAM,WAAW,2BAA2B;IAC3C,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACrB;AAMD,MAAM,WAAW,yBAAyB;IACzC,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CAClB;AAMD,MAAM,WAAW,wCAAwC;IACxD,aAAa,EAAE,UAAU,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CAClB;AAMD,MAAM,MAAM,sBAAsB,GAC/B,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,mBAAmB,CAAC;AAEvB,MAAM,WAAW,gBAAgB;IAChC,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,EAAE;QACd,IAAI,EAAE,QAAQ,CAAC;QACf,MAAM,EAAE,OAAO,CAAC;KAChB,CAAC;IACF,OAAO,EAAE;QACR,IAAI,EAAE,QAAQ,CAAC;QACf,MAAM,EAAE,OAAO,CAAC;KAChB,CAAC;IACF,iBAAiB,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,UAAU,CAAC;IACtB,OAAO,EAAE;QACR,SAAS,EAAE,SAAS,CAAC;QACrB,SAAS,EAAE,iBAAiB,CAAC;KAC7B,CAAC;IACF,QAAQ,CAAC,EAAE;QACV,SAAS,EAAE,SAAS,CAAC;QACrB,SAAS,EAAE,iBAAiB,CAAC;KAC7B,CAAC;IACF,eAAe,EAAE,SAAS,CAAC;IAC3B,MAAM,EAAE,sBAAsB,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,4BAA4B,CAAC;IAC7C,iCAAiC,CAAC,EAAE,MAAM,CAAC;CAC3C;AAMD,MAAM,WAAW,iCAAiC;IACjD,aAAa,EAAE,UAAU,CAAC;CAC1B;AAED,MAAM,WAAW,mCAAmC;IACnD,aAAa,EAAE,UAAU,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userDataApi.d.ts","sourceRoot":"","sources":["../../../../src/packages/userData/api/userDataApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAEvE,qBAAa,WAAW;IAKX,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,YAAY;CACnD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserDataApi = void 0;
|
|
4
|
+
class UserDataApi {
|
|
5
|
+
// =========================================================================
|
|
6
|
+
// Constructor
|
|
7
|
+
// =========================================================================
|
|
8
|
+
constructor(Provider) {
|
|
9
|
+
this.Provider = Provider;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.UserDataApi = UserDataApi;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/userData/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./userData"), exports);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Caller } from "../../general/utils/caller";
|
|
2
|
+
import { CallerConfig } from "../../types";
|
|
3
|
+
import { ApiUserDataCreateUserBody, ApiUserDataPublicKeyBody } from "./userDataTypes";
|
|
4
|
+
export declare class UserData extends Caller {
|
|
5
|
+
constructor(config?: CallerConfig);
|
|
6
|
+
/**
|
|
7
|
+
* Fetches the API for users public key.
|
|
8
|
+
* @async
|
|
9
|
+
* @param { SuiAddress } inputs - An object containing the walletAddress.
|
|
10
|
+
* @returns { Promise<string | undefined> } A promise that resolves users public key.
|
|
11
|
+
*/
|
|
12
|
+
getUserPublicKey(inputs: ApiUserDataPublicKeyBody): Promise<string | undefined>;
|
|
13
|
+
/**
|
|
14
|
+
* Fetches the API to create users public key.
|
|
15
|
+
* @async
|
|
16
|
+
* @param { ApiUserDataCreateUserBody } inputs - The inputs for creating users public key on BE side.
|
|
17
|
+
* @returns { Promise<boolean> } A promise that resolves to result if user pk has been created.
|
|
18
|
+
*/
|
|
19
|
+
createUserPublicKey(inputs: ApiUserDataCreateUserBody): Promise<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* Fetches the API for user create message to sign.
|
|
22
|
+
* @returns { string } message to sign with action related to the service you interact with.
|
|
23
|
+
*/
|
|
24
|
+
createUserAccountMessageToSign(): {
|
|
25
|
+
action: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Fetches the API for creating sign and terms message to sign.
|
|
29
|
+
* @returns { string } message to sign with action related to the service you interact with.
|
|
30
|
+
*/
|
|
31
|
+
createSignTermsAndConditionsMessageToSign(): {
|
|
32
|
+
action: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=userData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userData.d.ts","sourceRoot":"","sources":["../../../src/packages/userData/userData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACN,yBAAyB,EACzB,wBAAwB,EACxB,MAAM,iBAAiB,CAAC;AAEzB,qBAAa,QAAS,SAAQ,MAAM;gBAKvB,MAAM,CAAC,EAAE,YAAY;IAOjC;;;;;OAKG;IAEU,gBAAgB,CAC5B,MAAM,EAAE,wBAAwB,GAC9B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAO9B;;;;;OAKG;IAEU,mBAAmB,CAC/B,MAAM,EAAE,yBAAyB,GAC/B,OAAO,CAAC,OAAO,CAAC;IAOnB;;;OAGG;IAEI,8BAA8B;;;IAMrC;;;OAGG;IAEI,yCAAyC,IAAI;QACnD,MAAM,EAAE,MAAM,CAAC;KACf;CAKD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UserData = void 0;
|
|
13
|
+
const caller_1 = require("../../general/utils/caller");
|
|
14
|
+
class UserData extends caller_1.Caller {
|
|
15
|
+
// =========================================================================
|
|
16
|
+
// Constructor
|
|
17
|
+
// =========================================================================
|
|
18
|
+
constructor(config) {
|
|
19
|
+
super(config, "user-data");
|
|
20
|
+
}
|
|
21
|
+
// =========================================================================
|
|
22
|
+
// API
|
|
23
|
+
// =========================================================================
|
|
24
|
+
/**
|
|
25
|
+
* Fetches the API for users public key.
|
|
26
|
+
* @async
|
|
27
|
+
* @param { SuiAddress } inputs - An object containing the walletAddress.
|
|
28
|
+
* @returns { Promise<string | undefined> } A promise that resolves users public key.
|
|
29
|
+
*/
|
|
30
|
+
getUserPublicKey(inputs) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
return this.fetchApi(`public-key`, inputs);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Fetches the API to create users public key.
|
|
37
|
+
* @async
|
|
38
|
+
* @param { ApiUserDataCreateUserBody } inputs - The inputs for creating users public key on BE side.
|
|
39
|
+
* @returns { Promise<boolean> } A promise that resolves to result if user pk has been created.
|
|
40
|
+
*/
|
|
41
|
+
createUserPublicKey(inputs) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return this.fetchApi(`save-public-key`, inputs);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Fetches the API for user create message to sign.
|
|
48
|
+
* @returns { string } message to sign with action related to the service you interact with.
|
|
49
|
+
*/
|
|
50
|
+
createUserAccountMessageToSign() {
|
|
51
|
+
return {
|
|
52
|
+
action: `CREATE_USER_ACCOUNT`,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Fetches the API for creating sign and terms message to sign.
|
|
57
|
+
* @returns { string } message to sign with action related to the service you interact with.
|
|
58
|
+
*/
|
|
59
|
+
createSignTermsAndConditionsMessageToSign() {
|
|
60
|
+
return {
|
|
61
|
+
action: `SIGN_TERMS_AND_CONDITIONS`,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.UserData = UserData;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SuiAddress } from "../../types";
|
|
2
|
+
export interface ApiUserDataCreateUserBody {
|
|
3
|
+
walletAddress: SuiAddress;
|
|
4
|
+
bytes: string;
|
|
5
|
+
signature: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ApiUserDataPublicKeyBody {
|
|
8
|
+
walletAddress: SuiAddress;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=userDataTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userDataTypes.d.ts","sourceRoot":"","sources":["../../../src/packages/userData/userDataTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMzC,MAAM,WAAW,yBAAyB;IACzC,aAAa,EAAE,UAAU,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,wBAAwB;IACxC,aAAa,EAAE,UAAU,CAAC;CAC1B"}
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DcaClosedOrderEvent, DcaCreatedOrderEvent, DcaExecutedTradeEvent, DcaOrderObject, DcaOrderTradeObject } from "../dcaTypes";
|
|
2
|
-
import { DcaClosedOrderEventOnChain, DcaCreatedOrderEventOnChain, DcaExecutedTradeEventOnChain, DcaIndexerOrderResponse, DcaIndexerOrderTradeResponse } from "./dcaApiCastingTypes";
|
|
3
|
-
import { CoinType } from "../../../types";
|
|
4
|
-
export declare class DcaApiCasting {
|
|
5
|
-
static createdDcaOrderEventFromOnChain: (eventOnChain: DcaCreatedOrderEventOnChain) => DcaCreatedOrderEvent;
|
|
6
|
-
static closedDcaOrderEventFromOnChain: (eventOnChain: DcaClosedOrderEventOnChain) => DcaClosedOrderEvent;
|
|
7
|
-
static executedTradeEventFromOnChain: (eventOnChain: DcaExecutedTradeEventOnChain) => DcaExecutedTradeEvent;
|
|
8
|
-
static createdOrderEventOnIndexer: (response: DcaIndexerOrderResponse) => DcaOrderObject;
|
|
9
|
-
static createdOrderTradeEventOnIndexer: (response: DcaIndexerOrderTradeResponse, inputCoinType: CoinType, outputCoinType: CoinType) => DcaOrderTradeObject;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=dcaApiCasting.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dcaApiCasting.d.ts","sourceRoot":"","sources":["../../../../src/packages/dca/api/dcaApiCasting.ts"],"names":[],"mappings":"AACA,OAAO,EACN,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EAEnB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B,EAC5B,uBAAuB,EACvB,4BAA4B,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAW,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAGnD,qBAAa,aAAa;IAKzB,OAAc,+BAA+B,iDAE1C,oBAAoB,CAyBrB;IAEF,OAAc,8BAA8B,gDAEzC,mBAAmB,CAwBpB;IAEF,OAAc,6BAA6B,kDAExC,qBAAqB,CAiBtB;IAMF,OAAc,0BAA0B,aAC7B,uBAAuB,KAC/B,cAAc,CAuHf;IAEF,OAAc,+BAA+B,aAClC,4BAA4B,iBACvB,QAAQ,kBACP,QAAQ,KACtB,mBAAmB,CAgBpB;CACF"}
|