update js lib, add gold brick

This commit is contained in:
CounterFire2023 2023-12-26 16:32:45 +08:00
parent cdb2eb1099
commit 4b20687b1f
2 changed files with 98 additions and 46 deletions

File diff suppressed because one or more lines are too long

View File

@ -291,7 +291,7 @@ function exportWalletSecKey(funId, pass) {
* mint NFT * mint NFT
* @param {string} address: contract address of NFT * @param {string} address: contract address of NFT
* @param {string} tokenIds: token id of NFT, JSON string of string array * @param {string} tokenIds: token id of NFT, JSON string of string array
* @parsm {string} startTime: time of signature generation * @param {string} startTime: time of signature generation
* @param {string} saltNonce: nonce of signature * @param {string} saltNonce: nonce of signature
* @param {string} signature: signature * @param {string} signature: signature
* @param {string} estimate: 1: only estimate gas price * @param {string} estimate: 1: only estimate gas price
@ -764,6 +764,58 @@ function nftStakeInfo(funId, nft, tokenId) {
promiseCb(funId, jc.wallet.jcStandard.nftStakeInfo({ nft, tokenId })); promiseCb(funId, jc.wallet.jcStandard.nftStakeInfo({ nft, tokenId }));
} }
// end of staking // end of staking
// begin of gold bricks
/**
* mint Gold Bricks
* @param {string} address: contract address of NFT
* @param {string} tokenIds: token id of NFT, JSON string of string array
* @param {string} startTime: time of signature generation
* @param {string} saltNonce: nonce of signature
* @param {string} signature: signature
* @param {string} estimate: 1: only estimate gas price
*/
function mintBricks(funId, address, tokenIds, startTime, saltNonce, signature, estimate) {
tokenIds = JSON.parse(tokenIds);
estimate = (estimate || '0') | 0;
promiseCb(
funId,
jc.wallet.jcStandard.mintBricks({
address,
tokenIds,
startTime,
saltNonce,
signature,
estimate,
}),
(v) => JSON.stringify(v)
);
}
/**
* decompose Gold Bricks
* @param {string} address: contract address of NFT
* @param {string} tokenIds: token id of NFT, JSON string of string array
* @param {string} startTime: time of signature generation
* @param {string} saltNonce: nonce of signature
* @param {string} signature: signature
* @param {string} estimate: 1: only estimate gas price
*/
function decomposeBricks(funId, address, tokenIds, startTime, saltNonce, signature, estimate) {
tokenIds = JSON.parse(tokenIds);
estimate = (estimate || '0') | 0;
promiseCb(
funId,
jc.wallet.jcStandard.decomposeBricks({
address,
tokenIds,
startTime,
saltNonce,
signature,
estimate,
}),
(v) => JSON.stringify(v)
);
}
// end of gold bricks
/** /**
* delete account * delete account