-
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(deposit-api): add deposit api (#11)
* feat(deposit-api): add get deposits api * feat(deposit-api): add get deposit api * feat(deposit-api): add post deposit coin address api * feat(deposit-api): get deposit coin addresses api * feat(deposit-api): get deposit coin address api * feat(deposit-api): post deposit krw api * docs(readme): modify typo
- Loading branch information
Showing
23 changed files
with
425 additions
and
7 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,30 @@ | ||
### Example | ||
```typescript | ||
|
||
const param = { | ||
/** required */ | ||
/** Crypto Currency Code */ | ||
currenecy: 'XRP', | ||
}; | ||
|
||
// ES6 | ||
import ApiUpbit from 'node-upbit-api'; | ||
|
||
const res = await new ApiUpbit('accessKey', 'secretKey').getDepositCoinAddress(param); | ||
console.log(res); | ||
|
||
// ES5 | ||
var ApiUpbit = required('node-upbit-api'); | ||
|
||
new ApiUpbit('accessKey', 'secretKey').getDepositCoinAddress(param).then(res => console.log(res)); | ||
|
||
// console.log(res) | ||
{ | ||
/** Crypto Currency Code */ | ||
currency: 'XRP', | ||
/** Deposit Address */ | ||
deposit_address: '152rff1-d2v14v2rcxd-cd21vqdc1-2dsab', | ||
/** Secondary Deposit Address nullable Field */ | ||
secondary_addres: '2rcf1dv2-vd2c2d1dvf-2rcf21wdx-vdw1cdxw', | ||
} | ||
``` |
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,26 @@ | ||
### Example | ||
```typescript | ||
|
||
// ES6 | ||
import ApiUpbit from 'node-upbit-api'; | ||
|
||
const res = await new ApiUpbit('accessKey', 'secretKey').getDepositCoinAddresses(); | ||
console.log(res); | ||
|
||
// ES5 | ||
var ApiUpbit = required('node-upbit-api'); | ||
|
||
new ApiUpbit('accessKey', 'secretKey').getDepositCoinAddresses().then(res => console.log(res)); | ||
|
||
// console.log(res) | ||
[ | ||
{ | ||
/** Crypto Currency Code */ | ||
currency: 'XRP', | ||
/** Deposit Address */ | ||
deposit_address: '152rff1-d2v14v2rcxd-cd21vqdc1-2dsab', | ||
/** Secondary Deposit Address nullable Field */ | ||
secondary_addres: '2rcf1dv2-vd2c2d1dvf-2rcf21wdx-vdw1cdxw', | ||
} | ||
] | ||
``` |
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 */ | ||
/** Deposit Unique ID */ | ||
uuids: '35a4f1dc-1db5-4d6b-89b5-7ec137875956', | ||
/** optional */ | ||
/** Deposit TX ID */ | ||
txids: '98c15999f0bdc4ae0e8a-ed35868bb0c204fe6ec29e4058a3451e-88636d1040f4baddf943274ce37cf9cc', | ||
}; | ||
|
||
// ES6 | ||
import ApiUpbit from 'node-upbit-api'; | ||
|
||
const res = await new ApiUpbit('accessKey', 'secretKey').getDepoit(param); | ||
console.log(res); | ||
|
||
// ES5 | ||
var ApiUpbit = required('node-upbit-api'); | ||
|
||
new ApiUpbit('accessKey', 'secretKey').getDepoit(param).then(res => console.log(res)); | ||
|
||
// console.log(res) | ||
{ | ||
/** Deposit And Withdrawal Type */ | ||
type: 'deposit', | ||
/** Deposit Unique ID */ | ||
uuid: '35a4f1dc-1db5-4d6b-89b5-7ec137875956', | ||
/** Crypto Currenecy Code */ | ||
currency: 'XRP'; | ||
/** Deposit TX ID */ | ||
txid: '98c15999f0bdc4ae0e8a-ed35868bb0c204fe6ec29e4058a3451e-88636d1040f4baddf943274ce37cf9cc'; | ||
/** Deposital 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'; | ||
/** Deposit Price/Count */ | ||
amount: '1.0'; | ||
/** Deposit Fee */ | ||
fee: '0.0'; | ||
/** Deposit 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,64 @@ | ||
### Example | ||
```typescript | ||
|
||
const param = { | ||
/** required */ | ||
/** Crypto Currency Code */ | ||
currenecy: 'XRP'; | ||
/** required */ | ||
/** Deposit Status */ | ||
state: 'submitting' | 'submitted' | 'almost_accepted' | 'rejected' | 'accepted' | 'processing' | 'done' | 'canceled', | ||
/** required */ | ||
/** Deposit Unique ID */ | ||
uuids: []; | ||
/** required */ | ||
/** Deposit 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').getDeposits(param); | ||
console.log(res); | ||
|
||
// ES5 | ||
var ApiUpbit = required('node-upbit-api'); | ||
|
||
new ApiUpbit('accessKey', 'secretKey').getDeposits(param).then(res => console.log(res)); | ||
|
||
// console.log(res) | ||
[ | ||
{ | ||
/** Deposit And Withdrawal Type */ | ||
type: 'deposits', | ||
/** Deposit Unique ID */ | ||
uuid: '35a4f1dc-1db5-4d6b-89b5-7ec137875956', | ||
/** Crypto Currenecy Code */ | ||
currency: 'XRP'; | ||
/** Deposit TX ID */ | ||
txid: '98c15999f0bdc4ae0e8a-ed35868bb0c204fe6ec29e4058a3451e-88636d1040f4baddf943274ce37cf9cc'; | ||
/** Deposit 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'; | ||
/** Deposit Price/Count */ | ||
amount: '1.0'; | ||
/** Deposit Fee */ | ||
fee: '0.0'; | ||
/** Deposit 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,45 @@ | ||
### Example | ||
```typescript | ||
|
||
const param = { | ||
/** required */ | ||
/** Crypto Currency Code */ | ||
currenecy: 'XRP', | ||
}; | ||
|
||
// ES6 | ||
import ApiUpbit from 'node-upbit-api'; | ||
|
||
const res = await new ApiUpbit('accessKey', 'secretKey').postDepositCoinAddress(param); | ||
console.log(res); | ||
|
||
// ES5 | ||
var ApiUpbit = required('node-upbit-api'); | ||
|
||
new ApiUpbit('accessKey', 'secretKey').postDepositCoinAddress(param).then(res => console.log(res)); | ||
|
||
/** | ||
* The creation of deposit addresses is asynchronous on the server. | ||
* When requesting to issue an address, <PostDepositsCoinAddressPendingResponse> will be returned as a result, and <PostDepositsCoinAddressPendingResponse> will continue to be returned until the address issuance is completed. | ||
*/ | ||
|
||
// console.log(res) | ||
// Before Issued | ||
{ | ||
/** Whether success Request */ | ||
success: true, | ||
/** Message about the result of the request. */ | ||
message: 'XRP 입금 주소를 생성중입니다.', | ||
} | ||
|
||
// console.log(res) | ||
// After Issued | ||
{ | ||
/** Crypto Currency Code */ | ||
currency: 'XRP', | ||
/** Deposit Address */ | ||
deposit_address: '152rff1-d2v14v2rcxd-cd21vqdc1-2dsab', | ||
/** Secondary Deposit Address nullable Field */ | ||
secondary_addres: '2rcf1dv2-vd2c2d1dvf-2rcf21wdx-vdw1cdxw', | ||
} | ||
``` |
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 */ | ||
/** Deposit amount */ | ||
amount: 10000, | ||
}; | ||
|
||
// ES6 | ||
import ApiUpbit from 'node-upbit-api'; | ||
|
||
const res = await new ApiUpbit('accessKey', 'secretKey').postDepositKrw(param); | ||
console.log(res); | ||
|
||
// ES5 | ||
var ApiUpbit = required('node-upbit-api'); | ||
|
||
new ApiUpbit('accessKey', 'secretKey').postDepositKrw(param).then(res => console.log(res)); | ||
|
||
// console.log(res) | ||
{ | ||
/** Deposit And Withdrawal Type */ | ||
type: 'deposit', | ||
/** Deposit Unique ID */ | ||
uuid: '35a4f1dc-1db5-4d6b-89b5-7ec137875956', | ||
/** Currenecy Code */ | ||
currency: 'KRW'; | ||
/** Deposit TX ID */ | ||
txid: '98c15999f0bdc4ae0e8a-ed35868bb0c204fe6ec29e4058a3451e-88636d1040f4baddf943274ce37cf9cc'; | ||
/** Deposital 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'; | ||
/** Deposit Price/Count */ | ||
amount: '10000'; | ||
/** Deposit Fee */ | ||
fee: '0.0'; | ||
/** Deposit 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
Oops, something went wrong.