@taquito/taquito 19.2.1-beta.2 → 20.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ import { ContractMethod } from '../contract/contract-methods/contract-method-fla
4
4
  import { ContractMethodObject } from '../contract/contract-methods/contract-method-object-param';
5
5
  import { OpKind, withKind } from '../operations/types';
6
6
  import { OriginationWalletOperation } from './origination-operation';
7
- import { WalletDelegateParams, WalletFailingNoopParams, WalletIncreasePaidStorageParams, WalletOriginateParams, WalletProvider, WalletTransferParams } from './interface';
7
+ import { WalletDelegateParams, WalletFailingNoopParams, WalletIncreasePaidStorageParams, WalletOriginateParams, WalletProvider, WalletTransferParams, WalletStakeParams, WalletUnstakeParams, WalletFinalizeUnstakeParams } from './interface';
8
8
  export interface PKHOption {
9
9
  forceRefetch?: boolean;
10
10
  }
@@ -15,54 +15,40 @@ export declare class WalletOperationBatch {
15
15
  private operations;
16
16
  constructor(walletProvider: WalletProvider, context: Context);
17
17
  /**
18
- *
19
18
  * @description Add a transaction operation to the batch
20
- *
21
19
  * @param params Transfer operation parameter
22
20
  */
23
21
  withTransfer(params: WalletTransferParams): this;
24
22
  /**
25
- *
26
23
  * @description Add a contract call to the batch
27
- *
28
24
  * @param params Call a contract method
29
25
  * @param options Generic operation parameters
30
26
  */
31
27
  withContractCall(params: ContractMethod<Wallet> | ContractMethodObject<Wallet>, options?: Partial<SendParams>): this;
32
28
  /**
33
- *
34
29
  * @description Add a delegation operation to the batch
35
- *
36
30
  * @param params Delegation operation parameter
37
31
  */
38
32
  withDelegation(params: WalletDelegateParams): this;
39
33
  /**
40
- *
41
34
  * @description Add an origination operation to the batch
42
- *
43
35
  * @param params Origination operation parameter
44
36
  */
45
37
  withOrigination<TWallet extends DefaultWalletType = DefaultWalletType>(params: WalletOriginateParams<ContractStorageType<TWallet>>): this;
46
38
  /**
47
- *
48
39
  * @description Add an IncreasePaidStorage operation to the batch
49
- *
50
40
  * @param param IncreasePaidStorage operation parameter
51
41
  */
52
42
  withIncreasePaidStorage(params: WalletIncreasePaidStorageParams): this;
53
43
  private mapOperation;
54
44
  /**
55
- *
56
45
  * @description Add a group operation to the batch. Operation will be applied in the order they are in the params array
57
- *
58
46
  * @param params Operations parameter
59
47
  * @throws {@link InvalidOperationKindError}
60
48
  */
61
49
  with(params: WalletParamsWithKind[]): this;
62
50
  /**
63
- *
64
51
  * @description Submit batch operation to wallet
65
- *
66
52
  */
67
53
  send(): Promise<import("./batch-operation").BatchWalletOperation>;
68
54
  }
