DappStoreWallet.js
Getting Started
Installation for HTML/JS Projects
<script src="https://www.dapp.com/js/DappStoreWallet.js" type="module"></script>
Using DappStoreWallet.js
Connecting to DappStoreWallet & Get Identity
// Open a window for user to authorization log in
 window.DappStoreWallet.connect(CLIENT_ID, CLIENT_SECRET).then(connected => {
  if(connected){
    // Get User Account Info
    window.DappStoreWallet.getIdentity().then(walltes => {
        console.log(walltes) 
    })
  }
})
Transfer & Withdraw
// Transfer to a contract or eos account
window.DappStoreWallet.transfer(TO_ADDRESS,'0.1000 EOS', MEMO).then(trx_id => {
    console.log(trx_id)
})
// Withdraw
window.DappStoreWallet.withdraw(TO_ADDRESS,'0.1000 EOS', MEMO).then(trx_id => {
    console.log(trx_id)
})
Manage CPU/NET/RAM
// Stake CPU
window.DappStoreWallet.stake_cpu('0.1000 EOS').then(trx_id => {
    console.log(trx_id)
})

// Reclaim CPU
window.DappStoreWallet.reclaim_cpu('0.1000 EOS').then(trx_id => {
    console.log(trx_id)
})

// Stake NET
window.DappStoreWallet.stake_net('0.1000 EOS').then(trx_id => {
    console.log(trx_id)
})

// Reclaim NET
window.DappStoreWallet.reclaim_net('0.1000 EOS').then(trx_id => {
    console.log(trx_id)
})

// Buy RAM
window.DappStoreWallet.buy_ram('0.1000 EOS').then(trx_id => {
    console.log(trx_id)
})

// Sell RAM
window.DappStoreWallet.sell_ram('2').then(trx_id => {
    console.log(trx_id)
})

Push Transcation
 let transaction = {
   "actions": [{
     "account": "eosio.token",
     "name": "transfer",
     "authorization": [{
       "actor": "dappcomdnjot",
       "permission": "active"
       }],
       "data": {
         "from": "account_from",
         "to": "account_to",
         "quantity": "0.0001 EOS",
         "memo": "Test",
         "transfer": false
         }
      }],
  "action": "push_transaction"
}


window.DappStoreWallet.push_transaction(TRANSACTION).then(trx_id => {
  console.log(trx_id)
})
Request Arbitrary Signature
// Data: Any Message
window.DappStoreWallet.request_arbitrary_signature(DATA).then(signature => {
    console.log(signature)
})
Multi-sign Funtion (Pay the CPU/NET fee for the user)
Step 1: Build original actions
args = {
    "from": user,
    "to": contract,
    "quantity": "1.0000 EOS",
    "memo": "test payforcpu",
}
call abi_json_to_bin to get binargs
binargs = abi_json_to_bin("eosio.token", "transfer", args)

actions = [
    {
        "data": binargs,
        "account": "eosio.token",
        "name": "transfer",
        "authorization": [{
            "actor": user,
            "permission": "active",
        }],
    }
]
Step 2: Prepend action
actions = [
    {
        "account": payer,
        "name": "payforcpu",
        "authorization": [
            {
                "actor": payer,
                "permission": "active"
            }
        ],
        "data": ""
    },
    {
        "account": "eosio.token",
        "name": "transfer",
        "authorization": [{
            "actor": user,
            "permission": "active",
        }],
        "data": binargs
    }
]
Step 3: Sign it with payer_private_key (on dapp's backend)
tx = {
    "actions": actions
}

trx = sign(tx, payer, payer_private_key)

example:

trx = {
    "compression": "none",
    "transaction": {
        "expiration": "2020-01-16T10:41:13.440494+00:00",
        "ref_block_num": 30542,
        "ref_block_prefix": 4260131359,
        "net_usage_words": 0,
        "max_cpu_usage_ms": 0,
        "delay_sec": 0,
        "context_free_actions": [],
        "actions": [
            {
                "account": payer,
                "name": "payforcpu",
                "authorization": [
                    {
                        "actor": payer,
                        "permission": "active"
                    }
                ],
                "data": ""
            },
            {
                "account": "eosio.token",
                "name": "transfer",
                "authorization": [{
                    "actor": user,
                    "permission": "active",
                }],
                "data": binargs
            }
        ],
        "transaction_extensions": []
    },
    "signatures": [
        "SIG_K1_...",
    ]
}
Step 4: Send trx via DappStoreWallet.js
window.DappStoreWallet.multi_sign(TRX).then(trx_id => {
  console.log(trx_id)
})