@taquito/taquito
Advanced tools
Comparing version 19.2.1 to 20.0.0-RC.0
@@ -74,2 +74,3 @@ "use strict"; | ||
Protocols["ProxfordY"] = "ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH"; | ||
Protocols["PtParisBQ"] = "PtParisBQscdCm6Cfow6ndeU6wKJyA3aV1j4D3gQBQMsTQyJCrz"; | ||
Protocols["ProtoALpha"] = "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"; | ||
@@ -113,2 +114,3 @@ })(Protocols || (exports.Protocols = Protocols = {})); | ||
ChainIds["OXFORDNET2"] = "NetXxWsskGahzQB"; | ||
ChainIds["PARISNET"] = "NetXo8SqH1c38SS"; | ||
})(ChainIds || (exports.ChainIds = ChainIds = {})); | ||
@@ -115,0 +117,0 @@ // A fixed fee reveal operation gasLimit accepted by both simulate and injection endpoint is between 1.2-5 times of actual gas consumption (3.5 fails occasionally with gas exhausted; 4 fails occasionally with fee too low) |
@@ -307,2 +307,108 @@ "use strict"; | ||
* | ||
* @description Stake a given amount for the source address | ||
* | ||
* @returns An operation handle with the result from the rpc node | ||
* | ||
* @param Stake pseudo-operation parameter | ||
*/ | ||
stake(params) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const sourceValidation = (0, utils_1.validateAddress)((_a = params.source) !== null && _a !== void 0 ? _a : ''); | ||
if (params.source && sourceValidation !== utils_1.ValidationResult.VALID) { | ||
throw new core_1.InvalidAddressError(params.source, (0, utils_1.invalidDetail)(sourceValidation)); | ||
} | ||
if (!params.to) { | ||
params.to = params.source; | ||
} | ||
if (params.to && params.to !== params.source) { | ||
throw new core_1.InvalidStakingAddressError(params.to); | ||
} | ||
if (params.amount < 0) { | ||
throw new core_1.InvalidAmountError(params.amount.toString()); | ||
} | ||
const publicKeyHash = yield this.signer.publicKeyHash(); | ||
const estimate = yield this.estimate(params, this.estimator.stake.bind(this.estimator)); | ||
const source = params.source || publicKeyHash; | ||
const prepared = yield this.prepare.stake(Object.assign(Object.assign({}, params), estimate)); | ||
const content = prepared.opOb.contents.find((op) => op.kind === rpc_1.OpKind.TRANSACTION); | ||
const opBytes = yield this.forge(prepared); | ||
const { hash, context, forgedBytes, opResponse } = yield this.signAndInject(opBytes); | ||
return new transaction_operation_1.TransactionOperation(hash, content, source, forgedBytes, opResponse, context); | ||
}); | ||
} | ||
/** | ||
* | ||
* @description Unstake the given amount. If "everything" is given as amount, unstakes everything from the staking balance. | ||
* Unstaked tez remains frozen for a set amount of cycles (the slashing period) after the operation. Once this period is over, | ||
* the operation "finalize unstake" must be called for the funds to appear in the liquid balance. | ||
* | ||
* @returns An operation handle with the result from the rpc node | ||
* | ||
* @param Unstake pseudo-operation parameter | ||
*/ | ||
unstake(params) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const sourceValidation = (0, utils_1.validateAddress)((_a = params.source) !== null && _a !== void 0 ? _a : ''); | ||
if (params.source && sourceValidation !== utils_1.ValidationResult.VALID) { | ||
throw new core_1.InvalidAddressError(params.source, (0, utils_1.invalidDetail)(sourceValidation)); | ||
} | ||
if (!params.to) { | ||
params.to = params.source; | ||
} | ||
if (params.to && params.to !== params.source) { | ||
throw new core_1.InvalidStakingAddressError(params.to); | ||
} | ||
if (params.amount < 0) { | ||
throw new core_1.InvalidAmountError(params.amount.toString()); | ||
} | ||
const publicKeyHash = yield this.signer.publicKeyHash(); | ||
const estimate = yield this.estimate(params, this.estimator.unstake.bind(this.estimator)); | ||
const source = params.source || publicKeyHash; | ||
const prepared = yield this.prepare.unstake(Object.assign(Object.assign({}, params), estimate)); | ||
const content = prepared.opOb.contents.find((op) => op.kind === rpc_1.OpKind.TRANSACTION); | ||
const opBytes = yield this.forge(prepared); | ||
const { hash, context, forgedBytes, opResponse } = yield this.signAndInject(opBytes); | ||
return new transaction_operation_1.TransactionOperation(hash, content, source, forgedBytes, opResponse, context); | ||
}); | ||
} | ||
/** | ||
* | ||
* @description Transfer all the finalizable unstaked funds of the source to their liquid balance | ||
* @returns An operation handle with the result from the rpc node | ||
* | ||
* @param Finalize_unstake pseudo-operation parameter | ||
*/ | ||
finalizeUnstake(params) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const sourceValidation = (0, utils_1.validateAddress)((_a = params.source) !== null && _a !== void 0 ? _a : ''); | ||
if (params.source && sourceValidation !== utils_1.ValidationResult.VALID) { | ||
throw new core_1.InvalidAddressError(params.source, (0, utils_1.invalidDetail)(sourceValidation)); | ||
} | ||
if (!params.to) { | ||
params.to = params.source; | ||
} | ||
if (params.to && params.to !== params.source) { | ||
throw new core_1.InvalidStakingAddressError(params.to); | ||
} | ||
if (!params.amount) { | ||
params.amount = 0; | ||
} | ||
if (params.amount !== undefined && params.amount > 0) { | ||
throw new core_1.InvalidFinalizeUnstakeAmountError('Amount must be 0 to finalize unstake.'); | ||
} | ||
const publicKeyHash = yield this.signer.publicKeyHash(); | ||
const estimate = yield this.estimate(params, this.estimator.finalizeUnstake.bind(this.estimator)); | ||
const source = params.source || publicKeyHash; | ||
const prepared = yield this.prepare.finalizeUnstake(Object.assign(Object.assign({}, params), estimate)); | ||
const content = prepared.opOb.contents.find((op) => op.kind === rpc_1.OpKind.TRANSACTION); | ||
const opBytes = yield this.forge(prepared); | ||
const { hash, context, forgedBytes, opResponse } = yield this.signAndInject(opBytes); | ||
return new transaction_operation_1.TransactionOperation(hash, content, source, forgedBytes, opResponse, context); | ||
}); | ||
} | ||
/** | ||
* | ||
* @description Transfer Tickets to a smart contract address | ||
@@ -309,0 +415,0 @@ * |
@@ -183,2 +183,116 @@ "use strict"; | ||
* | ||
* @description Estimate gasLimit, storageLimit and fees for an stake pseudo-operation | ||
* | ||
* @returns An estimation of gasLimit, storageLimit and fees for the operation | ||
* | ||
* @param Stake pseudo-operation parameter | ||
*/ | ||
stake(_a) { | ||
var _b; | ||
var { fee, storageLimit, gasLimit } = _a, rest = __rest(_a, ["fee", "storageLimit", "gasLimit"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const sourceValidation = (0, utils_1.validateAddress)((_b = rest.source) !== null && _b !== void 0 ? _b : ''); | ||
if (rest.source && sourceValidation !== utils_1.ValidationResult.VALID) { | ||
throw new core_1.InvalidAddressError(rest.source, (0, utils_1.invalidDetail)(sourceValidation)); | ||
} | ||
if (!rest.to) { | ||
rest.to = rest.source; | ||
} | ||
if (rest.to && rest.to !== rest.source) { | ||
throw new core_1.InvalidStakingAddressError(rest.to); | ||
} | ||
if (rest.amount < 0) { | ||
throw new core_1.InvalidAmountError(rest.amount.toString()); | ||
} | ||
const preparedOperation = yield this.prepare.stake(Object.assign({ fee, | ||
storageLimit, | ||
gasLimit }, rest)); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const estimateProperties = yield this.calculateEstimates(preparedOperation, protocolConstants); | ||
if (preparedOperation.opOb.contents[0].kind === 'reveal') { | ||
estimateProperties.shift(); | ||
estimateProperties[0].opSize -= this.OP_SIZE_REVEAL / 2; | ||
} | ||
return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties); | ||
}); | ||
} | ||
/** | ||
* | ||
* @description Estimate gasLimit, storageLimit and fees for an Unstake pseudo-operation | ||
* | ||
* @returns An estimation of gasLimit, storageLimit and fees for the operation | ||
* | ||
* @param Unstake pseudo-operation parameter | ||
*/ | ||
unstake(_a) { | ||
var _b; | ||
var { fee, storageLimit, gasLimit } = _a, rest = __rest(_a, ["fee", "storageLimit", "gasLimit"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const sourceValidation = (0, utils_1.validateAddress)((_b = rest.source) !== null && _b !== void 0 ? _b : ''); | ||
if (rest.source && sourceValidation !== utils_1.ValidationResult.VALID) { | ||
throw new core_1.InvalidAddressError(rest.source, (0, utils_1.invalidDetail)(sourceValidation)); | ||
} | ||
if (!rest.to) { | ||
rest.to = rest.source; | ||
} | ||
if (rest.to && rest.to !== rest.source) { | ||
throw new core_1.InvalidStakingAddressError(rest.to); | ||
} | ||
if (rest.amount < 0) { | ||
throw new core_1.InvalidAmountError(rest.amount.toString()); | ||
} | ||
const preparedOperation = yield this.prepare.unstake(Object.assign({ fee, | ||
storageLimit, | ||
gasLimit }, rest)); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const estimateProperties = yield this.calculateEstimates(preparedOperation, protocolConstants); | ||
if (preparedOperation.opOb.contents[0].kind === 'reveal') { | ||
estimateProperties.shift(); | ||
estimateProperties[0].opSize -= this.OP_SIZE_REVEAL / 2; | ||
} | ||
return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties); | ||
}); | ||
} | ||
/** | ||
* | ||
* @description Estimate gasLimit, storageLimit and fees for an finalize_unstake pseudo-operation | ||
* | ||
* @returns An estimation of gasLimit, storageLimit and fees for the operation | ||
* | ||
* @param finalize_unstake pseudo-operation parameter | ||
*/ | ||
finalizeUnstake(_a) { | ||
var _b; | ||
var { fee, storageLimit, gasLimit } = _a, rest = __rest(_a, ["fee", "storageLimit", "gasLimit"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const sourceValidation = (0, utils_1.validateAddress)((_b = rest.source) !== null && _b !== void 0 ? _b : ''); | ||
if (rest.source && sourceValidation !== utils_1.ValidationResult.VALID) { | ||
throw new core_1.InvalidAddressError(rest.source, (0, utils_1.invalidDetail)(sourceValidation)); | ||
} | ||
if (!rest.to) { | ||
rest.to = rest.source; | ||
} | ||
if (rest.to && rest.to !== rest.source) { | ||
throw new core_1.InvalidStakingAddressError(rest.to); | ||
} | ||
if (!rest.amount) { | ||
rest.amount = 0; | ||
} | ||
if (rest.amount !== undefined && rest.amount !== 0) { | ||
throw new Error('Amount must be 0 for finalize_unstake operation'); | ||
} | ||
const preparedOperation = yield this.prepare.finalizeUnstake(Object.assign({ fee, | ||
storageLimit, | ||
gasLimit }, rest)); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const estimateProperties = yield this.calculateEstimates(preparedOperation, protocolConstants); | ||
if (preparedOperation.opOb.contents[0].kind === 'reveal') { | ||
estimateProperties.shift(); | ||
estimateProperties[0].opSize -= this.OP_SIZE_REVEAL / 2; | ||
} | ||
return estimate_1.Estimate.createEstimateInstanceFromProperties(estimateProperties); | ||
}); | ||
} | ||
/** | ||
* | ||
* @description Estimate gasLimit, storageLimit and fees for a transferTicket operation | ||
@@ -185,0 +299,0 @@ * |
@@ -319,2 +319,106 @@ "use strict"; | ||
* | ||
* @description Method to prepare a stake pseudo-operation | ||
* @param operation RPCOperation object or RPCOperation array | ||
* @param source string or undefined source pkh | ||
* @returns a PreparedOperation object | ||
*/ | ||
stake(_a) { | ||
var { fee, storageLimit, gasLimit } = _a, rest = __rest(_a, ["fee", "storageLimit", "gasLimit"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { pkh } = yield this.getKeys(); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const op = yield (0, contract_1.createTransferOperation)(Object.assign(Object.assign(Object.assign(Object.assign({}, rest), { to: pkh }), mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS)), { parameter: { | ||
entrypoint: 'stake', | ||
value: { | ||
prim: 'Unit', | ||
}, | ||
} })); | ||
const operation = yield this.addRevealOperationIfNeeded(op, pkh); | ||
const ops = this.convertIntoArray(operation); | ||
const hash = yield this.getBlockHash(); | ||
const protocol = yield this.getProtocolHash(); | ||
__classPrivateFieldSet(this, _PrepareProvider_counters, {}, "f"); | ||
const headCounter = parseInt(yield this.getHeadCounter(pkh), 10); | ||
const contents = this.constructOpContents(ops, headCounter, pkh, rest.source); | ||
return { | ||
opOb: { | ||
branch: hash, | ||
contents, | ||
protocol, | ||
}, | ||
counter: headCounter, | ||
}; | ||
}); | ||
} | ||
/** | ||
* | ||
* @description Method to prepare a unstake pseudo-operation | ||
* @param operation RPCOperation object or RPCOperation array | ||
* @param source string or undefined source pkh | ||
* @returns a PreparedOperation object | ||
*/ | ||
unstake(_a) { | ||
var { fee, storageLimit, gasLimit } = _a, rest = __rest(_a, ["fee", "storageLimit", "gasLimit"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { pkh } = yield this.getKeys(); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const op = yield (0, contract_1.createTransferOperation)(Object.assign(Object.assign(Object.assign(Object.assign({}, rest), { to: pkh }), mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS)), { parameter: { | ||
entrypoint: 'unstake', | ||
value: { prim: 'Unit' }, | ||
} })); | ||
const operation = yield this.addRevealOperationIfNeeded(op, pkh); | ||
const ops = this.convertIntoArray(operation); | ||
const hash = yield this.getBlockHash(); | ||
const protocol = yield this.getProtocolHash(); | ||
__classPrivateFieldSet(this, _PrepareProvider_counters, {}, "f"); | ||
const headCounter = parseInt(yield this.getHeadCounter(pkh), 10); | ||
const contents = this.constructOpContents(ops, headCounter, pkh, rest.source); | ||
return { | ||
opOb: { | ||
branch: hash, | ||
contents, | ||
protocol, | ||
}, | ||
counter: headCounter, | ||
}; | ||
}); | ||
} | ||
/** | ||
* | ||
* @description Method to prepare a finalize_unstake pseudo-operation | ||
* @param operation RPCOperation object or RPCOperation array | ||
* @param source string or undefined source pkh | ||
* @returns a PreparedOperation object | ||
*/ | ||
finalizeUnstake(_a) { | ||
var { fee, storageLimit, gasLimit } = _a, rest = __rest(_a, ["fee", "storageLimit", "gasLimit"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { pkh } = yield this.getKeys(); | ||
const protocolConstants = yield this.context.readProvider.getProtocolConstants('head'); | ||
const DEFAULT_PARAMS = yield this.getOperationLimits(protocolConstants); | ||
const op = yield (0, contract_1.createTransferOperation)(Object.assign(Object.assign(Object.assign(Object.assign({}, rest), { to: pkh, amount: 0 }), mergeLimits({ fee, storageLimit, gasLimit }, DEFAULT_PARAMS)), { parameter: { | ||
entrypoint: 'finalize_unstake', | ||
value: { prim: 'Unit' }, | ||
} })); | ||
const operation = yield this.addRevealOperationIfNeeded(op, pkh); | ||
const ops = this.convertIntoArray(operation); | ||
const hash = yield this.getBlockHash(); | ||
const protocol = yield this.getProtocolHash(); | ||
__classPrivateFieldSet(this, _PrepareProvider_counters, {}, "f"); | ||
const headCounter = parseInt(yield this.getHeadCounter(pkh), 10); | ||
const contents = this.constructOpContents(ops, headCounter, pkh, rest.source); | ||
return { | ||
opOb: { | ||
branch: hash, | ||
contents, | ||
protocol, | ||
}, | ||
counter: headCounter, | ||
}; | ||
}); | ||
} | ||
/** | ||
* | ||
* @description Method to prepare a delegation operation | ||
@@ -321,0 +425,0 @@ * @param operation RPCOperation object or RPCOperation array |
@@ -21,3 +21,3 @@ "use strict"; | ||
/** | ||
* @description Access the balance of a contract. | ||
* @description Access the spendable balance of a contract, excluding frozen bonds. | ||
* @param address address from which we want to retrieve the balance | ||
@@ -210,3 +210,10 @@ * @param block from which we want to retrieve the balance | ||
} | ||
/** | ||
* @description Returns the cycle at which the launch of the Adaptive Issuance feature is set to happen. A result of null means that the feature is not yet set to launch. | ||
* @param block from which we want to retrieve the information | ||
*/ | ||
getAdaptiveIssuanceLaunchCycle(block) { | ||
return this.rpc.getAdaptiveIssuanceLaunchCycle({ block: String(block) }); | ||
} | ||
} | ||
exports.RpcReadAdapter = RpcReadAdapter; |
@@ -21,3 +21,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TezosToolkit = exports.TaquitoLocalForger = exports.RpcReadAdapter = exports.ObservableSubscription = exports.PollingSubscribeProvider = exports.OperationBatch = exports.RpcForger = exports.CompositeForger = exports.UnitValue = exports.MichelsonMap = void 0; | ||
exports.TezosToolkit = exports.TaquitoLocalForger = exports.RpcReadAdapter = exports.ObservableSubscription = exports.PollingSubscribeProvider = exports.OperationBatch = exports.RpcForger = exports.CompositeForger = exports.UnitValue = exports.MichelsonMap = exports.Token = void 0; | ||
const rpc_1 = require("@taquito/rpc"); | ||
@@ -36,5 +36,7 @@ const context_1 = require("./context"); | ||
const rpc_injector_1 = require("./injector/rpc-injector"); | ||
var michelson_encoder_1 = require("@taquito/michelson-encoder"); | ||
Object.defineProperty(exports, "MichelsonMap", { enumerable: true, get: function () { return michelson_encoder_1.MichelsonMap; } }); | ||
Object.defineProperty(exports, "UnitValue", { enumerable: true, get: function () { return michelson_encoder_1.UnitValue; } }); | ||
const michelson_encoder_1 = require("@taquito/michelson-encoder"); | ||
var michelson_encoder_2 = require("@taquito/michelson-encoder"); | ||
Object.defineProperty(exports, "Token", { enumerable: true, get: function () { return michelson_encoder_2.Token; } }); | ||
Object.defineProperty(exports, "MichelsonMap", { enumerable: true, get: function () { return michelson_encoder_2.MichelsonMap; } }); | ||
Object.defineProperty(exports, "UnitValue", { enumerable: true, get: function () { return michelson_encoder_2.UnitValue; } }); | ||
__exportStar(require("./constants"), exports); | ||
@@ -317,2 +319,9 @@ __exportStar(require("./context"), exports); | ||
/** | ||
* @description Sets the strategy used for field numbering in Token execute/encode/decode to convert Michelson values to/from javascript objects | ||
* @param strategy a value of type FieldNumberingStrategy that controls how field numbers are calculated | ||
*/ | ||
setFieldNumberingStrategy(strategy) { | ||
michelson_encoder_1.Token.fieldNumberingStrategy = strategy; | ||
} | ||
/** | ||
* @description Provide access to tezos account management | ||
@@ -319,0 +328,0 @@ */ |
@@ -6,4 +6,4 @@ "use strict"; | ||
exports.VERSION = { | ||
"commitHash": "2e05f6f865be17a1b367b284542b24ffa9823271", | ||
"version": "19.2.1" | ||
"commitHash": "8e07853b62879d06b02ba80c84004fb591452edb", | ||
"version": "20.0.0-RC.0" | ||
}; |
@@ -33,2 +33,17 @@ "use strict"; | ||
} | ||
mapStakeParamsToWalletParams(params) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return (0, types_1.attachKind)(yield params(), types_1.OpKind.TRANSACTION); | ||
}); | ||
} | ||
mapUnstakeParamsToWalletParams(params) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return (0, types_1.attachKind)(yield params(), types_1.OpKind.TRANSACTION); | ||
}); | ||
} | ||
mapFinalizeUnstakeParamsToWalletParams(params) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return (0, types_1.attachKind)(yield params(), types_1.OpKind.TRANSACTION); | ||
}); | ||
} | ||
mapOriginateParamsToWalletParams(params) { | ||
@@ -35,0 +50,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -24,5 +24,3 @@ "use strict"; | ||
/** | ||
* | ||
* @description Add a transaction operation to the batch | ||
* | ||
* @param params Transfer operation parameter | ||
@@ -39,5 +37,3 @@ */ | ||
/** | ||
* | ||
* @description Add a contract call to the batch | ||
* | ||
* @param params Call a contract method | ||
@@ -50,5 +46,3 @@ * @param options Generic operation parameters | ||
/** | ||
* | ||
* @description Add a delegation operation to the batch | ||
* | ||
* @param params Delegation operation parameter | ||
@@ -66,5 +60,3 @@ */ | ||
/** | ||
* | ||
* @description Add an origination operation to the batch | ||
* | ||
* @param params Origination operation parameter | ||
@@ -77,5 +69,3 @@ */ | ||
/** | ||
* | ||
* @description Add an IncreasePaidStorage operation to the batch | ||
* | ||
* @param param IncreasePaidStorage operation parameter | ||
@@ -110,5 +100,3 @@ */ | ||
/** | ||
* | ||
* @description Add a group operation to the batch. Operation will be applied in the order they are in the params array | ||
* | ||
* @param params Operations parameter | ||
@@ -139,5 +127,3 @@ * @throws {@link InvalidOperationKindError} | ||
/** | ||
* | ||
* @description Submit batch operation to wallet | ||
* | ||
*/ | ||
@@ -170,3 +156,2 @@ send() { | ||
* @description Retrieve the PKH of the account that is currently in use by the wallet | ||
* | ||
* @param option Option to use while fetching the PKH. | ||
@@ -185,3 +170,2 @@ * If forceRefetch is specified the wallet provider implementation will refetch the PKH from the wallet | ||
* @description Retrieve the PK of the account that is currently in use by the wallet | ||
* | ||
* @param option Option to use while fetching the PK. | ||
@@ -199,7 +183,4 @@ * If forceRefetch is specified the wallet provider implementation will refetch the PK from the wallet | ||
/** | ||
* | ||
* @description Originate a new contract according to the script in parameters. | ||
* | ||
* @returns An operation handle with the result from the rpc node | ||
* | ||
* @returns a OriginationWalletOperation promise object when followed by .send() | ||
* @param originateParams Originate operation parameter | ||
@@ -215,7 +196,4 @@ */ | ||
/** | ||
* | ||
* @description Set the delegate for a contract. | ||
* | ||
* @returns An operation handle with the result from the rpc node | ||
* | ||
* @returns a WalletDelegateParams promise object when followed by .send() | ||
* @param delegateParams operation parameter | ||
@@ -236,7 +214,4 @@ */ | ||
/** | ||
* | ||
* @description failing_noop operation that is guaranteed to fail. DISCLAIMER: Not all wallets support signing failing_noop operations. | ||
* | ||
* @returns Signature for a failing_noop | ||
* | ||
* @param params operation parameter | ||
@@ -272,7 +247,4 @@ */ | ||
/** | ||
* | ||
* @description Register the current address as delegate. | ||
* | ||
* @returns An operation handle with the result from the rpc node | ||
* | ||
* @returns a DelegationWalletOperation promise object when followed by .send() | ||
*/ | ||
@@ -290,7 +262,4 @@ registerDelegate() { | ||
/** | ||
* | ||
* @description Transfer tezos tokens from current address to a specific address or call a smart contract. | ||
* | ||
* @returns A wallet command from which we can send the operation to the wallet | ||
* | ||
* @returns a TransactionWalletOperation promise object when followed by .send() | ||
* @param params operation parameter | ||
@@ -310,9 +279,80 @@ */ | ||
/** | ||
* | ||
* @description | ||
* | ||
* @returns | ||
* | ||
* @param params | ||
* @description Stake a given amount for the source address | ||
* @returns a TransactionWalletOperation promise object when followed by .send() | ||
* @param Stake pseudo-operation parameter | ||
*/ | ||
stake(params) { | ||
return this.walletCommand(() => __awaiter(this, void 0, void 0, function* () { | ||
const mappedParams = yield this.walletProvider.mapStakeParamsToWalletParams(() => __awaiter(this, void 0, void 0, function* () { | ||
const source = yield this.pkh(); | ||
if (!params.to) { | ||
params.to = source; | ||
} | ||
if (params.to !== source) { | ||
throw new core_1.InvalidStakingAddressError(params.to); | ||
} | ||
params.parameter = { entrypoint: 'stake', value: { prim: 'Unit' } }; | ||
return params; | ||
})); | ||
const opHash = yield this.walletProvider.sendOperations([mappedParams]); | ||
return this.context.operationFactory.createTransactionOperation(opHash); | ||
})); | ||
} | ||
/** | ||
* @description Unstake the given amount. If "everything" is given as amount, unstakes everything from the staking balance. | ||
* Unstaked tez remains frozen for a set amount of cycles (the slashing period) after the operation. Once this period is over, | ||
* the operation "finalize unstake" must be called for the funds to appear in the liquid balance. | ||
* @returns a TransactionWalletOperation promise object when followed by .send() | ||
* @param Unstake pseudo-operation parameter | ||
*/ | ||
unstake(params) { | ||
return this.walletCommand(() => __awaiter(this, void 0, void 0, function* () { | ||
const mappedParams = yield this.walletProvider.mapUnstakeParamsToWalletParams(() => __awaiter(this, void 0, void 0, function* () { | ||
const source = yield this.pkh(); | ||
if (!params.to) { | ||
params.to = source; | ||
} | ||
if (params.to !== source) { | ||
throw new core_1.InvalidStakingAddressError(params.to); | ||
} | ||
params.parameter = { entrypoint: 'unstake', value: { prim: 'Unit' } }; | ||
return params; | ||
})); | ||
const opHash = yield this.walletProvider.sendOperations([mappedParams]); | ||
return yield this.context.operationFactory.createTransactionOperation(opHash); | ||
})); | ||
} | ||
/** | ||
* @description Transfer all the finalizable unstaked funds of the source to their liquid balance | ||
* @returns a TransactionWalletOperation promise object when followed by .send() | ||
* @param Finalize_unstake pseudo-operation parameter | ||
*/ | ||
finalizeUnstake(params) { | ||
return this.walletCommand(() => __awaiter(this, void 0, void 0, function* () { | ||
const mappedParams = yield this.walletProvider.mapFinalizeUnstakeParamsToWalletParams(() => __awaiter(this, void 0, void 0, function* () { | ||
const source = yield this.pkh(); | ||
if (!params.to) { | ||
params.to = source; | ||
} | ||
if (params.to !== source) { | ||
throw new core_1.InvalidStakingAddressError(params.to); | ||
} | ||
if (!params.amount) { | ||
params.amount = 0; | ||
} | ||
if (params.amount !== 0) { | ||
throw new core_1.InvalidFinalizeUnstakeAmountError('Amount must be 0 to finalize unstake.'); | ||
} | ||
params.parameter = { entrypoint: 'finalize_unstake', value: { prim: 'Unit' } }; | ||
return params; | ||
})); | ||
const opHash = yield this.walletProvider.sendOperations([mappedParams]); | ||
return yield this.context.operationFactory.createTransactionOperation(opHash); | ||
})); | ||
} | ||
/** | ||
* @description Increase the paid storage of a smart contract. | ||
* @returns a IncreasePaidStorageWalletOperation promise object when followed by .send() | ||
* @param params operation parameter | ||
*/ | ||
increasePaidStorage(params) { | ||
@@ -330,7 +370,4 @@ const destinationValidation = (0, utils_1.validateAddress)(params.destination); | ||
/** | ||
* | ||
* @description Create a batch of operation | ||
* | ||
* @returns A batch object from which we can add more operation or send a command to the wallet to execute the batch | ||
* | ||
* @param params List of operation to initialize the batch with | ||
@@ -346,6 +383,4 @@ */ | ||
/** | ||
* | ||
* @description Create an smart contract abstraction for the address specified. Calling entrypoints with the returned | ||
* smart contract abstraction will leverage the wallet provider to make smart contract calls | ||
* | ||
* @param address Smart contract address | ||
@@ -352,0 +387,0 @@ * @throws {@link InvalidContractAddressError} If the contract address is not valid |
@@ -53,2 +53,3 @@ /** | ||
ProxfordY = "ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH", | ||
PtParisBQ = "PtParisBQscdCm6Cfow6ndeU6wKJyA3aV1j4D3gQBQMsTQyJCrz", | ||
ProtoALpha = "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK" | ||
@@ -90,3 +91,4 @@ } | ||
NAIROBINET = "NetXyuzvDo2Ugzb", | ||
OXFORDNET2 = "NetXxWsskGahzQB" | ||
OXFORDNET2 = "NetXxWsskGahzQB", | ||
PARISNET = "NetXo8SqH1c38SS" | ||
} | ||
@@ -93,0 +95,0 @@ export declare const getRevealGasLimit: (address: string) => number; |
@@ -10,3 +10,3 @@ import { BigMapKeyType, MichelsonMap, MichelsonMapKey, Schema } from '@taquito/michelson-encoder'; | ||
import { TransactionOperation } from '../operations/transaction-operation'; | ||
import { DelegateParams, OriginateParams, TransferParams, RegisterDelegateParams, ParamsWithKind, RevealParams, RegisterGlobalConstantParams, IncreasePaidStorageParams, TransferTicketParams, DrainDelegateParams, BallotParams, ProposalsParams, UpdateConsensusKeyParams, SmartRollupAddMessagesParams, SmartRollupOriginateParams, SmartRollupExecuteOutboxMessageParams, FailingNoopParams } from '../operations/types'; | ||
import { DelegateParams, OriginateParams, TransferParams, RegisterDelegateParams, ParamsWithKind, RevealParams, RegisterGlobalConstantParams, IncreasePaidStorageParams, TransferTicketParams, DrainDelegateParams, BallotParams, ProposalsParams, UpdateConsensusKeyParams, SmartRollupAddMessagesParams, SmartRollupOriginateParams, SmartRollupExecuteOutboxMessageParams, FailingNoopParams, StakeParams, UnstakeParams, FinalizeUnstakeParams } from '../operations/types'; | ||
import { ContractAbstraction, ContractStorageType, DefaultContractType } from './contract'; | ||
@@ -122,2 +122,29 @@ import { IncreasePaidStorageOperation } from '../operations/increase-paid-storage-operation'; | ||
* | ||
* @description Stake tz from current address to a specific address. Built on top of the existing transaction operation | ||
* | ||
* @returns An operation handle with the result from the rpc node | ||
* | ||
* @param Stake pseudo-operation parameter | ||
*/ | ||
stake(params: StakeParams): Promise<TransactionOperation>; | ||
/** | ||
* | ||
* @description Unstake tz from current address to a specific address. Built on top of the existing transaction operation | ||
* | ||
* @returns An operation handle with the result from the rpc node | ||
* | ||
* @param Unstake pseudo-operation parameter | ||
*/ | ||
unstake(params: UnstakeParams): Promise<TransactionOperation>; | ||
/** | ||
* | ||
* @description Finalize unstake tz from current address to a specific address. Built on top of the existing transaction operation | ||
* | ||
* @returns An operation handle with the result from the rpc node | ||
* | ||
* @param finalize_unstake pseudo-operation parameter | ||
*/ | ||
finalizeUnstake(params: FinalizeUnstakeParams): Promise<TransactionOperation>; | ||
/** | ||
* | ||
* @description Transfer tickets from an implicit account to a contract or another implicit account. | ||
@@ -124,0 +151,0 @@ * |
@@ -9,3 +9,3 @@ import { BigMapKeyType, MichelsonMap, MichelsonMapKey, Schema } from '@taquito/michelson-encoder'; | ||
import { TransactionOperation } from '../operations/transaction-operation'; | ||
import { DelegateParams, OriginateParams, ParamsWithKind, RegisterDelegateParams, RegisterGlobalConstantParams, RevealParams, TransferParams, TransferTicketParams, IncreasePaidStorageParams, DrainDelegateParams, BallotParams, ProposalsParams, UpdateConsensusKeyParams, SmartRollupAddMessagesParams, SmartRollupOriginateParams, SmartRollupExecuteOutboxMessageParams, FailingNoopParams } from '../operations/types'; | ||
import { DelegateParams, OriginateParams, ParamsWithKind, RegisterDelegateParams, RegisterGlobalConstantParams, RevealParams, TransferParams, TransferTicketParams, IncreasePaidStorageParams, DrainDelegateParams, BallotParams, ProposalsParams, UpdateConsensusKeyParams, SmartRollupAddMessagesParams, SmartRollupOriginateParams, SmartRollupExecuteOutboxMessageParams, FailingNoopParams, StakeParams, UnstakeParams, FinalizeUnstakeParams } from '../operations/types'; | ||
import { DefaultContractType, ContractStorageType, ContractAbstraction } from './contract'; | ||
@@ -132,2 +132,30 @@ import { ContractProvider, ContractSchema, StorageProvider } from './interface'; | ||
* | ||
* @description Stake a given amount for the source address | ||
* | ||
* @returns An operation handle with the result from the rpc node | ||
* | ||
* @param Stake pseudo-operation parameter | ||
*/ | ||
stake(params: StakeParams): Promise<TransactionOperation>; | ||
/** | ||
* | ||
* @description Unstake the given amount. If "everything" is given as amount, unstakes everything from the staking balance. | ||
* Unstaked tez remains frozen for a set amount of cycles (the slashing period) after the operation. Once this period is over, | ||
* the operation "finalize unstake" must be called for the funds to appear in the liquid balance. | ||
* | ||
* @returns An operation handle with the result from the rpc node | ||
* | ||
* @param Unstake pseudo-operation parameter | ||
*/ | ||
unstake(params: UnstakeParams): Promise<TransactionOperation>; | ||
/** | ||
* | ||
* @description Transfer all the finalizable unstaked funds of the source to their liquid balance | ||
* @returns An operation handle with the result from the rpc node | ||
* | ||
* @param Finalize_unstake pseudo-operation parameter | ||
*/ | ||
finalizeUnstake(params: FinalizeUnstakeParams): Promise<TransactionOperation>; | ||
/** | ||
* | ||
* @description Transfer Tickets to a smart contract address | ||
@@ -134,0 +162,0 @@ * |
import { OriginateParams, TransferParams, DelegateParams, RegisterDelegateParams, ParamsWithKind } from '../operations'; | ||
import { RevealParams, RegisterGlobalConstantParams, TransferTicketParams, IncreasePaidStorageParams, UpdateConsensusKeyParams, SmartRollupAddMessagesParams, SmartRollupOriginateParams, SmartRollupExecuteOutboxMessageParams } from '../operations/types'; | ||
import { RevealParams, RegisterGlobalConstantParams, TransferTicketParams, IncreasePaidStorageParams, UpdateConsensusKeyParams, SmartRollupAddMessagesParams, SmartRollupOriginateParams, SmartRollupExecuteOutboxMessageParams, StakeParams, UnstakeParams, FinalizeUnstakeParams } from '../operations/types'; | ||
import { Estimate } from './estimate'; | ||
@@ -26,2 +26,29 @@ import { ContractMethod, ContractMethodObject, ContractProvider } from '../contract'; | ||
* | ||
* @description Estimate gasLimit, storageLimit and fees for an stake pseudo-operation | ||
* | ||
* @returns An estimation of gasLimit, storageLimit and fees for the operation | ||
* | ||
* @param Estimate | ||
*/ | ||
stake({ fee, storageLimit, gasLimit, ...rest }: StakeParams): Promise<Estimate>; | ||
/** | ||
* | ||
* @description Estimate gasLimit, storageLimit and fees for an unstake pseudo-operation | ||
* | ||
* @returns An estimation of gasLimit, storageLimit and fees for the operation | ||
* | ||
* @param Estimate | ||
*/ | ||
unstake({ fee, storageLimit, gasLimit, ...rest }: UnstakeParams): Promise<Estimate>; | ||
/** | ||
* | ||
* @description Estimate gasLimit, storageLimit and fees for an finalize_unstake pseudo-operation | ||
* | ||
* @returns An estimation of gasLimit, storageLimit and fees for the operation | ||
* | ||
* @param Estimate | ||
*/ | ||
finalizeUnstake({ fee, storageLimit, gasLimit, ...rest }: FinalizeUnstakeParams): Promise<Estimate>; | ||
/** | ||
* | ||
* @description Estimate gasLimit, storageLimit and fees for an transferTicket operation | ||
@@ -28,0 +55,0 @@ * |
@@ -1,2 +0,2 @@ | ||
import { DelegateParams, OriginateParams, ParamsWithKind, RegisterDelegateParams, TransferParams, RevealParams, RegisterGlobalConstantParams, TransferTicketParams, IncreasePaidStorageParams, UpdateConsensusKeyParams, SmartRollupAddMessagesParams, SmartRollupOriginateParams, SmartRollupExecuteOutboxMessageParams } from '../operations/types'; | ||
import { DelegateParams, OriginateParams, ParamsWithKind, RegisterDelegateParams, TransferParams, RevealParams, RegisterGlobalConstantParams, TransferTicketParams, IncreasePaidStorageParams, UpdateConsensusKeyParams, SmartRollupAddMessagesParams, SmartRollupOriginateParams, SmartRollupExecuteOutboxMessageParams, StakeParams, UnstakeParams, FinalizeUnstakeParams } from '../operations/types'; | ||
import { Estimate } from './estimate'; | ||
@@ -34,2 +34,29 @@ import { EstimationProvider } from '../estimate/estimate-provider-interface'; | ||
* | ||
* @description Estimate gasLimit, storageLimit and fees for an stake pseudo-operation | ||
* | ||
* @returns An estimation of gasLimit, storageLimit and fees for the operation | ||
* | ||
* @param Stake pseudo-operation parameter | ||
*/ | ||
stake({ fee, storageLimit, gasLimit, ...rest }: StakeParams): Promise<Estimate>; | ||
/** | ||
* | ||
* @description Estimate gasLimit, storageLimit and fees for an Unstake pseudo-operation | ||
* | ||
* @returns An estimation of gasLimit, storageLimit and fees for the operation | ||
* | ||
* @param Unstake pseudo-operation parameter | ||
*/ | ||
unstake({ fee, storageLimit, gasLimit, ...rest }: UnstakeParams): Promise<Estimate>; | ||
/** | ||
* | ||
* @description Estimate gasLimit, storageLimit and fees for an finalize_unstake pseudo-operation | ||
* | ||
* @returns An estimation of gasLimit, storageLimit and fees for the operation | ||
* | ||
* @param finalize_unstake pseudo-operation parameter | ||
*/ | ||
finalizeUnstake({ fee, storageLimit, gasLimit, ...rest }: FinalizeUnstakeParams): Promise<Estimate>; | ||
/** | ||
* | ||
* @description Estimate gasLimit, storageLimit and fees for a transferTicket operation | ||
@@ -36,0 +63,0 @@ * |
@@ -26,3 +26,3 @@ import { OperationObject, InternalOperationResultKindEnum, OpKind, TransactionOperationParameter, MichelsonV1Expression, BallotVote, PvmKind } from '@taquito/rpc'; | ||
kind: OpKind; | ||
}>(op: T) => op is withKind<T, OpKind.ORIGINATION | OpKind.DELEGATION | OpKind.REVEAL | OpKind.TRANSACTION | OpKind.ATTESTATION | OpKind.ENDORSEMENT | OpKind.PREATTESTATION | OpKind.PREENDORSEMENT | OpKind.SET_DEPOSITS_LIMIT | OpKind.DOUBLE_PREATTESTATION_EVIDENCE | OpKind.DOUBLE_PREENDORSEMENT_EVIDENCE | OpKind.ATTESTATION_WITH_SLOT | OpKind.ENDORSEMENT_WITH_SLOT | OpKind.SEED_NONCE_REVELATION | OpKind.DOUBLE_ATTESTATION_EVIDENCE | OpKind.DOUBLE_ENDORSEMENT_EVIDENCE | OpKind.DOUBLE_BAKING_EVIDENCE | OpKind.PROPOSALS | OpKind.BALLOT | OpKind.REGISTER_GLOBAL_CONSTANT | OpKind.TRANSFER_TICKET | OpKind.INCREASE_PAID_STORAGE | OpKind.UPDATE_CONSENSUS_KEY | OpKind.DRAIN_DELEGATE | OpKind.VDF_REVELATION | OpKind.EVENT | OpKind.TICKET_UPDATES | OpKind.SMART_ROLLUP_ORIGINATE | OpKind.SMART_ROLLUP_ADD_MESSAGES | OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE | OpKind.SMART_ROLLUP_PUBLISH | OpKind.SMART_ROLLUP_CEMENT | OpKind.SMART_ROLLUP_RECOVER_BOND | OpKind.SMART_ROLLUP_REFUTE | OpKind.SMART_ROLLUP_TIMEOUT>; | ||
}>(op: T) => op is withKind<T, OpKind.ORIGINATION | OpKind.DELEGATION | OpKind.REVEAL | OpKind.TRANSACTION | OpKind.ATTESTATION | OpKind.ENDORSEMENT | OpKind.PREATTESTATION | OpKind.PREENDORSEMENT | OpKind.SET_DEPOSITS_LIMIT | OpKind.DOUBLE_PREATTESTATION_EVIDENCE | OpKind.DOUBLE_PREENDORSEMENT_EVIDENCE | OpKind.ATTESTATION_WITH_DAL | OpKind.ENDORSEMENT_WITH_DAL | OpKind.SEED_NONCE_REVELATION | OpKind.DOUBLE_ATTESTATION_EVIDENCE | OpKind.DOUBLE_ENDORSEMENT_EVIDENCE | OpKind.DOUBLE_BAKING_EVIDENCE | OpKind.PROPOSALS | OpKind.BALLOT | OpKind.REGISTER_GLOBAL_CONSTANT | OpKind.TRANSFER_TICKET | OpKind.INCREASE_PAID_STORAGE | OpKind.UPDATE_CONSENSUS_KEY | OpKind.DRAIN_DELEGATE | OpKind.VDF_REVELATION | OpKind.EVENT | OpKind.TICKET_UPDATES | OpKind.SMART_ROLLUP_ORIGINATE | OpKind.SMART_ROLLUP_ADD_MESSAGES | OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE | OpKind.SMART_ROLLUP_PUBLISH | OpKind.SMART_ROLLUP_CEMENT | OpKind.SMART_ROLLUP_RECOVER_BOND | OpKind.SMART_ROLLUP_REFUTE | OpKind.SMART_ROLLUP_TIMEOUT | OpKind.DAL_PUBLISH_COMMITMENT>; | ||
export declare const isOpRequireReveal: <T extends { | ||
@@ -174,2 +174,41 @@ kind: OpKind; | ||
/** | ||
* @description RPC Stake pseudo operation params | ||
*/ | ||
export interface StakeParams { | ||
to?: string; | ||
source?: string; | ||
amount: number; | ||
fee?: number; | ||
parameter?: TransactionOperationParameter; | ||
gasLimit?: number; | ||
storageLimit?: number; | ||
mutez?: boolean; | ||
} | ||
/** | ||
* @description RPC unstake pseudo operation params | ||
*/ | ||
export interface UnstakeParams { | ||
to?: string; | ||
source?: string; | ||
amount: number; | ||
fee?: number; | ||
parameter?: TransactionOperationParameter; | ||
gasLimit?: number; | ||
storageLimit?: number; | ||
mutez?: boolean; | ||
} | ||
/** | ||
* @description RPC finalize_unstake pseudo operation params | ||
*/ | ||
export interface FinalizeUnstakeParams { | ||
to?: string; | ||
source?: string; | ||
amount?: number; | ||
fee?: number; | ||
parameter?: TransactionOperationParameter; | ||
gasLimit?: number; | ||
storageLimit?: number; | ||
mutez?: boolean; | ||
} | ||
/** | ||
* @description RPC register global constant operation | ||
@@ -176,0 +215,0 @@ */ |
import { PreapplyParams } from '@taquito/rpc'; | ||
import { DelegateParams, RevealParams, RegisterGlobalConstantParams, TransferParams, OriginateParams, UpdateConsensusKeyParams, TransferTicketParams, IncreasePaidStorageParams, BallotParams, ProposalsParams, DrainDelegateParams, ParamsWithKind, SmartRollupAddMessagesParams, SmartRollupOriginateParams, SmartRollupExecuteOutboxMessageParams, RegisterDelegateParams, ActivationParams } from '../operations/types'; | ||
import { DelegateParams, RevealParams, RegisterGlobalConstantParams, TransferParams, OriginateParams, UpdateConsensusKeyParams, TransferTicketParams, IncreasePaidStorageParams, BallotParams, ProposalsParams, DrainDelegateParams, ParamsWithKind, SmartRollupAddMessagesParams, SmartRollupOriginateParams, SmartRollupExecuteOutboxMessageParams, RegisterDelegateParams, ActivationParams, StakeParams, UnstakeParams, FinalizeUnstakeParams } from '../operations/types'; | ||
import { PreparationProvider, PreparedOperation } from './interface'; | ||
@@ -64,2 +64,26 @@ import { Context } from '../context'; | ||
* | ||
* @description Method to prepare a stake pseudo-operation | ||
* @param operation RPCOperation object or RPCOperation array | ||
* @param source string or undefined source pkh | ||
* @returns a PreparedOperation object | ||
*/ | ||
stake({ fee, storageLimit, gasLimit, ...rest }: StakeParams): Promise<PreparedOperation>; | ||
/** | ||
* | ||
* @description Method to prepare a unstake pseudo-operation | ||
* @param operation RPCOperation object or RPCOperation array | ||
* @param source string or undefined source pkh | ||
* @returns a PreparedOperation object | ||
*/ | ||
unstake({ fee, storageLimit, gasLimit, ...rest }: UnstakeParams): Promise<PreparedOperation>; | ||
/** | ||
* | ||
* @description Method to prepare a finalize_unstake pseudo-operation | ||
* @param operation RPCOperation object or RPCOperation array | ||
* @param source string or undefined source pkh | ||
* @returns a PreparedOperation object | ||
*/ | ||
finalizeUnstake({ fee, storageLimit, gasLimit, ...rest }: FinalizeUnstakeParams): Promise<PreparedOperation>; | ||
/** | ||
* | ||
* @description Method to prepare a delegation operation | ||
@@ -66,0 +90,0 @@ * @param operation RPCOperation object or RPCOperation array |
@@ -1,2 +0,2 @@ | ||
import { BlockResponse, EntrypointsResponse, MichelsonV1Expression, SaplingDiffResponse, ScriptedContracts } from '@taquito/rpc'; | ||
import { BlockResponse, EntrypointsResponse, MichelsonV1Expression, SaplingDiffResponse, ScriptedContracts, AILaunchCycleResponse } from '@taquito/rpc'; | ||
import BigNumber from 'bignumber.js'; | ||
@@ -13,3 +13,3 @@ export type BigMapQuery = { | ||
/** | ||
* @description Access the balance of a contract. | ||
* @description Access the spendable balance of a contract, excluding frozen bonds. | ||
* @param address address from which we want to retrieve the balance | ||
@@ -121,2 +121,7 @@ * @param block from which we want to retrieve the balance | ||
getLiveBlocks(block: BlockIdentifier): Promise<string[]>; | ||
/** | ||
* @description Returns the cycle at which the launch of the Adaptive Issuance feature is set to happen. A result of null means that the feature is not yet set to launch. | ||
* @param block from which we want to retrieve the information | ||
*/ | ||
getAdaptiveIssuanceLaunchCycle(block: BlockIdentifier): Promise<AILaunchCycleResponse>; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { BlockResponse, EntrypointsResponse, MichelsonV1Expression, RpcClientInterface, SaplingDiffResponse, ScriptedContracts } from '@taquito/rpc'; | ||
import { BlockResponse, EntrypointsResponse, MichelsonV1Expression, RpcClientInterface, SaplingDiffResponse, ScriptedContracts, AILaunchCycleResponse } from '@taquito/rpc'; | ||
import BigNumber from 'bignumber.js'; | ||
@@ -11,3 +11,3 @@ import { BigMapQuery, BlockIdentifier, SaplingStateQuery, TzReadProvider } from './interface'; | ||
/** | ||
* @description Access the balance of a contract. | ||
* @description Access the spendable balance of a contract, excluding frozen bonds. | ||
* @param address address from which we want to retrieve the balance | ||
@@ -119,2 +119,7 @@ * @param block from which we want to retrieve the balance | ||
getLiveBlocks(block: BlockIdentifier): Promise<string[]>; | ||
/** | ||
* @description Returns the cycle at which the launch of the Adaptive Issuance feature is set to happen. A result of null means that the feature is not yet set to launch. | ||
* @param block from which we want to retrieve the information | ||
*/ | ||
getAdaptiveIssuanceLaunchCycle(block: BlockIdentifier): Promise<AILaunchCycleResponse>; | ||
} |
@@ -25,3 +25,4 @@ /** | ||
import { Injector } from './injector/interface'; | ||
export { MichelsonMap, UnitValue } from '@taquito/michelson-encoder'; | ||
import { FieldNumberingStrategy } from '@taquito/michelson-encoder'; | ||
export { FieldNumberingStrategy, Token, MichelsonMap, UnitValue } from '@taquito/michelson-encoder'; | ||
export { Forger, ForgeParams, ForgeResponse } from '@taquito/local-forging'; | ||
@@ -202,2 +203,7 @@ export * from './constants'; | ||
/** | ||
* @description Sets the strategy used for field numbering in Token execute/encode/decode to convert Michelson values to/from javascript objects | ||
* @param strategy a value of type FieldNumberingStrategy that controls how field numbers are calculated | ||
*/ | ||
setFieldNumberingStrategy(strategy: FieldNumberingStrategy): void; | ||
/** | ||
* @description Provide access to tezos account management | ||
@@ -204,0 +210,0 @@ */ |
@@ -6,3 +6,3 @@ import BigNumber from 'bignumber.js'; | ||
* | ||
* @param address Tezos address you want to get the balance for (eg tz1...) | ||
* @param address Tezos address you want to get the spendable balance for (eg tz1...) | ||
*/ | ||
@@ -9,0 +9,0 @@ getBalance(address: string): Promise<BigNumber>; |
@@ -1,4 +0,7 @@ | ||
import { DelegateParams, FailingNoopParams, IncreasePaidStorageParams, OriginateParams, TransferParams } from '../operations/types'; | ||
import { DelegateParams, FailingNoopParams, IncreasePaidStorageParams, OriginateParams, TransferParams, StakeParams, UnstakeParams, FinalizeUnstakeParams } from '../operations/types'; | ||
export type WalletDefinedFields = 'source'; | ||
export type WalletTransferParams = Omit<TransferParams, WalletDefinedFields>; | ||
export type WalletStakeParams = Omit<StakeParams, WalletDefinedFields>; | ||
export type WalletUnstakeParams = Omit<UnstakeParams, WalletDefinedFields>; | ||
export type WalletFinalizeUnstakeParams = Omit<FinalizeUnstakeParams, WalletDefinedFields>; | ||
export type WalletOriginateParams<TStorage = any> = Omit<OriginateParams<TStorage>, WalletDefinedFields>; | ||
@@ -22,2 +25,14 @@ export type WalletDelegateParams = Omit<DelegateParams, WalletDefinedFields>; | ||
/** | ||
* @description Transform WalletStakeParams into a format compliant with the underlying wallet | ||
*/ | ||
mapStakeParamsToWalletParams: (params: () => Promise<WalletStakeParams>) => Promise<any>; | ||
/** | ||
* @description Transform WalletUnstakeParams into a format compliant with the underlying wallet | ||
*/ | ||
mapUnstakeParamsToWalletParams: (params: () => Promise<WalletUnstakeParams>) => Promise<any>; | ||
/** | ||
* @description Transform WalletFinalizeUnstakeParams into a format compliant with the underlying wallet | ||
*/ | ||
mapFinalizeUnstakeParamsToWalletParams: (params: () => Promise<WalletFinalizeUnstakeParams>) => Promise<any>; | ||
/** | ||
* @description Transform WalletOriginateParams into a format compliant with the underlying wallet | ||
@@ -24,0 +39,0 @@ */ |
import { Context } from '../context'; | ||
import { OpKind } from '../operations/types'; | ||
import { WalletDelegateParams, WalletIncreasePaidStorageParams, WalletOriginateParams, WalletProvider, WalletTransferParams } from './interface'; | ||
import { WalletDelegateParams, WalletIncreasePaidStorageParams, WalletOriginateParams, WalletProvider, WalletTransferParams, WalletStakeParams, WalletUnstakeParams, WalletFinalizeUnstakeParams } from './interface'; | ||
import { WalletParamsWithKind } from './wallet'; | ||
@@ -11,2 +11,5 @@ export declare class LegacyWalletProvider implements WalletProvider { | ||
mapTransferParamsToWalletParams(params: () => Promise<WalletTransferParams>): Promise<import("../operations/types").withKind<WalletTransferParams, OpKind.TRANSACTION>>; | ||
mapStakeParamsToWalletParams(params: () => Promise<WalletStakeParams>): Promise<import("../operations/types").withKind<WalletStakeParams, OpKind.TRANSACTION>>; | ||
mapUnstakeParamsToWalletParams(params: () => Promise<WalletUnstakeParams>): Promise<import("../operations/types").withKind<WalletUnstakeParams, OpKind.TRANSACTION>>; | ||
mapFinalizeUnstakeParamsToWalletParams(params: () => Promise<WalletFinalizeUnstakeParams>): Promise<import("../operations/types").withKind<WalletFinalizeUnstakeParams, OpKind.TRANSACTION>>; | ||
mapOriginateParamsToWalletParams(params: () => Promise<WalletOriginateParams>): Promise<import("../operations/types").withKind<WalletOriginateParams, OpKind.ORIGINATION>>; | ||
@@ -13,0 +16,0 @@ mapDelegateParamsToWalletParams(params: () => Promise<WalletDelegateParams>): Promise<import("../operations/types").withKind<WalletDelegateParams, OpKind.DELEGATION>>; |
@@ -7,3 +7,3 @@ import { Context } from '../context'; | ||
import { OriginationWalletOperation } from './origination-operation'; | ||
import { WalletDelegateParams, WalletFailingNoopParams, WalletIncreasePaidStorageParams, WalletOriginateParams, WalletProvider, WalletTransferParams } from './interface'; | ||
import { WalletDelegateParams, WalletFailingNoopParams, WalletIncreasePaidStorageParams, WalletOriginateParams, WalletProvider, WalletTransferParams, WalletStakeParams, WalletUnstakeParams, WalletFinalizeUnstakeParams } from './interface'; | ||
export interface PKHOption { | ||
@@ -19,5 +19,3 @@ forceRefetch?: boolean; | ||
/** | ||
* | ||
* @description Add a transaction operation to the batch | ||
* | ||
* @param params Transfer operation parameter | ||
@@ -27,5 +25,3 @@ */ | ||
/** | ||
* | ||
* @description Add a contract call to the batch | ||
* | ||
* @param params Call a contract method | ||
@@ -36,5 +32,3 @@ * @param options Generic operation parameters | ||
/** | ||
* | ||
* @description Add a delegation operation to the batch | ||
* | ||
* @param params Delegation operation parameter | ||
@@ -44,5 +38,3 @@ */ | ||
/** | ||
* | ||
* @description Add an origination operation to the batch | ||
* | ||
* @param params Origination operation parameter | ||
@@ -52,5 +44,3 @@ */ | ||
/** | ||
* | ||
* @description Add an IncreasePaidStorage operation to the batch | ||
* | ||
* @param param IncreasePaidStorage operation parameter | ||
@@ -61,5 +51,3 @@ */ | ||
/** | ||
* | ||
* @description Add a group operation to the batch. Operation will be applied in the order they are in the params array | ||
* | ||
* @param params Operations parameter | ||
@@ -70,5 +58,3 @@ * @throws {@link InvalidOperationKindError} | ||
/** | ||
* | ||
* @description Submit batch operation to wallet | ||
* | ||
*/ | ||
@@ -85,3 +71,2 @@ send(): Promise<import("./batch-operation").BatchWalletOperation>; | ||
* @description Retrieve the PKH of the account that is currently in use by the wallet | ||
* | ||
* @param option Option to use while fetching the PKH. | ||
@@ -93,3 +78,2 @@ * If forceRefetch is specified the wallet provider implementation will refetch the PKH from the wallet | ||
* @description Retrieve the PK of the account that is currently in use by the wallet | ||
* | ||
* @param option Option to use while fetching the PK. | ||
@@ -101,7 +85,4 @@ * If forceRefetch is specified the wallet provider implementation will refetch the PK from the wallet | ||
/** | ||
* | ||
* @description Originate a new contract according to the script in parameters. | ||
* | ||
* @returns An operation handle with the result from the rpc node | ||
* | ||
* @returns a OriginationWalletOperation promise object when followed by .send() | ||
* @param originateParams Originate operation parameter | ||
@@ -113,7 +94,4 @@ */ | ||
/** | ||
* | ||
* @description Set the delegate for a contract. | ||
* | ||
* @returns An operation handle with the result from the rpc node | ||
* | ||
* @returns a WalletDelegateParams promise object when followed by .send() | ||
* @param delegateParams operation parameter | ||
@@ -125,7 +103,4 @@ */ | ||
/** | ||
* | ||
* @description failing_noop operation that is guaranteed to fail. DISCLAIMER: Not all wallets support signing failing_noop operations. | ||
* | ||
* @returns Signature for a failing_noop | ||
* | ||
* @param params operation parameter | ||
@@ -145,7 +120,4 @@ */ | ||
/** | ||
* | ||
* @description Register the current address as delegate. | ||
* | ||
* @returns An operation handle with the result from the rpc node | ||
* | ||
* @returns a DelegationWalletOperation promise object when followed by .send() | ||
*/ | ||
@@ -156,7 +128,4 @@ registerDelegate(): { | ||
/** | ||
* | ||
* @description Transfer tezos tokens from current address to a specific address or call a smart contract. | ||
* | ||
* @returns A wallet command from which we can send the operation to the wallet | ||
* | ||
* @returns a TransactionWalletOperation promise object when followed by .send() | ||
* @param params operation parameter | ||
@@ -168,9 +137,32 @@ */ | ||
/** | ||
* | ||
* @description | ||
* | ||
* @returns | ||
* | ||
* @param params | ||
* @description Stake a given amount for the source address | ||
* @returns a TransactionWalletOperation promise object when followed by .send() | ||
* @param Stake pseudo-operation parameter | ||
*/ | ||
stake(params: WalletStakeParams): { | ||
send: () => Promise<import("./transaction-operation").TransactionWalletOperation>; | ||
}; | ||
/** | ||
* @description Unstake the given amount. If "everything" is given as amount, unstakes everything from the staking balance. | ||
* Unstaked tez remains frozen for a set amount of cycles (the slashing period) after the operation. Once this period is over, | ||
* the operation "finalize unstake" must be called for the funds to appear in the liquid balance. | ||
* @returns a TransactionWalletOperation promise object when followed by .send() | ||
* @param Unstake pseudo-operation parameter | ||
*/ | ||
unstake(params: WalletUnstakeParams): { | ||
send: () => Promise<import("./transaction-operation").TransactionWalletOperation>; | ||
}; | ||
/** | ||
* @description Transfer all the finalizable unstaked funds of the source to their liquid balance | ||
* @returns a TransactionWalletOperation promise object when followed by .send() | ||
* @param Finalize_unstake pseudo-operation parameter | ||
*/ | ||
finalizeUnstake(params: WalletFinalizeUnstakeParams): { | ||
send: () => Promise<import("./transaction-operation").TransactionWalletOperation>; | ||
}; | ||
/** | ||
* @description Increase the paid storage of a smart contract. | ||
* @returns a IncreasePaidStorageWalletOperation promise object when followed by .send() | ||
* @param params operation parameter | ||
*/ | ||
increasePaidStorage(params: WalletIncreasePaidStorageParams): { | ||
@@ -180,7 +172,4 @@ send: () => Promise<import("./increase-paid-storage-operation").IncreasePaidStorageWalletOperation>; | ||
/** | ||
* | ||
* @description Create a batch of operation | ||
* | ||
* @returns A batch object from which we can add more operation or send a command to the wallet to execute the batch | ||
* | ||
* @param params List of operation to initialize the batch with | ||
@@ -190,6 +179,4 @@ */ | ||
/** | ||
* | ||
* @description Create an smart contract abstraction for the address specified. Calling entrypoints with the returned | ||
* smart contract abstraction will leverage the wallet provider to make smart contract calls | ||
* | ||
* @param address Smart contract address | ||
@@ -196,0 +183,0 @@ * @throws {@link InvalidContractAddressError} If the contract address is not valid |
{ | ||
"name": "@taquito/taquito", | ||
"version": "19.2.1", | ||
"version": "20.0.0-RC.0", | ||
"description": "High level functionality that builds upon the other packages in the Tezos Typescript Library Suite.", | ||
@@ -34,3 +34,3 @@ "keywords": [ | ||
"scripts": { | ||
"test": "jest --coverage --testPathIgnorePatterns=operation-factory.spec.ts", | ||
"test": "jest --coverage", | ||
"test:watch": "jest --coverage --watch", | ||
@@ -81,9 +81,9 @@ "test:prod": "npm run lint && npm run test -- --no-cache", | ||
"dependencies": { | ||
"@taquito/core": "^19.2.1", | ||
"@taquito/http-utils": "^19.2.1", | ||
"@taquito/local-forging": "^19.2.1", | ||
"@taquito/michel-codec": "^19.2.1", | ||
"@taquito/michelson-encoder": "^19.2.1", | ||
"@taquito/rpc": "^19.2.1", | ||
"@taquito/utils": "^19.2.1", | ||
"@taquito/core": "^20.0.0-RC.0", | ||
"@taquito/http-utils": "^20.0.0-RC.0", | ||
"@taquito/local-forging": "^20.0.0-RC.0", | ||
"@taquito/michel-codec": "^20.0.0-RC.0", | ||
"@taquito/michelson-encoder": "^20.0.0-RC.0", | ||
"@taquito/rpc": "^20.0.0-RC.0", | ||
"@taquito/utils": "^20.0.0-RC.0", | ||
"bignumber.js": "^9.1.2", | ||
@@ -130,3 +130,3 @@ "rxjs": "^7.8.1" | ||
}, | ||
"gitHead": "3b9dbecb374ffd8136f494ae0817b2d1d530f8d9" | ||
"gitHead": "35bba2dcede224a126fd82e28c441756a5b962e6" | ||
} |
@@ -10,3 +10,3 @@ # Taquito high-level functions | ||
```html | ||
<script src="https://unpkg.com/@taquito/taquito@19.2.1/dist/taquito.min.js" | ||
<script src="https://unpkg.com/@taquito/taquito@20.0.0-RC.0/dist/taquito.min.js" | ||
crossorigin="anonymous" integrity="sha384-IxvP0ECHi5oqLyz94wF85pU9+ktcsL1HHtA42MITxZsGbsUMEu/g+0Vkjj5vqiMR"></script> | ||
@@ -13,0 +13,0 @@ ``` |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2125682
28331
2
+ Added@taquito/core@20.1.0(transitive)
+ Added@taquito/http-utils@20.1.0(transitive)
+ Added@taquito/local-forging@20.1.0(transitive)
+ Added@taquito/michel-codec@20.1.0(transitive)
+ Added@taquito/michelson-encoder@20.1.0(transitive)
+ Added@taquito/rpc@20.1.0(transitive)
+ Added@taquito/utils@20.1.0(transitive)
- Removed@taquito/core@19.2.1(transitive)
- Removed@taquito/http-utils@19.2.1(transitive)
- Removed@taquito/local-forging@19.2.1(transitive)
- Removed@taquito/michel-codec@19.2.1(transitive)
- Removed@taquito/michelson-encoder@19.2.1(transitive)
- Removed@taquito/rpc@19.2.1(transitive)
- Removed@taquito/utils@19.2.1(transitive)
Updated@taquito/core@^20.0.0-RC.0
Updated@taquito/rpc@^20.0.0-RC.0
Updated@taquito/utils@^20.0.0-RC.0