Skip to content

Commit

Permalink
Merge pull request #638 from UnUniFi/fix/loan
Browse files Browse the repository at this point in the history
fix: Loan calculation
  • Loading branch information
Senna46 authored Jul 18, 2023
2 parents bc99e7f + 883f045 commit 512a6ba
Show file tree
Hide file tree
Showing 67 changed files with 4,695 additions and 10,402 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ docs/node_modules
docs/.vuepress/dist
data
docker-build/*
cmd/ununifid/__debug_bin
5 changes: 2 additions & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"golang.go",
"zxh404.vscode-proto3",
"eamodio.gitlens",
"TabNine.tabnine-vscode",
"streetsidesoftware.code-spell-checker",
"streetsidesoftware.code-spell-checker"
]
}
}
7 changes: 3 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"editor.detectIndentation": false,
"editor.formatOnSave": true,
"cSpell.enabled": true,
"tabnine.experimentalAutoImports": true,
"go.lintTool": "golangci-lint",
"go.formatTool": "goimports",
"go.useLanguageServer": true,
Expand All @@ -26,7 +25,7 @@
},
"files.eol": "\n",
"[proto3]": {
"editor.defaultFormatter": "xaver.clang-format"
"editor.defaultFormatter": "zxh404.vscode-proto3"
},
"clang-format.style": "{BasedOnStyle: Google, IndentWidth: 2, ColumnLimit: 120, AlignConsecutiveAssignments: true, AlignConsecutiveDeclarations: true, SpacesInSquareBrackets: true}",
}
"clang-format.style": "{BasedOnStyle: Google, IndentWidth: 2, ColumnLimit: 120, AlignConsecutiveAssignments: true, AlignConsecutiveDeclarations: true, SpacesInSquareBrackets: true}"
}
2 changes: 1 addition & 1 deletion deprecated/proto/nftmarketv1/nftmarket.proto
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ message EventBorrow {
}

message EventRepay {
string repayer = 1;
string borrower = 1;
string class_id = 2;
string nft_id = 3;
string amount = 4;
Expand Down
161 changes: 82 additions & 79 deletions docs/architecture/adr-nft-market/06_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,76 +13,79 @@ A user can query and interact with the `nftmarket` module using the CLI.
The `query` commands allow users to query `nftmarket` state.

```sh
ununifid query nftmarket --help
ununifid query nftbackedloan --help
```

<!-- todo: write section -->

#### classes

The `classes` endpoint allows users to query all listing nft series.

```sh
ununifid query nftmarket classes [flags]
ununifid query nftbackedloan classes [flags]
```

Example:

```sh
ununifid query nftmarket classes
ununifid query nftbackedloan classes
```

Example Output:

```yml
classes:
- id: a10
name: crypotpunk
description: crypotpunk is awsome
symbol: cryp
uri: http...
uriHash: xxxxx
nft:
- id: ax10
- id: a10
name: crypotpunk
description: crypotpunk is awsome
symbol: cryp
uri: http...
uriHash: xxxxx
nftCount: 20
- id: b10
name: ape
description: ape is awsome
symbol: ape
uri: http...
uriHash: xxxxx
nft:
- id: bx10
nft:
- id: ax10
uri: http...
uriHash: xxxxx
nftCount: 20
- id: b10
name: ape
description: ape is awsome
symbol: ape
uri: http...
uriHash: xxxxx
nftCount: 5
nft:
- id: bx10
uri: http...
uriHash: xxxxx
nftCount: 5
pagination:
total: '2'
total: "2"
```
### Transactions
The `tx` commands allow users to interact with the `nftmarket` module.

```sh
ununifid tx nftmarket --help
ununifid tx nftbackedloan--help
```

#### listing

The `listing` command listing NFT.

```sh
ununifid tx nftmarket listing [class-id] [nft-id] [flags]
ununifid tx nftbackedloanlisting [class-id] [nft-id] [flags]
```

Example:

```sh
ununifid tx nftmarket listing a10 a10 --from myKeyName --chain-id ununifi-x
ununifid tx nftbackedloanlisting a10 a10 --from myKeyName --chain-id ununifi-x
```

<!-- todo: write section -->

## gRPC

A user can query the `nftmarket` module using gRPC endpoints.
Expand Down Expand Up @@ -110,36 +113,36 @@ Example Output:
{
"classes": [
{
"id":"a10",
"name":"crypotpunk",
"description":"crypotpunk is awsome",
"symbol":"cryp",
"uri":"http...",
"uriHash":"xxxxx",
"nft":[
"id": "a10",
"name": "crypotpunk",
"description": "crypotpunk is awsome",
"symbol": "cryp",
"uri": "http...",
"uriHash": "xxxxx",
"nft": [
{
"id":"ax10",
"uri":"http...",
"uriHash":"xxxxx"
"id": "ax10",
"uri": "http...",
"uriHash": "xxxxx"
}
],
"nftCount":20
"nftCount": 20
},
{
"id":"b10",
"name":"ape",
"description":"ape is awsome",
"symbol":"ape",
"uri":"http...",
"uriHash":"xxxxx",
"nft":[
"id": "b10",
"name": "ape",
"description": "ape is awsome",
"symbol": "ape",
"uri": "http...",
"uriHash": "xxxxx",
"nft": [
{
"id":"bx10",
"uri":"http...",
"uriHash":"xxxxx"
"id": "bx10",
"uri": "http...",
"uriHash": "xxxxx"
}
],
"nftCount":5
"nftCount": 5
}
],
"pagination": {
Expand Down Expand Up @@ -170,20 +173,20 @@ Example Output:
```json
{
"class": {
"id":"a10",
"name":"crypotpunk",
"description":"crypotpunk is awsome",
"symbol":"cryp",
"uri":"http...",
"uriHash":"xxxxx",
"nft":[
{
"id":"ax10",
"uri":"http...",
"uriHash":"xxxxx",
}
],
"nftCount":20,
"id": "a10",
"name": "crypotpunk",
"description": "crypotpunk is awsome",
"symbol": "cryp",
"uri": "http...",
"uriHash": "xxxxx",
"nft": [
{
"id": "ax10",
"uri": "http...",
"uriHash": "xxxxx"
}
],
"nftCount": 20
}
}
```
Expand All @@ -209,30 +212,30 @@ Example Output:

```json
{
"nft":{
"classId":"a10",
"id":"ax10",
"uri":"http...",
"uriHash":"xxxxx",
"listingType":"DIRECT_ASSET_BORROW",
"bidToken":"uguu",
"state":"BIDDING",
"minBid":"1",
"bidActiverank":"2",
"bids":[
"nft": {
"classId": "a10",
"id": "ax10",
"uri": "http...",
"uriHash": "xxxxx",
"listingType": "DIRECT_ASSET_BORROW",
"bidToken": "uguu",
"state": "BIDDING",
"minBid": "1",
"bidActiverank": "2",
"bids": [
{
"bidder":"ununifi1...",
"amount":"100uguu",
"bidder": "ununifi1...",
"amount": "100uguu"
},
{
"bidder":"ununifi1...",
"amount":"99uguu",
"bidder": "ununifi1...",
"amount": "99uguu"
},
{
"bidder":"ununifi1...",
"amount":"98uguu",
"bidder": "ununifi1...",
"amount": "98uguu"
}
],
]
}
}
```
Loading

0 comments on commit 512a6ba

Please sign in to comment.