File tree Expand file tree Collapse file tree 7 files changed +1552
-994
lines changed
Expand file tree Collapse file tree 7 files changed +1552
-994
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @deltadefi-protocol/typescript-sdk" ,
33 "description" : " The Typescript SDK for interacting with DeltaDeFi protocol" ,
4- "version" : " 0.3.22 " ,
4+ "version" : " 0.3.23 " ,
55 "main" : " ./dist/index.cjs" ,
66 "browser" : " ./dist/index.js" ,
77 "module" : " ./dist/index.js" ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
1111 BuildWithdrawalTransactionResponse ,
1212 SubmitWithdrawalTransactionRequest ,
1313 SubmitWithdrawalTransactionResponse ,
14+ GetOrderRecordRequest ,
1415 GetOrderRecordResponse ,
1516 GetDepositRecordsResponse ,
1617 GetWithdrawalRecordsResponse ,
@@ -95,8 +96,8 @@ export class Accounts extends Api {
9596 * Retrieves order records.
9697 * @returns A promise that resolves to the order records response.
9798 */
98- public getOrderRecords ( ) : Promise < GetOrderRecordResponse > {
99- const res = this . axiosInstance . get ( '/accounts/order-records' ) ;
99+ public getOrderRecords ( data : GetOrderRecordRequest ) : Promise < GetOrderRecordResponse > {
100+ const res = this . axiosInstance . get ( '/accounts/order-records' , { params : data } ) ;
100101 return this . resolveAxiosData ( res ) ;
101102 }
102103
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export class ApiClient {
4646 if ( network === 'mainnet' ) {
4747 // TODO: input production link once available
4848 baseURL = 'https://api.deltadefi.io' ;
49- wsURL = 'wss://api-staging .deltadefi.io' ;
49+ wsURL = 'wss://api.deltadefi.io' ;
5050 } else {
5151 baseURL = 'https://api-staging.deltadefi.io' ;
5252 wsURL = 'wss://api-staging.deltadefi.io' ;
Original file line number Diff line number Diff line change 1- export type TradingSymbol = 'ADAUSDX ' ;
1+ export type TradingSymbol = 'ADAUSDM ' ;
22
3- export type OrderStatus = 'building' | 'processing' | 'open' | 'closed' | 'failed' | 'cancelled' ;
3+ export type OrderStatus =
4+ | 'open'
5+ | 'fully_filled'
6+ | 'partially_filled'
7+ | 'cancelled'
8+ | 'partially_cancelled'
9+ | 'failed' ;
410
511export type OrderSide = 'buy' | 'sell' ;
612
@@ -47,3 +53,17 @@ export type OrderJSON = {
4753 update_time : number ;
4854 fills ?: OrderExecutionRecordJSON [ ] ;
4955} ;
56+
57+ export type OrderFillingRecordJSON = {
58+ execution_id : string ;
59+ order_id : string ;
60+ status : OrderStatus ;
61+ symbol : TradingSymbol ;
62+ executed_qty : string ;
63+ side : OrderSide ;
64+ type : OrderType ;
65+ fee_charged : string ;
66+ fee_unit : string ;
67+ executed_price : number ;
68+ created_time : number ;
69+ } ;
Original file line number Diff line number Diff line change @@ -79,8 +79,10 @@ export type SubmitCancelOrderTransactionRequest = {
7979 signed_tx : string ;
8080} ;
8181
82- export type Status = 'open ' | 'closed ' ;
82+ export type Status = 'openOrder ' | 'orderHistory' | 'tradingHistory ';
8383
8484export type GetOrderRecordRequest = {
85- status ?: Status ;
85+ status : Status ; // Must be either 'openOrder' | 'orderHistory' | 'tradingHistory'
86+ limit : number ; // default number is 10 while number must be between 1 and 250
87+ page : number ; // default number is 1 while number must be between 1 and 1000
8688} ;
Original file line number Diff line number Diff line change 1- import { Asset } from '@meshsdk/core' ;
2- import { OrderJSON , AccountBalance } from '../models' ;
1+ import { OrderJSON , AccountBalance , OrderFillingRecordJSON } from '../models' ;
32
43export type SignInResponse = {
54 token : string ;
@@ -40,23 +39,30 @@ export type GetOperationKeyResponse = {
4039
4140export type TransactionStatus = 'building' | 'submitted' | 'submission_failed' | 'confirmed' ;
4241
42+ export type AssetRecord = {
43+ asset : string ;
44+ asset_unit : string ;
45+ qty : number ;
46+ } ;
47+
4348export type DepositRecord = {
4449 created_at : string ;
4550 status : TransactionStatus ;
46- assets : Asset [ ] ;
51+ assets : AssetRecord [ ] ;
4752 tx_hash : string ;
4853} ;
4954
5055export type GetDepositRecordsResponse = DepositRecord [ ] ;
5156
5257export type GetOrderRecordResponse = {
53- Orders : OrderJSON [ ] ;
58+ orders : OrderJSON [ ] ;
59+ order_filling_records : OrderFillingRecordJSON [ ] ;
5460} ;
5561
5662export type WithdrawalRecord = {
5763 created_at : string ;
5864 status : TransactionStatus ;
59- assets : Asset [ ] ;
65+ assets : AssetRecord [ ] ;
6066} ;
6167
6268export type GetWithdrawalRecordsResponse = WithdrawalRecord [ ] ;
@@ -127,9 +133,7 @@ export type BuildCancelOrderTransactionResponse = {
127133 tx_hex : string ;
128134} ;
129135
130- export type SubmitCancelOrderTransactionResponse = {
131- tx_hash : string ;
132- } ;
136+ export type SubmitCancelOrderTransactionResponse = object ;
133137
134138export type GetAPIKeyResponse = {
135139 api_key : string ;
You can’t perform that action at this time.
0 commit comments