Skip to content

Commit

Permalink
Merge pull request #16 from infinity-swap/revert-14-CPROD-1375-add-sn…
Browse files Browse the repository at this point in the history
…s-token-logo
  • Loading branch information
blutooth authored Dec 15, 2022
2 parents 509ef6f + a235a9c commit f85e576
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"name": "@infinityswapofficial/token-lists",
"version": "0.1.1",
"description": "InfinitySwap Token Lists specification",
"author": "InfinitySwap <support@infinityswap.one> (https://infinityswap.one)",
"author": {
"name": "InfinitySwap",
"email": "support@infinityswap.one",
"url": "https://infinityswap.one"
},
"type": "module",
"source": "src/index.ts",
"exports": {
Expand Down
9 changes: 2 additions & 7 deletions src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export interface TokenProperties {
tags?: string[];
index_canister?: string;
canisterInfo?: CanisterInfo;
logo?: string;
}

export type JsonnableToken = TokenProperties;
Expand Down Expand Up @@ -58,7 +57,6 @@ export class Token {
indexCanister?: Principal;
tags?: string[];
canisterInfo?: CanisterInfo;
logo?: string;

constructor(props: TokenProperties) {
this.id = Principal.fromText(props.id);
Expand All @@ -72,7 +70,6 @@ export class Token {
this.indexCanister = props.index_canister
? Principal.fromText(props.index_canister)
: undefined;
this.logo = props.logo;
}

get wasmHash() {
Expand Down Expand Up @@ -116,8 +113,7 @@ export class Token {
standard: this.standard,
tags: this.tags,
index_canister: this.indexCanister?.toText(),
canisterInfo: this.canisterInfo,
logo: this.logo
canisterInfo: this.canisterInfo
};
}
}
Expand Down Expand Up @@ -188,8 +184,7 @@ export class TokenList {
agent
});

const [snsMeta, snsTokenMeta] = await snsWrapper.metadata({});
tokenMeta.logo = snsMeta.logo[0];
const [, snsTokenMeta] = await snsWrapper.metadata({});
snsTokenMeta.forEach(([key, val]) => {
if (key.includes('decimals') && 'Nat' in val) {
tokenMeta.decimals = Number(val.Nat);
Expand Down

0 comments on commit f85e576

Please sign in to comment.