Skip to content

Commit 24c1129

Browse files
author
T. Ismael Verdugo
committed
feat: transfer to super account and to another sub account
1 parent 2e15084 commit 24c1129

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

lib/client.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,63 @@ Accepted values: wallet, spot. Must not be the same as source
15741574
return response["response"];
15751575
}
15761576

1577+
/**
1578+
* Creates and commits a transfer from a subaccount to its super account
1579+
*
1580+
* Call is being sent by a subaccount
1581+
*
1582+
* Created but not committed transfer will reserve pending amount on the sender
1583+
* wallet affecting their ability to withdraw or transfer crypto to another
1584+
* account. Incomplete withdrawals affect subaccount transfers the same way
1585+
*
1586+
* Requires the "Withdraw cryptocurrencies" API key Access Right
1587+
*
1588+
* https://api.exchange.cryptomkt.com/#transfer-to-super-account
1589+
*
1590+
* @param {object} params Parameters
1591+
* @param {number} params.amount the amount of currency to transfer
1592+
* @param {string} params.currency the currency to transfer
1593+
*
1594+
* @return The transaction ID of the tranfer
1595+
*/
1596+
async transferToSuperAccount(params: {
1597+
amount: number;
1598+
currency: string;
1599+
}): Promise<string> {
1600+
const response = await this.post("sub-account/transfer/sub-to-super", params);
1601+
return response["response"];
1602+
}
1603+
1604+
/**
1605+
* Creates and commits a transfer between the user (subaccount) and another
1606+
* subaccount.
1607+
*
1608+
* Call is being sent by a subaccount
1609+
*
1610+
* Created but not committed transfer will reserve pending amount on the sender
1611+
* wallet affecting their ability to withdraw or transfer crypto to another
1612+
* account. Incomplete withdrawals affect subaccount transfers the same way
1613+
*
1614+
* Requires the "Withdraw cryptocurrencies" API key Access Right
1615+
*
1616+
* https://api.exchange.cryptomkt.com/#transfer-across-subaccounts
1617+
*
1618+
* @param {object} params Parameters
1619+
* @param {number} params.subAccountId The account ID of the account to transfer to
1620+
* @param {number} params.amount the amount of currency to transfer
1621+
* @param {string} params.currency the currency to transfer
1622+
*
1623+
* @return The transaction ID of the tranfer
1624+
*/
1625+
async transferToAnotherSubAccount(params: {
1626+
subAccountId: number;
1627+
amount: number;
1628+
currency: string;
1629+
}): Promise<string> {
1630+
const response = await this.post("sub-account/transfer/sub-to-sub", params);
1631+
return response["response"];
1632+
}
1633+
15771634
/**
15781635
* Returns a list of withdrawal settings for sub-accounts listed
15791636
*

0 commit comments

Comments
 (0)