🆙 RPC API
The LUKSO UP Browser Extension uses the RPC API methods from the table below. The methods are grouped by category: signing methods, standard methods, and LUKSO-specific methods.
We encourage developers to use
eth_sign for signing purposes.
While a security issue potentially existed in the initial implementation on Ethereum, the current implementation has no such potential exploit. As such usage of this method is preferable to personal_sign.
This method returns a EIP-191 signature over the data provided to the call. It requests that the user provides an Ethereum address that should sign the transaction as well as the data (encoded bytes) that are to be executed.
string - on a successful call the method returns a signature, a string representing hex encoded bytes or an error with code
4001 - if the user rejects the requets
personal_sign endpoint is enabled to allow for backward compatibility. However, its use is not recommended.
Some libraries such as Ethers.js end up using
personal_sign under the hood. That is why, for compatibility reasons,
personal_sign is left enabled. Note however that
personal_sign ultimately acts as a proxy, redirecting the call to the eth_sign method.
Creates new message call transaction and signs it using the account specified in
from. This method requires that the user has granted permission to interact with their account first.
The transaction will not be signed by the UP itself, but by a controller address that has sufficient permissions.
This method is specified by EIP-1102. Calling this method may trigger a user interface that allows the user to approve or reject account access for a given DApp.
string - an array of accounts or throws an error with code
4001 if the request was rejected by the user.
This method implements EIP-3326. It allows Dapps to request that a wallet switches its active chain (connection).
The method requires that a target chain ID is provided
error - the method will return null if successful or throw an error otherwise
Similar to the
eth_requestAccounts this method returns all of the addresses that the user has approved for the DApp. This method does not trigger a user interface.
string - a successful request returns an array of hexadecimal Ethereum address strings
Add a custom relayer.
relayer - Object
Object containing the new relayer properties. To find more information about custom relayers, you can read the Transaction Relay Service API.
|String||The name of the relayer.|
|String||The base API URL.|
|Array||Array of string (hex) or int.|
name: 'My Relayer',
String Array - Array of Universal Profile addresses the user selected for this relay service
It returns an array of Universal Profile addresses.
Add a Universal Profile address to the UP Browser Extension.
String - Universal Profile address to add to the extension
The Universal Profile address to add.
String - New controller address, to be added to the profile by the dapp.
It allows the creation of a Universal Profile for the UP Browser Extension using the LSP23 Standard, which under the hood will wrap many operations/transactions into one, simplifying deployment.
To perform the deployment of a Universal Profile, the dApp needs the salt and the controllerAddress. The controllerAddress will be injected in the dataKeys and dataValues array, then the salt and the encoded dataKeys and dataValues are sent to the relayer to deploy the profile. Previously, the relayer had to do several consecutive transactions to deploy a profile. Now, all those transactions are taking place at the smart contract level, so the relayer only creates one transaction.
up_generateLSP23Address: should be used for creating a new Universal Profile using the UP Browser Extension
up_import: should be used for adding already existing Universal Profiles to the UP Browser Extension
|primaryImplementationContractAddress||string||Universal Profile implementation address|
|secondaryImplementationContractAddress||string||Key Manager implementation address|
|secondaryContractInitializationCalldata||string||initialization calldata for for the Key Manager contract|
|secondaryContractAddControlledContractAddress||boolean||the my.universalprofile.cloud sets it as true|
|secondaryContractExtraInitializationParams||string||my.universalprofile.cloud sets it as '0x'|
|upPostDeploymentModuleAddress||string||address of the post deployment module|
|linkedContractsFactoryAddress||string||address of the linkedContractsFactory (LSP23)|
|dataKeys||string||data that will be set on a smart contract, e.g: adding controllers, adding LSP3 metadata, or adding default controller permissions|
|dataValues||string||data that will be set on a smart contract, e.g: adding controllers, adding LSP3 metadata, or adding default controller permissions|
|dataKeysControllerIndex||number||an array index where the controller key is placed|
|dataValuesControllerIndex||number||array index where the controller value is placed|