Skip to main content

Deposit

On everPay, the wallet address of each blockchain corresponds to an everPay account. everPay account IDs correspond to the wallet address of the wallet on the corresponding blockchain. Users do not need to register an account with everPay. everPay currently supports all valid accounts for Ethereum and Arweave.

For example

  • Ethereum wallet 0x26361130d5d6E798E9319114643AF8c868412859 has the same account ID on everPay which would be 0x26361130d5d6E798E9319114643AF8c868412859
  • Arweave wallet 5NPqYBdIsIpJzPeYixuz7BEH_W7BEk_mb8HxBD3OHXo on everPay, the corresponding account ID would be 5NPqYBdIsIpJzPeYixuz7BEH_W7BEk_mb8HxBD3OHX

The act of depositing, i.e. make a blockchain transfer to the everPay DAO managed blockchain wallet address.

Example.

  • Ethereum wallet 0x26361130d5d6E798E9319114643AF8c868412859 transfers 0.1 USDT to everPay's multisignature contract on Ethereum, everPay's backend service monitors the entry and waits for 20 blocks to confirm it, i.e. it will mark the assets on the account which will increase the amount to 0.1 USDT on everPay.
  • Arweave wallet 5NPqYBdIsIpJzPeYixuz7BEH_W7BEk_mb8HxBD3OHXo transfers 0.1 AR to everPay's threshold signature wallet address on Arweave, everPay's backend service monitors the entry and waits for 20 blocks confirmations, i.e. it will mark the assets on the account which will increase the amount to 0.1 AR on everPay.

Fund your Ethereum account

Blockchain wallets like imToken / MetaMask

  1. via info API to get everPay's multi-signature contract address ethLocker on Ethereum.
  2. transfer the assets and the amount that you want to deposit to the ethLocker multi-signature contract address via blockchain wallet like imToken / MetaMask.
  3. wait for the transaction to be confirmed in 20 blocks.
  4. via balances API to get the assets information.

Via ethers.js

Pseudocode reference source: everpay-js src/lib/ethereum.ts#L14.

const transferAsync = async (ethConnectedSigner: Signer, {
symbol,
token,
from,
to,
value
}: TransferAsyncParams): Promise<EthereumTransaction> => {
let transactionResponse: EthereumTransaction
if (symbol.toLowerCase() === 'eth') {
const transactionRequest = {
from: from.toLowerCase(),
to: to?.toLowerCase(),
value
}
transactionResponse = await ethConnectedSigner.sendTransaction(transactionRequest)
} else {
const tokenID = getTokenAddrByChainType(token, ChainType.ethereum)
const erc20RW = new Contract(tokenID.toLowerCase(), erc20Abi, ethConnectedSigner)
transactionResponse = await erc20RW.transfer(to, value)
}
return transactionResponse
}

Via everpay-js

everpay-js is now an open-source package, integrated with ethers.js, developers do not need to care about Token decimals. It's very easy for developers to integrate and use.

To use everpay-js for top-ups, please refer to: everpay-js deposit.

Fund your Arweave account

Blockchain wallets such as ArConnect

  1. via info API to get everPay's gated signature managed wallet address arLocker on Arweave.
  2. transfer the assets and amount that you want to top up to the arLocker address, via a blockchain wallet like ArConnect.
  3. wait 20 blocks for the transaction to be confirmed.
  4. via balances API to get the assets information.

Via arweave.js

Pseudocode reference source: everpay-js src/lib/arweave.ts#L102.

const transferAsync = async (arJWK: ArJWK, {
to,
value
}: TransferAsyncParams): Promise<ArTransferResult> => {
const arweave = Arweave.init(options)

const transactionTransfer = await arweave.createTransaction({
target: to,
quantity: value.toString()
}, arJWK)
// Assigned the signature value directly to the original transaction.
await arweave.transactions.sign(transactionTransfer, arJWK)
const responseTransfer = await arweave.transactions.post(transactionTransfer)
return responseTransfer
}

Via everpay-js

everpay-js is now a packaged open source, integrated with ethers.js, developers do not need to care about Token decimals. It is very easy for developers to integrate and use.

To use everpay-js for top-ups, please refer to: everpay-js deposit.

everPay transaction

The everPay transaction to recharge is generated by the everPay backend service after detecting the receipt of assets at the everPay DAO managed wallet address. Schema will first be generated, then everPay will use the everPay signature wallet to sign it and submit it to everPay's server to mark the addition of assets to user's account.

