@33cn/game-cashier-react
Advanced tools
Comparing version 1.9.11 to 1.9.12
@@ -20,10 +20,19 @@ /** | ||
* @export | ||
* @param {string} address | ||
* @param {number} amount | ||
* @param {string} contractAddr | ||
* @param {string} contractName | ||
* @param {boolean} isWithdraw | ||
* @param {boolean} needWithhold 是否需要代扣 | ||
* @param {string} gameNodeURL 游戏节点 | ||
* @param {string} address 手续费扣费地址 用户地址 needWithhold为false时生效 | ||
* @param {number} amount 转账金额 | ||
* @param {string} contractAddr 目标合约地址 | ||
* @param {string} contractName 目标合约名称 | ||
* @param {boolean} isWithdraw 是否是撤回 撤回时 币从目标合约地址转回到原合约地址 | ||
* @param {string} [withholdAddress] 代扣地址 needWithhold为true时生效 | ||
* @returns | ||
*/ | ||
export declare function transferBetweenContract(needWithhold: boolean, gameNodeURL: string, address: string, amount: number, contractAddr: string, contractName: string, isWithdraw: boolean, withholdAddress?: string): Promise<any>; | ||
/** | ||
* @description 从主链的coins转到paracross合约 | ||
* @param url 节点地址 主链地址 | ||
* @param amount 转账金额 | ||
* @param isWithdraw 是否撤回 不是撤回时:币从coins合约转向paracross合约 撤回时:币从paracross合约转向coins合约 | ||
*/ | ||
export declare function toParacross(url: string, amount: number, isWithdraw: boolean): Promise<any>; | ||
@@ -30,0 +39,0 @@ export declare function rechargeParaStep1(gameNodeURL: string, amount: number, address: string): Promise<any>; |
@@ -57,7 +57,10 @@ import * as tslib_1 from "tslib"; | ||
* @export | ||
* @param {string} address | ||
* @param {number} amount | ||
* @param {string} contractAddr | ||
* @param {string} contractName | ||
* @param {boolean} isWithdraw | ||
* @param {boolean} needWithhold 是否需要代扣 | ||
* @param {string} gameNodeURL 游戏节点 | ||
* @param {string} address 手续费扣费地址 用户地址 needWithhold为false时生效 | ||
* @param {number} amount 转账金额 | ||
* @param {string} contractAddr 目标合约地址 | ||
* @param {string} contractName 目标合约名称 | ||
* @param {boolean} isWithdraw 是否是撤回 撤回时 币从目标合约地址转回到原合约地址 | ||
* @param {string} [withholdAddress] 代扣地址 needWithhold为true时生效 | ||
* @returns | ||
@@ -84,2 +87,8 @@ */ | ||
} | ||
/** | ||
* @description 从主链的coins转到paracross合约 | ||
* @param url 节点地址 主链地址 | ||
* @param amount 转账金额 | ||
* @param isWithdraw 是否撤回 不是撤回时:币从coins合约转向paracross合约 撤回时:币从paracross合约转向coins合约 | ||
*/ | ||
export function toParacross(url, amount, isWithdraw) { | ||
@@ -93,2 +102,10 @@ return callPromiseAPI('CreateRawTransaction', { | ||
} | ||
/** | ||
* @description 从主链的paracross转到游戏链的paracross上 | ||
* @param {string} url 节点地址 平行链地址 | ||
* @param {string} address 用户地址 | ||
* @param {number} amount 转账金额 | ||
* @param {boolean} isWithdraw 是否撤回 | ||
* @returns | ||
*/ | ||
function paracrossAssetTransfer(url, address, amount, isWithdraw) { | ||
@@ -106,2 +123,9 @@ return callPromiseAPI('CreateTransaction', { | ||
} | ||
/** | ||
* @description 游戏链的paracross转到游戏链的trade合约 | ||
* @param {string} url 节点地址 平行链地址 | ||
* @param {number} amount 转账金额 | ||
* @param {boolean} isWithdraw 是否撤回 | ||
* @returns | ||
*/ | ||
function paracrossToTrade(url, amount, isWithdraw) { | ||
@@ -119,2 +143,8 @@ return callPromiseAPI('CreateTransaction', { | ||
} | ||
/** | ||
* @description 用bty购买游戏币 GBTY | ||
* @param {string} url 节点地址 平行链地址 | ||
* @param {number} amount 转账金额 | ||
* @returns | ||
*/ | ||
function sellParacross(url, amount) { | ||
@@ -126,2 +156,8 @@ return callPromiseAPI('', { | ||
} | ||
/** | ||
* @description 用游戏币GBTY购买bty | ||
* @param {string} url | ||
* @param {number} amount | ||
* @returns | ||
*/ | ||
function buyParacross(url, amount) { | ||
@@ -128,0 +164,0 @@ return callPromiseAPI('', { |
@@ -16,3 +16,3 @@ import * as tslib_1 from "tslib"; | ||
App.prototype.render = function () { | ||
return (React.createElement(Cashier, { coinName: "TSC", gameNodeURL: "http://39.100.69.229:8901", gameName: "\u5E78\u8FD0\u6570\u5B57", gameIcon: icontest, contractName: "user.p.tschain.user.wasm.dice", contractAddr: "1HCyoL1QPzc1FKTKi9oPfREZrszzHQUuHx", withholdAddress: 'user.p.tschain.none', dialogVisible: this.state.visible, noNeedPara: false, onClose: this.onClose, gameBalance: 10, coinsBalance: 12, onNewTransactionSend: this.onNewSended, needWithhold: false })); | ||
return (React.createElement(Cashier, { coinName: "GBTY", gameNodeURL: "http://47.98.245.85:8901", gameName: "\u5E78\u8FD0\u6570\u5B57", gameIcon: icontest, contractName: "user.p.game.user.wasm.lucky", contractAddr: "184tkVBLrp6gWbi274LBKYgkPsZq7tYHAP", dialogVisible: this.state.visible, noNeedPara: false, onClose: this.onClose, gameBalance: 10, coinsBalance: 12, onNewTransactionSend: this.onNewSended, needWithhold: false, withholdAddress: 'user.p.game.none' })); | ||
}; | ||
@@ -19,0 +19,0 @@ App.prototype.onClose = function () { |
@@ -181,2 +181,3 @@ import * as tslib_1 from "tslib"; | ||
.then(function (hash) { | ||
console.log('充值第二步', hash); | ||
_this.setState({ | ||
@@ -230,2 +231,3 @@ rechargeState: { | ||
.then(function (hash) { | ||
console.log('充值的第三步', hash); | ||
_this.setState({ | ||
@@ -232,0 +234,0 @@ rechargeState: { |
@@ -193,3 +193,3 @@ import * as tslib_1 from "tslib"; | ||
tx3 = _a.sent(); | ||
return [4 /*yield*/, signTx(tx3, 'user.p.game.none', '')]; | ||
return [4 /*yield*/, signTxGroup(tx3, this.props.withholdAddress)]; | ||
case 7: | ||
@@ -196,0 +196,0 @@ signedTx3 = _a.sent(); |
{ | ||
"name": "@33cn/game-cashier-react", | ||
"version": "1.9.11", | ||
"version": "1.9.12", | ||
"main": "lib/Cashier.js", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
619198
2676