@massalabs/wallet-provider 1.4.2-dev.20230929102824 → 1.4.2-dev.20230929132145
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/dist/cmd/account/IAccount.d.ts +62 -4
- package/dist/cmd/account/IAccount.d.ts.map +1 -1
- package/dist/cmd/account/IAccount.js.map +1 -1
- package/dist/esm/account/IAccount.d.ts +62 -4
- package/dist/esm/account/IAccount.d.ts.map +1 -1
- package/dist/esm/account/IAccount.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,20 +2,78 @@
|
|
|
2
2
|
import { ITransactionDetails } from '..';
|
|
3
3
|
import { IAccountBalanceResponse } from './AccountBalance';
|
|
4
4
|
import { IAccountSignOutput } from './AccountSign';
|
|
5
|
-
import { Args } from '@massalabs/web3-utils';
|
|
5
|
+
import { Args, IContractReadOperationResponse } from '@massalabs/web3-utils';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* `IAccount` outlines the structure expected for an account.
|
|
9
8
|
*/
|
|
10
9
|
export interface IAccount {
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves the account's address.
|
|
12
|
+
*
|
|
13
|
+
* @returns Account address as a string.
|
|
14
|
+
*/
|
|
11
15
|
address(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves the account's name.
|
|
18
|
+
*
|
|
19
|
+
* @returns Account name as a string.
|
|
20
|
+
*/
|
|
12
21
|
name(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves the name of the provider associated with the account.
|
|
24
|
+
*
|
|
25
|
+
* @returns Provider name as a string.
|
|
26
|
+
*/
|
|
13
27
|
providerName(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Initiates a request to retrieve the account's balance.
|
|
30
|
+
*
|
|
31
|
+
* @returns Promise resolving to an `IAccountBalanceResponse`.
|
|
32
|
+
*/
|
|
14
33
|
balance(): Promise<IAccountBalanceResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Signs data.
|
|
36
|
+
*
|
|
37
|
+
* @param data - Data to be signed, can be of type Buffer, Uint8Array, or string.
|
|
38
|
+
* @returns Promise resolving to an `IAccountSignOutput`.
|
|
39
|
+
*/
|
|
15
40
|
sign(data: Buffer | Uint8Array | string): Promise<IAccountSignOutput>;
|
|
41
|
+
/**
|
|
42
|
+
* Purchases rolls.
|
|
43
|
+
*
|
|
44
|
+
* @param amount - Amount of rolls to purchase.
|
|
45
|
+
* @param fee - Transaction fee.
|
|
46
|
+
* @returns A promise resolving to an `ITransactionDetails` object.
|
|
47
|
+
*/
|
|
16
48
|
buyRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;
|
|
49
|
+
/**
|
|
50
|
+
* Sells rolls.
|
|
51
|
+
*
|
|
52
|
+
* @param amount - Amount of rolls to sell.
|
|
53
|
+
* @param fee - Transaction fee.
|
|
54
|
+
* @returns A promise resolving to an `ITransactionDetails` object.
|
|
55
|
+
*/
|
|
17
56
|
sellRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;
|
|
57
|
+
/**
|
|
58
|
+
* Sends a transaction.
|
|
59
|
+
*
|
|
60
|
+
* @param amount - Amount to send.
|
|
61
|
+
* @param recipientAddress - Address of the recipient.
|
|
62
|
+
* @param fee - Transaction fee.
|
|
63
|
+
* @returns A promise resolving to an `ITransactionDetails` object.
|
|
64
|
+
*/
|
|
18
65
|
sendTransaction(amount: bigint, recipientAddress: string, fee: bigint): Promise<ITransactionDetails>;
|
|
19
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Calls a smart contract.
|
|
68
|
+
*
|
|
69
|
+
* @param contractAddress - Address of the smart contract.
|
|
70
|
+
* @param functionName - Name of the function to call.
|
|
71
|
+
* @param parameter - Parameters to pass to the function.
|
|
72
|
+
* @param amount - Amount of funds to send with the call.
|
|
73
|
+
* @param fee - Fee for the transaction.
|
|
74
|
+
* @param maxGas - Maximum gas to use for the transaction.
|
|
75
|
+
* @param nonPersistentExecution - Optional flag for non-persistent execution.
|
|
76
|
+
*/
|
|
77
|
+
callSC(contractAddress: string, functionName: string, parameter: Uint8Array | Args, amount: bigint, fee: bigint, maxGas: bigint, nonPersistentExecution?: boolean): Promise<ITransactionDetails | IContractReadOperationResponse>;
|
|
20
78
|
}
|
|
21
79
|
//# sourceMappingURL=IAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccount.d.ts","sourceRoot":"","sources":["../../../src/account/IAccount.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,IAAI,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"IAccount.d.ts","sourceRoot":"","sources":["../../../src/account/IAccount.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,IAAI,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,OAAO,IAAI,MAAM,CAAC;IAElB;;;;OAIG;IACH,IAAI,IAAI,MAAM,CAAC;IAEf;;;;OAIG;IACH,YAAY,IAAI,MAAM,CAAC;IAEvB;;;;OAIG;IACH,OAAO,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAE5C;;;;;OAKG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEtE;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEpE;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAErE;;;;;;;OAOG;IACH,eAAe,CACb,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,MAAM,EACxB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEhC;;;;;;;;;;OAUG;IACH,MAAM,CACJ,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,UAAU,GAAG,IAAI,EAC5B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,sBAAsB,CAAC,EAAE,OAAO,GAC/B,OAAO,CAAC,mBAAmB,GAAG,8BAA8B,CAAC,CAAC;CAClE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccount.js","sourceRoot":"","sources":["../../../src/account/IAccount.ts"],"names":[],"mappings":"","sourcesContent":["import { ITransactionDetails } from '..';\nimport { IAccountBalanceResponse } from './AccountBalance';\nimport { IAccountSignOutput } from './AccountSign';\nimport { Args } from '@massalabs/web3-utils';\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"IAccount.js","sourceRoot":"","sources":["../../../src/account/IAccount.ts"],"names":[],"mappings":"","sourcesContent":["import { ITransactionDetails } from '..';\nimport { IAccountBalanceResponse } from './AccountBalance';\nimport { IAccountSignOutput } from './AccountSign';\nimport { Args, IContractReadOperationResponse } from '@massalabs/web3-utils';\n\n/**\n * `IAccount` outlines the structure expected for an account.\n */\nexport interface IAccount {\n /**\n * Retrieves the account's address.\n *\n * @returns Account address as a string.\n */\n address(): string;\n\n /**\n * Retrieves the account's name.\n *\n * @returns Account name as a string.\n */\n name(): string;\n\n /**\n * Retrieves the name of the provider associated with the account.\n *\n * @returns Provider name as a string.\n */\n providerName(): string;\n\n /**\n * Initiates a request to retrieve the account's balance.\n *\n * @returns Promise resolving to an `IAccountBalanceResponse`.\n */\n balance(): Promise<IAccountBalanceResponse>;\n\n /**\n * Signs data.\n *\n * @param data - Data to be signed, can be of type Buffer, Uint8Array, or string.\n * @returns Promise resolving to an `IAccountSignOutput`.\n */\n sign(data: Buffer | Uint8Array | string): Promise<IAccountSignOutput>;\n\n /**\n * Purchases rolls.\n *\n * @param amount - Amount of rolls to purchase.\n * @param fee - Transaction fee.\n * @returns A promise resolving to an `ITransactionDetails` object.\n */\n buyRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;\n\n /**\n * Sells rolls.\n *\n * @param amount - Amount of rolls to sell.\n * @param fee - Transaction fee.\n * @returns A promise resolving to an `ITransactionDetails` object.\n */\n sellRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;\n\n /**\n * Sends a transaction.\n *\n * @param amount - Amount to send.\n * @param recipientAddress - Address of the recipient.\n * @param fee - Transaction fee.\n * @returns A promise resolving to an `ITransactionDetails` object.\n */\n sendTransaction(\n amount: bigint,\n recipientAddress: string,\n fee: bigint,\n ): Promise<ITransactionDetails>;\n\n /**\n * Calls a smart contract.\n *\n * @param contractAddress - Address of the smart contract.\n * @param functionName - Name of the function to call.\n * @param parameter - Parameters to pass to the function.\n * @param amount - Amount of funds to send with the call.\n * @param fee - Fee for the transaction.\n * @param maxGas - Maximum gas to use for the transaction.\n * @param nonPersistentExecution - Optional flag for non-persistent execution.\n */\n callSC(\n contractAddress: string,\n functionName: string,\n parameter: Uint8Array | Args,\n amount: bigint,\n fee: bigint,\n maxGas: bigint,\n nonPersistentExecution?: boolean,\n ): Promise<ITransactionDetails | IContractReadOperationResponse>;\n}\n"]}
|
|
@@ -2,20 +2,78 @@
|
|
|
2
2
|
import { ITransactionDetails } from '..';
|
|
3
3
|
import { IAccountBalanceResponse } from './AccountBalance';
|
|
4
4
|
import { IAccountSignOutput } from './AccountSign';
|
|
5
|
-
import { Args } from '@massalabs/web3-utils';
|
|
5
|
+
import { Args, IContractReadOperationResponse } from '@massalabs/web3-utils';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* `IAccount` outlines the structure expected for an account.
|
|
9
8
|
*/
|
|
10
9
|
export interface IAccount {
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves the account's address.
|
|
12
|
+
*
|
|
13
|
+
* @returns Account address as a string.
|
|
14
|
+
*/
|
|
11
15
|
address(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves the account's name.
|
|
18
|
+
*
|
|
19
|
+
* @returns Account name as a string.
|
|
20
|
+
*/
|
|
12
21
|
name(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves the name of the provider associated with the account.
|
|
24
|
+
*
|
|
25
|
+
* @returns Provider name as a string.
|
|
26
|
+
*/
|
|
13
27
|
providerName(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Initiates a request to retrieve the account's balance.
|
|
30
|
+
*
|
|
31
|
+
* @returns Promise resolving to an `IAccountBalanceResponse`.
|
|
32
|
+
*/
|
|
14
33
|
balance(): Promise<IAccountBalanceResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Signs data.
|
|
36
|
+
*
|
|
37
|
+
* @param data - Data to be signed, can be of type Buffer, Uint8Array, or string.
|
|
38
|
+
* @returns Promise resolving to an `IAccountSignOutput`.
|
|
39
|
+
*/
|
|
15
40
|
sign(data: Buffer | Uint8Array | string): Promise<IAccountSignOutput>;
|
|
41
|
+
/**
|
|
42
|
+
* Purchases rolls.
|
|
43
|
+
*
|
|
44
|
+
* @param amount - Amount of rolls to purchase.
|
|
45
|
+
* @param fee - Transaction fee.
|
|
46
|
+
* @returns A promise resolving to an `ITransactionDetails` object.
|
|
47
|
+
*/
|
|
16
48
|
buyRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;
|
|
49
|
+
/**
|
|
50
|
+
* Sells rolls.
|
|
51
|
+
*
|
|
52
|
+
* @param amount - Amount of rolls to sell.
|
|
53
|
+
* @param fee - Transaction fee.
|
|
54
|
+
* @returns A promise resolving to an `ITransactionDetails` object.
|
|
55
|
+
*/
|
|
17
56
|
sellRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;
|
|
57
|
+
/**
|
|
58
|
+
* Sends a transaction.
|
|
59
|
+
*
|
|
60
|
+
* @param amount - Amount to send.
|
|
61
|
+
* @param recipientAddress - Address of the recipient.
|
|
62
|
+
* @param fee - Transaction fee.
|
|
63
|
+
* @returns A promise resolving to an `ITransactionDetails` object.
|
|
64
|
+
*/
|
|
18
65
|
sendTransaction(amount: bigint, recipientAddress: string, fee: bigint): Promise<ITransactionDetails>;
|
|
19
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Calls a smart contract.
|
|
68
|
+
*
|
|
69
|
+
* @param contractAddress - Address of the smart contract.
|
|
70
|
+
* @param functionName - Name of the function to call.
|
|
71
|
+
* @param parameter - Parameters to pass to the function.
|
|
72
|
+
* @param amount - Amount of funds to send with the call.
|
|
73
|
+
* @param fee - Fee for the transaction.
|
|
74
|
+
* @param maxGas - Maximum gas to use for the transaction.
|
|
75
|
+
* @param nonPersistentExecution - Optional flag for non-persistent execution.
|
|
76
|
+
*/
|
|
77
|
+
callSC(contractAddress: string, functionName: string, parameter: Uint8Array | Args, amount: bigint, fee: bigint, maxGas: bigint, nonPersistentExecution?: boolean): Promise<ITransactionDetails | IContractReadOperationResponse>;
|
|
20
78
|
}
|
|
21
79
|
//# sourceMappingURL=IAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccount.d.ts","sourceRoot":"","sources":["../../../src/account/IAccount.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,IAAI,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,O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EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,sBAAsB,CAAC,EAAE,OAAO,GAC/B,OAAO,CAAC,mBAAmB,GAAG,8BAA8B,CAAC,CAAC;CAClE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccount.js","sourceRoot":"","sources":["../../../src/account/IAccount.ts"],"names":[],"mappings":"","sourcesContent":["import { ITransactionDetails } from '..';\nimport { IAccountBalanceResponse } from './AccountBalance';\nimport { IAccountSignOutput } from './AccountSign';\nimport { Args } from '@massalabs/web3-utils';\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"IAccount.js","sourceRoot":"","sources":["../../../src/account/IAccount.ts"],"names":[],"mappings":"","sourcesContent":["import { ITransactionDetails } from '..';\nimport { IAccountBalanceResponse } from './AccountBalance';\nimport { IAccountSignOutput } from './AccountSign';\nimport { Args, IContractReadOperationResponse } from '@massalabs/web3-utils';\n\n/**\n * `IAccount` outlines the structure expected for an account.\n */\nexport interface IAccount {\n /**\n * Retrieves the account's address.\n *\n * @returns Account address as a string.\n */\n address(): string;\n\n /**\n * Retrieves the account's name.\n *\n * @returns Account name as a string.\n */\n name(): string;\n\n /**\n * Retrieves the name of the provider associated with the account.\n *\n * @returns Provider name as a string.\n */\n providerName(): string;\n\n /**\n * Initiates a request to retrieve the account's balance.\n *\n * @returns Promise resolving to an `IAccountBalanceResponse`.\n */\n balance(): Promise<IAccountBalanceResponse>;\n\n /**\n * Signs data.\n *\n * @param data - Data to be signed, can be of type Buffer, Uint8Array, or string.\n * @returns Promise resolving to an `IAccountSignOutput`.\n */\n sign(data: Buffer | Uint8Array | string): Promise<IAccountSignOutput>;\n\n /**\n * Purchases rolls.\n *\n * @param amount - Amount of rolls to purchase.\n * @param fee - Transaction fee.\n * @returns A promise resolving to an `ITransactionDetails` object.\n */\n buyRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;\n\n /**\n * Sells rolls.\n *\n * @param amount - Amount of rolls to sell.\n * @param fee - Transaction fee.\n * @returns A promise resolving to an `ITransactionDetails` object.\n */\n sellRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;\n\n /**\n * Sends a transaction.\n *\n * @param amount - Amount to send.\n * @param recipientAddress - Address of the recipient.\n * @param fee - Transaction fee.\n * @returns A promise resolving to an `ITransactionDetails` object.\n */\n sendTransaction(\n amount: bigint,\n recipientAddress: string,\n fee: bigint,\n ): Promise<ITransactionDetails>;\n\n /**\n * Calls a smart contract.\n *\n * @param contractAddress - Address of the smart contract.\n * @param functionName - Name of the function to call.\n * @param parameter - Parameters to pass to the function.\n * @param amount - Amount of funds to send with the call.\n * @param fee - Fee for the transaction.\n * @param maxGas - Maximum gas to use for the transaction.\n * @param nonPersistentExecution - Optional flag for non-persistent execution.\n */\n callSC(\n contractAddress: string,\n functionName: string,\n parameter: Uint8Array | Args,\n amount: bigint,\n fee: bigint,\n maxGas: bigint,\n nonPersistentExecution?: boolean,\n ): Promise<ITransactionDetails | IContractReadOperationResponse>;\n}\n"]}
|