-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
51,248 additions
and
33,419 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,62 @@ | ||
package main | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/migratooor/tokenLists/generators/common/chains" | ||
"github.com/migratooor/tokenLists/generators/common/helpers" | ||
"github.com/migratooor/tokenLists/generators/common/models" | ||
"github.com/migratooor/tokenLists/generators/common/utils" | ||
) | ||
|
||
func handleInkypumpTokenList( | ||
chainID uint64, | ||
tokenAddresses []string, | ||
tokenIcons map[string]string, | ||
) []models.TokenListToken { | ||
tokenList := helpers.GetTokensFromAddressesWithIcons(chainID, tokenAddresses, tokenIcons) | ||
tokenList = append(tokenList, chains.CHAINS[chainID].Coin) | ||
return tokenList | ||
} | ||
|
||
func fetchInkypumpTokenList() []models.TokenListToken { | ||
type TInkypumpAPIResponse struct { | ||
Tokens []struct { | ||
Address string `json:"address"` | ||
IconURI string `json:"image_url"` | ||
Name string `json:"name"` | ||
Symbol string `json:"ticker"` | ||
FundingProgress float64 `json:"funding_progress"` | ||
} `json:"tokens"` | ||
TotalPages int `json:"totalPages"` | ||
TotalCount int `json:"totalCount"` | ||
} | ||
|
||
baseAPIEndpoint := `https://inkypump.com/api/tokens` | ||
tokenAddresses := []string{} | ||
tokenIcons := make(map[string]string) | ||
for i := 0; i < 40; i++ { | ||
nextPageURI := `?page=` + strconv.Itoa(i) + `&sortBy=mcap-high` | ||
response := helpers.FetchJSON[TInkypumpAPIResponse](baseAPIEndpoint + nextPageURI) | ||
for _, token := range response.Tokens { | ||
if token.FundingProgress >= 1.0 { | ||
tokenAddresses = append(tokenAddresses, token.Address) | ||
tokenIcons[utils.ToAddress(token.Address)] = token.IconURI | ||
} | ||
} | ||
if i >= response.TotalPages { | ||
break | ||
} | ||
} | ||
return handleInkypumpTokenList(57073, tokenAddresses, tokenIcons) | ||
} | ||
|
||
func buildInkypumpTokenList() { | ||
tokenList := helpers.LoadTokenListFromJsonFile(`inkypump.json`) | ||
tokenList.Name = `Inkypump` | ||
tokenList.LogoURI = `https://assets.smold.app/api/chain/57073/logo-128.png` | ||
tokenList.Keywords = []string{`inkypump`, `launcher`} | ||
tokens := []models.TokenListToken{} | ||
tokens = append(tokens, fetchInkypumpTokenList()...) | ||
helpers.SaveTokenListInJsonFile(tokenList, tokens, `inkypump.json`, helpers.SavingMethodStandard) | ||
} |
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,32 @@ | ||
package chains | ||
|
||
import ( | ||
"math" | ||
|
||
"github.com/migratooor/tokenLists/generators/common/models" | ||
) | ||
|
||
var INK = TChain{ | ||
ID: 57073, | ||
Name: `Ink`, | ||
Type: `EVM`, | ||
LogoURI: `https://assets.smold.app/chains/57073/logo-128.png`, | ||
IsTestNet: false, | ||
RpcURI: `https://rpc-gel.inkonchain.com`, | ||
MaxBlockRange: 100_000_000, | ||
MaxBatchSize: math.MaxInt64, | ||
WeightRatio: 0.0, | ||
MulticallContract: TContractData{ | ||
Address: `0xca11bde05977b3631167028862be2a173976ca11`, | ||
Block: 0, | ||
}, | ||
Coin: models.TokenListToken{ | ||
Address: `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE`, | ||
Name: `Ethereum`, | ||
Symbol: `ETH`, | ||
LogoURI: `https://assets.smold.app/api/token/57073/0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE/logo-128.png`, | ||
ChainID: 57073, | ||
Decimals: 18, | ||
}, | ||
IgnoredTokens: []string{}, | ||
} |
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.