🔗Phantasma Link Client
The connecting Wallets to Dapps
Phantasma Link is a protocol designed to allow dapps to sign transactions and do other on-chain operations on the behalf of users, in a transparent way, without requiring access to the user private key.
In this documentation, we will explore each method of the Phantasma Link Client, explaining their purpose and usage.
Authorize
The Authorize
method is used to authenticate the user and grant the specified dApp access to the user's wallet. It requires the dApp identifier, an authentication token, and the version number. The callback
returns a boolean indicating whether the authorization was successful and an optional error message.
GetAccount
The GetAccount
method retrieves the user's account details for the specified platform and version. The callback
returns the account object and an optional error message.
GetPeer
The GetPeer
method retrieves the current peer node of the Phantasma blockchain. The callback
returns the peer node URL.
GetNexus
The GetNexus
method retrieves the current nexus name of the Phantasma blockchain. The callback
returns the nexus name.
InvokeScript
The InvokeScript
method allows you to execute a script on the specified chain in the Phantasma blockchain. It requires the chain name, the script as a byte array, and a unique identifier. The callback
returns an array of results and an optional error message.
SignData
The SignData
method signs a given data using the user's private key. It requires the platform, the signature type, the data as a byte array, and a unique identifier. The callback
returns the signed data, random appended bytes, and an optional error message.
SignTransactionSignature
The SignTransactionSignature
method signs a given transaction using the user's private key. It requires the transaction object, the platform, and the signature type. The callback
returns the transaction signature and an optional error message.
FetchAndMultiSignature
The FetchAndMultiSignature
method retrieves the user's multi-signature account for the specified subject and platform, signs it with the user's private key, and submits it to the blockchain. It requires the subject, the platform, the signature type, and a unique identifier. The callback
returns a boolean indicating the success of the operation and an optional error message.
SignTransaction
The SignTransaction
method creates, signs, and broadcasts a transaction to the Phantasma blockchain. It requires the platform, the signature type, the chain name, the script and payload as byte arrays, a unique identifier, and an optional Proof of Work (PoW) object. The callback
returns the transaction hash and an optional error message.
WriteArchive
The WriteArchive
method writes data to the Phantasma blockchain's archive. It requires the archive hash, the block index, and the data as a byte array. The callback
returns a boolean indicating the success of the operation and an optional error message.
With this documentation, you should now have a better understanding of the methods available in the Phantasma Link Client and how they can be used to interact with the Phantasma blockchain. Developers can implement these methods in their projects to facilitate easy and secure interaction with the Phantasma ecosystem, providing users with seamless access to decentralized applications and digital asset management.
Last updated