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

Sync main #237

Merged
merged 6 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ coverage
*.log
yarn.lock
types
.cspell.json
.cspell.json
.env.test
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,21 @@ const myContracts = await lspFactory.UniversalProfile.deploy({
{
width: 500,
height: 500,
verificationFunction: 'keccak256(bytes)',
verificationData: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14',
verification: {
method: 'keccak256(bytes)',
data: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14',
},
url: 'ipfs://QmPLqMFHxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrtjSGp',
},
],
backgroundImage: [
{
width: 500,
height: 500,
verificationFunction: 'keccak256(bytes)',
verificationData: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14',
verification: {
method: 'keccak256(bytes)',
data: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14',
},
url: 'ipfs://QmPLqMFHxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrtjSGp',
},
],
Expand Down
192 changes: 128 additions & 64 deletions docs/classes/lsp4-digital-asset-metadata.md

Large diffs are not rendered by default.

66 changes: 44 additions & 22 deletions docs/classes/universal-profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,80 +391,102 @@ const myLocalAvatar = new File();
{
"width": 1800,
"height": 1800,
"verificationFunction": "keccak256(bytes)",
"verificationData": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7",
"verification": {
"method": "keccak256(bytes)",
"data": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7",
},
"url": "ipfs://QmPCQwamReJshNiqSSzf4zMVffNiDx44ykTf1zY95vG6rv"
},
{
"width": 1024,
"height": 1024,
"verificationFunction": "keccak256(bytes)",
"verificationData": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938",
"verification": {
"method": "keccak256(bytes)",
"data": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938",
},
"url": "ipfs://Qme8tedX78TaxVwtvacJyS7bcSwe69F4aNnknUzL3gYdFY"
},
{
"width": 640,
"height": 640,
"verificationFunction": "keccak256(bytes)",
"verificationData": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd",
"verification": {
"method": "keccak256(bytes)",
"data": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd",
},
"url": "ipfs://QmdQRdeeGGmWCPs1iCtxiNzHMZemFpvcsdvweCdnufHdqr"
},
{
"width": 320,
"height": 320,
"verificationFunction": "keccak256(bytes)",
"verificationData": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9",
"verification": {
"method": "keccak256(bytes)",
"data": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9",
},
"url": "ipfs://QmfYYafv6ucuKSm3EbcJxho9Cr2g5Pa3yhv7TaANbP8jbg"
},
{
"width": 180,
"height": 180,
"verificationFunction": "keccak256(bytes)",
"verificationData": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853",
"verification": {
"method": "keccak256(bytes)",
"data": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853",
},
"url": "ipfs://QmU5XJfL1V5tBLfm7xYMGYEi7VLiwDCfsCc8KswRgXNQSr"
}
],
backgroundImage: [
{
"width": 1800,
"height": 1800,
"verificationFunction": "keccak256(bytes)",
"verificationData": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7",
"verification": {
"method": "keccak256(bytes)",
"data": "0x5c6125b5a553337b5ad55610c47114bf58d33c7a21aef14b0ed4c214203c9ca7",
},
"url": "ipfs://QmPCQwamReJshNiqSSzf4zMVffNiDx44ykTf1zY95vG6rv"
},
{
"width": 1024,
"height": 1024,
"verificationFunction": "keccak256(bytes)",
"verificationData": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938",
"verification": {
"method": "keccak256(bytes)",
"data": "0xc4d1d37a8545012be38a8f33f9a53daceab955a17310bcfffe00f34811506938",
},
"url": "ipfs://Qme8tedX78TaxVwtvacJyS7bcSwe69F4aNnknUzL3gYdFY"
},
{
"width": 640,
"height": 640,
"verificationFunction": "keccak256(bytes)",
"verificationData": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd",
"verification": {
"method": "keccak256(bytes)",
"data": "0xa63ebb82e8c428c9a02f1c0a040199748844dccf62e75fcd85454bce4acd4afd",
},
"url": "ipfs://QmdQRdeeGGmWCPs1iCtxiNzHMZemFpvcsdvweCdnufHdqr"
},
{
"width": 320,
"height": 320,
"verificationFunction": "keccak256(bytes)",
"verificationData": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9",
"verification": {
"method": "keccak256(bytes)",
"data": "0x2ab638bb61f4cb686c3ca5ca09285e4507ad2328c0b5f6e10378425ed7c75cd9",
},
"url": "ipfs://QmfYYafv6ucuKSm3EbcJxho9Cr2g5Pa3yhv7TaANbP8jbg"
},
{
"width": 180,
"height": 180,
"verificationFunction": "keccak256(bytes)",
"verificationData": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853",
"verification": {
"method": "keccak256(bytes)",
"data": "0xefb0b36b3bba2338c18b2b55a0cbc52f04eda03e9b58ca8d04a92fc9b1387853",
},
"url": "ipfs://QmU5XJfL1V5tBLfm7xYMGYEi7VLiwDCfsCc8KswRgXNQSr"
}
],
avatar: [
{
"verificationFunction": "keccak256(bytes)",
"verificationData": "0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11",
"verification": {
"method": "keccak256(bytes)",
"data": "0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11",
},
"url": "ipfs://QmWkAki4mLq2cshpbKs4HFCaZdpUX1jLKKfb5y8YMATkwk",
"fileType": "image/jpeg"
}
Expand Down
30 changes: 19 additions & 11 deletions docs/deployment/digital-asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ await lspFactory.LSP8IdentifiableDigitalAsset.deploy({
});
```

You can also provide the JSON file yourself to generate the verificationData value:
You can also provide the JSON file yourself to generate the verification data value:

```javascript title='Providing a previously uploaded LSP4 metadata URL and JSON file itself'
await lspFactory.LSP8IdentifiableDigitalAsset.deploy({
Expand All @@ -209,13 +209,15 @@ await lspFactory.LSP8IdentifiableDigitalAsset.deploy({
});
```

Or you can provide the verificationData value and then uploaded file URL:
Or you can provide the verification data value and then uploaded file URL:

```javascript title='Providing a previously uploaded LSP4 metadata URL and verificationData values'
```javascript title='Providing a previously uploaded LSP4 metadata URL and verification data values'
await lspFactory.LSP8IdentifiableDigitalAsset.deploy({
digitalAssetMetadata: {
verificationData: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14',
verificationFunction: 'keccak256(utf8)',
verification: {
method: 'keccak256(utf8)',
data: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14',
},
url: 'https://mycoolserver.com/file.json'
},
...
Expand Down Expand Up @@ -244,8 +246,10 @@ await lspFactory.LSP8IdentifiableDigitalAsset.deploy({
{
width: 500,
height: 500,
verificationFunction: 'keccak256(bytes)',
verificationData: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14',
verification: {
method: 'keccak256(bytes)',
data: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14',
},
url: 'ipfs://QmPLqMFDxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrajSGp',
}
... // Multiple sizes of the image should be included
Expand All @@ -266,8 +270,10 @@ await lspFactory.LSP8IdentifiableDigitalAsset.deploy({
{
width: 256,
height: 256,
verificationFunction: 'keccak256(bytes)',
verificationData: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14',
verification: {
method: 'keccak256(bytes)',
data: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14',
},
url: 'ipfs://QmPLqMFDxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrajSGp',
}
... // Multiple sizes of the icon image should be included
Expand All @@ -286,8 +292,10 @@ await lspFactory.LSP8IdentifiableDigitalAsset.deploy({
digitalAssetMetadata: {
assets: [
{
verificationFunction: 'keccak256(bytes)',
verificationData: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14',
verification: {
method: 'keccak256(bytes)',
data: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14',
},
url: 'ipfs://QmPLqMFDxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrajSGp',
fileType: 'fbx'
}
Expand Down
30 changes: 20 additions & 10 deletions docs/deployment/universal-profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ Or you can provide the hash value and then uploaded file URL:
await lspFactory.UniversalProfile.deploy({
controllerAddresses: ['0x...'],
lsp3Profile: {
verificationData: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14',
verificationFunction: 'keccak256(utf8)',
verification: {
data: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14',
method: 'keccak256(utf8)',
},
url: 'https://mycoolserver.com/file.json',
},
});
Expand Down Expand Up @@ -176,8 +178,10 @@ const myUniversalProfileData = {
{
width: 500,
height: 500,
verificationFunction: 'keccak256(bytes)',
verificationData: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14', // bytes32 hex string of the image verificationData
verification: {
method: 'keccak256(bytes)',
data: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14', // bytes32 hex string of the image verificationData
},
url: 'ipfs://QmPLqMFDxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrajSGp',
},
... // Multiple image sizes should be included
Expand All @@ -186,8 +190,10 @@ const myUniversalProfileData = {
{
width: 500,
height: 500,
verificationFunction: 'keccak256(bytes)',
verificationData: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', // bytes32 hex string of the image hash
verification: {
method: 'keccak256(bytes)',
datas: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', // bytes32 hex string of the image hash
},
url: 'ipfs://QmPLqMFHxiUDYAom3Zg4SiwoxDaFcZpHXpAmiDzxrtjSGp',
},
... // Multiple image sizes should be included
Expand Down Expand Up @@ -223,8 +229,10 @@ Avatar files passed as a metadata objects will be set directly on the [LSP3 Prof
asset: [
myLocalAvatar,
{
verificationFunction: 'keccak256(bytes)',
verificationData: '0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11',
verification: {
method: 'keccak256(bytes)',
data: '0x5f3dbd89cde4dde36241c501203b67a93b89908063f5516535136bc25f712e11',
},
url: 'ipfs://QmWkAki4mLq2c9hsbKs4HFCaZdpUX1jLKKBb5y8YMATkak',
fileType: 'image/obj',
},
Expand Down Expand Up @@ -327,8 +335,10 @@ await myLSPFactory.UniversalProfile.uploadProfileData(myLSP3MetaData);

/**
{
verificationData: '0x1234...',
verificationFunction: 'keccak256(utf8)',
verification: {
data: '0x1234...',
method: 'keccak256(utf8)',
},
url: 'https://ipfs.lukso.network/ipfs/QmPzUfdKhY6vfcLNDnitwKanpm5GqjYSmw9todNVmi4bqy',
json: {
LSP3Profile: {
Expand Down
26 changes: 15 additions & 11 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const provider = 'https://rpc.testnet.lukso.network';

const lspFactory = new LSPFactory(provider, {
deployKey: '0x...', // Private key of the account which will deploy smart contracts
chainId: 2828,
chainId: 4201,
});
```

Expand All @@ -36,7 +36,7 @@ If used in the browser on a dApp's page, pass the ethereum object as the provide
await ethereum.request({ method: 'eth_requestAccounts', params: [] });

const lspFactory = new LSPFactory(ethereum, {
chainId: 2828,
chainId: 4201,
});
```

Expand All @@ -61,19 +61,23 @@ const myLSP3MetaData = {
{
width: 500,
height: 500,
verificationFunction: 'keccak256(bytes)',
// bytes32 hex string of the image hash
verificationData: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14',
verification: {
method: 'keccak256(bytes)',
// bytes32 hex string of the image hash
data: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14',
},
url: 'ipfs://QmPLqMFHxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrtjSGp',
},
],
backgroundImage: [
{
width: 500,
height: 500,
verificationFunction: 'keccak256(bytes)',
// bytes32 hex string of the image hash
verificationData: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14',
verification: {
method: 'keccak256(bytes)',
// bytes32 hex string of the image hash
data: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14',
},
url: 'ipfs://QmPLqMFHxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrtjSGp',
},
],
Expand Down Expand Up @@ -118,7 +122,7 @@ When instantiating LSPFactory options can be passed to specify parameters such a
```javascript title="Instantiating LSPFactory with custom options set"
const lspFactory = new LSPFactory('https://rpc.testnet.lukso.network', {
deployKey: '0x...',
chainId: 2828,
chainId: 4201,
ipfsGateway: 'https://ipfs.infura.io:5001',
});
```
Expand All @@ -131,7 +135,7 @@ If no value is set here, LSPFactory will attempt to sign transactions via a brow

#### Chain Id

`chainId` is used to specify the network that LSPFactory is interacting with. The provided `chainId` will be used to determine which base contracts to use when using [proxy deployment](./deployment/options.md#deploy-proxy). Previously deployed base contract addresses are stored in the [versions file](https://github.com/lukso-network/tools-lsp-factory/blob/main/src/versions.json) and accessed using the provided chainId. Defaults to 22 (l14 testnet).
`chainId` is used to specify the network that LSPFactory is interacting with. The provided `chainId` will be used to determine which base contracts to use when using [proxy deployment](./deployment/options.md#deploy-proxy). Previously deployed base contract addresses are stored in the [versions file](https://github.com/lukso-network/tools-lsp-factory/blob/main/src/versions.json) and accessed using the provided chainId. Defaults to 4201 ([LUKSO Testnet](https://docs.lukso.tech/networks/testnet/parameters)).

#### IPFS Gateway

Expand All @@ -140,7 +144,7 @@ If no value is set here, LSPFactory will attempt to sign transactions via a brow
```javascript title="Instantiating LSPFactory with custom ipfsGateway options set"
const lspFactory = new LSPFactory('https://rpc.testnet.lukso.network', {
deployKey: '0x...',
chainId: 2828,
chainId: 4201,
ipfsGateway: {
host: 'ipfs.infura.io',
port: 5001,
Expand Down
Loading
Loading