@@ -74,47 +60,36 @@ export declare class Wallet {
74
60
  private _pk?;
75
61
  /**
76
62
  * @description Retrieve the PKH of the account that is currently in use by the wallet
77
- *
78
63
  * @param option Option to use while fetching the PKH.
79
64
  * If forceRefetch is specified the wallet provider implementation will refetch the PKH from the wallet
80
65
  */
81
66
  pkh({ forceRefetch }?: PKHOption): Promise<string>;
82
67
  /**
83
68
  * @description Retrieve the PK of the account that is currently in use by the wallet
84
- *
85
69
  * @param option Option to use while fetching the PK.
86
70
  * If forceRefetch is specified the wallet provider implementation will refetch the PK from the wallet
87
71
  */
88
72
  pk({ forceRefetch }?: PKHOption): Promise<string>;
89
73
  private walletCommand;
90
74
  /**
91
- *
92
75
  * @description Originate a new contract according to the script in parameters.
93
- *
94
- * @returns An operation handle with the result from the rpc node
95
- *
76
+ * @returns a OriginationWalletOperation promise object when followed by .send()
96
77
  * @param originateParams Originate operation parameter
97
78
  */
98
79
  originate<TWallet extends DefaultWalletType = DefaultWalletType>(params: WalletOriginateParams<ContractStorageType<TWallet>>): {
99
80
  send: () => Promise<OriginationWalletOperation<TWallet>>;
100
81
  };
101
82
  /**
102
- *
103
83
  * @description Set the delegate for a contract.
104
- *
105
- * @returns An operation handle with the result from the rpc node
106
- *
84
+ * @returns a WalletDelegateParams promise object when followed by .send()
107
85
  * @param delegateParams operation parameter
108
86
  */
109
87
  setDelegate(params: WalletDelegateParams): {
110
88
  send: () => Promise<import("./delegation-operation").DelegationWalletOperation>;
111
89
  };
112
90
  /**
113
- *
114
91
  * @description failing_noop operation that is guaranteed to fail. DISCLAIMER: Not all wallets support signing failing_noop operations.
115
- *
116
92
  * @returns Signature for a failing_noop
117
- *
118
93
  * @param params operation parameter
119
94
  */
120
95
  signFailingNoop(params: WalletFailingNoopParams): Promise<{
@@ -129,51 +104,63 @@ export declare class Wallet {
129
104
  };
130
105
  }>;
131
106
  /**
132
- *
133
107
  * @description Register the current address as delegate.
134
- *
135
- * @returns An operation handle with the result from the rpc node
136
- *
108
+ * @returns a DelegationWalletOperation promise object when followed by .send()
137
109
  */
138
110
  registerDelegate(): {
139
111
  send: () => Promise<import("./delegation-operation").DelegationWalletOperation>;
140
112
  };
141
113
  /**
142
- *
143
114
  * @description Transfer tezos tokens from current address to a specific address or call a smart contract.
144
- *
145
- * @returns A wallet command from which we can send the operation to the wallet
146
- *
115
+ * @returns a TransactionWalletOperation promise object when followed by .send()
147
116
  * @param params operation parameter
148
117
  */
149
118
  transfer(params: WalletTransferParams): {
150
119
  send: () => Promise<import("./transaction-operation").TransactionWalletOperation>;
151
120
  };
152
121
  /**
153
- *
154
- * @description
155
- *
156
- * @returns
157
- *
158
- * @param params
122
+ * @description Stake a given amount for the source address
123
+ * @returns a TransactionWalletOperation promise object when followed by .send()
124
+ * @param Stake pseudo-operation parameter
125
+ */
126
+ stake(params: WalletStakeParams): {
127
+ send: () => Promise<import("./transaction-operation").TransactionWalletOperation>;
128
+ };
129
+ /**
130
+ * @description Unstake the given amount. If "everything" is given as amount, unstakes everything from the staking balance.
131
+ * Unstaked tez remains frozen for a set amount of cycles (the slashing period) after the operation. Once this period is over,
132
+ * the operation "finalize unstake" must be called for the funds to appear in the liquid balance.
133
+ * @returns a TransactionWalletOperation promise object when followed by .send()
134
+ * @param Unstake pseudo-operation parameter
135
+ */
136
+ unstake(params: WalletUnstakeParams): {
137
+ send: () => Promise<import("./transaction-operation").TransactionWalletOperation>;
138
+ };
139
+ /**
140
+ * @description Transfer all the finalizable unstaked funds of the source to their liquid balance
141
+ * @returns a TransactionWalletOperation promise object when followed by .send()
142
+ * @param Finalize_unstake pseudo-operation parameter
143
+ */
144
+ finalizeUnstake(params: WalletFinalizeUnstakeParams): {
145
+ send: () => Promise<import("./transaction-operation").TransactionWalletOperation>;
146
+ };
147
+ /**
148
+ * @description Increase the paid storage of a smart contract.
149
+ * @returns a IncreasePaidStorageWalletOperation promise object when followed by .send()
150
+ * @param params operation parameter
159
151
  */
160
152
  increasePaidStorage(params: WalletIncreasePaidStorageParams): {
161
153
  send: () => Promise<import("./increase-paid-storage-operation").IncreasePaidStorageWalletOperation>;
162
154
  };
163
155
  /**
164
- *
165
156
  * @description Create a batch of operation
166
- *
167
157
  * @returns A batch object from which we can add more operation or send a command to the wallet to execute the batch
168
- *
169
158
  * @param params List of operation to initialize the batch with
170
159
  */
171
160
  batch(params?: Parameters<WalletOperationBatch['with']>[0]): WalletOperationBatch;
172
161
  /**
173
- *
174
162
  * @description Create an smart contract abstraction for the address specified. Calling entrypoints with the returned
175
163
  * smart contract abstraction will leverage the wallet provider to make smart contract calls
176
- *
177
164
  * @param address Smart contract address
178
165
  * @throws {@link InvalidContractAddressError} If the contract address is not valid
179
166
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taquito/taquito",
3
- "version": "19.2.1-beta.2",
3
+ "version": "20.0.0-beta.1",
4
4
  "description": "High level functionality that builds upon the other packages in the Tezos Typescript Library Suite.",
5
5
  "keywords": [
6
6
  "tezos",
@@ -31,7 +31,7 @@
31
31
  "node": ">=18"
32
32
  },
33
33
  "scripts": {
34
- "test": "jest --coverage --testPathIgnorePatterns=operation-factory.spec.ts",
34
+ "test": "jest --coverage",
35
35
  "test:watch": "jest --coverage --watch",
36
36
  "test:prod": "npm run lint && npm run test -- --no-cache",
37
37
  "lint": "eslint --ext .js,.ts .",
@@ -77,13 +77,13 @@
77
77
  ]
78
78
  },
79
79
  "dependencies": {
80
- "@taquito/core": "^19.2.1-beta.2",
81
- "@taquito/http-utils": "^19.2.1-beta.2",
82
- "@taquito/local-forging": "^19.2.1-beta.2",
83
- "@taquito/michel-codec": "^19.2.1-beta.2",
84
- "@taquito/michelson-encoder": "^19.2.1-beta.2",
85
- "@taquito/rpc": "^19.2.1-beta.2",
86
- "@taquito/utils": "^19.2.1-beta.2",
80
+ "@taquito/core": "^20.0.0-beta.1",
81
+ "@taquito/http-utils": "^20.0.0-beta.1",
82
+ "@taquito/local-forging": "^20.0.0-beta.1",
83
+ "@taquito/michel-codec": "^20.0.0-beta.1",
84
+ "@taquito/michelson-encoder": "^20.0.0-beta.1",
85
+ "@taquito/rpc": "^20.0.0-beta.1",
86
+ "@taquito/utils": "^20.0.0-beta.1",
87
87
  "bignumber.js": "^9.1.2",
88
88
  "rxjs": "^7.8.1"
89
89
  },
@@ -125,5 +125,5 @@
125
125
  "webpack-cli": "^5.1.4",
126
126
  "webpack-subresource-integrity": "^5.1.0"
127
127
  },
128
- "gitHead": "5b9e3029baaef495f4ae8377dfb82dcd225c26f9"
128
+ "gitHead": "55491dbb67866d3196843b167ca9303f803b1a99"
129
129
  }