Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply link for arthera network #425

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions controllers/campaign.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1072,18 +1072,31 @@ exports.apply = async (req, res) => {
401,
'Wallet v2 not found'
)
cred = await unlockV2(req, res)

cred =
req.body.network === 'ARTHERA'
? await unlockArthera(req, res)
: await unlockV2(req, res)
let decryptAccount =
await cred.Web3BEP20.eth.accounts.wallet.decrypt(
[userWallet.walletV2.keystore],
req.body.pass
)

signature = await cred.Web3BEP20.eth.accounts.sign(
req.body.idPost + hash,
decryptAccount[0].privateKey
)
req.body.network === 'ARTHERA'
? await cred.Web3ARTHERA.eth.accounts.wallet.decrypt(
[userWallet.walletV2.keystore],
req.body.pass
)
: await cred.Web3BEP20.eth.accounts.wallet.decrypt(
[userWallet.walletV2.keystore],
req.body.pass
)

signature =
req.body.network === 'ARTHERA'
? await cred.Web3ARTHERA.eth.accounts.sign(
req.body.idPost + hash,
decryptAccount[0].privateKey
)
: await cred.Web3BEP20.eth.accounts.sign(
req.body.idPost + hash,
decryptAccount[0].privateKey
)
if (!cred) return
}

Expand Down
Loading