skalenetwork / metaport

Metaport is simple JS/TS IMA widget
https://metaport-gamma.vercel.app
GNU Lesser General Public License v3.0
5 stars 7 forks source link

Restructure metaport config, drop dynamic token lookup, replace persistent Metamask connection #168

Closed dmytrotkk closed 12 months ago

dmytrotkk commented 1 year ago

The current Metaport config structure doesn't allow us to add complex routes (e.g. Mainnet -> Europa -> Calypso)

Changes that should be made:

  1. Drop dynamic token lookup, and list all token mappings in the config
  2. Develop a new config structure that will allow routed requests
  3. Drop persistent Metamask connection for a source chain, use only to send TXs instead

These changes will drastically simplify internal architecture, speed up Metaport usage and allow routed transfers in the Sandbox mode.

dmytrotkk commented 1 year ago

Proposed config structure:

{
  "skaleNetwork": "mainnet",
  "autoLookup": true,
  "openButton": true,
  "chains": [
    "mainnet",
    "elated-tan-skat",
    "honorable-steel-rasalhague"
  ],
  "tokens": {
    "mainnet": {
      "eth": {
        "chains": [
          "elated-tan-skat",
          "adorable-quaint-bellatrix"
        ]
      },
      "erc20": {
        "_SKL_0x00c83aeCC790e8a4453e5dD3B0B4b3680501a7A7": {
          "address": "0x00c83aeCC790e8a4453e5dD3B0B4b3680501a7A7",
          "cloneAddress": "0xE0595a049d02b7674572b0d59cd4880Db60EDC50",
          "decimals": "18",
          "name": "SKALE",
          "symbol": "SKL",
          "chains": {
            "elated-tan-skat": {
              "type": "direct"
            },
            "honorable-steel-rasalhague": {
              "type": "routed",
              "hub": "elated-tan-skat",
              "tokenKeyname": "_SKL_0xD162bB5c75FE99144295b03510bAb2DF99617440",
              "tokenType": "erc20"
            }
          }
        }
      }
    },
    "elated-tan-skat": {
      "erc20": {
        "_SKL_0xD162bB5c75FE99144295b03510bAb2DF99617440": {
          "address": "0xD162bB5c75FE99144295b03510bAb2DF99617440",
          "cloneAddress": "0x4048C4dd6eccF1Dc23b068211fDf20AD19602e50",
          "decimals": "18",
          "name": "SKALE",
          "symbol": "SKL",
          "wraps": "0xE0595a049d02b7674572b0d59cd4880Db60EDC50",
          "chains": {
            "mainnet": {
              "type": "direct"
            },
            "honorable-steel-rasalhague": {
              "type": "direct"
            }
          }
        }
      }
    }
  },
  "theme": {
    "mode": "dark"
  }
}
yatsunastya commented 11 months ago

No QA status