From d1eb4ccc922430adae4d96a7087d821d8be6b22f Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Wed, 15 Jun 2022 12:07:14 +0200 Subject: [PATCH 1/5] okc --- makefile_conf/chain/okc.mk | 3 +++ src/chainConfig.h | 3 ++- src/main.c | 6 ++++++ src/tokens.c | 2 ++ src/tokens.h | 1 + 5 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 makefile_conf/chain/okc.mk diff --git a/makefile_conf/chain/okc.mk b/makefile_conf/chain/okc.mk new file mode 100644 index 0000000..d520276 --- /dev/null +++ b/makefile_conf/chain/okc.mk @@ -0,0 +1,3 @@ +APP_LOAD_PARAMS += --path "44'/60'" +DEFINES += CHAINID_UPCASE=\"OKC\" CHAINID_COINNAME=\"OKT\" CHAIN_KIND=CHAIN_KIND_OKC CHAIN_ID=66 +APPNAME = "OKXChain" \ No newline at end of file diff --git a/src/chainConfig.h b/src/chainConfig.h index 91aabe0..136fde4 100644 --- a/src/chainConfig.h +++ b/src/chainConfig.h @@ -63,7 +63,8 @@ typedef enum chain_kind_e { CHAIN_KIND_MOONBEAM, CHAIN_KIND_BTTC, CHAIN_KIND_KARDIACHAIN, - CHAIN_KIND_WETHIO + CHAIN_KIND_WETHIO, + CHAIN_KIND_OKC } chain_kind_t; typedef struct chain_config_s { diff --git a/src/main.c b/src/main.c index 0cd2025..0bbfaf5 100644 --- a/src/main.c +++ b/src/main.c @@ -284,6 +284,9 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) { case CHAIN_KIND_WETHIO: numTokens = NUM_TOKENS_WETHIO; break; + case CHAIN_KIND_OKC: + numTokens = NUM_TOKENS_OKC; + break; } for (i = 0; i < numTokens; i++) { switch (chainConfig->kind) { @@ -410,6 +413,9 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) { case CHAIN_KIND_WETHIO: currentToken = (tokenDefinition_t *) PIC(&TOKENS_WETHIO[i]); break; + case CHAIN_KIND_OKC: + currentToken = (tokenDefinition_t *) PIC(&TOKENS_OKC[i]); + break; } if (memcmp(currentToken->address, tmpContent.txContent.destination, ADDRESS_LENGTH) == 0) { return currentToken; diff --git a/src/tokens.c b/src/tokens.c index 0347ec4..0224135 100644 --- a/src/tokens.c +++ b/src/tokens.c @@ -204,4 +204,6 @@ const tokenDefinition_t const TOKENS_KARDIACHAIN[NUM_TOKENS_KARDIACHAIN] = {}; const tokenDefinition_t const TOKENS_WETHIO[NUM_TOKENS_WETHIO] = {}; +const tokenDefinition_t const TOKENS_OKC[NUM_TOKENS_OKC] = {}; + #endif diff --git a/src/tokens.h b/src/tokens.h index eb4a14e..2dbecf4 100644 --- a/src/tokens.h +++ b/src/tokens.h @@ -106,6 +106,7 @@ static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = { #define NUM_TOKENS_BTTC 0 #define NUM_TOKENS_KARDIACHAIN 0 #define NUM_TOKENS_WETHIO 0 +#define NUM_TOKENS_OKC 0 extern tokenDefinition_t const TOKENS_AKROMA[NUM_TOKENS_AKROMA]; extern tokenDefinition_t const TOKENS_ELLAISM[NUM_TOKENS_ELLAISM]; From 785cfdc2eaacc4a9bdacbc57fc075ac4d0f0536e Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Wed, 15 Jun 2022 13:32:50 +0200 Subject: [PATCH 2/5] cube --- makefile_conf/chain/cube.mk | 3 +++ src/chainConfig.h | 3 ++- src/main.c | 6 ++++++ src/tokens.c | 2 ++ src/tokens.h | 2 ++ src_common/network.c | 1 + 6 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 makefile_conf/chain/cube.mk diff --git a/makefile_conf/chain/cube.mk b/makefile_conf/chain/cube.mk new file mode 100644 index 0000000..6eff774 --- /dev/null +++ b/makefile_conf/chain/cube.mk @@ -0,0 +1,3 @@ +APP_LOAD_PARAMS += --path "44'/60'" +DEFINES += CHAINID_UPCASE=\"CUBE\" CHAINID_COINNAME=\"CUBE\" CHAIN_KIND=CHAIN_KIND_CUBE CHAIN_ID=1818 +APPNAME = "Cube" \ No newline at end of file diff --git a/src/chainConfig.h b/src/chainConfig.h index 136fde4..5cf3909 100644 --- a/src/chainConfig.h +++ b/src/chainConfig.h @@ -64,7 +64,8 @@ typedef enum chain_kind_e { CHAIN_KIND_BTTC, CHAIN_KIND_KARDIACHAIN, CHAIN_KIND_WETHIO, - CHAIN_KIND_OKC + CHAIN_KIND_OKC, + CHAIN_KIND_CUBE } chain_kind_t; typedef struct chain_config_s { diff --git a/src/main.c b/src/main.c index 0bbfaf5..1f3aa78 100644 --- a/src/main.c +++ b/src/main.c @@ -287,6 +287,9 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) { case CHAIN_KIND_OKC: numTokens = NUM_TOKENS_OKC; break; + case CHAIN_KIND_CUBE: + numTokens = NUM_TOKENS_CUBE; + break; } for (i = 0; i < numTokens; i++) { switch (chainConfig->kind) { @@ -416,6 +419,9 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) { case CHAIN_KIND_OKC: currentToken = (tokenDefinition_t *) PIC(&TOKENS_OKC[i]); break; + case CHAIN_KIND_CUBE: + currentToken = (tokenDefinition_t *) PIC(&TOKENS_CUBE[i]); + break; } if (memcmp(currentToken->address, tmpContent.txContent.destination, ADDRESS_LENGTH) == 0) { return currentToken; diff --git a/src/tokens.c b/src/tokens.c index 0224135..37f228a 100644 --- a/src/tokens.c +++ b/src/tokens.c @@ -206,4 +206,6 @@ const tokenDefinition_t const TOKENS_WETHIO[NUM_TOKENS_WETHIO] = {}; const tokenDefinition_t const TOKENS_OKC[NUM_TOKENS_OKC] = {}; +const tokenDefinition_t const TOKENS_CUBE[NUM_TOKENS_CUBE] = {}; + #endif diff --git a/src/tokens.h b/src/tokens.h index 2dbecf4..2ed3323 100644 --- a/src/tokens.h +++ b/src/tokens.h @@ -107,6 +107,7 @@ static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = { #define NUM_TOKENS_KARDIACHAIN 0 #define NUM_TOKENS_WETHIO 0 #define NUM_TOKENS_OKC 0 +#define NUM_TOKENS_CUBE 0 extern tokenDefinition_t const TOKENS_AKROMA[NUM_TOKENS_AKROMA]; extern tokenDefinition_t const TOKENS_ELLAISM[NUM_TOKENS_ELLAISM]; @@ -149,6 +150,7 @@ extern tokenDefinition_t const TOKENS_MOONBEAM[NUM_TOKENS_MOONBEAM]; extern tokenDefinition_t const TOKENS_BTTC[NUM_TOKENS_BTTC]; extern tokenDefinition_t const TOKENS_KARDIACHAIN[NUM_TOKENS_KARDIACHAIN]; extern tokenDefinition_t const TOKENS_WETHIO[NUM_TOKENS_WETHIO]; +extern tokenDefinition_t const TOKENS_CUBE[NUM_TOKENS_CUBE]; #endif /* HAVE_TOKENS_LIST */ diff --git a/src_common/network.c b/src_common/network.c index 392b7d5..376c5e6 100644 --- a/src_common/network.c +++ b/src_common/network.c @@ -25,6 +25,7 @@ const network_info_t NETWORK_MAPPING[] = { {.chain_id = 44787, .name = "Celo Alfajores", .ticker = "aCELO "}, {.chain_id = 62320, .name = "Celo Baklava", .ticker = "bCELO "}, {.chain_id = 11297108109, .name = "Palm Network", .ticker = "PALM "}}; + {.chain_id = 1818, .name = "Cube", .ticker = "CUBE "}, uint64_t get_chain_id(void) { uint64_t chain_id = 0; From ded57d628fa2ffaa248eb155ed9c1aeae7e74916 Mon Sep 17 00:00:00 2001 From: tjulien-ledger Date: Fri, 27 May 2022 15:32:37 +0200 Subject: [PATCH 3/5] adding okc icons and fix for cube --- icons/nanos_app_okc.gif | Bin 0 -> 74 bytes icons/nanox_app_okc.gif | Bin 0 -> 71 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 icons/nanos_app_okc.gif create mode 100644 icons/nanox_app_okc.gif diff --git a/icons/nanos_app_okc.gif b/icons/nanos_app_okc.gif new file mode 100644 index 0000000000000000000000000000000000000000..ef6b29c4d091633d4f42a8db1d9e74ba54a74f13 GIT binary patch literal 74 zcmZ?wbhEHb6krfwXkY+=|Ns9h{$v3&bwDIYhJi`3r+?+?wG4tR`tu@RZq3emZt12m VNme|e(`wP%>AN2JShF%%0|2sh6} Date: Tue, 7 Jun 2022 16:32:10 +0200 Subject: [PATCH 4/5] adding cube icons + network.c fix --- icons/nanos_app_cube.gif | Bin 0 -> 73 bytes icons/nanox_app_cube.gif | Bin 0 -> 70 bytes src_common/network.c | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 icons/nanos_app_cube.gif create mode 100644 icons/nanox_app_cube.gif diff --git a/icons/nanos_app_cube.gif b/icons/nanos_app_cube.gif new file mode 100644 index 0000000000000000000000000000000000000000..1e1d755abe3e4ea3e677c88ad051156c45f4747a GIT binary patch literal 73 zcmZ?wbhEHb6krfwXkY+=|Ns9h{$v3&bwDIYhJi_;r+?+?xAF~hLK-{X`EJSYOO)S{ T*`qn{UWVkGAjeNO;tbXR%+41i literal 0 HcmV?d00001 diff --git a/icons/nanox_app_cube.gif b/icons/nanox_app_cube.gif new file mode 100644 index 0000000000000000000000000000000000000000..912c760e594a722601a4bd8a257291f2cdba1035 GIT binary patch literal 70 zcmZ?wbhEHb literal 0 HcmV?d00001 diff --git a/src_common/network.c b/src_common/network.c index 376c5e6..29b2182 100644 --- a/src_common/network.c +++ b/src_common/network.c @@ -24,8 +24,8 @@ const network_info_t NETWORK_MAPPING[] = { {.chain_id = 43114, .name = "Avalanche", .ticker = "AVAX "}, {.chain_id = 44787, .name = "Celo Alfajores", .ticker = "aCELO "}, {.chain_id = 62320, .name = "Celo Baklava", .ticker = "bCELO "}, - {.chain_id = 11297108109, .name = "Palm Network", .ticker = "PALM "}}; - {.chain_id = 1818, .name = "Cube", .ticker = "CUBE "}, + {.chain_id = 11297108109, .name = "Palm Network", .ticker = "PALM "}, + {.chain_id = 1818, .name = "Cube", .ticker = "CUBE "}}; uint64_t get_chain_id(void) { uint64_t chain_id = 0; From b483804ff453395f57a6ec63d136d7590467e218 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Wed, 15 Jun 2022 13:33:40 +0200 Subject: [PATCH 5/5] adding astar&shiden --- icons/nanos_app_astar.gif | Bin 0 -> 100 bytes icons/nanos_app_shiden.gif | Bin 0 -> 95 bytes icons/nanox_app_astar.gif | Bin 0 -> 77 bytes icons/nanox_app_shiden.gif | Bin 0 -> 72 bytes makefile_conf/chain/astar.mk | 3 +++ makefile_conf/chain/shiden.mk | 3 +++ src/chainConfig.h | 4 +++- src/main.c | 12 ++++++++++++ src/tokens.c | 4 ++++ src/tokens.h | 4 ++++ src_common/network.c | 4 +++- 11 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 icons/nanos_app_astar.gif create mode 100644 icons/nanos_app_shiden.gif create mode 100644 icons/nanox_app_astar.gif create mode 100644 icons/nanox_app_shiden.gif create mode 100644 makefile_conf/chain/astar.mk create mode 100644 makefile_conf/chain/shiden.mk diff --git a/icons/nanos_app_astar.gif b/icons/nanos_app_astar.gif new file mode 100644 index 0000000000000000000000000000000000000000..d656968c04da929083d73ee442b276d1ee1ef21b GIT binary patch literal 100 zcmZ?wbhEHb6krfwXkcLY|NlP&1B2p!Za>$MU}whwS0g9P7F>dtc!FLRTfpB%kTMH%#&t^k{|b?8-g--GPz88UXNJ9Nz!{ literal 0 HcmV?d00001 diff --git a/icons/nanos_app_shiden.gif b/icons/nanos_app_shiden.gif new file mode 100644 index 0000000000000000000000000000000000000000..c3b91d475f6fe19b06bc9b40d9a087dd6924b3ee GIT binary patch literal 95 zcmZ?wbhEHb6krfwXkcLY|NlP&1B2p!Za>$MU}whwS0gP$p8QV literal 0 HcmV?d00001 diff --git a/icons/nanox_app_astar.gif b/icons/nanox_app_astar.gif new file mode 100644 index 0000000000000000000000000000000000000000..827e926ac00ff317e4065994b548feab555ffa62 GIT binary patch literal 77 zcmZ?wbhEHbkind) { @@ -422,6 +428,12 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) { case CHAIN_KIND_CUBE: currentToken = (tokenDefinition_t *) PIC(&TOKENS_CUBE[i]); break; + case CHAIN_KIND_SHIDEN: + currentToken = (tokenDefinition_t *) PIC(&TOKENS_SHIDEN[i]); + break; + case CHAIN_KIND_ASTAR: + currentToken = (tokenDefinition_t *) PIC(&TOKENS_ASTAR[i]); + break; } if (memcmp(currentToken->address, tmpContent.txContent.destination, ADDRESS_LENGTH) == 0) { return currentToken; diff --git a/src/tokens.c b/src/tokens.c index 37f228a..b26771c 100644 --- a/src/tokens.c +++ b/src/tokens.c @@ -208,4 +208,8 @@ const tokenDefinition_t const TOKENS_OKC[NUM_TOKENS_OKC] = {}; const tokenDefinition_t const TOKENS_CUBE[NUM_TOKENS_CUBE] = {}; +const tokenDefinition_t const TOKENS_ASTAR[NUM_TOKENS_ASTAR] = {}; + +const tokenDefinition_t const TOKENS_SHIDEN[NUM_TOKENS_SHIDEN] = {}; + #endif diff --git a/src/tokens.h b/src/tokens.h index 2ed3323..318edad 100644 --- a/src/tokens.h +++ b/src/tokens.h @@ -108,6 +108,8 @@ static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = { #define NUM_TOKENS_WETHIO 0 #define NUM_TOKENS_OKC 0 #define NUM_TOKENS_CUBE 0 +#define NUM_TOKENS_ASTAR 0 +#define NUM_TOKENS_SHIDEN 0 extern tokenDefinition_t const TOKENS_AKROMA[NUM_TOKENS_AKROMA]; extern tokenDefinition_t const TOKENS_ELLAISM[NUM_TOKENS_ELLAISM]; @@ -151,6 +153,8 @@ extern tokenDefinition_t const TOKENS_BTTC[NUM_TOKENS_BTTC]; extern tokenDefinition_t const TOKENS_KARDIACHAIN[NUM_TOKENS_KARDIACHAIN]; extern tokenDefinition_t const TOKENS_WETHIO[NUM_TOKENS_WETHIO]; extern tokenDefinition_t const TOKENS_CUBE[NUM_TOKENS_CUBE]; +extern tokenDefinition_t const TOKENS_ASTAR[NUM_TOKENS_ASTAR]; +extern tokenDefinition_t const TOKENS_SHIDEN[NUM_TOKENS_SHIDEN]; #endif /* HAVE_TOKENS_LIST */ diff --git a/src_common/network.c b/src_common/network.c index 29b2182..2d090b9 100644 --- a/src_common/network.c +++ b/src_common/network.c @@ -25,7 +25,9 @@ const network_info_t NETWORK_MAPPING[] = { {.chain_id = 44787, .name = "Celo Alfajores", .ticker = "aCELO "}, {.chain_id = 62320, .name = "Celo Baklava", .ticker = "bCELO "}, {.chain_id = 11297108109, .name = "Palm Network", .ticker = "PALM "}, - {.chain_id = 1818, .name = "Cube", .ticker = "CUBE "}}; + {.chain_id = 1818, .name = "Cube", .ticker = "CUBE "}, + {.chain_id = 336, .name = "Shiden", .ticker = "SDN "}, + {.chain_id = 592, .name = "Astar", .ticker = "ASTR "}}; uint64_t get_chain_id(void) { uint64_t chain_id = 0;