Welcome to the MetaMask Snap for Massa! This Snap enables seamless integration of MetaMask with the Massa layer 1 protocol, providing users with convenient access to Massa's features directly through MetaMask.
This repository contains the MetaMask Snap for Massa and an example dApp to demonstrate its usage.
Astro-Devs Labs
The MetaMask Snap for Massa supports the following operations:
Method | Parameters | Response | Param Example | Response Example |
---|---|---|---|---|
account.balance |
{
address: string;
} |
{
finalBalance: string,
candidateBalance: string
} |
{
address: 'AU1234567890abcdef';
} |
{
finalBalance: "100",
candidateBalance: "200",
} |
Method | Parameters | Response | Param Example | Response Example |
---|---|---|---|---|
account.sign |
{
address: string,<br>data: number[]
} |
{
signature: number[],
publicKey: string
} |
{
address: "AU1234567890abcdef",
data: [1, 2, 3]
} |
{
signature: [4, 5, 6],
publicKey: "Pabcdef1234567890"
} |
Method | Parameters | Response | Param Example | Response Example |
---|---|---|---|---|
account.callSC |
{
nickname: string,
fee: string,
functionName: string,
at: string,
args: number[],
coins: string,
nonPersistentExecution?: {
isNPE: boolean,
maxGas: string
}
} |
{
operationId: string;
} |
{
nickname: "TestContract",
fee: "100",
functionName: "transfer",
at: "ASabcdef1234567890",
args: [1, 2, 3],
coins: "Massa"
} |
{
operationId: 'OP1234567890abcdef';
} |
Method | Parameters | Response | Param Example | Response Example |
---|---|---|---|---|
account.sendTransaction |
{
recipientAddress: string,
amount: bigint,
fee: bigint
} |
{
operationId: string;
} |
{
recipientAddress: "AU1234567890abcdef",
amount: 100,
fee: 10
} |
{
operationId: 'OP1234567890abcdef';
} |
Method | Parameters | Response | Param Example | Response Example |
---|---|---|---|---|
account.sellRolls |
{
fee: string,
amount: string
} |
{
operationId: string;
} |
{
fee: "100",
amount: "50"
} |
{
operationId: 'OP1234567890abcdef';
} |
Method | Parameters | Response | Param Example | Response Example |
---|---|---|---|---|
account.buyRolls |
{
fee: string,
amount: string
} |
{
operationId: string;
} |
{
fee: "100",
amount: "50"
} |
{
operationId: 'OP1234567890abcdef';
} |
Method | Parameters | Response | Param Example | Response Example |
---|---|---|---|---|
account.getActive |
{
name: string,
address: string
} |
{
name: "Active Account",
address: "AU1234567890abcdef"
} |
Method | Parameters | Response | Param Example | Response Example |
---|---|---|---|---|
Provider.getNodeUrl |
string |
'https://node1.example.com'; |
Method | Parameters | Response | Param Example | Response Example |
---|---|---|---|---|
account.getActive |
{
name: string,
address: string
} |
{
name: "Account 0",
address: "AU12ZDFfdf2Rdf3f4fg"
} |
Method | Parameters | Response | Param Example | Response Example |
---|---|---|---|---|
account.showCredentials |
{
address?: string<br>
} |
{
publicKey: string<br>;
} |
{
address: 'AU1234567890abcdef'<br>;
} |
{
publicKey: 'Pabcdef1234567890'<br>;
} |
Method | Parameters | Response | Param Example | Response Example |
---|---|---|---|---|
account.addToken |
{
address: string,
accountAddress?: string
} |
{
address: string,
accountAddress: string
} |
{
address: "AU1234567890abcdef",
accountAddress: "AU1234567890abcdef"
} |
{
address: "AU1234567890abcdef",
accountAddress: "AU1234567890abcdef"
} |
Method | Parameters | Response | Param Example | Response Example |
---|---|---|---|---|
account.deleteToken |
{
accountAddress?: string,
address: string
} |
{
response: 'OK' | 'ERROR',
message?: string
} |
{
address: "AU1234567890abcdef",
accountAddress: "AU1234567890abcdef"
} |
{
response: 'OK';
} |
For detailed information about each operation, including parameters and responses, refer to the corresponding DTOs in the codebase.
The following command will build the snap from local code. It will also build the companion dApp that serve as an example of snap usage.
yarn install
yarn build
yarn start
navigate to http://localhost:8000
We welcome contributions from the community! If you would like to contribute to the MetaMask Snap for Massa, please checkout our "good first issue" issues and submit a pull request.
The MetaMask Snap for Massa is released under the BSL license.