Skip to content
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 Akroma #19

Merged
merged 1 commit into from
Jul 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile.genericwallet
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 @@ -1287,6 +1290,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_POA 0
Expand All @@ -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];
Expand Down