-
Notifications
You must be signed in to change notification settings - Fork 2
feat: token version #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: token version #261
Conversation
|
||
#### Clone the project and install dependencies | ||
|
||
`git clone https://github.com/HathorNetwork/hathor-wallet-service-sync_daemon.git` | ||
```sh | ||
$ git clone https://github.com/HathorNetwork/hathor-wallet-service-sync_daemon.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you replace this with
git@github.com:HathorNetwork/hathor-wallet-service.git
?
@@ -54,6 +79,16 @@ AWS_SECRET_ACCESS_KEY="..." | |||
|
|||
These are used for communicating with the alert SQS | |||
|
|||
#### Docker images | |||
|
|||
Some packages depends on some docker images. To build them you'll need to have Hathor VPN access configured, check this [link](https://github.com/HathorNetwork/ops-tools/blob/master/terraform/wireguard-vpn/SOP.md#adding-a-new-client-to-the-vpn) for it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which ones?
@@ -1,5 +1,6 @@ | |||
{ | |||
"compilerOptions": { | |||
"composite": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for?
@@ -5,9 +5,26 @@ | |||
* LICENSE file in the root directory of this source tree. | |||
*/ | |||
|
|||
import { constants } from '@hathor/wallet-lib'; | |||
import { constants } from "@hathor/wallet-lib"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
export enum TokenInfoVersion { | ||
DEPOSIT = 1, | ||
FEE = 2 | ||
} | ||
|
||
export interface ITokenInfo { | ||
id: string; | ||
name: string; | ||
symbol: string; | ||
version?: TokenInfoVersion | null; | ||
} | ||
|
||
export interface ITokenInfoOptions extends ITokenInfo { | ||
transactions?: number | ||
} | ||
|
||
export class TokenInfo implements ITokenInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have those types in the wallet-lib?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm introducing them in a new PR that should be merged before this.
The types we have there: TokenInfoVersion, ITokenInfo (With a different name)
"node": ">=18" | ||
"node": ">=20" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should upgrade to 22, since the current lib version already requires node 22
@@ -119,6 +119,7 @@ export interface TokenInformationRow extends RowDataPacket { | |||
name: string; | |||
symbol: string; | |||
transactions: number; | |||
version?: number | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why null?
async up(queryInterface, Sequelize) { | ||
queryInterface.addColumn("token", "version", { | ||
type: Sequelize.INTEGER, | ||
allowNull: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why allow null?
We could create the column with a default value of 0 (or whatever value the tokenVersion.DEPOSIT
is) so that all "current listed" tokens will be marked as DBTs (Deposit Based Token).
What do you think?
Motivation
This PR is part of the Dynamic transaction model implementation.
According to the docs, tokens can be created with two versions:
The
wallet-service
is used bywallet-lib
, a project that expect theversion
field to be available on thegetTokenDetails
API.Acceptance Criteria
TokenInfo
entity to handle theversion
getTokenInformation
API method.Checklist
master
, confirm this code is production-ready and can be included in future releases as soon as it gets merged