移除一些中文注释

This commit is contained in:
cebgcontract 2022-04-23 20:03:41 +08:00
parent 58e8eaff6d
commit 895b577151
7 changed files with 118 additions and 108 deletions

View File

@ -21,7 +21,6 @@ export const defaultUser: IUser = {
account: ''
}
/**
*
* @param data {account: string, token: string}
*/
export const getUserInfo = (data: any) =>

View File

@ -139,6 +139,13 @@ export default class ChainManager {
return balance
}
/**
* get amount of mystery boxes
* this method can get amount of general erc721 also
* @param {string} address
* @param {number} chainId
* @return {Promise<any>}
*/
public async getNftBalance(address: string, chainId: number) {
const coinInstance = await this.getInstance(address, chainId, MYSTERY_BOX_ABI)
const balance = await coinInstance.methods.balanceOf(AppModule.accountId).call()
@ -172,6 +179,15 @@ export default class ChainManager {
return nftId
}
/**
* Open one mystery box
* @param {string} address address of mystery box contract on current chain
* @param {string} boxId nftid of mystery box
* @param {number[]} tokenIds
* @param {string} nonce
* @param {string} signature
* @return {Promise<any>}
*/
public async openMysteryBox(
address: string,
boxId: string,
@ -184,7 +200,6 @@ export default class ChainManager {
return proxyInstance.methods.openBox(boxId, tokenIds, nonce, signature).send({ gas: 1000000 })
}
// 转账
public async transferToAccount({ to, amount, chainId, address } : {
to: string
amount: number

View File

@ -409,7 +409,6 @@ export class Blockchain {
}
/**
*
* @param {string} address
* @param {string | null} account
* @return {Promise<any>}
@ -420,7 +419,6 @@ export class Blockchain {
return await coinInstance.methods.balanceOf(account).call()
}
// 转账
public async transferToAccount(account: string, amount: number, address: string) {
const amountBN = this.web3.utils.toBN(this.web3.utils.toWei(amount + ''))
const coinInstance: any = await this.getContractInstance(address)

View File

@ -14,8 +14,8 @@
</el-slider>
</div>
<div class="modal-footer">
<button class="general-btn btn cancel-btn" @click="cancelSelect"></button>
<button class="general-btn btn confirm-btn" @click="confirmSelect"></button>
<button class="general-btn btn cancel-btn" @click="cancelSelect">Cancel</button>
<button class="general-btn btn confirm-btn" @click="confirmSelect">Confirm</button>
</div>
</div>
</div>

View File

@ -337,7 +337,6 @@ export default class WalletPanel extends Vue {
}
/**
* 获取用户选择的币的数量
* @param data
* @return {Promise<number>}
*/
@ -356,7 +355,7 @@ export default class WalletPanel extends Vue {
}
/**
* 查询token->game的订单
* query token->game
* @param {string} txhash
* @return {Promise<void>}
*/
@ -387,7 +386,7 @@ export default class WalletPanel extends Vue {
}
/**
* 查询token->game的订单
* query token->game
* @param {string} seqId
* @return {Promise<void>}
*/

View File

@ -5,7 +5,7 @@ export enum NftType{
}
/**
* 0:正常状态 1:出售中 2:出租中
* 0:Normal 1:Sell 2:Rent
*/
export enum NftState {
NORMAL = 0,
@ -34,7 +34,6 @@ export interface INftData{
level: number
job?: string
quality: number
// 所有者地址
owner?: string
state: NftState
mintTime: number

View File

@ -118,7 +118,7 @@ export default class Official extends Vue {
mounted() {
this.checkOrderHistory()
// if (process.env.NODE_ENV === 'development') {
window.showModal = this.showTestModal
// window.showModal = this.showTestModal
// }
}
@ -320,102 +320,102 @@ export default class Official extends Vue {
this.rewardModal.show()
}
showTestModal() {
const nftList = [{
token_id: '501007316659010037',
owner_address: '0x42448c6a38c08637218d8327b748f213fc2c0231',
owner_name: '',
item_id: '30600',
type: '1',
state: '0',
hide_attr: 1,
is_genesis: false,
image: 'https://www.cebg.games/res/avatars/30600.png',
currency_list: [],
transaction_recrod: [],
info:
{
name: 'Canoe',
attr: [],
job: 1,
level: 1,
quality: 1,
hp: 200,
speed: 6,
atk: 32,
def: 7,
advanced_count: 0,
lucky: 0,
success_rate: 0
},
mint_time: '1650529475'
},
{
token_id: '501007316776010040',
owner_address: '0x42448c6a38c08637218d8327b748f213fc2c0231',
owner_name: '',
item_id: '30100',
type: '1',
state: '0',
hide_attr: 1,
is_genesis: false,
image: 'https://www.cebg.games/res/avatars/30100.png',
currency_list: [],
transaction_recrod: [],
info:
{
name: 'Hill',
attr: [],
job: 1,
level: 1,
quality: 1,
hp: 195,
speed: 6,
atk: 35,
def: 6,
advanced_count: 0,
lucky: 0,
success_rate: 0
},
mint_time: '1650529592'
},
{
token_id: '501007319181010046',
owner_address: '0x42448c6a38c08637218d8327b748f213fc2c0231',
owner_name: '',
item_id: '30300',
type: '1',
state: '0',
hide_attr: 1,
is_genesis: true,
image: 'https://www.cebg.games/res/avatars/30300_1.png',
currency_list: [],
transaction_recrod: [],
info:
{
name: 'Aoi',
attr: [],
job: 3,
level: 1,
quality: 1,
hp: 120,
speed: 5,
atk: 20,
def: 10,
advanced_count: 0,
lucky: 0,
success_rate: 0
},
mint_time: '1650531993'
}]
const cardList: INftData[] = []
nftList.forEach(o => cardList.push(parseNftData(o)))
const data = {
title: 'Test data',
cardList
}
this.showRewardModal(data)
}
// showTestModal() {
// const nftList = [{
// token_id: '501007316659010037',
// owner_address: '0x42448c6a38c08637218d8327b748f213fc2c0231',
// owner_name: '',
// item_id: '30600',
// type: '1',
// state: '0',
// hide_attr: 1,
// is_genesis: false,
// image: 'https://www.cebg.games/res/avatars/30600.png',
// currency_list: [],
// transaction_recrod: [],
// info:
// {
// name: 'Canoe',
// attr: [],
// job: 1,
// level: 1,
// quality: 1,
// hp: 200,
// speed: 6,
// atk: 32,
// def: 7,
// advanced_count: 0,
// lucky: 0,
// success_rate: 0
// },
// mint_time: '1650529475'
// },
// {
// token_id: '501007316776010040',
// owner_address: '0x42448c6a38c08637218d8327b748f213fc2c0231',
// owner_name: '',
// item_id: '30100',
// type: '1',
// state: '0',
// hide_attr: 1,
// is_genesis: false,
// image: 'https://www.cebg.games/res/avatars/30100.png',
// currency_list: [],
// transaction_recrod: [],
// info:
// {
// name: 'Hill',
// attr: [],
// job: 1,
// level: 1,
// quality: 1,
// hp: 195,
// speed: 6,
// atk: 35,
// def: 6,
// advanced_count: 0,
// lucky: 0,
// success_rate: 0
// },
// mint_time: '1650529592'
// },
// {
// token_id: '501007319181010046',
// owner_address: '0x42448c6a38c08637218d8327b748f213fc2c0231',
// owner_name: '',
// item_id: '30300',
// type: '1',
// state: '0',
// hide_attr: 1,
// is_genesis: true,
// image: 'https://www.cebg.games/res/avatars/30300_1.png',
// currency_list: [],
// transaction_recrod: [],
// info:
// {
// name: 'Aoi',
// attr: [],
// job: 3,
// level: 1,
// quality: 1,
// hp: 120,
// speed: 5,
// atk: 20,
// def: 10,
// advanced_count: 0,
// lucky: 0,
// success_rate: 0
// },
// mint_time: '1650531993'
// }]
// const cardList: INftData[] = []
// nftList.forEach(o => cardList.push(parseNftData(o)))
// const data = {
// title: 'Test data',
// cardList
// }
// this.showRewardModal(data)
// }
toPage(pageNo: number) {
console.log('to page: ', pageNo)