Skip to content

Commit f0b31d7

Browse files
committed
feat: transfer
1 parent 291d4c8 commit f0b31d7

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

src/client/accounts/index.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ import {
2020
AccountBalance,
2121
GetAPIKeyResponse,
2222
GetOperationKeyResponse,
23+
BuildTransferalTransactionRequest,
24+
BuildTransferalTransactionResponse,
25+
SubmitTransferalTransactionRequest,
26+
SubmitTransferalTransactionResponse,
2327
} from '../../types';
2428
import { Api } from '../api';
2529

@@ -157,6 +161,18 @@ export class Accounts extends Api {
157161
return this.resolveAxiosData(res);
158162
}
159163

164+
/**
165+
* Builds a transferal transaction.
166+
* @param data - The build transferal transaction request data.
167+
* @returns A promise that resolves to the build transferal transaction response.
168+
*/
169+
public buildTransferalTransaction(
170+
data: BuildTransferalTransactionRequest,
171+
): Promise<BuildTransferalTransactionResponse> {
172+
const res = this.axiosInstance.post('/accounts/transferal/build', data);
173+
return this.resolveAxiosData(res);
174+
}
175+
160176
/**
161177
* Submits a deposit transaction.
162178
* @param data - The submit deposit transaction request data.
@@ -180,4 +196,16 @@ export class Accounts extends Api {
180196
const res = this.axiosInstance.post('/accounts/withdrawal/submit', data);
181197
return this.resolveAxiosData(res);
182198
}
199+
200+
/**
201+
* Submits a transferal transaction.
202+
* @param data - The submit transferal transaction request data.
203+
* @returns A promise that resolves to the submit transferal transaction response.
204+
*/
205+
public submittransferalTransaction(
206+
data: SubmitTransferalTransactionRequest,
207+
): Promise<SubmitTransferalTransactionResponse> {
208+
const res = this.axiosInstance.post('/accounts/transferal/submit', data);
209+
return this.resolveAxiosData(res);
210+
}
183211
}

src/types/requests/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ export type SubmitWithdrawalTransactionRequest = {
3737
signed_tx: string;
3838
};
3939

40+
export type BuildTransferalTransactionRequest = {
41+
transferal_amount: Asset[];
42+
to_address: string
43+
};
44+
45+
export type SubmitTransferalTransactionRequest = {
46+
signed_tx: string;
47+
};
48+
4049
export type GetMarketDepthRequest = {
4150
symbol: TradingSymbol;
4251
};

src/types/responses/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ export type BuildWithdrawalTransactionResponse = {
8282
tx_hex: string;
8383
};
8484

85+
export type BuildTransferalTransactionResponse = {
86+
tx_hex: string;
87+
};
88+
8589
export type SubmitDepositTransactionResponse = {
8690
tx_hash: string;
8791
};
@@ -90,6 +94,10 @@ export type SubmitWithdrawalTransactionResponse = {
9094
tx_hash: string;
9195
};
9296

97+
export type SubmitTransferalTransactionResponse = {
98+
tx_hash: string;
99+
};
100+
93101
export type GetTermsAndConditionResponse = string;
94102

95103
export type MarketDepth = {

0 commit comments

Comments
 (0)