requestNetwork icon indicating copy to clipboard operation
requestNetwork copied to clipboard

feat: improve currency typing

Open benjlevesque opened this issue 3 years ago • 0 comments

This change allows 2 things:

  • using more specific types, like ERC20Currency:
const method = (c: ERC20Currency) => c;
if (curr.type === 'ERC20') {
  method(curr);
}
  • simplify the use of network:
if(curr.type === 'ISO4217'){
  // type: undefined
  curr.network
} else{
  // type: string
  curr.network
}

benjlevesque avatar Apr 18 '22 14:04 benjlevesque