Skip to content

Commit e6928cf

Browse files
committed
reformat code
1 parent 4fed49a commit e6928cf

File tree

7 files changed

+44
-12
lines changed

7 files changed

+44
-12
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ yarn-error.log
44
.idea
55
_book
66
dist
7+
docs/detail
8+
docs/Changelog.md
9+
docs/README.md
10+
11+
File renamed without changes.

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
<p align="center">
2-
<a href="https://github.com/Loopring/loopring-web-v2" rel="noopener" target="_blank"><img width="150" src="https://loopring.org/images/logo.svg" alt="Loopring-website"></a>
3-
</p>
4-
51
# Loopring SDK
62

73
[![license](https://img.shields.io/badge/license-GPL-blue)](https://github.com/Loopring/loopring_sdk/master/LICENSE)

docs/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Overview
44

5-
- [Introduction](./detail/README.md)
5+
- [Introduction](README.md)
66
- [Changelog](ChangeLog.md)
77

88
### SDKs demo

docs/js_sdk/contract_api.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,42 @@
11
# Contract API
2+
deposit step:
3+
- check approveMax
4+
- (options) approveNFT
5+
- deposit
6+
7+
NFT View step:
8+
- getContractNFTMeta;
9+
- getIPFS JSON information;
10+
211

312
## getNonce
413
```typescript
5-
const nonce = await contract.getNonce(web3, acc.address);
14+
const nonce = await contract.getNonce(web3, acc.address);
15+
```
16+
## approveMax_LRC
17+
```typescript
18+
const nonce = await contract.getNonce(web3, acc.address);
19+
const response = await contract.approveMax(web3, acc.address, lrc.address,
20+
acc.depositAddr, gasPrice, gasLimit, ChainId.GOERLI, nonce, true)
621
```
22+
## deposit_LRC2
23+
```typescript
24+
const nonce = await contract.getNonce(web3, acc.address)
25+
const response = await contract.deposit(web3, acc.address, acc.exchangeAddr,
26+
lrc, 11, 0, gasPrice, gasLimit, ChainId.GOERLI, nonce, true)
27+
```
28+
##approveZero_LRC
29+
```typescript
30+
const nonce = await contract.getNonce(web3, acc.address)
31+
const response = await contract.approveZero(web3, acc.address, lrc.address,
32+
acc.depositAddr, gasPrice, gasLimit, ChainId.GOERLI, nonce, true)
33+
```
34+
##forceWithdrawal
35+
```typescript
36+
const nonce = await contract.getNonce(web3, acc.address)
37+
const response = await contract.forceWithdrawal(web3, acc.address, acc.accountId, acc.exchangeAddr,
38+
eth, 0, gasPrice, gasLimit, ChainId.GOERLI, nonce, true)
39+
40+
```
41+
42+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"prepublishOnly": "NODE_ENV=production tsdx build",
4949
"doc": "typedoc --out docs/detail src\\/",
5050
"build-book": "npx honkit build",
51-
"build-b": "npm run doc; npm run build-book",
51+
"build-b": "cp Changelog.md ./docs/Changelog.md;cp README.md ./docs/README.md; npm run doc; npm run build-book",
5252
"serve-book": "npx honkit serve",
5353
"deploy-book": "gh-pages -d _book"
5454
},

src/tests/contract.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ describe('contract test', function () {
116116
console.log(`nonce: ${nonce} approveMax: ${response}`)
117117
}, DEFAULT_TIMEOUT)
118118

119-
120-
121-
122119
it('deposit_LRC1', async () => {
123120
const nonce = await contract.getNonce(web3, acc.address)
124121
await sleep(200)
@@ -137,7 +134,6 @@ describe('contract test', function () {
137134
//
138135
// console.log(`nonce: ${nonce} deposit_ETH: ${response}`)
139136
// }, DEFAULT_TIMEOUT)
140-
141137
it('forceWithdrawal test', async () => {
142138
const nonce = await contract.getNonce(web3, acc.address)
143139
await sleep(200)
@@ -157,5 +153,4 @@ describe('contract test', function () {
157153
console.log(`nonce: ${nonce} approveZero: ${response}`)
158154
}, DEFAULT_TIMEOUT)
159155

160-
161156
})

0 commit comments

Comments
 (0)