-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(exchange-api): add withdraws api (#7)
* feat(withdraw-api): get withdraws api * docs(withdraw-api): add description in get withdraws api * feat(withdraw-api): add withdraw detail and withdraw chance * feat(withdraw-api): add withdraw chance api and withdraw coin api * docs(withdraw-api): modify sample code * fix(withdraw-api):post withdraws krw api * feat(withdraw-api): ad post withdraws krw api
- Loading branch information
Showing
22 changed files
with
596 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
### Example | ||
```typescript | ||
|
||
/** Either (uuid, txid) value must be included. */ | ||
const param = { | ||
/** required */ | ||
/** Crypto Currency Code */ | ||
currenecy: 'XRP', | ||
/** optional */ | ||
/** Withdraw Unique ID */ | ||
uuids: '35a4f1dc-1db5-4d6b-89b5-7ec137875956', | ||
/** optional */ | ||
/** Withdraw TX ID */ | ||
txids: '98c15999f0bdc4ae0e8a-ed35868bb0c204fe6ec29e4058a3451e-88636d1040f4baddf943274ce37cf9cc', | ||
}; | ||
|
||
// ES6 | ||
import ApiUpbit from 'node-upbit-api'; | ||
|
||
const res = await new ApiUpbit('accessKey', 'secretKey').getWithdraw(param); | ||
console.log(res); | ||
|
||
// ES5 | ||
var ApiUpbit = required('node-upbit-api'); | ||
|
||
new ApiUpbit('accessKey', 'secretKey').getWithdraw(param).then(res => console.log(res)); | ||
|
||
// console.log(res) | ||
{ | ||
/** Deposit And Withdrawal Type */ | ||
type: 'withdraw', | ||
/** Withdraw Unique ID */ | ||
uuid: '35a4f1dc-1db5-4d6b-89b5-7ec137875956', | ||
/** Crypto Currenecy Code */ | ||
currency: 'XRP'; | ||
/** Withdraw TX ID */ | ||
txid: '98c15999f0bdc4ae0e8a-ed35868bb0c204fe6ec29e4058a3451e-88636d1040f4baddf943274ce37cf9cc'; | ||
/** Withdrawal Status */ | ||
state: 'submitting' | 'submitted' | 'almost_accepted' | 'rejected' | 'accepted' | 'processing' | 'done' | 'canceled', | ||
/** Create Datetime */ | ||
created_at: '2019-02-28T15:17:51+09:00'; | ||
/** Done Datetime */ | ||
done_at: '2019-02-28T15:22:12+09:00'; | ||
/** Withdraw Price/Count */ | ||
amount: '1.0'; | ||
/** Withdraw Fee */ | ||
fee: '0.0'; | ||
/** Withdraw Type */ | ||
transaction_type: 'default' | 'internal'; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
### Example | ||
```typescript | ||
|
||
const param = { | ||
/** required */ | ||
/** Crypto Currency Code */ | ||
currency: 'BTC' | ||
}; | ||
|
||
// ES6 | ||
import ApiUpbit from 'node-upbit-api'; | ||
|
||
const res = await new ApiUpbit('accessKey', 'secretKey').getWithdrawsChance(param); | ||
console.log(res); | ||
|
||
// ES5 | ||
var ApiUpbit = required('node-upbit-api'); | ||
|
||
new ApiUpbit('accessKey', 'secretKey').getWithdrawsChance(param).then(res => console.log(res)); | ||
|
||
// console.log(res) | ||
{ | ||
/** User Security Level */ | ||
member_level: { | ||
/** Security Level */ | ||
security_level: 3, | ||
/** Fee Level */ | ||
fee_level: 0, | ||
/** Email Verified */ | ||
email_verified: true, | ||
/** Real Name Verified */ | ||
identity_auth_verified: true, | ||
/** Bank Account Verified */ | ||
bank_account_verified: true, | ||
/** Kakao Pay Verified */ | ||
kakao_pay_auth_verified: false, | ||
/** Lock This Account */ | ||
locked: false, | ||
/** Wallet Withdraw Locked */ | ||
wallet_locked: false | ||
}, | ||
/** Currency Information */ | ||
currency: { | ||
/** Currency Code */ | ||
code: 'BTC', | ||
/** Withdraw Fee */ | ||
withdraw_fee: '0.0005', | ||
/** Is Coin */ | ||
is_coin: true, | ||
/** Currency Wallet State */ | ||
wallet_state: 'working', | ||
/** Wallet Support */ | ||
wallet_support: [ | ||
'deposit', | ||
'withdraw', | ||
] | ||
}, | ||
/** User Account Information */ | ||
account: { | ||
/** Currency Code */ | ||
currency: 'BTC', | ||
/** Available Order Price/Count */ | ||
balance: '10.0', | ||
/** Locked In Order Price/Count */ | ||
locked: '0.0', | ||
/** Average Buy Price */ | ||
avg_buy_price: '8042000', | ||
/** whether average buy price modify */ | ||
avg_buy_price_modified: false, | ||
/** Base currency */ | ||
unit_currency: 'KRW', | ||
}, | ||
/** Information on withdrawal restrictions */ | ||
withdraw_limit: { | ||
/** Currency Code */ | ||
currency: 'BTC', | ||
/** withdraw Minimum Price/Count */ | ||
minimum: null, | ||
/** One Time Withdraw Maximum */ | ||
onetime: null, | ||
/** Daily Withdraw Maximum */ | ||
daily: '10.0', | ||
/** Remaining Daily Withdraw Limit */ | ||
remaining_daily: '10.0', | ||
/** Remaining Daily Withdraw Limit On KRW */ | ||
remaining_daily_krw: '0.0', | ||
/** Withdraw Price/Count Number of decimal places */ | ||
fixed: null, | ||
/** Is Support Withdraw */ | ||
can_withdraw: true, | ||
} | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
### Example | ||
```typescript | ||
|
||
const param = { | ||
/** required */ | ||
/** Crypto Currency Code */ | ||
currenecy: 'XRP'; | ||
/** required */ | ||
/** Withdrawal Status */ | ||
state: 'submitting' | 'submitted' | 'almost_accepted' | 'rejected' | 'accepted' | 'processing' | 'done' | 'canceled', | ||
/** required */ | ||
/** Withdraw Unique ID */ | ||
uuids: []; | ||
/** required */ | ||
/** Withdraw TX ID */ | ||
txids: []; | ||
/** optional */ | ||
/** Default 100, Max 100 */ | ||
limit: 100; | ||
/** optional */ | ||
/** Default 1 */ | ||
page: 1; | ||
/** optional */ | ||
/** Default 'desc' */ | ||
order_by: 'desc' | 'asc'; | ||
}; | ||
|
||
// ES6 | ||
import ApiUpbit from 'node-upbit-api'; | ||
|
||
const res = await new ApiUpbit('accessKey', 'secretKey').getWithdraws(param); | ||
console.log(res); | ||
|
||
// ES5 | ||
var ApiUpbit = required('node-upbit-api'); | ||
|
||
new ApiUpbit('accessKey', 'secretKey').getWithdraws(param).then(res => console.log(res)); | ||
|
||
// console.log(res) | ||
[ | ||
{ | ||
/** Deposit And Withdrawal Type */ | ||
type: 'withdraw', | ||
/** Withdraw Unique ID */ | ||
uuid: '35a4f1dc-1db5-4d6b-89b5-7ec137875956', | ||
/** Crypto Currenecy Code */ | ||
currency: 'XRP'; | ||
/** Withdraw TX ID */ | ||
txid: '98c15999f0bdc4ae0e8a-ed35868bb0c204fe6ec29e4058a3451e-88636d1040f4baddf943274ce37cf9cc'; | ||
/** Withdrawal Status */ | ||
state: 'submitting' | 'submitted' | 'almost_accepted' | 'rejected' | 'accepted' | 'processing' | 'done' | 'canceled', | ||
/** Create Datetime */ | ||
created_at: '2019-02-28T15:17:51+09:00'; | ||
/** Done Datetime */ | ||
done_at: '2019-02-28T15:22:12+09:00'; | ||
/** Withdraw Price/Count */ | ||
amount: '1.0'; | ||
/** Withdraw Fee */ | ||
fee: '0.0'; | ||
/** Withdraw Type */ | ||
transaction_type: 'default' | 'internal'; | ||
} | ||
] | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
### Example | ||
```typescript | ||
|
||
/** Either (uuid, txid) value must be included. */ | ||
const param = { | ||
/** required */ | ||
/** Crypto Currency Code */ | ||
currenecy: 'XRP', | ||
/** required */ | ||
/** Withdraw Count */ | ||
amount: 10, | ||
/** required */ | ||
/** Withdrawal Address Registered in the Withdrawal Address */ | ||
address: 'r213421-df232f12-f321fd-21f32', | ||
/** optional */ | ||
/** Second Withdrawal Address (Only the Coins Needed) */ | ||
secondary_address: '13f1d123v-f2c1crvcf-rf13cv1x-fr1fc2', | ||
/** optional */ | ||
/** Withdraw Transaction Type */ | ||
transaction_type: 'default' | 'interanl', | ||
}; | ||
|
||
// ES6 | ||
import ApiUpbit from 'node-upbit-api'; | ||
|
||
const res = await new ApiUpbit('accessKey', 'secretKey').postWithdrawsCoin(param); | ||
console.log(res); | ||
|
||
// ES5 | ||
var ApiUpbit = required('node-upbit-api'); | ||
|
||
new ApiUpbit('accessKey', 'secretKey').postWithdrawsCoin(param).then(res => console.log(res)); | ||
|
||
// console.log(res) | ||
{ | ||
/** Deposit And Withdrawal Type */ | ||
type: 'withdraw', | ||
/** Withdraw Unique ID */ | ||
uuid: '35a4f1dc-1db5-4d6b-89b5-7ec137875956', | ||
/** Crypto Currenecy Code */ | ||
currency: 'XRP', | ||
/** Withdraw TX ID */ | ||
txid: '98c15999f0bdc4ae0e8a-ed35868bb0c204fe6ec29e4058a3451e-88636d1040f4baddf943274ce37cf9cc', | ||
/** Withdrawal Status */ | ||
state: 'submitting' | 'submitted' | 'almost_accepted' | 'rejected' | 'accepted' | 'processing' | 'done' | 'canceled', | ||
/** Create Datetime */ | ||
created_at: '2019-02-28T15:17:51+09:00', | ||
/** Done Datetime */ | ||
done_at: '2019-02-28T15:22:12+09:00', | ||
/** Withdraw Price/Count */ | ||
amount: '10.0', | ||
/** Withdraw Fee */ | ||
fee: '0.0', | ||
/** KRW Conversion price. */ | ||
krw_amount: '5000.0', | ||
/** Withdraw Type */ | ||
transaction_type: 'default' | 'internal', | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
### Example | ||
```typescript | ||
|
||
const param = { | ||
/** required */ | ||
/** Withdraw price */ | ||
amount: 100000, | ||
}; | ||
|
||
// ES6 | ||
import ApiUpbit from 'node-upbit-api'; | ||
|
||
const res = await new ApiUpbit('accessKey', 'secretKey').postWithdrawsKrw(param); | ||
console.log(res); | ||
|
||
// ES5 | ||
var ApiUpbit = required('node-upbit-api'); | ||
|
||
new ApiUpbit('accessKey', 'secretKey').postWithdrawsKrw(param).then(res => console.log(res)); | ||
|
||
// console.log(res) | ||
{ | ||
/** Deposit And Withdrawal Type */ | ||
type: 'withdraw', | ||
/** Withdraw Unique ID */ | ||
uuid: '35a4f1dc-1db5-4d6b-89b5-7ec137875956', | ||
/** Crypto Currenecy Code */ | ||
currency: 'KRW', | ||
/** Withdraw TX ID */ | ||
txid: '98c15999f0bdc4ae0e8a-ed35868bb0c204fe6ec29e4058a3451e-88636d1040f4baddf943274ce37cf9cc', | ||
/** Withdrawal Status */ | ||
state: 'submitting' | 'submitted' | 'almost_accepted' | 'rejected' | 'accepted' | 'processing' | 'done' | 'canceled', | ||
/** Create Datetime */ | ||
created_at: '2019-02-28T15:17:51+09:00', | ||
/** Done Datetime */ | ||
done_at: null, | ||
/** Withdraw Price/Count */ | ||
amount: '100000', | ||
/** Withdraw Fee */ | ||
fee: '0.0', | ||
/** Withdraw Type */ | ||
transaction_type: 'default' | 'internal', | ||
} | ||
``` |
Oops, something went wrong.