Technical Overview

Context Level

Core Components Level

On-chain History Backend Design

Structure

PackagesFunction

analytics

This package is used to analyze user actions by logging event , page view,... Nothing much about it

background

This package is used to handle request of provider to sign, request public/private key,...This is one of the most important directories of the project.

background/chains

Used to handle messages related to the chain, such as: handleSuggestChainInfoMsg, handleRemoveSuggestedChainInfoMsg,..

background/interaction

Used to handle messages related to user interaction, such as: handleApproveInteractionMsg, handleRejectInteractionMsg

background/keyring

Used to handle messages related to the keyring,mnemonic, private key/public key and signing request, such as: CreatePrivateKeyMsg, UnlockKeyRingMsg, RequestSignAminoMsg, RequestSignEthereumMsg, CreateLedgerKeyMsg,...

background/ledger

Used to handle messages related to the ledger service, such as: getPublicKey, initLedger,..

background/permission

Used to handle messages related to the permission and access, such as: handleEnableAccessMsg, handleGetPermissionOriginsMsg,..

background/persistent-memory

Used to handle messages related to the persistent memory, such as: handleSetPersistentMemoryMsg

background/secret-wasm

Used to handle messages related to the secret-wasm, such as: handleGetPubkeyMsg,handleReqeustEncryptMsg, handleRequestDecryptMsg..

background/tokens

Used to handle messages related to the tokens managerment such as: handleGetTokensMsg,handleSuggestTokenMsg, handleAddTokenMsg..

background/tx

Used to handle messages related to the transaction, such as: sendTx ,processTxResultNotification

background/updater

Used to handle messages related to the chain update, such as: handleTryUpdateChainMsg

background/utils

Used to contain helper functions of background

bitcoin

This package contain helper function for BTC

common

This package is used to handle common function like fetchTx, helper function,..

common/api

Used to contain common functions related to api, includes api utils and api services

common/axios

Used to contain common functions related to axios package, like fetchAdapter, getResponse, createError, createRequest

common/denom

Used to contain common functions related to denom, like DenomHelper

common/escape

Used to contain common functions related to escape html

common/json

Used to contain common functions related to json, like sortObjectByKey, sortedJsonByKeyStringify

common/kv-store

Used to contain common functions related to kv store, like get/set

common/mobx

Used to contain common functions related to mobx

common/tx

Used to contain common functions related to transaction, like fetchTx, fetchTxPoll

common/ui-config

Used to contain common functions related to ui configuration

common/niversal-swap

Used to contain common functions related to universal swap feature, like getTransferTokenFee, getSwapToken, getTokenOnSpecificChainId,...

common/web3

Used to create Web3Provider

common/utils

Used to contain other common functions, mostly about bigInt/amount formatting

cosmos

This package is used to handle cosmos function

cosmos/account

Used to contain BaseAccount class, which have basic info about cosmos account like address, account number, sequence

cosmos/adr-36

Used to contain functions related to ADR36AminoSignDoc, like checkAndValidateADR36AminoSignDoc, makeADR36AminoSignDoc, verifyADR36Amino

cosmos/bech32

Used to contain functions related to bech32 address, like shortenAddress,toBech32,...

cosmos/chain-id

Used to contain functions related to chain id, like EthermintChainIdHelper,parse,...

cosmos/signing

Used to contain functions related to encode signature and pubkey, like encodeSecp256k1Signature,...

cosmos/stargate

Used to contain functions related to stargate, like ProtoCodec,ProtoSignDocDecoder,SignDocWrapper...

cosmos/tx-tracer

Used to contain functions related to transaction tracer, like sendSubscribeBlockRpc,subscribeMsgByAddress,...

crypto

This package is used to generate wallet,encrypt/decrypt,...

crypto/mnemonic

Used to contain functions related to mnemonic, like generateWallet,validateMnemonic,generateWalletFromMnemonic...

crypto/hash

Used to contain functions related to hash function, like keccak256,truncHashPortion...

crypto/key

Used to contain functions related to private key and pubkey,includes PrivKeySecp256k1 class and PubKeySecp256k1 class

ens

This package is used to handle ens, like isValidENS, fetchResolverAddress,...

hooks

This package is used to contain common hooks

hooks/address-book

Used to contain hook related to address book, like useAddressBookConfig

hooks/ibc

Used to contain hook related to ibc, like useIBCAmountConfig, useIBCTransferGasConfig, useIBCTransferConfig,...

hooks/interaction

Used to contain hook related to Interaction info, like useInteractionInfo

hooks/register

Used to contain hook related to register, like useRegisterConfig

hooks/tx

Used to contain hook related to transaction, like useFeeEvmConfig, useGasEvmConfig, useGasConfig, useAmountConfig,...

hooks/universal-swap

Used to contain hook related to universal swap, like useCoinGeckoPrices, useRelayerFee, useTaxRate,...

hooks/sign-doc

Used to contain hook related to sign doc, like useSignDocAmountConfig

provider

This package provides functions for dApps to communicate with the background

provider/core

Used to contain core functions of wallet injector, like OWallet signDirect, getOfflineSigner, suggestToken,... This is where we create all of the wallet instances that are injected into the dApps.

provider/cosmjs

Used to contain cosmjs function, like CosmJSOfflineSignerOnlyAmino class,CosmJSOfflineSigner class,signAmino,signDirect,...

provider/enigma

Used to contain engma utils function, like getEnigmaPubKey, enigmaEncrypt, enigmaDecrypt,...

provider/inject

Used to create injector, and handle message of dApps like a proxy

provider/msgs

Used to create provider messages

router

This package is used to routing app message bettween provider and background

router-extension

Same with router, but more specified for extension

router-mock

Router mockup

mobile

This package contain mobile app code

extension

This package contain extension app code

stores

This package is used to handle store function, includes update/add info chains, tokens, price, query,...Basically, it contain all the functions and property of account, query, chain,...etc that we need and interact with in the app.This is one of the most important directories of the project.

stores/account

Account store, used to handle and store all the functions and property related to account, like processSendToken, simulateTx,... it prepare data, create msg and send it into background

stores/chain

Chain store, used to handle and store all the functions and property related to chain, like setChainInfo, findCurrency,..

stores/common

Used to contain common utils functions of store

stores/core

Used to contain core functions of store

stores/ibc

Used to contain function of ibc store, like channel, currency-registrar

stores/price

Used to contain price store functions and property

stores/query

Used to contain query store functions and property, like ObservableQueryAccount, ObservableQueryBalanceNative,...

types

This package contain project all kind of types

unit

This package contain project unit helper function, like CoinPretty, DecUtils, PricePretty

proto-types

For generate package proto types

wc-client & wc-qrcode-modal

For wallet connect(not implemented yet)

Last updated