This part of the everPay transaction to recharge does not require developers to generate and sign, developers can choose to skip it.

Schema

FieldDescription
tokenSymbolToken Symbol, AR,ETH,USDT,USDC etc.
action'mint' to deposit.
fromthe current everPay account ID that signed the transaction.
toThe address of the blockchain transfer wallet which the user made a deposit, i.e. the everPay account ID to be topped up.
amountThe amount of the deposit, type uint; decimals processing is required for setting, e.g. 0.1USDT, after USDT's decimals: 6 processing, it's 100000.
feeHandling fee, type uint, set with decimals, e.g. 0.1USDT, here it's 100000 after USDT's decimals: 6 processing.
feeRecipientReceive everPay account ID for handling fees, via info API interface to get.
nonceunix milliseconds.
tokenIDvia info API interface, must be consistent with the token id field corresponding to tokenSymbol.
chainTypechainType is the same as info API, the token chainType consistent.
chainIDchainID is the same as info API, the token chainID consistent.
dataBlockchain transfer transaction data for users to make top-up, different blockchain has different transfer transaction data.
versiontransaction version 'v1'.
info
  • action the everPay transaction for the recharge, with action specified as 'mint'.
  • to is specified as the everPay account ID of the recharge.
  • data everPay will take the original blockchain recharge details and use them as Schema data parameters for correlation and traceability.

Ethereum account top-up example

{
"tokenSymbol": "ETH",
"action": "mint",
"from": "0xa06b79E655Db7D7C3B3E7B2ccEEb068c3259d0C9",
"to": "0x98905d8B65A24bcE11D2915c9A5C526E62F80000",
"amount": "90000000000000000",
"fee": "0",
"feeRecipient": "0x6451eB7f668de69Fb4C943Db72bCF2A73DeeC6B1",
"nonce": 1627277080832,
"tokenID": "0x0000000000000000000000000000000000000000",
"chainType": "ethereum",
"chainID": "1",
"data": "{\"hash\": \"0x9fcfad3670edf887f3d42a48dfae82ec9c8689d2d8f5749099359b88042984dc\", \"nonce\": \"0xb\", \"blockHash\": \"0x3c40385cd619ec85981e129a3767128bcd21aaba2a0157e165380ef25af3b3e6\", \"blockNumber\": \"0xc4d666\", \"transactionIndex\": \"0x106\", \"from\": \"0x98905d8B65A24bcE11D2915c9A5C526E62F80000\", \"to\": \"0x38741A69785e84399Fcf7c5ad61D572f7EcB1dab\", \"value\": \"0x13fbe85edc90000\", \"gas\": \"0x587a\", \"gasPrice\": \"0x5d21dbfb3\", \"input\": \"0x\", \"r\": \"0x6b67df40d2509efbca5be9b95205d2844714f05f010c0de315efb13c37a712d0\", \"s\": \"0x5cd205e2cd0eea0011292d3fafa9475b138b2ff4947176bc94edc6e997b97179\", \"v\": \"0x25\"}",
"sig": "0xccf208efaf9a2359ecf50f518e345e92b8b260a1692bdacdfe805be6e9a49f1d1ebe821ebbde2cb42744422becb1c430e4f67d822df22d7c26c6de08417c5f9a1c"
}

Arweave account top-up example

