Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add up_generateLsp23Address docs #644

Merged
merged 5 commits into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 87 additions & 4 deletions docs/standards/rpc-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This page is under active development.

:::

The [LUKSO Extension](../guides/browser-extension/install-browser-extension.md) uses the RPC API methods from the table below. The methods are grouped by category: signing methods, standard methods, and LUKSO-specific methods.
The [LUKSO UP Browser Extension](../guides/browser-extension/install-browser-extension.md) uses the RPC API methods from the table below. The methods are grouped by category: signing methods, standard methods, and LUKSO-specific methods.

## Supported Methods

Expand Down Expand Up @@ -147,17 +147,17 @@ params: [

#### Returns

##### 1. `String Array` - Array of universal profile addresses the user selected for this relay service
##### 1. `String Array` - Array of Universal Profile addresses the user selected for this relay service

It returns an array of Universal Profile addresses.

### up_import {#up_import}

Add a Universal Profile address.
Add a Universal Profile address to the UP Browser Extension.

#### Parameters

##### 1. `String` - Universal profile address to add to the extension
##### 1. `String` - Universal Profile address to add to the extension

The Universal Profile address to add.

Expand All @@ -168,3 +168,86 @@ params: ['0x311611C9A46a192C14Ea993159a0498EDE5578aC'];
#### Returns

##### 1. `String` - New controller address, to be added to the profile by the dapp.

### up_generateLsp23Address {#up_generateLsp23Address}

It allows the creation of a Universal Profile for the UP Browser Extension using the [LSP23 Standard](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md), 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

##### Parameters

<table>
<tr>
<td>Name</td>
<td>Type</td>
<td>Description</td>
</tr>
<tr>
<td>primaryImplementationContractAddress</td>
<td>string</td>
<td>Universal Profile implementation address</td>
</tr>
<tr>
<td>secondaryImplementationContractAddress</td>
<td>string</td>
<td>Key Manager implementation address</td>
</tr>
<tr>
<td>secondaryContractInitializationCalldata</td>
<td>string</td>
<td>initialization calldata for for the Key Manager contract</td>
</tr>
<tr>
<td>secondaryContractAddControlledContractAddress</td>
<td>boolean</td>
<td>the my.universalprofile.cloud sets it as true</td>
</tr>
<tr>
<td>secondaryContractExtraInitializationParams</td>
<td>string</td>
<td>my.universalprofile.cloud sets it as '0x'</td>
</tr>
<tr>
<td>upPostDeploymentModuleAddress</td>
<td>string</td>
<td>address of the post deployment module</td>
</tr>
<tr>
<td>linkedContractsFactoryAddress</td>
<td>string</td>
<td> address of the linkedContractsFactory (LSP23)</td>
</tr>
<tr>
<td>dataKeys</td>
<td>string[]</td>
<td> data that will be set on a smart contract, e.g: adding controllers, adding LSP3 metadata, or adding default controller permissions</td>
</tr>
<tr>
<td>dataValues</td>
<td>string[]</td>
<td> data that will be set on a smart contract, e.g: adding controllers, adding LSP3 metadata, or adding default controller permissions</td>
</tr>
<tr>
<td>dataKeysControllerIndex</td>
<td>number</td>
<td> an array index where the controller key is placed</td>
</tr>
<tr>
<td>dataValuesControllerIndex</td>
<td>number</td>
<td> array index where the controller value is placed</td>
</tr>
</table>

#### Returns

| Name | Type |
| ------------------- | --------- |
| `salt` | string |
| `controllerAddress` | string |
| `upAddress` | upAddress |