@massalabs/wallet-provider 1.4.2-dev.20230929102824 → 1.4.2-dev.20230929135423
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 +26 -85
- package/dist/cmd/account/AccountBalance.d.ts +5 -7
- package/dist/cmd/account/AccountBalance.d.ts.map +1 -1
- package/dist/cmd/account/AccountBalance.js.map +1 -1
- package/dist/cmd/account/AccountSign.d.ts +9 -9
- package/dist/cmd/account/AccountSign.d.ts.map +1 -1
- package/dist/cmd/account/AccountSign.js.map +1 -1
- package/dist/cmd/account/IAccount.d.ts +35 -5
- package/dist/cmd/account/IAccount.d.ts.map +1 -1
- package/dist/cmd/account/IAccount.js.map +1 -1
- package/dist/cmd/account/IAccountCallSCRequest.d.ts +9 -10
- package/dist/cmd/account/IAccountCallSCRequest.d.ts.map +1 -1
- package/dist/cmd/account/IAccountCallSCRequest.js.map +1 -1
- package/dist/cmd/account/IAccountDetails.d.ts +3 -1
- package/dist/cmd/account/IAccountDetails.d.ts.map +1 -1
- package/dist/cmd/account/IAccountDetails.js.map +1 -1
- package/dist/cmd/account/IAccountRolls.d.ts +3 -1
- package/dist/cmd/account/IAccountRolls.d.ts.map +1 -1
- package/dist/cmd/account/IAccountRolls.js.map +1 -1
- package/dist/cmd/account/IAccountSendTransaction.d.ts +4 -1
- package/dist/cmd/account/IAccountSendTransaction.d.ts.map +1 -1
- package/dist/cmd/account/IAccountSendTransaction.js.map +1 -1
- package/dist/esm/account/AccountBalance.d.ts +5 -7
- package/dist/esm/account/AccountBalance.d.ts.map +1 -1
- package/dist/esm/account/AccountBalance.js.map +1 -1
- package/dist/esm/account/AccountSign.d.ts +9 -9
- package/dist/esm/account/AccountSign.d.ts.map +1 -1
- package/dist/esm/account/AccountSign.js.map +1 -1
- package/dist/esm/account/IAccount.d.ts +35 -5
- package/dist/esm/account/IAccount.d.ts.map +1 -1
- package/dist/esm/account/IAccount.js.map +1 -1
- package/dist/esm/account/IAccountCallSCRequest.d.ts +9 -10
- package/dist/esm/account/IAccountCallSCRequest.d.ts.map +1 -1
- package/dist/esm/account/IAccountCallSCRequest.js.map +1 -1
- package/dist/esm/account/IAccountDetails.d.ts +3 -1
- package/dist/esm/account/IAccountDetails.d.ts.map +1 -1
- package/dist/esm/account/IAccountDetails.js.map +1 -1
- package/dist/esm/account/IAccountRolls.d.ts +3 -1
- package/dist/esm/account/IAccountRolls.d.ts.map +1 -1
- package/dist/esm/account/IAccountRolls.js.map +1 -1
- package/dist/esm/account/IAccountSendTransaction.d.ts +4 -1
- package/dist/esm/account/IAccountSendTransaction.d.ts.map +1 -1
- package/dist/esm/account/IAccountSendTransaction.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,69 +1,22 @@
|
|
|
1
|
+
# Wallet-Provider
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
> **PREREQUISITES:**
|
|
4
|
+
>
|
|
5
|
+
> - NodeJS 18+
|
|
6
|
+
> - npm / yarn (refer to package.json for specifics)
|
|
3
7
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`Wallet-provider` is a TypeScript library that one could utilize to establish a connection between a frontend application and any browser wallet extensions that implement the [massa standard](https://github.com/massalabs/massa-standards/blob/main/wallet/dapps-communication.md). With this library one can access all massa-blockchain wallets and their standardized functionalities for ready use.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
`Wallet-provider` could be used as a library for frameworks or as a stand-alone bundled js file which can be easily loaded into the browser.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
### Library (Node.js/React/Vue.js) usage
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
> npm install @massalabs/wallet-provider
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
### Browser usage
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Add the following script to your html file:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
```ts
|
|
33
|
-
|
|
34
|
-
<script
|
|
35
|
-
|
|
36
|
-
type="text/javascript"
|
|
37
|
-
|
|
38
|
-
src="https://cdn.jsdelivr.net/npm/@massalabs/wallet-provider@x.x.x/bundle.js"
|
|
39
|
-
|
|
40
|
-
></script>
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
whereby the x.x.x is one of the available released versions under [Wallet-provider's releases page](https://github.com/massalabs/wallet-provider/releases).
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
In your code, once the script is fully loaded, just use `window.wallet` to access all `wallet-provider`'s' exported functionalities.
|
|
8
|
+
`Wallet-provider` is a TypeScript library designed to seamlessly connect frontend applications with MassaStation and browser wallet extensions adhering to the [massa standard](https://github.com/massalabs/massa-standards/blob/main/wallet/dapps-communication.md). This library provides a gateway to all massa-blockchain wallets, offering standardized functionalities for effortless integration.
|
|
51
9
|
|
|
10
|
+
## **Installation**
|
|
52
11
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<script>
|
|
56
|
-
|
|
57
|
-
const providers = window.massa.providers();
|
|
58
|
-
|
|
59
|
-
console.log("Massa Providers ", providers);
|
|
12
|
+
`Wallet-provider` can be integrated as a library within frameworks or bundled for direct browser use.
|
|
60
13
|
|
|
61
|
-
|
|
14
|
+
### **For Frameworks (Node.js/React/Vue.js)**
|
|
62
15
|
|
|
16
|
+
```sh
|
|
17
|
+
npm install @massalabs/wallet-provider
|
|
63
18
|
```
|
|
64
19
|
|
|
65
|
-
|
|
66
|
-
|
|
67
20
|
## Documentation
|
|
68
21
|
|
|
69
22
|
Wallet-provider provides complete documentation of all available functions and objects.
|
|
@@ -76,31 +29,16 @@ npm run doc
|
|
|
76
29
|
|
|
77
30
|
The documentation will be generated in the `docs/documentation/html` directory.
|
|
78
31
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
## Web3 Wallet Provider Requirement and Initialization
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
### Requirements
|
|
85
|
-
|
|
86
|
-
- NodeJS 16+
|
|
87
|
-
|
|
88
|
-
- npm / yarn (see package.json)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
### Initialization
|
|
92
|
-
|
|
93
|
-
1. Run `npm install` to install all dependencies
|
|
94
|
-
|
|
95
|
-
2. Run `npx playwright install --with-deps` to install playwright and its dependencies
|
|
32
|
+
## Usage
|
|
96
33
|
|
|
97
|
-
|
|
34
|
+
- Go to [Web3 client initialization](https://docs.massa.net/docs/build/massa-web3#with-wallet-provider) to learn how to use wallet provider in a dapp.
|
|
98
35
|
|
|
99
|
-
|
|
36
|
+
- Discover dApp examples with associated frontends at the [massa-sc-examples](https://github.com/massalabs/massa-sc-examples) repository.
|
|
100
37
|
|
|
101
|
-
|
|
38
|
+
## Example
|
|
102
39
|
|
|
103
|
-
|
|
40
|
+
Wallet-provider is meant to be used with massa-web3 but can also be used as a standalone library.
|
|
41
|
+
Here is a simple example of how to use Wallet-provider:
|
|
104
42
|
|
|
105
43
|
```ts
|
|
106
44
|
|
|
@@ -135,7 +73,7 @@ await myProvider.importAccount(publicKey, privateKey);
|
|
|
135
73
|
|
|
136
74
|
console.log("Retrieving the accounts ...");
|
|
137
75
|
|
|
138
|
-
const myAccounts = await
|
|
76
|
+
const myAccounts = await myProvider.accounts();
|
|
139
77
|
|
|
140
78
|
console.log("Provider accounts ...", myAccounts);
|
|
141
79
|
|
|
@@ -151,7 +89,7 @@ console.log("Account address ", myAccount.address());
|
|
|
151
89
|
|
|
152
90
|
console.log("Retrieving the account balance ...");
|
|
153
91
|
|
|
154
|
-
const accountBalance = await
|
|
92
|
+
const accountBalance = await myAccount.balance();
|
|
155
93
|
|
|
156
94
|
console.log("Account Balance = ", accountBalance.balance);
|
|
157
95
|
|
|
@@ -160,7 +98,7 @@ console.log("Account Balance = ", accountBalance.balance);
|
|
|
160
98
|
|
|
161
99
|
console.log("Signing a message ...");
|
|
162
100
|
|
|
163
|
-
const signature = await
|
|
101
|
+
const signature = await myAccount.sign([0, 1, 2]);
|
|
164
102
|
|
|
165
103
|
console.log("Signature = ", signature);
|
|
166
104
|
|
|
@@ -173,8 +111,11 @@ await myProvider.importAccount(myAccount.address());
|
|
|
173
111
|
|
|
174
112
|
```
|
|
175
113
|
|
|
176
|
-
|
|
177
114
|
## Contributing
|
|
178
|
-
We welcome contributions from the community!
|
|
179
115
|
|
|
180
|
-
If you
|
|
116
|
+
Community contributions are highly valued! If you're keen on contributing to `Wallet-provider`, please check out our [CONTRIBUTING guidelines](CONTRIBUTING.md).
|
|
117
|
+
|
|
118
|
+
## License
|
|
119
|
+
|
|
120
|
+
`Wallet-provider` is distributed under the [MIT License](LICENSE).
|
|
121
|
+
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* address - The account address.
|
|
2
|
+
* Request for an AccountBalance command.
|
|
5
3
|
*/
|
|
6
4
|
export interface IAccountBalanceRequest {
|
|
5
|
+
/** Account address */
|
|
7
6
|
address: string;
|
|
8
7
|
}
|
|
9
8
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* finalBalance - The account's final confirmed balance.
|
|
13
|
-
* candidateBalance - The account's pending balance.
|
|
9
|
+
* Response from an AccountBalance command.
|
|
14
10
|
*/
|
|
15
11
|
export interface IAccountBalanceResponse {
|
|
12
|
+
/** Final confirmed balance of the account */
|
|
16
13
|
finalBalance: string;
|
|
14
|
+
/** Pending balance of the account */
|
|
17
15
|
candidateBalance: string;
|
|
18
16
|
}
|
|
19
17
|
//# sourceMappingURL=AccountBalance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountBalance.d.ts","sourceRoot":"","sources":["../../../src/account/AccountBalance.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"AccountBalance.d.ts","sourceRoot":"","sources":["../../../src/account/AccountBalance.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,6CAA6C;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountBalance.js","sourceRoot":"","sources":["../../../src/account/AccountBalance.ts"],"names":[],"mappings":"","sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"AccountBalance.js","sourceRoot":"","sources":["../../../src/account/AccountBalance.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Request for an AccountBalance command.\n */\nexport interface IAccountBalanceRequest {\n /** Account address */\n address: string;\n}\n\n/**\n * Response from an AccountBalance command.\n */\nexport interface IAccountBalanceResponse {\n /** Final confirmed balance of the account */\n finalBalance: string;\n /** Pending balance of the account */\n candidateBalance: string;\n}\n"]}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* address - Account's unique address.
|
|
4
|
-
* data - Data to be signed, as a Uint8Array.
|
|
2
|
+
* Payload for a signing operation request sent to the content script.
|
|
5
3
|
*/
|
|
6
4
|
export interface IAccountSignRequest {
|
|
5
|
+
/** Account's unique address */
|
|
7
6
|
address: string;
|
|
7
|
+
/** Data to be signed, represented as a Uint8Array */
|
|
8
8
|
data: Uint8Array;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
* publicKey - Public key of the account.
|
|
13
|
-
* signature - Signed message data.
|
|
11
|
+
* Response from the content script after a signing operation.
|
|
14
12
|
*/
|
|
15
13
|
export interface IAccountSignResponse {
|
|
14
|
+
/** Public key of the account */
|
|
16
15
|
publicKey: string;
|
|
16
|
+
/** Signed message data */
|
|
17
17
|
signature: string;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
* publicKey - Public key of the account.
|
|
22
|
-
* base58Encoded - Base58 encoded representation of the signed data.
|
|
20
|
+
* Output produced by the sign() method.
|
|
23
21
|
*/
|
|
24
22
|
export interface IAccountSignOutput {
|
|
23
|
+
/** Public key of the account */
|
|
25
24
|
publicKey: string;
|
|
25
|
+
/** Base58 encoded representation of the signed data */
|
|
26
26
|
base58Encoded: string;
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=AccountSign.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountSign.d.ts","sourceRoot":"","sources":["../../../src/account/AccountSign.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"AccountSign.d.ts","sourceRoot":"","sources":["../../../src/account/AccountSign.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,IAAI,EAAE,UAAU,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountSign.js","sourceRoot":"","sources":["../../../src/account/AccountSign.ts"],"names":[],"mappings":"","sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"AccountSign.js","sourceRoot":"","sources":["../../../src/account/AccountSign.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Payload for a signing operation request sent to the content script.\n */\nexport interface IAccountSignRequest {\n /** Account's unique address */\n address: string;\n /** Data to be signed, represented as a Uint8Array */\n data: Uint8Array;\n}\n\n/**\n * Response from the content script after a signing operation.\n */\nexport interface IAccountSignResponse {\n /** Public key of the account */\n publicKey: string;\n /** Signed message data */\n signature: string;\n}\n\n/**\n * Output produced by the sign() method.\n */\nexport interface IAccountSignOutput {\n /** Public key of the account */\n publicKey: string;\n /** Base58 encoded representation of the signed data */\n base58Encoded: string;\n}\n"]}
|
|
@@ -2,20 +2,50 @@
|
|
|
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
|
+
* Defines the expected structure for an account.
|
|
9
8
|
*/
|
|
10
9
|
export interface IAccount {
|
|
10
|
+
/** Retrieves the account's address. */
|
|
11
11
|
address(): string;
|
|
12
|
+
/** Retrieves the account's name. */
|
|
12
13
|
name(): string;
|
|
14
|
+
/** Retrieves the provider's name associated with the account. */
|
|
13
15
|
providerName(): string;
|
|
16
|
+
/** Initiates a balance retrieval request for the account. */
|
|
14
17
|
balance(): Promise<IAccountBalanceResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Signs data.
|
|
20
|
+
* @param data - Data to be signed (Buffer, Uint8Array, or string).
|
|
21
|
+
*/
|
|
15
22
|
sign(data: Buffer | Uint8Array | string): Promise<IAccountSignOutput>;
|
|
23
|
+
/**
|
|
24
|
+
* Purchases rolls.
|
|
25
|
+
* @param amount - Amount of rolls.
|
|
26
|
+
* @param fee - Fee.
|
|
27
|
+
*/
|
|
16
28
|
buyRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;
|
|
17
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Sends a transaction.
|
|
31
|
+
*
|
|
32
|
+
* @param amount - Amount to send.
|
|
33
|
+
* @param recipientAddress - Address of the recipient.
|
|
34
|
+
* @param fee - Transaction fee.
|
|
35
|
+
* @returns A promise resolving to an `ITransactionDetails` object.
|
|
36
|
+
*/
|
|
18
37
|
sendTransaction(amount: bigint, recipientAddress: string, fee: bigint): Promise<ITransactionDetails>;
|
|
19
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Calls a smart contract.
|
|
40
|
+
*
|
|
41
|
+
* @param contractAddress - Address of the smart contract.
|
|
42
|
+
* @param functionName - Name of the function to call.
|
|
43
|
+
* @param parameter - Parameters to pass to the function.
|
|
44
|
+
* @param amount - Amount of funds to send with the call.
|
|
45
|
+
* @param fee - Fee for the transaction.
|
|
46
|
+
* @param maxGas - Maximum gas to use for the transaction.
|
|
47
|
+
* @param nonPersistentExecution - Optional flag for non-persistent execution.
|
|
48
|
+
*/
|
|
49
|
+
callSC(contractAddress: string, functionName: string, parameter: Uint8Array | Args, amount: bigint, fee: bigint, maxGas: bigint, nonPersistentExecution?: boolean): Promise<ITransactionDetails | IContractReadOperationResponse>;
|
|
20
50
|
}
|
|
21
51
|
//# 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,uCAAuC;IACvC,OAAO,IAAI,MAAM,CAAC;IAElB,oCAAoC;IACpC,IAAI,IAAI,MAAM,CAAC;IAEf,iEAAiE;IACjE,YAAY,IAAI,MAAM,CAAC;IAEvB,6DAA6D;IAC7D,OAAO,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAE5C;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEtE;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEpE;;;;;;;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 * Defines the expected structure for an account.\n */\nexport interface IAccount {\n /** Retrieves the account's address. */\n address(): string;\n\n /** Retrieves the account's name. */\n name(): string;\n\n /** Retrieves the provider's name associated with the account. */\n providerName(): string;\n\n /** Initiates a balance retrieval request for the account. */\n balance(): Promise<IAccountBalanceResponse>;\n\n /**\n * Signs data.\n * @param data - Data to be signed (Buffer, Uint8Array, or string).\n */\n sign(data: Buffer | Uint8Array | string): Promise<IAccountSignOutput>;\n\n /**\n * Purchases rolls.\n * @param amount - Amount of rolls.\n * @param fee - Fee.\n */\n buyRolls(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"]}
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { Args } from '@massalabs/web3-utils';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* interact with a deployed smart contract.
|
|
3
|
+
* Interface for requests to interact with deployed smart contracts via content script.
|
|
5
4
|
*
|
|
6
5
|
* @remarks
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @see nickname - The nickname of the account to use.
|
|
10
|
-
* @see name - The name of the function to be called.
|
|
11
|
-
* @see at - The address of the smart contract.
|
|
12
|
-
* @see args - The parameters as an Args object to be passed to the function.
|
|
13
|
-
* @see coins - The amount of MASSA coins to be sent to the block creator.
|
|
14
|
-
* @see dryRun - The parameters for the dry run.
|
|
6
|
+
* Pass an empty array if the smart contract function doesn't require parameters.
|
|
15
7
|
*/
|
|
16
8
|
export interface IAccountCallSCRequest {
|
|
9
|
+
/** Account nickname to use */
|
|
17
10
|
nickname: string;
|
|
11
|
+
/** Function name to call */
|
|
18
12
|
name: string;
|
|
13
|
+
/** Deployed smart contract address */
|
|
19
14
|
at: string;
|
|
15
|
+
/** Parameters to pass to the function, as an `Args` object */
|
|
20
16
|
args: Args;
|
|
17
|
+
/** Amount of MASSA coins sent to the block creator */
|
|
21
18
|
coins: bigint;
|
|
19
|
+
/** Transaction fee */
|
|
22
20
|
fee: bigint;
|
|
21
|
+
/** Flag for non-persistent execution */
|
|
23
22
|
nonPersistentExecution: boolean;
|
|
24
23
|
}
|
|
25
24
|
//# sourceMappingURL=IAccountCallSCRequest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountCallSCRequest.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountCallSCRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"IAccountCallSCRequest.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountCallSCRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,8DAA8D;IAC9D,IAAI,EAAE,IAAI,CAAC;IACX,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,wCAAwC;IACxC,sBAAsB,EAAE,OAAO,CAAC;CACjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountCallSCRequest.js","sourceRoot":"","sources":["../../../src/account/IAccountCallSCRequest.ts"],"names":[],"mappings":"","sourcesContent":["import { Args } from '@massalabs/web3-utils';\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"IAccountCallSCRequest.js","sourceRoot":"","sources":["../../../src/account/IAccountCallSCRequest.ts"],"names":[],"mappings":"","sourcesContent":["import { Args } from '@massalabs/web3-utils';\n\n/**\n * Interface for requests to interact with deployed smart contracts via content script.\n *\n * @remarks\n * Pass an empty array if the smart contract function doesn't require parameters.\n */\nexport interface IAccountCallSCRequest {\n /** Account nickname to use */\n nickname: string;\n /** Function name to call */\n name: string;\n /** Deployed smart contract address */\n at: string;\n /** Parameters to pass to the function, as an `Args` object */\n args: Args;\n /** Amount of MASSA coins sent to the block creator */\n coins: bigint;\n /** Transaction fee */\n fee: bigint;\n /** Flag for non-persistent execution */\n nonPersistentExecution: boolean;\n}\n"]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Interface for account details.
|
|
3
3
|
*/
|
|
4
4
|
export interface IAccountDetails {
|
|
5
|
+
/** Optional account name */
|
|
5
6
|
name?: string;
|
|
7
|
+
/** Account address */
|
|
6
8
|
address: string;
|
|
7
9
|
}
|
|
8
10
|
//# sourceMappingURL=IAccountDetails.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountDetails.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountDetails.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
1
|
+
{"version":3,"file":"IAccountDetails.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountDetails.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountDetails.js","sourceRoot":"","sources":["../../../src/account/IAccountDetails.ts"],"names":[],"mappings":"","sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"IAccountDetails.js","sourceRoot":"","sources":["../../../src/account/IAccountDetails.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface for account details.\n */\nexport interface IAccountDetails {\n /** Optional account name */\n name?: string;\n /** Account address */\n address: string;\n}\n"]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Interface for roll operation requests (buy & sell) sent to the content script.
|
|
3
3
|
*/
|
|
4
4
|
export interface IAccountRollsRequest {
|
|
5
|
+
/** Amount of rolls involved in the operation */
|
|
5
6
|
amount: string;
|
|
7
|
+
/** Fee associated with the operation */
|
|
6
8
|
fee: string;
|
|
7
9
|
}
|
|
8
10
|
//# sourceMappingURL=IAccountRolls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountRolls.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountRolls.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
1
|
+
{"version":3,"file":"IAccountRolls.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountRolls.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountRolls.js","sourceRoot":"","sources":["../../../src/account/IAccountRolls.ts"],"names":[],"mappings":"","sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"IAccountRolls.js","sourceRoot":"","sources":["../../../src/account/IAccountRolls.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface for roll operation requests (buy & sell) sent to the content script.\n */\nexport interface IAccountRollsRequest {\n /** Amount of rolls involved in the operation */\n amount: string;\n /** Fee associated with the operation */\n fee: string;\n}\n"]}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Interface for transaction send requests sent to the content script.
|
|
3
3
|
*/
|
|
4
4
|
export interface IAccountSendTransactionRequest {
|
|
5
|
+
/** Address of the recipient */
|
|
5
6
|
recipientAddress: string;
|
|
7
|
+
/** Amount to be sent */
|
|
6
8
|
amount: string;
|
|
9
|
+
/** Transaction fee */
|
|
7
10
|
fee: string;
|
|
8
11
|
}
|
|
9
12
|
//# sourceMappingURL=IAccountSendTransaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountSendTransaction.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountSendTransaction.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
1
|
+
{"version":3,"file":"IAccountSendTransaction.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountSendTransaction.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,+BAA+B;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountSendTransaction.js","sourceRoot":"","sources":["../../../src/account/IAccountSendTransaction.ts"],"names":[],"mappings":"","sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"IAccountSendTransaction.js","sourceRoot":"","sources":["../../../src/account/IAccountSendTransaction.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface for transaction send requests sent to the content script.\n */\nexport interface IAccountSendTransactionRequest {\n /** Address of the recipient */\n recipientAddress: string;\n /** Amount to be sent */\n amount: string;\n /** Transaction fee */\n fee: string;\n}\n"]}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* address - The account address.
|
|
2
|
+
* Request for an AccountBalance command.
|
|
5
3
|
*/
|
|
6
4
|
export interface IAccountBalanceRequest {
|
|
5
|
+
/** Account address */
|
|
7
6
|
address: string;
|
|
8
7
|
}
|
|
9
8
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* finalBalance - The account's final confirmed balance.
|
|
13
|
-
* candidateBalance - The account's pending balance.
|
|
9
|
+
* Response from an AccountBalance command.
|
|
14
10
|
*/
|
|
15
11
|
export interface IAccountBalanceResponse {
|
|
12
|
+
/** Final confirmed balance of the account */
|
|
16
13
|
finalBalance: string;
|
|
14
|
+
/** Pending balance of the account */
|
|
17
15
|
candidateBalance: string;
|
|
18
16
|
}
|
|
19
17
|
//# sourceMappingURL=AccountBalance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountBalance.d.ts","sourceRoot":"","sources":["../../../src/account/AccountBalance.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"AccountBalance.d.ts","sourceRoot":"","sources":["../../../src/account/AccountBalance.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,6CAA6C;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountBalance.js","sourceRoot":"","sources":["../../../src/account/AccountBalance.ts"],"names":[],"mappings":"","sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"AccountBalance.js","sourceRoot":"","sources":["../../../src/account/AccountBalance.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Request for an AccountBalance command.\n */\nexport interface IAccountBalanceRequest {\n /** Account address */\n address: string;\n}\n\n/**\n * Response from an AccountBalance command.\n */\nexport interface IAccountBalanceResponse {\n /** Final confirmed balance of the account */\n finalBalance: string;\n /** Pending balance of the account */\n candidateBalance: string;\n}\n"]}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* address - Account's unique address.
|
|
4
|
-
* data - Data to be signed, as a Uint8Array.
|
|
2
|
+
* Payload for a signing operation request sent to the content script.
|
|
5
3
|
*/
|
|
6
4
|
export interface IAccountSignRequest {
|
|
5
|
+
/** Account's unique address */
|
|
7
6
|
address: string;
|
|
7
|
+
/** Data to be signed, represented as a Uint8Array */
|
|
8
8
|
data: Uint8Array;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
* publicKey - Public key of the account.
|
|
13
|
-
* signature - Signed message data.
|
|
11
|
+
* Response from the content script after a signing operation.
|
|
14
12
|
*/
|
|
15
13
|
export interface IAccountSignResponse {
|
|
14
|
+
/** Public key of the account */
|
|
16
15
|
publicKey: string;
|
|
16
|
+
/** Signed message data */
|
|
17
17
|
signature: string;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
* publicKey - Public key of the account.
|
|
22
|
-
* base58Encoded - Base58 encoded representation of the signed data.
|
|
20
|
+
* Output produced by the sign() method.
|
|
23
21
|
*/
|
|
24
22
|
export interface IAccountSignOutput {
|
|
23
|
+
/** Public key of the account */
|
|
25
24
|
publicKey: string;
|
|
25
|
+
/** Base58 encoded representation of the signed data */
|
|
26
26
|
base58Encoded: string;
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=AccountSign.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountSign.d.ts","sourceRoot":"","sources":["../../../src/account/AccountSign.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"AccountSign.d.ts","sourceRoot":"","sources":["../../../src/account/AccountSign.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,IAAI,EAAE,UAAU,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountSign.js","sourceRoot":"","sources":["../../../src/account/AccountSign.ts"],"names":[],"mappings":"","sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"AccountSign.js","sourceRoot":"","sources":["../../../src/account/AccountSign.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Payload for a signing operation request sent to the content script.\n */\nexport interface IAccountSignRequest {\n /** Account's unique address */\n address: string;\n /** Data to be signed, represented as a Uint8Array */\n data: Uint8Array;\n}\n\n/**\n * Response from the content script after a signing operation.\n */\nexport interface IAccountSignResponse {\n /** Public key of the account */\n publicKey: string;\n /** Signed message data */\n signature: string;\n}\n\n/**\n * Output produced by the sign() method.\n */\nexport interface IAccountSignOutput {\n /** Public key of the account */\n publicKey: string;\n /** Base58 encoded representation of the signed data */\n base58Encoded: string;\n}\n"]}
|
|
@@ -2,20 +2,50 @@
|
|
|
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
|
+
* Defines the expected structure for an account.
|
|
9
8
|
*/
|
|
10
9
|
export interface IAccount {
|
|
10
|
+
/** Retrieves the account's address. */
|
|
11
11
|
address(): string;
|
|
12
|
+
/** Retrieves the account's name. */
|
|
12
13
|
name(): string;
|
|
14
|
+
/** Retrieves the provider's name associated with the account. */
|
|
13
15
|
providerName(): string;
|
|
16
|
+
/** Initiates a balance retrieval request for the account. */
|
|
14
17
|
balance(): Promise<IAccountBalanceResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Signs data.
|
|
20
|
+
* @param data - Data to be signed (Buffer, Uint8Array, or string).
|
|
21
|
+
*/
|
|
15
22
|
sign(data: Buffer | Uint8Array | string): Promise<IAccountSignOutput>;
|
|
23
|
+
/**
|
|
24
|
+
* Purchases rolls.
|
|
25
|
+
* @param amount - Amount of rolls.
|
|
26
|
+
* @param fee - Fee.
|
|
27
|
+
*/
|
|
16
28
|
buyRolls(amount: bigint, fee: bigint): Promise<ITransactionDetails>;
|
|
17
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Sends a transaction.
|
|
31
|
+
*
|
|
32
|
+
* @param amount - Amount to send.
|
|
33
|
+
* @param recipientAddress - Address of the recipient.
|
|
34
|
+
* @param fee - Transaction fee.
|
|
35
|
+
* @returns A promise resolving to an `ITransactionDetails` object.
|
|
36
|
+
*/
|
|
18
37
|
sendTransaction(amount: bigint, recipientAddress: string, fee: bigint): Promise<ITransactionDetails>;
|
|
19
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Calls a smart contract.
|
|
40
|
+
*
|
|
41
|
+
* @param contractAddress - Address of the smart contract.
|
|
42
|
+
* @param functionName - Name of the function to call.
|
|
43
|
+
* @param parameter - Parameters to pass to the function.
|
|
44
|
+
* @param amount - Amount of funds to send with the call.
|
|
45
|
+
* @param fee - Fee for the transaction.
|
|
46
|
+
* @param maxGas - Maximum gas to use for the transaction.
|
|
47
|
+
* @param nonPersistentExecution - Optional flag for non-persistent execution.
|
|
48
|
+
*/
|
|
49
|
+
callSC(contractAddress: string, functionName: string, parameter: Uint8Array | Args, amount: bigint, fee: bigint, maxGas: bigint, nonPersistentExecution?: boolean): Promise<ITransactionDetails | IContractReadOperationResponse>;
|
|
20
50
|
}
|
|
21
51
|
//# 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,uCAAuC;IACvC,OAAO,IAAI,MAAM,CAAC;IAElB,oCAAoC;IACpC,IAAI,IAAI,MAAM,CAAC;IAEf,iEAAiE;IACjE,YAAY,IAAI,MAAM,CAAC;IAEvB,6DAA6D;IAC7D,OAAO,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAE5C;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEtE;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEpE;;;;;;;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 * Defines the expected structure for an account.\n */\nexport interface IAccount {\n /** Retrieves the account's address. */\n address(): string;\n\n /** Retrieves the account's name. */\n name(): string;\n\n /** Retrieves the provider's name associated with the account. */\n providerName(): string;\n\n /** Initiates a balance retrieval request for the account. */\n balance(): Promise<IAccountBalanceResponse>;\n\n /**\n * Signs data.\n * @param data - Data to be signed (Buffer, Uint8Array, or string).\n */\n sign(data: Buffer | Uint8Array | string): Promise<IAccountSignOutput>;\n\n /**\n * Purchases rolls.\n * @param amount - Amount of rolls.\n * @param fee - Fee.\n */\n buyRolls(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"]}
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { Args } from '@massalabs/web3-utils';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* interact with a deployed smart contract.
|
|
3
|
+
* Interface for requests to interact with deployed smart contracts via content script.
|
|
5
4
|
*
|
|
6
5
|
* @remarks
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @see nickname - The nickname of the account to use.
|
|
10
|
-
* @see name - The name of the function to be called.
|
|
11
|
-
* @see at - The address of the smart contract.
|
|
12
|
-
* @see args - The parameters as an Args object to be passed to the function.
|
|
13
|
-
* @see coins - The amount of MASSA coins to be sent to the block creator.
|
|
14
|
-
* @see dryRun - The parameters for the dry run.
|
|
6
|
+
* Pass an empty array if the smart contract function doesn't require parameters.
|
|
15
7
|
*/
|
|
16
8
|
export interface IAccountCallSCRequest {
|
|
9
|
+
/** Account nickname to use */
|
|
17
10
|
nickname: string;
|
|
11
|
+
/** Function name to call */
|
|
18
12
|
name: string;
|
|
13
|
+
/** Deployed smart contract address */
|
|
19
14
|
at: string;
|
|
15
|
+
/** Parameters to pass to the function, as an `Args` object */
|
|
20
16
|
args: Args;
|
|
17
|
+
/** Amount of MASSA coins sent to the block creator */
|
|
21
18
|
coins: bigint;
|
|
19
|
+
/** Transaction fee */
|
|
22
20
|
fee: bigint;
|
|
21
|
+
/** Flag for non-persistent execution */
|
|
23
22
|
nonPersistentExecution: boolean;
|
|
24
23
|
}
|
|
25
24
|
//# sourceMappingURL=IAccountCallSCRequest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountCallSCRequest.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountCallSCRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"IAccountCallSCRequest.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountCallSCRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,8DAA8D;IAC9D,IAAI,EAAE,IAAI,CAAC;IACX,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,wCAAwC;IACxC,sBAAsB,EAAE,OAAO,CAAC;CACjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountCallSCRequest.js","sourceRoot":"","sources":["../../../src/account/IAccountCallSCRequest.ts"],"names":[],"mappings":"","sourcesContent":["import { Args } from '@massalabs/web3-utils';\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"IAccountCallSCRequest.js","sourceRoot":"","sources":["../../../src/account/IAccountCallSCRequest.ts"],"names":[],"mappings":"","sourcesContent":["import { Args } from '@massalabs/web3-utils';\n\n/**\n * Interface for requests to interact with deployed smart contracts via content script.\n *\n * @remarks\n * Pass an empty array if the smart contract function doesn't require parameters.\n */\nexport interface IAccountCallSCRequest {\n /** Account nickname to use */\n nickname: string;\n /** Function name to call */\n name: string;\n /** Deployed smart contract address */\n at: string;\n /** Parameters to pass to the function, as an `Args` object */\n args: Args;\n /** Amount of MASSA coins sent to the block creator */\n coins: bigint;\n /** Transaction fee */\n fee: bigint;\n /** Flag for non-persistent execution */\n nonPersistentExecution: boolean;\n}\n"]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Interface for account details.
|
|
3
3
|
*/
|
|
4
4
|
export interface IAccountDetails {
|
|
5
|
+
/** Optional account name */
|
|
5
6
|
name?: string;
|
|
7
|
+
/** Account address */
|
|
6
8
|
address: string;
|
|
7
9
|
}
|
|
8
10
|
//# sourceMappingURL=IAccountDetails.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountDetails.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountDetails.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
1
|
+
{"version":3,"file":"IAccountDetails.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountDetails.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountDetails.js","sourceRoot":"","sources":["../../../src/account/IAccountDetails.ts"],"names":[],"mappings":"","sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"IAccountDetails.js","sourceRoot":"","sources":["../../../src/account/IAccountDetails.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface for account details.\n */\nexport interface IAccountDetails {\n /** Optional account name */\n name?: string;\n /** Account address */\n address: string;\n}\n"]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Interface for roll operation requests (buy & sell) sent to the content script.
|
|
3
3
|
*/
|
|
4
4
|
export interface IAccountRollsRequest {
|
|
5
|
+
/** Amount of rolls involved in the operation */
|
|
5
6
|
amount: string;
|
|
7
|
+
/** Fee associated with the operation */
|
|
6
8
|
fee: string;
|
|
7
9
|
}
|
|
8
10
|
//# sourceMappingURL=IAccountRolls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountRolls.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountRolls.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
1
|
+
{"version":3,"file":"IAccountRolls.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountRolls.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountRolls.js","sourceRoot":"","sources":["../../../src/account/IAccountRolls.ts"],"names":[],"mappings":"","sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"IAccountRolls.js","sourceRoot":"","sources":["../../../src/account/IAccountRolls.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface for roll operation requests (buy & sell) sent to the content script.\n */\nexport interface IAccountRollsRequest {\n /** Amount of rolls involved in the operation */\n amount: string;\n /** Fee associated with the operation */\n fee: string;\n}\n"]}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Interface for transaction send requests sent to the content script.
|
|
3
3
|
*/
|
|
4
4
|
export interface IAccountSendTransactionRequest {
|
|
5
|
+
/** Address of the recipient */
|
|
5
6
|
recipientAddress: string;
|
|
7
|
+
/** Amount to be sent */
|
|
6
8
|
amount: string;
|
|
9
|
+
/** Transaction fee */
|
|
7
10
|
fee: string;
|
|
8
11
|
}
|
|
9
12
|
//# sourceMappingURL=IAccountSendTransaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountSendTransaction.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountSendTransaction.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
1
|
+
{"version":3,"file":"IAccountSendTransaction.d.ts","sourceRoot":"","sources":["../../../src/account/IAccountSendTransaction.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,+BAA+B;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAccountSendTransaction.js","sourceRoot":"","sources":["../../../src/account/IAccountSendTransaction.ts"],"names":[],"mappings":"","sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"IAccountSendTransaction.js","sourceRoot":"","sources":["../../../src/account/IAccountSendTransaction.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface for transaction send requests sent to the content script.\n */\nexport interface IAccountSendTransactionRequest {\n /** Address of the recipient */\n recipientAddress: string;\n /** Amount to be sent */\n amount: string;\n /** Transaction fee */\n fee: string;\n}\n"]}
|