MetaStellar.io/Docs
Metamask Wallet Support For your Stellar Application-
Step1: Copy the callMetaStellarFunction
The call Metastellar function is the easiest way to start using stellar on metamask. simply copy this function into a utils file, then pass the desired operation and parameters.
The callMetaStellar Function is a one stop soultion to accessing a users stellar-metamask wallet. Simply run callMetaStellar('connect') to connect and install stellar onto a users Metamask! From there you can interact with the stellar wallet by callingcallMetaStellar('functionName-as-string', {"params":"in-key-value format"});
We beleave the best thing to do is to copy the callMetaStellar Function into a utils folder on your application.
Connecting Stellar + Metamask + Your App
callMetaStellar('connect')
The Wallet must be connected before any other methods can be called. The wallet will auto-install if it is not already!
Getting the Address
callMetaStellar('getAddress')
The getAddress method returns the address of the currentAccount. The wallet supports multiple accounts, but only one can be connected at a time. this gets the current one.
Getting a dataPacket
callMetaStellar('getDataPacket')
Most of the time it is useful to get an overview of a users wallet state. To do this simply call the getDataPacket function. This returns the current Address along with the mainnet and testnet balance a list of assets for the current address and the wallet name and federation address if one exists.
Signing a Transaction
callMetaStellar('signTransaction', {transaction: xdr-as-string , testnet: true })
Most of the time it is useful to get an overview of a users wallet state. To do this simply call the getDataPacket function. This returns the current Address along with the mainnet and testnet balance a list of assets for the current address and the wallet name and federation address if one exists.
Signing and Submiting Transaction
callMetaStellar('signAndSubmitTransaction', {transaction: xdr-as-string , testnet: true })
Most of the time it is useful to get an overview of a users wallet state. To do this simply call the getDataPacket function. This returns the current Address along with the mainnet and testnet balance a list of assets for the current address and the wallet name and federation address if one exists.