-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from rarimo/feat/withdrawals
Add withdrawals
- Loading branch information
Showing
23 changed files
with
5,016 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
allOf: | ||
- $ref: '#/components/schemas/WithdrawKey' | ||
- type: object | ||
x-go-is-request: true | ||
required: | ||
- attributes | ||
properties: | ||
attributes: | ||
type: object | ||
required: | ||
- amount | ||
- proof | ||
properties: | ||
amount: | ||
type: integer | ||
format: int64 | ||
description: Amount of points to withdraw | ||
example: 580 | ||
proof: | ||
type: object | ||
format: types.ZKProof | ||
description: Query ZK passport verification proof. |
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,13 @@ | ||
type: object | ||
required: | ||
- id | ||
- type | ||
properties: | ||
id: | ||
type: string | ||
description: Nullifier of the points owner | ||
example: "0x123...abc" | ||
pattern: '^0x[0-9a-fA-F]{64}$' | ||
type: | ||
type: string | ||
enum: [ withdraw ] |
39 changes: 39 additions & 0 deletions
39
docs/spec/paths/integrations@geo-points-svc@v1@public@balances@{nullifier}@withdrawals.yaml
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,39 @@ | ||
post: | ||
tags: | ||
- Points balance | ||
summary: Withdraw points | ||
description: | | ||
Convert points to RariMarket points by exchange rate and withdraw to user wallet. | ||
Updated balance with new rank is returned. | ||
operationId: withdrawPoints | ||
parameters: | ||
- $ref: '#/components/parameters/pathNullifier' | ||
requestBody: | ||
required: true | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
type: object | ||
required: | ||
- data | ||
properties: | ||
data: | ||
$ref: '#/components/schemas/Withdraw' | ||
responses: | ||
200: | ||
description: Success | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
type: object | ||
required: | ||
- data | ||
properties: | ||
data: | ||
$ref: '#/components/schemas/Balance' | ||
400: | ||
$ref: '#/components/responses/invalidParameter' | ||
401: | ||
$ref: '#/components/responses/invalidAuth' | ||
500: | ||
$ref: '#/components/responses/internalError' |
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
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,13 @@ | ||
-- +migrate Up | ||
CREATE TABLE IF NOT EXISTS withdrawals | ||
( | ||
tx_hash BYTEA PRIMARY KEY, | ||
nullifier TEXT NOT NULL REFERENCES balances (nullifier), | ||
amount integer NOT NULL, | ||
created_at TIMESTAMP NOT NULL DEFAULT NOW() | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS withdrawals_page_index ON withdrawals (nullifier, created_at); | ||
|
||
-- +migrate Down | ||
DROP TABLE IF EXISTS withdrawals; |
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
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.