Skip to content

Latest commit

 

History

History
17 lines (9 loc) · 9.41 KB

technical-overview.md

File metadata and controls

17 lines (9 loc) · 9.41 KB

Technical Overview

Context Level

OWallet-Context

Core Components Level

OWallet-Components

On-chain History Backend Design

OWallet-HistoryBackend

Structure

PackagesFunction
analyticsThis package is used to analyze user actions by logging event , page view,... Nothing much about it
backgroundThis 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/chainsUsed to handle messages related to the chain, such as: handleSuggestChainInfoMsg, handleRemoveSuggestedChainInfoMsg,..
background/interactionUsed to handle messages related to user interaction, such as: handleApproveInteractionMsg, handleRejectInteractionMsg
background/keyringUsed to handle messages related to the keyring,mnemonic, private key/public key and signing request, such as: CreatePrivateKeyMsg, UnlockKeyRingMsg, RequestSignAminoMsg, RequestSignEthereumMsg, CreateLedgerKeyMsg,...
background/ledgerUsed to handle messages related to the ledger service, such as: getPublicKey, initLedger,..
background/permissionUsed to handle messages related to the permission and access, such as: handleEnableAccessMsg, handleGetPermissionOriginsMsg,..
background/persistent-memoryUsed to handle messages related to the persistent memory, such as: handleSetPersistentMemoryMsg
background/secret-wasmUsed to handle messages related to the secret-wasm, such as: handleGetPubkeyMsg,handleReqeustEncryptMsg, handleRequestDecryptMsg..
background/tokensUsed to handle messages related to the tokens managerment such as: handleGetTokensMsg,handleSuggestTokenMsg, handleAddTokenMsg..
background/txUsed to handle messages related to the transaction, such as: sendTx ,processTxResultNotification
background/updaterUsed to handle messages related to the chain update, such as: handleTryUpdateChainMsg
background/utilsUsed to contain helper functions of background
bitcoinThis package contain helper function for BTC
commonThis package is used to handle common function like fetchTx, helper function,..
common/apiUsed to contain common functions related to api, includes api utils and api services
common/axiosUsed to contain common functions related to axios package, like fetchAdapter, getResponse, createError, createRequest
common/denomUsed to contain common functions related to denom, like DenomHelper
common/escapeUsed to contain common functions related to escape html
common/jsonUsed to contain common functions related to json, like sortObjectByKey, sortedJsonByKeyStringify
common/kv-storeUsed to contain common functions related to kv store, like get/set
common/mobxUsed to contain common functions related to mobx
common/txUsed to contain common functions related to transaction, like fetchTx, fetchTxPoll
common/ui-configUsed to contain common functions related to ui configuration
common/niversal-swapUsed to contain common functions related to universal swap feature, like getTransferTokenFee, getSwapToken, getTokenOnSpecificChainId,...
common/web3Used to create Web3Provider
common/utilsUsed to contain other common functions, mostly about bigInt/amount formatting
cosmosThis package is used to handle cosmos function
cosmos/accountUsed to contain BaseAccount class, which have basic info about cosmos account like address, account number, sequence
cosmos/adr-36Used to contain functions related to ADR36AminoSignDoc, like checkAndValidateADR36AminoSignDoc, makeADR36AminoSignDoc, verifyADR36Amino
cosmos/bech32Used to contain functions related to bech32 address, like shortenAddress,toBech32,...
cosmos/chain-idUsed to contain functions related to chain id, like EthermintChainIdHelper,parse,...
cosmos/signingUsed to contain functions related to encode signature and pubkey, like encodeSecp256k1Signature,...
cosmos/stargateUsed to contain functions related to stargate, like ProtoCodec,ProtoSignDocDecoder,SignDocWrapper...
cosmos/tx-tracerUsed to contain functions related to transaction tracer, like sendSubscribeBlockRpc,subscribeMsgByAddress,...
cryptoThis package is used to generate wallet,encrypt/decrypt,...
crypto/mnemonicUsed to contain functions related to mnemonic, like generateWallet,validateMnemonic,generateWalletFromMnemonic...
crypto/hashUsed to contain functions related to hash function, like keccak256,truncHashPortion...
crypto/keyUsed to contain functions related to private key and pubkey,includes PrivKeySecp256k1 class and PubKeySecp256k1 class
ensThis package is used to handle ens, like isValidENS, fetchResolverAddress,...
hooksThis package is used to contain common hooks
hooks/address-bookUsed to contain hook related to address book, like useAddressBookConfig
hooks/ibcUsed to contain hook related to ibc, like useIBCAmountConfig, useIBCTransferGasConfig, useIBCTransferConfig,...
hooks/interactionUsed to contain hook related to Interaction info, like useInteractionInfo
hooks/registerUsed to contain hook related to register, like useRegisterConfig
hooks/txUsed to contain hook related to transaction, like useFeeEvmConfig, useGasEvmConfig, useGasConfig, useAmountConfig,...
hooks/universal-swapUsed to contain hook related to universal swap, like useCoinGeckoPrices, useRelayerFee, useTaxRate,...
hooks/sign-docUsed to contain hook related to sign doc, like useSignDocAmountConfig
providerThis package provides functions for dApps to communicate with the background
provider/coreUsed 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/cosmjsUsed to contain cosmjs function, like CosmJSOfflineSignerOnlyAmino class,CosmJSOfflineSigner class,signAmino,signDirect,...
provider/enigmaUsed to contain engma utils function, like getEnigmaPubKey, enigmaEncrypt, enigmaDecrypt,...
provider/injectUsed to create injector, and handle message of dApps like a proxy
provider/msgsUsed to create provider messages
routerThis package is used to routing app message bettween provider and background
router-extensionSame with router, but more specified for extension
router-mockRouter mockup
mobileThis package contain mobile app code
extensionThis package contain extension app code
storesThis 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/accountAccount 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/chainChain store, used to handle and store all the functions and property related to chain, like setChainInfo, findCurrency,..
stores/commonUsed to contain common utils functions of store
stores/coreUsed to contain core functions of store
stores/ibcUsed to contain function of ibc store, like channel, currency-registrar
stores/priceUsed to contain price store functions and property
stores/queryUsed to contain query store functions and property, like ObservableQueryAccount, ObservableQueryBalanceNative,...
typesThis package contain project all kind of types
unitThis package contain project unit helper function, like CoinPretty, DecUtils, PricePretty
proto-typesFor generate package proto types
wc-client & wc-qrcode-modalFor wallet connect(not implemented yet)