@taquito/taquito
Advanced tools
Comparing version 8.0.0-alpha.0 to 8.0.0-beta.1
@@ -46,6 +46,6 @@ "use strict"; | ||
var createOriginationOperation = function (_a) { | ||
var code = _a.code, init = _a.init, _b = _a.balance, balance = _b === void 0 ? "0" : _b, delegate = _a.delegate, storage = _a.storage, _c = _a.fee, fee = _c === void 0 ? constants_1.DEFAULT_FEE.ORIGINATION : _c, _d = _a.gasLimit, gasLimit = _d === void 0 ? constants_1.DEFAULT_GAS_LIMIT.ORIGINATION : _d, _e = _a.storageLimit, storageLimit = _e === void 0 ? constants_1.DEFAULT_STORAGE_LIMIT.ORIGINATION : _e; | ||
var code = _a.code, init = _a.init, _b = _a.balance, balance = _b === void 0 ? "0" : _b, delegate = _a.delegate, storage = _a.storage, _c = _a.fee, fee = _c === void 0 ? constants_1.DEFAULT_FEE.ORIGINATION : _c, _d = _a.gasLimit, gasLimit = _d === void 0 ? constants_1.DEFAULT_GAS_LIMIT.ORIGINATION : _d, _e = _a.storageLimit, storageLimit = _e === void 0 ? constants_1.DEFAULT_STORAGE_LIMIT.ORIGINATION : _e, _f = _a.mutez, mutez = _f === void 0 ? false : _f; | ||
return __awaiter(void 0, void 0, void 0, function () { | ||
var parser, contractCode, c, c, order_1, contractStorage, storageType, schema, c, script, operation; | ||
return __generator(this, function (_f) { | ||
return __generator(this, function (_g) { | ||
// tslint:disable-next-line: strict-type-predicates | ||
@@ -99,3 +99,5 @@ if (storage !== undefined && init !== undefined) { | ||
storage_limit: storageLimit, | ||
balance: format_1.format("tz", "mutez", balance).toString(), | ||
balance: mutez | ||
? balance.toString() | ||
: format_1.format('tz', 'mutez', balance).toString(), | ||
script: script, | ||
@@ -102,0 +104,0 @@ }; |
@@ -340,5 +340,6 @@ "use strict"; | ||
}; | ||
RpcContractProvider.prototype.at = function (address) { | ||
RpcContractProvider.prototype.at = function (address, contractAbstractionComposer) { | ||
if (contractAbstractionComposer === void 0) { contractAbstractionComposer = function (x) { return x; }; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var script, entrypoints, blockHeader, chainId; | ||
var script, entrypoints, blockHeader, chainId, abs; | ||
return __generator(this, function (_a) { | ||
@@ -356,3 +357,4 @@ switch (_a.label) { | ||
chainId = blockHeader.chain_id; | ||
return [2 /*return*/, new contract_1.ContractAbstraction(address, script, this, this, entrypoints, chainId)]; | ||
abs = new contract_1.ContractAbstraction(address, script, this, this, entrypoints, chainId); | ||
return [2 /*return*/, contractAbstractionComposer(abs, this.context)]; | ||
} | ||
@@ -359,0 +361,0 @@ }); |
@@ -269,2 +269,12 @@ "use strict"; | ||
}); | ||
/** | ||
* @description Allow to add a module to the TezosToolkit instance. This method adds the appropriate Providers(s) required by the module to the internal context. | ||
* | ||
* @param module extension to add to the TezosToolkit instance | ||
* | ||
* @example Tezos.addExtension(new Tzip16Module()); | ||
*/ | ||
TezosToolkit.prototype.addExtension = function (module) { | ||
module.configureContext(this._context); | ||
}; | ||
TezosToolkit.prototype.getFactory = function (ctor) { | ||
@@ -271,0 +281,0 @@ var _this = this; |
@@ -377,5 +377,6 @@ "use strict"; | ||
*/ | ||
Wallet.prototype.at = function (address) { | ||
Wallet.prototype.at = function (address, contractAbstractionComposer) { | ||
if (contractAbstractionComposer === void 0) { contractAbstractionComposer = function (x) { return x; }; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var script, entrypoints, blockHeader, chainId; | ||
var script, entrypoints, blockHeader, chainId, abs; | ||
return __generator(this, function (_a) { | ||
@@ -393,3 +394,4 @@ switch (_a.label) { | ||
chainId = blockHeader.chain_id; | ||
return [2 /*return*/, new contract_1.ContractAbstraction(address, script, this, this.context.contract, entrypoints, chainId)]; | ||
abs = new contract_1.ContractAbstraction(address, script, this, this.context.contract, entrypoints, chainId); | ||
return [2 /*return*/, contractAbstractionComposer(abs, this.context)]; | ||
} | ||
@@ -396,0 +398,0 @@ }); |
@@ -9,5 +9,5 @@ import { Schema } from '@taquito/michelson-encoder'; | ||
constructor(id: BigNumber, schema: Schema, provider: ContractProvider); | ||
get(keyToEncode: string): Promise<unknown>; | ||
get<T>(keyToEncode: string): Promise<T | undefined>; | ||
toJSON(): string; | ||
toString(): string; | ||
} |
@@ -57,3 +57,3 @@ import { ParameterSchema, Schema } from '@taquito/michelson-encoder'; | ||
private args; | ||
constructor(currentContract: ContractAbstraction<ContractProvider | Wallet>, provider: ContractProvider | Wallet, name: string, chainId: string, callbackParametersSchema: ParameterSchema, parameterSchema: ParameterSchema, args: any[]); | ||
constructor(currentContract: ContractAbstraction<ContractProvider | Wallet>, provider: ContractProvider, name: string, chainId: string, callbackParametersSchema: ParameterSchema, parameterSchema: ParameterSchema, args: any[]); | ||
/** | ||
@@ -60,0 +60,0 @@ * |
import { Schema } from '@taquito/michelson-encoder'; | ||
import { Context } from '../context'; | ||
import { DelegateOperation } from '../operations/delegate-operation'; | ||
@@ -121,3 +122,3 @@ import { OriginationOperation } from '../operations/origination-operation'; | ||
transfer(params: TransferParams): Promise<TransactionOperation>; | ||
at(address: string, schema?: ContractSchema): Promise<ContractAbstraction<ContractProvider>>; | ||
at<T extends ContractAbstraction<ContractProvider>>(address: string, contractAbstractionComposer?: (abs: ContractAbstraction<ContractProvider>, context: Context) => T): Promise<T>; | ||
} |
import { OriginateParams, RPCOriginationOperation, TransferParams, RPCTransferOperation, DelegateParams, RPCDelegateOperation, RegisterDelegateParams } from '../operations/types'; | ||
export declare const createOriginationOperation: ({ code, init, balance, delegate, storage, fee, gasLimit, storageLimit, }: OriginateParams) => Promise<RPCOriginationOperation>; | ||
export declare const createOriginationOperation: ({ code, init, balance, delegate, storage, fee, gasLimit, storageLimit, mutez }: OriginateParams) => Promise<RPCOriginationOperation>; | ||
export declare const createTransferOperation: ({ to, amount, parameter, fee, gasLimit, storageLimit, mutez, }: TransferParams) => Promise<RPCTransferOperation>; | ||
export declare const createSetDelegateOperation: ({ delegate, source, fee, gasLimit, storageLimit, }: DelegateParams) => Promise<RPCDelegateOperation>; | ||
export declare const createRegisterDelegateOperation: ({ fee, gasLimit, storageLimit, }: RegisterDelegateParams, source: string) => Promise<RPCDelegateOperation>; |
@@ -86,3 +86,5 @@ import { Schema } from '@taquito/michelson-encoder'; | ||
transfer(params: TransferParams): Promise<TransactionOperation>; | ||
at(address: string): Promise<ContractAbstraction<ContractProvider>>; | ||
at<T extends ContractAbstraction<ContractProvider>>(address: string, contractAbstractionComposer?: ContractAbstractionComposer<T>): Promise<T>; | ||
} | ||
declare type ContractAbstractionComposer<T> = (abs: ContractAbstraction<ContractProvider>, context: Context) => T; | ||
export {}; |
@@ -66,2 +66,3 @@ import { OperationObject, InternalOperationResultKindEnum, OpKind, TransactionOperationParameter } from '@taquito/rpc'; | ||
storageLimit?: number; | ||
mutez?: boolean; | ||
}; | ||
@@ -68,0 +69,0 @@ /** |
@@ -6,2 +6,3 @@ import { RpcClient } from '@taquito/rpc'; | ||
import { ContractProvider, EstimationProvider } from './contract/interface'; | ||
import { Extension } from './extension/extension'; | ||
import { Forger } from './forger/interface'; | ||
@@ -31,2 +32,3 @@ import { format } from './format'; | ||
export * from './wallet'; | ||
export { Extension } from './extension/extension'; | ||
export interface SetProviderOptions { | ||
@@ -137,3 +139,11 @@ forger?: Forger; | ||
get signer(): Signer; | ||
/** | ||
* @description Allow to add a module to the TezosToolkit instance. This method adds the appropriate Providers(s) required by the module to the internal context. | ||
* | ||
* @param module extension to add to the TezosToolkit instance | ||
* | ||
* @example Tezos.addExtension(new Tzip16Module()); | ||
*/ | ||
addExtension(module: Extension): void; | ||
getFactory<T, K extends Array<any>>(ctor: TaquitoProvider<T, K>): (...args: K) => T; | ||
} |
@@ -10,5 +10,5 @@ import { Context } from '../context'; | ||
mapTransferParamsToWalletParams(params: WalletTransferParams): Promise<import("../operations/types").withKind<Pick<import("../operations/types").TransferParams, "to" | "amount" | "parameter" | "mutez">, OpKind.TRANSACTION>>; | ||
mapOriginateParamsToWalletParams(params: WalletOriginateParams): Promise<import("../operations/types").withKind<Pick<import("../operations/types").OriginateParams, "balance" | "code" | "delegate" | "init" | "storage">, OpKind.ORIGINATION>>; | ||
mapOriginateParamsToWalletParams(params: WalletOriginateParams): Promise<import("../operations/types").withKind<Pick<import("../operations/types").OriginateParams, "mutez" | "balance" | "code" | "delegate" | "init" | "storage">, OpKind.ORIGINATION>>; | ||
mapDelegateParamsToWalletParams(params: WalletDelegateParams): Promise<import("../operations/types").withKind<Pick<import("../operations/types").DelegateParams, "delegate">, OpKind.DELEGATION>>; | ||
sendOperations(params: WalletParamsWithKind[]): Promise<string>; | ||
} |
@@ -12,3 +12,3 @@ import { BlockResponse, OperationContentsAndResultOrigination, OperationContentsAndResultReveal } from '@taquito/rpc'; | ||
status(): Promise<OperationStatus>; | ||
contract(): Promise<import("../contract").WalletContract>; | ||
contract(): Promise<import("../contract").ContractAbstraction<import("./wallet").Wallet>>; | ||
} |
import { Context } from '../context'; | ||
import { ContractMethod, WalletContract } from '../contract'; | ||
import { ContractAbstraction, ContractMethod } from '../contract'; | ||
import { OpKind, withKind } from '../operations/types'; | ||
@@ -130,3 +130,3 @@ import { WalletDelegateParams, WalletOriginateParams, WalletProvider, WalletTransferParams } from './interface'; | ||
*/ | ||
at(address: string): Promise<WalletContract>; | ||
at<T extends ContractAbstraction<Wallet>>(address: string, contractAbstractionComposer?: (abs: ContractAbstraction<Wallet>, context: Context) => T): Promise<T>; | ||
} |
{ | ||
"name": "@taquito/taquito", | ||
"version": "8.0.0-alpha.0", | ||
"version": "8.0.0-beta.1", | ||
"description": "High level functionality that builds upon the other packages in the Tezos Typescript Library Suite.", | ||
@@ -80,7 +80,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@taquito/http-utils": "^8.0.0-alpha.0", | ||
"@taquito/michel-codec": "^8.0.0-alpha.0", | ||
"@taquito/michelson-encoder": "^8.0.0-alpha.0", | ||
"@taquito/rpc": "^8.0.0-alpha.0", | ||
"@taquito/utils": "^8.0.0-alpha.0", | ||
"@taquito/http-utils": "^8.0.0-beta.1", | ||
"@taquito/michel-codec": "^8.0.0-beta.1", | ||
"@taquito/michelson-encoder": "^8.0.0-beta.1", | ||
"@taquito/rpc": "^8.0.0-beta.1", | ||
"@taquito/utils": "^8.0.0-beta.1", | ||
"bignumber.js": "^9.0.1", | ||
@@ -122,3 +122,3 @@ "rx-sandbox": "^1.0.3", | ||
}, | ||
"gitHead": "66f5a4487644cf9e57d153b35ec535250e6b82b6" | ||
"gitHead": "1a563e06fb2fad0fce858026b6a195f307118940" | ||
} |
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
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 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 not supported yet
1419600
162
17771