Skip to content

Commit f2587d4

Browse files
committed
feat: network code parameter on create deposit crypto address
1 parent 29743e2 commit f2587d4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

lib/client.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,24 +820,33 @@ export class Client {
820820
*
821821
* @return the currency address
822822
*/
823-
async getDepositCryptoAddressOfCurrency(currency: string): Promise<Address> {
823+
async getDepositCryptoAddress(currency: string, network_code?: string): Promise<Address> {
824824
const addressList = await this.get(`wallet/crypto/address`, { currency });
825825
return addressList[0];
826826
}
827827

828828
/**
829829
* Creates a new address for the currency
830830
*
831+
* Creates a new deposit address.
832+
* Existing addresses may still receive funds.
833+
* For some tokens (e.g., Ethereum tokens),
834+
* a single address is generated per base currency with additional
835+
* identifiers which differ for each address: payment_id or public_key.
836+
* As a result, generating a new address for such a token
837+
* will change the current address for an entire base currency accordingly.
838+
*
831839
* Requires the "Payment information" API key Access Right.
832840
*
833841
* https://api.exchange.cryptomkt.com/#generate-deposit-crypto-address
834842
*
835843
* @param {string} currency currency to create a new address
844+
* @param {string} network_code Optional. network code
836845
*
837846
* @return The created address for the currency
838847
*/
839848
createDepositCryptoAddress(currency: string, network_code?: string): Promise<Address> {
840-
return this.post(`wallet/crypto/address`, { currency });
849+
return this.post(`wallet/crypto/address`, { currency, network_code });
841850
}
842851

843852
/**

lib/models/Address.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ export interface Address {
33
currency: string;
44
payment_id: string;
55
public_key: string;
6+
netwokd_code: string;
67
}

0 commit comments

Comments
 (0)