koilib 5.0.0 → 5.1.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.
- package/README.md +74 -11
- package/dist/koinos.js +93 -53
- package/dist/koinos.min.js +1 -1
- package/lib/Contract.js +34 -30
- package/lib/Contract.js.map +1 -1
- package/lib/Provider.d.ts +4 -1
- package/lib/Provider.js +19 -8
- package/lib/Provider.js.map +1 -1
- package/lib/Serializer.js +22 -4
- package/lib/Serializer.js.map +1 -1
- package/lib/Signer.d.ts +14 -11
- package/lib/Signer.js +18 -11
- package/lib/Signer.js.map +1 -1
- package/lib/browser/Contract.js +34 -30
- package/lib/browser/Contract.js.map +1 -1
- package/lib/browser/Provider.d.ts +4 -1
- package/lib/browser/Provider.js +19 -8
- package/lib/browser/Provider.js.map +1 -1
- package/lib/browser/Serializer.js +22 -4
- package/lib/browser/Serializer.js.map +1 -1
- package/lib/browser/Signer.d.ts +14 -11
- package/lib/browser/Signer.js +18 -11
- package/lib/browser/Signer.js.map +1 -1
- package/lib/browser/interface.d.ts +56 -1
- package/lib/interface.d.ts +56 -1
- package/package.json +1 -1
package/lib/interface.d.ts
CHANGED
|
@@ -185,6 +185,12 @@ export interface BaseTransactionOptions {
|
|
|
185
185
|
* testing purposes and check the possible events triggered.
|
|
186
186
|
*/
|
|
187
187
|
broadcast?: boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Function to be called before sending a transaction to the
|
|
190
|
+
* blockchain. It is useful to apply multisignatures to
|
|
191
|
+
* the transaction
|
|
192
|
+
*/
|
|
193
|
+
beforeSend?: (tx: TransactionJson) => Promise<void>;
|
|
188
194
|
}
|
|
189
195
|
export interface TransactionOptions extends BaseTransactionOptions {
|
|
190
196
|
/**
|
|
@@ -229,6 +235,52 @@ export interface DeployOptions extends BaseTransactionOptions {
|
|
|
229
235
|
*/
|
|
230
236
|
authorizesUploadContract?: boolean;
|
|
231
237
|
}
|
|
238
|
+
export interface SendTransactionOptions {
|
|
239
|
+
/**
|
|
240
|
+
* Broadcast
|
|
241
|
+
*
|
|
242
|
+
* Boolean to define if the transaction should be broadcasted
|
|
243
|
+
* to the different nodes in the network. By default it is true.
|
|
244
|
+
*
|
|
245
|
+
* Set it to false if you want to interact with a contract for
|
|
246
|
+
* testing purposes and check the possible events triggered.
|
|
247
|
+
*/
|
|
248
|
+
broadcast?: boolean;
|
|
249
|
+
/**
|
|
250
|
+
* Collection of Abis so that the receiver can parse the
|
|
251
|
+
* operations in the transaction
|
|
252
|
+
*/
|
|
253
|
+
abis?: Record<string, Abi>;
|
|
254
|
+
/**
|
|
255
|
+
* Function to be called before sending a transaction to the
|
|
256
|
+
* blockchain. It is useful to apply multisignatures to
|
|
257
|
+
* the transaction.
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```ts
|
|
261
|
+
* const signer2 = Signer.fromSeed("signer2");
|
|
262
|
+
* const signer3 = Signer.fromSeed("signer3");
|
|
263
|
+
*
|
|
264
|
+
* const addMoreSignatures = async (tx) => {
|
|
265
|
+
* await signer2.signTransaction(tx);
|
|
266
|
+
* await signer3.signTransaction(tx);
|
|
267
|
+
* };
|
|
268
|
+
*
|
|
269
|
+
* const { transaction } = await koin.transfer(
|
|
270
|
+
* {
|
|
271
|
+
* from: "16MT1VQFgsVxEfJrSGinrA5buiqBsN5ViJ",
|
|
272
|
+
* to: "1Gvqdo9if6v6tFomEuTuMWP1D7H7U9yksb",
|
|
273
|
+
* value: "1000000",
|
|
274
|
+
* },
|
|
275
|
+
* {
|
|
276
|
+
* payer: signer2.getAddress(),
|
|
277
|
+
* beforeSend: addMoreSignatures,
|
|
278
|
+
* }
|
|
279
|
+
* );
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
beforeSend?: (tx: TransactionJson) => Promise<void>;
|
|
283
|
+
}
|
|
232
284
|
export interface RecoverPublicKeyOptions {
|
|
233
285
|
/**
|
|
234
286
|
* Boolean to define if the public key should
|
|
@@ -263,7 +315,10 @@ export interface RecoverPublicKeyOptions {
|
|
|
263
315
|
*
|
|
264
316
|
* @param timeout - Timeout in milliseconds. By default it is 15000
|
|
265
317
|
*/
|
|
266
|
-
export declare type WaitFunction = (type?: "byBlock" | "byTransactionId", timeout?: number) => Promise<
|
|
318
|
+
export declare type WaitFunction = (type?: "byBlock" | "byTransactionId", timeout?: number) => Promise<{
|
|
319
|
+
blockId: string;
|
|
320
|
+
blockNumber?: number;
|
|
321
|
+
}>;
|
|
267
322
|
export interface GenesisDataEntryEncoded {
|
|
268
323
|
space: {
|
|
269
324
|
system?: boolean;
|