-
Notifications
You must be signed in to change notification settings - Fork 982
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
Add support for symbols containing unicode chars #176
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -231,19 +231,33 @@ | |
"name": { | ||
"type": "string", | ||
"description": "The name of the token", | ||
"minLength": 1, | ||
"minLength": 0, | ||
"maxLength": 40, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zzmp btw, this limit isn't correct. You can have more than 40 chars and as far as I know there isn't a limit. This pair is one https://dexscreener.com/polygon/0x841120E51aD43EfE489244728532854A352073aD There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok thanks I lost all my devices and I was able to recover some databases now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok |
||
"pattern": "^[ \\w.'+\\-%/À-ÖØ-öø-ÿ:&\\[\\]\\(\\)]+$", | ||
"anyOf": [ | ||
{ | ||
"const": "" | ||
}, | ||
{ | ||
"pattern": "^[ \\S+]+$" | ||
} | ||
], | ||
"examples": [ | ||
"USD Coin" | ||
] | ||
}, | ||
"symbol": { | ||
alexandrebini marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"type": "string", | ||
"description": "The symbol for the token; must be alphanumeric", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ], |
||
"pattern": "^[a-zA-Z0-9+\\-%/$.]+$", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "examples": |
||
"minLength": 1, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. USD COIN |
||
"description": "The symbol for the token", | ||
"minLength": 0, | ||
"maxLength": 20, | ||
"anyOf": [ | ||
{ | ||
"const": "" | ||
}, | ||
{ | ||
"pattern": "^\\S+$" | ||
} | ||
], | ||
"examples": [ | ||
"USDC" | ||
] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "My Token List", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice |
||
"timestamp": "2020-06-12T00:00:00+00:00", | ||
"tokens": [ | ||
{ | ||
"chainId": 137, | ||
"address": "0xc31C535F4d9A789df0c16D461B4F811543b72FEb", | ||
"decimals": 0, | ||
"name": "", | ||
"symbol": "" | ||
}, | ||
{ | ||
"chainId": 137, | ||
"address": "0xF336f5624D34c3Be82eF3EFc4978bd2397B1524A", | ||
"decimals": 0, | ||
"name": "", | ||
"symbol": "" | ||
} | ||
], | ||
"version": { | ||
"major": 1, | ||
"minor": 0, | ||
"patch": 0 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import exampleNameSymbolSpecialCharacters from './schema/example-name-symbol-spe | |
import bigExampleList from './schema/bigexample.tokenlist.json'; | ||
import exampleListMinimum from './schema/exampleminimum.tokenlist.json'; | ||
import emptyList from './schema/empty.tokenlist.json'; | ||
import emptyNameSymbol from './schema/empty-name-symbol.tokenlist.json'; | ||
import bigWords from './schema/bigwords.tokenlist.json'; | ||
import invalidTokenAddress from './schema/invalidtokenaddress.tokenlist.json'; | ||
import invalidTimestamp from './schema/invalidtimestamp.tokenlist.json'; | ||
|
@@ -63,6 +64,10 @@ describe('schema', () => { | |
checkSchema(emptyList, false); | ||
}); | ||
|
||
it('works for empty names and symbols', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have many errors in the past I want to make amends |
||
checkSchema(emptyNameSymbol, true); | ||
}); | ||
|
||
it('fails with big names', () => { | ||
checkSchema(bigWords, false); | ||
}); | ||
|
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.
0
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.
Release coin