From 15cb3cebeb65a7e82879d3c7009e4cce8f730555 Mon Sep 17 00:00:00 2001 From: Michael Ira Krufky Date: Sat, 28 Jul 2018 09:31:14 -0400 Subject: [PATCH] Add support for Akroma --- Makefile.genericwallet | 4 ++++ blue_app_akroma.gif | Bin 0 -> 3477 bytes glyphs/blue_badge_akroma.gif | Bin 0 -> 2260 bytes glyphs/nanos_badge_akroma.gif | Bin 0 -> 1331 bytes nanos_app_akroma.gif | Bin 0 -> 1337 bytes src_genericwallet/chainConfig.h | 1 + src_genericwallet/main.c | 6 ++++++ src_genericwallet/tokens.c | 2 ++ src_genericwallet/tokens.h | 2 ++ 9 files changed, 15 insertions(+) create mode 100644 blue_app_akroma.gif create mode 100644 glyphs/blue_badge_akroma.gif create mode 100644 glyphs/nanos_badge_akroma.gif create mode 100644 nanos_app_akroma.gif diff --git a/Makefile.genericwallet b/Makefile.genericwallet index 9ec6ed510..ab8ac7cc1 100755 --- a/Makefile.genericwallet +++ b/Makefile.genericwallet @@ -66,6 +66,10 @@ else ifeq ($(CHAIN),ubiq) APP_LOAD_PARAMS += --path "44'/108'" DEFINES += CHAINID_UPCASE=\"UBIQ\" CHAINID_COINNAME=\"UBQ\" CHAIN_KIND=CHAIN_KIND_UBIQ CHAIN_ID=8 APPNAME = "Ubiq" +else ifeq ($(CHAIN),akroma) +APP_LOAD_PARAMS += --path "44'/200625'" +DEFINES += CHAINID_UPCASE=\"AKA\" CHAINID_COINNAME=\"AKA\" CHAIN_KIND=CHAIN_KIND_AKROMA CHAIN_ID=200625 +APPNAME = "Akroma" else ifeq ($(CHAIN),wanchain) APP_LOAD_PARAMS += --path "44'/5718350'" DEFINES += CHAINID_UPCASE=\"WAN\" CHAINID_COINNAME=\"WAN\" CHAIN_KIND=CHAIN_KIND_WANCHAIN CHAIN_ID=1 diff --git a/blue_app_akroma.gif b/blue_app_akroma.gif new file mode 100644 index 0000000000000000000000000000000000000000..b1a656aafca6541494b106518e3037a17f5b1f10 GIT binary patch literal 3477 zcm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Q}VxuDIv!yO!U1$L+V>ddtl>En9ly4cA|H?KMlTUcBh4g;!p2`DK@0a`8nM zUeJI3g8B2#JNKNk&pPvr)921P?bO+)oP5%WC-n9D#aRW@i0lb>tB<51-L<*rCbk-G_7?JWW36z^R=bQxffQX>!{Et&_x-iBRBU(MY(NV*x`` zP5bXRp>f}R_TH<3tS9!|WB1*5-DT&UcHCk6@#D4|J7(LuZAOpUdaEr*Zn61@&4v#P zh3W@JlwZ82U=AL@(C~)2W0w`zq(%2sZ?D}#LGWspNEN^rv>Iabwl(+&IXA*q*Q1I_!wa6b_IvO#{UF=19B5Ma4Ej;`w&5O$kThaZ%wS$^=P@ z#wxNgr00TMRAh}IS+S;UP}M=UKn%L(3~0n%WRc~J0JF9);hOpeWsTatL~6>i*cmpc z(T!@ha)cWpSXMg_Z>l{EZQQsn?$BYSfBydK&p+1x{@bs={Jid`AAeZ;{deDf^YvF> ze)0L5&p!R+_Ss4iyy5!muD#~!fvc{(;_}NbU3|&K7hQP4 z`HL1Vn19~6^X8s2=j^l2Jmd7!X3v^=>M19mbYg$8ke`wBJ@*6$*;cmicr%kuK|}A= zjyrbxF-P|tb>y_EM@&g}Cl2pAtW!O7@*y3QCdS)i%7nIqTgS^SvDxrp z1W~_!MES*Q3g+MeB!)N6n_nETh{Zi@=NxPHEPV|>eO+!$BGI!dH?VTW~a5 literal 0 HcmV?d00001 diff --git a/src_genericwallet/chainConfig.h b/src_genericwallet/chainConfig.h index 5bf034a94..35d2f4081 100644 --- a/src_genericwallet/chainConfig.h +++ b/src_genericwallet/chainConfig.h @@ -5,6 +5,7 @@ #define CHAIN_CONFIG_H typedef enum chain_kind_e { + CHAIN_KIND_AKROMA, CHAIN_KIND_ETHEREUM, CHAIN_KIND_ETHEREUM_CLASSIC, CHAIN_KIND_EXPANSE, diff --git a/src_genericwallet/main.c b/src_genericwallet/main.c index b7d8fa09a..ef0fb0893 100644 --- a/src_genericwallet/main.c +++ b/src_genericwallet/main.c @@ -1259,6 +1259,9 @@ void handleSign(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint16_t dataLength if (tokenContext.provisioned) { uint32_t numTokens = 0; switch(chainConfig->kind) { + case CHAIN_KIND_AKROMA: + numTokens = NUM_TOKENS_AKROMA; + break; case CHAIN_KIND_ETHEREUM: numTokens = NUM_TOKENS_ETHEREUM; break; @@ -1287,6 +1290,9 @@ void handleSign(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint16_t dataLength for (i=0; ikind) { + case CHAIN_KIND_AKROMA: + currentToken = PIC(&TOKENS_AKROMA[i]); + break; case CHAIN_KIND_ETHEREUM: currentToken = PIC(&TOKENS_ETHEREUM[i]); break; diff --git a/src_genericwallet/tokens.c b/src_genericwallet/tokens.c index 1a869ed05..5951e913b 100644 --- a/src_genericwallet/tokens.c +++ b/src_genericwallet/tokens.c @@ -17,6 +17,8 @@ #include "tokens.h" +const tokenDefinition_t const TOKENS_AKROMA[NUM_TOKENS_AKROMA] = {}; + const tokenDefinition_t const TOKENS_ETHEREUM[NUM_TOKENS_ETHEREUM] = { {{0x4E,0x84,0xE9,0xe5,0xfb,0x0A,0x97,0x26,0x28,0xCf,0x45,0x68,0xc4,0x03,0x16,0x7E,0xF1,0xD4,0x04,0x31}, "$FFC ", 18}, {{0xa0,0x24,0xe8,0x05,0x7e,0xec,0x47,0x4a,0x9b,0x23,0x56,0x83,0x37,0x07,0xdd,0x05,0x79,0xe2,0x6e,0xf3}, "$FYX ", 18}, diff --git a/src_genericwallet/tokens.h b/src_genericwallet/tokens.h index 1066c3535..cb670d8e8 100644 --- a/src_genericwallet/tokens.h +++ b/src_genericwallet/tokens.h @@ -23,6 +23,7 @@ typedef struct tokenDefinition_t { uint8_t decimals; } tokenDefinition_t; +#define NUM_TOKENS_AKROMA 0 #define NUM_TOKENS_ETHEREUM 677 #define NUM_TOKENS_ETHEREUM_CLASSIC 0 #define NUM_TOKENS_POA 0 @@ -32,6 +33,7 @@ typedef struct tokenDefinition_t { #define NUM_TOKENS_WANCHAIN 0 #define NUM_TOKENS_KUSD 0 +extern tokenDefinition_t const TOKENS_AKROMA[NUM_TOKENS_AKROMA]; extern tokenDefinition_t const TOKENS_ETHEREUM[NUM_TOKENS_ETHEREUM]; extern tokenDefinition_t const TOKENS_ETHEREUM_CLASSIC[NUM_TOKENS_ETHEREUM_CLASSIC]; extern tokenDefinition_t const TOKENS_POA[NUM_TOKENS_POA];