Skip to content

Commit

Permalink
Merge pull request #19 from mkrufky/akroma
Browse files Browse the repository at this point in the history
Add support for Akroma
  • Loading branch information
Nicolas Bacca authored Jul 29, 2018
2 parents a17834d + 15cb3ce commit 4e76ef3
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile.genericwallet
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,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
Expand Down
Binary file added blue_app_akroma.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added glyphs/blue_badge_akroma.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added glyphs/nanos_badge_akroma.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added nanos_app_akroma.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src_genericwallet/chainConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions src_genericwallet/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1290,6 +1293,9 @@ void handleSign(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint16_t dataLength
for (i=0; i<numTokens; i++) {
tokenDefinition_t *currentToken = NULL;
switch(chainConfig->kind) {
case CHAIN_KIND_AKROMA:
currentToken = PIC(&TOKENS_AKROMA[i]);
break;
case CHAIN_KIND_ETHEREUM:
currentToken = PIC(&TOKENS_ETHEREUM[i]);
break;
Expand Down
2 changes: 2 additions & 0 deletions src_genericwallet/tokens.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 2 additions & 0 deletions src_genericwallet/tokens.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_PIRL 0
Expand All @@ -33,6 +34,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_PIRL[NUM_TOKENS_PIRL];
Expand Down

0 comments on commit 4e76ef3

Please sign in to comment.