{
"tokenSymbol": "AR",
"action": "mint",
"from": "0xa06b79E655Db7D7C3B3E7B2ccEEb068c3259d0C9",
"to": "4g-19C67-avcYzufcc4_ame3RNtCi12K9LDrkeXdwBA",
"amount": "500000000000000",
"fee": "0",
"feeRecipient": "0x6451eB7f668de69Fb4C943Db72bCF2A73DeeC6B1",
"nonce": 1627476994839,
"tokenID": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,0x4fadc7a98f2dc96510e42dd1a74141eeae0c1543",
"chainType": "arweave,ethereum",
"chainID": "0,1",
"data": "{\"format\": 2, \"id\": \"D3pYmLFViRQlDQW5_CJvAbFkPRgi_0MVrntkhFqBXv4\", \"last_tx\": \"EelSY8pa3ZXFUrtXVQmjh3xqkunr4zLj1iYNXQXSiwMn6r5lWXIxTTJalb75CT-e\", \"owner\": \"kqyojcylUXJ-zRZWCq0JsfB5Er7jZ8KIJdpu12xIiuD61WyAH0PZjGX-CeDjCDpdn2rz-5fywiSIhDelMSlLwRZlpMOX-wAR8sXVRlcjo9ybykNPJGSfuKjBvnkP7OyejvEm43pyGSpJWUMYZYDKDrZVTEnwz5bgiPRTPM8EIg8IJauibUrOVTJ9Fo3ffDVLo32P1H0gFMhI5eWn5z_UtXzmFLsxT8XUtWLdpF0aoe4LSoiBgw1BUnHKyX26L854HvULMGL9Onoy6qXMbzlJvUsmoqe8tjvgGlju4XvU0W8ec7ERXfUg9HnKPwC4Cz9U1kZT1JQMnU4S_RREoR9-UGWKWannAOjPB2rw4WMQklR8B-y5Z_hN4LbC5pAZeR-YBCqVc1aQhKYnXWYaVY_-TbHeqAk_befbgbrPrpc9pVlulUIIYdhj0G6QDThsJMUs0XcTjq3YH3_5w3Xzta6UW-wKrA00MfWASnjjMbN3zYfCFG9FQiW6DUaIQrSq-5Vdnb9n3QAMT4Uz5r0ifjbHF33fPxqkcEUD_HcdfuPnHqKcmhd_t-mc55g5Z9BKKGiOXv-H6Jq0vLahuYaZQwN4cxSyRHZNpzcFMwz-rQXeEqlFpoVvbj3xnysMAeuMgJFbS2GBMf2SftN6PDgnhpdh5EbdnL2jBlmBo6RumCcVgt8\", \"tags\": [{\"name\": \"U2lnbmluZy1DbGllbnQ\", \"value\": \"QXJDb25uZWN0\"}, {\"name\": \"U2lnbmluZy1DbGllbnQtVmVyc2lvbg\", \"value\": \"MC4zLjE\"}], \"target\": \"dH-_dwLlN86fitrFZzi86IVEEQFyYpTzWcqnFh460ys\", \"quantity\": \"500000000000000\", \"data\": \"\", \"data_size\": \"0\", \"data_tree\": [], \"data_root\": \"\", \"reward\": \"1602432\", \"signature\": \"OyTAe5I_uAquM4rr09Zt1YDCORyfzpVkL59lue84KcM44qIuR9nIotNM0VVJkXLLcu3nRz16zOTFKLVwpqxzppSARclXP6_VSas9UHjrfx5WiQrJO1aTq821vlwbw6uAnZcOGfcci0dLCtXscNNKJ1mmjnqaccxmwUlEdbvJm29R0fiN5_y8UDKWlSVMrqm391-Gac7MEBdXTO5Em5foIrESnOb0-mF2Gdk5XsQ62y-6k9lqKnK56ro2gMaSCHlGUNtnxdEsOHpmjJTzt9lL7i8CH2gxZYIWAkJbsrtto_0td2nMeeS-JwdxwMsE__19iKQ_8PGPWJ_gevLjHI7uvtaYxGGMxCB-Gq9yiuNl9J5g4SNd82MeWE6OR4k44tyH6uGYBBKn5VSZKs2q5KR20vYV9d2PaRODKPhleZ5VpzjRMWDlypD-s7yCysUPOqMRW87oZjMB69Xm1ouN-f-q6TlT6GeO6J9QfsuHo2g6KwiISsSaYkYbMbxmMF05Y1fodKMPBjSdNFtPJLpDtXJO-HmYcY7yzyhKEjOewqpOdGFWcCDMecv4wy16nkk1HRuKcz72-BzSHo_CNYmwYewDXkktSkD3vl4EKvB7AYlBFX9C5zNMq-px1kKgZN_B5-AQ1rYiHUSNRj7lhFwabQferAJ7AfnVRlo2K-olriWSSQQ\", \"targetChainType\": \"arweave\"}",
"sig": "0x2893bb0b2c5d743e656e66b2f76050166c062c369286d303a217b6ea00ea88fa1345683edd371d698b8cfaf8df7f60b19a16940e7349284b23521c1050cfb2ab1c"
}

Record queries

Developers can use the mintedTxByChainTxHash interface to query the everPay transaction recharge record based on the blockchain record ID of the recharge (e.g. txHash for ethereum), to confirm whether the recharge has been completed.