65 lines
2.4 KiB
JavaScript
65 lines
2.4 KiB
JavaScript
System.register(["__unresolved_0", "cc", "web3/dist/web3.min.js"], function (_export, _context) {
|
|
"use strict";
|
|
|
|
var _reporterNs, _cclegacy, Web3, _crd, web3;
|
|
|
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
|
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
|
|
function createNft(_x) {
|
|
return _createNft.apply(this, arguments);
|
|
}
|
|
|
|
function _createNft() {
|
|
_createNft = _asyncToGenerator(function* (params) {
|
|
if (params.toAddress === "" || params.toAddress === null || params.toAddress === undefined) {
|
|
params.toAddress = web3.eth.defaultAccount;
|
|
}
|
|
|
|
var contract = new web3.eth.Contract(eval("(" + params.abi + ")"), params.address);
|
|
yield contract.methods.Mint(params.toAddress, params.token_id).send({
|
|
from: web3.eth.defaultAccount
|
|
}), function (error, transactionHash) {
|
|
if (!error) {
|
|
return transactionHash;
|
|
} else {
|
|
console.log(error);
|
|
}
|
|
};
|
|
});
|
|
return _createNft.apply(this, arguments);
|
|
}
|
|
|
|
function _reportPossibleCrUseOfWeb(extras) {
|
|
_reporterNs.report("Web3", "web3/dist/web3.min.js", _context.meta, extras);
|
|
}
|
|
|
|
_export("createNft", createNft);
|
|
|
|
return {
|
|
setters: [function (_unresolved_) {
|
|
_reporterNs = _unresolved_;
|
|
}, function (_cc) {
|
|
_cclegacy = _cc.cclegacy;
|
|
}, function (_web3DistWeb3MinJs) {
|
|
Web3 = _web3DistWeb3MinJs.default;
|
|
}],
|
|
execute: function () {
|
|
_crd = true;
|
|
|
|
_cclegacy._RF.push({}, "2741axHfMlDUbRCZMaHJZxs", "web3", undefined);
|
|
|
|
_export("web3", web3 = new (_crd && Web3 === void 0 ? (_reportPossibleCrUseOfWeb({
|
|
error: Error()
|
|
}), Web3) : Web3)((_crd && Web3 === void 0 ? (_reportPossibleCrUseOfWeb({
|
|
error: Error()
|
|
}), Web3) : Web3).givenProvider));
|
|
|
|
_cclegacy._RF.pop();
|
|
|
|
_crd = false;
|
|
}
|
|
};
|
|
});
|
|
//# sourceMappingURL=6d28fddc7895c9edaa543d94124191a6fb8a6c9b.js.map
|