Skip to content

Commit

Permalink
chore: Refactor to use biome.
Browse files Browse the repository at this point in the history
  • Loading branch information
richtera committed Apr 5, 2024
1 parent 633406d commit d10f47c
Show file tree
Hide file tree
Showing 52 changed files with 4,217 additions and 4,025 deletions.
64 changes: 0 additions & 64 deletions .eslintrc

This file was deleted.

17 changes: 16 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,23 @@
"noExplicitAny": "off"
},
"style": {
"useImportType": "off"
"useImportType": "off",
"useNodejsImportProtocol": "off"
}
}
},
"formatter": {
"indentWidth": 2,
"indentStyle": "space"
},
"javascript": {
"formatter": {
"semicolons": "asNeeded",
"quoteStyle": "single",
"trailingComma": "none"
}
},
"files": {
"ignore": ["node_modules", "build", "coverage", ".vscode"]
}
}
42 changes: 21 additions & 21 deletions examples/src/decodeData.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// https://stackoverflow.com/questions/60059121/nodejs-es6-imports-cannot-find-module#comment106219502_60059121
// eslint-disable-next-line import/extensions
import { getInstance } from './instantiation.js';
import { getInstance } from './instantiation.js'

const myERC725 = getInstance();
const myERC725 = getInstance()

const decodedDataOneKey = myERC725.decodeData([
{
keyName: 'LSP3Profile',
value:
'0x00006f357c6a0020820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361697066733a2f2f516d597231564a4c776572673670456f73636468564775676f3339706136727963455a4c6a7452504466573834554178',
},
]);
'0x00006f357c6a0020820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361697066733a2f2f516d597231564a4c776572673670456f73636468564775676f3339706136727963455a4c6a7452504466573834554178'
}
])
/**
[
{
Expand All @@ -31,27 +31,27 @@ const decodedDataManyKeys = myERC725.decodeData([
{
keyName: 'LSP3Profile',
value:
'0x00006f357c6a0020820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361697066733a2f2f516d597231564a4c776572673670456f73636468564775676f3339706136727963455a4c6a7452504466573834554178',
'0x00006f357c6a0020820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361697066733a2f2f516d597231564a4c776572673670456f73636468564775676f3339706136727963455a4c6a7452504466573834554178'
},
{
keyName: 'LSP3IssuedAssets[]',
value: [
{
key: '0x3a47ab5bd3a594c3a8995f8fa58d0876c96819ca4516bd76100c92462f2f9dc0',
value:
'0x0000000000000000000000000000000000000000000000000000000000000002',
'0x0000000000000000000000000000000000000000000000000000000000000002'
},
{
key: '0x3a47ab5bd3a594c3a8995f8fa58d087600000000000000000000000000000000',
value: '0xd94353d9b005b3c0a9da169b768a31c57844e490',
value: '0xd94353d9b005b3c0a9da169b768a31c57844e490'
},
{
key: '0x3a47ab5bd3a594c3a8995f8fa58d087600000000000000000000000000000001',
value: '0xdaea594e385fc724449e3118b2db7e86dfba1826',
},
],
},
]);
value: '0xdaea594e385fc724449e3118b2db7e86dfba1826'
}
]
}
])
/**
[
{
Expand All @@ -75,11 +75,11 @@ const decodedDataManyKeys = myERC725.decodeData([
}
]
*/
console.log('/*--------------------------------------------/*');
console.log('/* decodeData - one key (VerifiableURI) /*');
console.log('/*--------------------------------------------/*');
console.log(decodedDataOneKey);
console.log('/*--------------------------------------------/*');
console.log('/* decodeData - many keys /*');
console.log('/*--------------------------------------------/*');
console.log(decodedDataManyKeys);
console.log('/*--------------------------------------------/*')
console.log('/* decodeData - one key (VerifiableURI) /*')
console.log('/*--------------------------------------------/*')
console.log(decodedDataOneKey)
console.log('/*--------------------------------------------/*')
console.log('/* decodeData - many keys /*')
console.log('/*--------------------------------------------/*')
console.log(decodedDataManyKeys)
58 changes: 29 additions & 29 deletions examples/src/encodeData.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// https://stackoverflow.com/questions/60059121/nodejs-es6-imports-cannot-find-module#comment106219502_60059121
// eslint-disable-next-line import/extensions
import { getInstance, profileJson } from './instantiation.js';
import { getInstance, profileJson } from './instantiation.js'

const myERC725 = getInstance();
const myERC725 = getInstance()

const encodedDataOneKey = myERC725.encodeData({
keyName: 'LSP3Profile',
value: {
json: profileJson, // check instantiation.js to see the actual JSON
url: 'ipfs://QmQTqheBLZFnQUxu5RDs8tA9JtkxfZqMBcmGd9sukXxwRm',
},
});
url: 'ipfs://QmQTqheBLZFnQUxu5RDs8tA9JtkxfZqMBcmGd9sukXxwRm'
}
})
/**
{
keys: [
Expand All @@ -27,11 +27,11 @@ const encodedDataOneKeyV2 = myERC725.encodeData({
value: {
verification: {
method: 'keccak256(utf8)',
data: '0x820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361',
data: '0x820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361'
},
url: 'ipfs://QmYr1VJLwerg6pEoscdhVGugo39pa6rycEZLjtRPDfW84UAx',
},
});
url: 'ipfs://QmYr1VJLwerg6pEoscdhVGugo39pa6rycEZLjtRPDfW84UAx'
}
})
/**
{
keys: [
Expand All @@ -49,23 +49,23 @@ const encodedDataManyKeys = myERC725.encodeData([
value: {
verification: {
method: 'keccak256(utf8)',
data: '0x820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361',
data: '0x820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361'
},
url: 'ipfs://QmYr1VJLwerg6pEoscdhVGugo39pa6rycEZLjtRPDfW84UAx',
},
url: 'ipfs://QmYr1VJLwerg6pEoscdhVGugo39pa6rycEZLjtRPDfW84UAx'
}
},
{
keyName: 'LSP3IssuedAssets[]',
value: [
'0xD94353D9B005B3c0A9Da169b768a31C57844e490',
'0xDaea594E385Fc724449E3118B2Db7E86dFBa1826',
],
'0xDaea594E385Fc724449E3118B2Db7E86dFBa1826'
]
},
{
keyName: 'LSP1UniversalReceiverDelegate',
value: '0x1183790f29BE3cDfD0A102862fEA1a4a30b3AdAb',
},
]);
value: '0x1183790f29BE3cDfD0A102862fEA1a4a30b3AdAb'
}
])
/**
{
keys: [
Expand All @@ -85,15 +85,15 @@ const encodedDataManyKeys = myERC725.encodeData([
}
*/

console.log('/*-----------------------------------------------------/*');
console.log('/* encodedData - one key (LSP3Profile) with JSON /*');
console.log('/*-----------------------------------------------------/*');
console.log(encodedDataOneKey);
console.log('/*-----------------------------------------------------/*');
console.log('/* encodedData - one key (LSP3Profile) with hash /*');
console.log('/*-----------------------------------------------------/*');
console.log(encodedDataOneKeyV2);
console.log('/*-----------------------------------------------------/*');
console.log('/* encodedData - many keys /*');
console.log('/*-----------------------------------------------------/*');
console.log(encodedDataManyKeys);
console.log('/*-----------------------------------------------------/*')
console.log('/* encodedData - one key (LSP3Profile) with JSON /*')
console.log('/*-----------------------------------------------------/*')
console.log(encodedDataOneKey)
console.log('/*-----------------------------------------------------/*')
console.log('/* encodedData - one key (LSP3Profile) with hash /*')
console.log('/*-----------------------------------------------------/*')
console.log(encodedDataOneKeyV2)
console.log('/*-----------------------------------------------------/*')
console.log('/* encodedData - many keys /*')
console.log('/*-----------------------------------------------------/*')
console.log(encodedDataManyKeys)
36 changes: 18 additions & 18 deletions examples/src/fetchData.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// https://stackoverflow.com/questions/60059121/nodejs-es6-imports-cannot-find-module#comment106219502_60059121
// eslint-disable-next-line import/extensions
import { getInstance } from './instantiation.js';
import { getInstance } from './instantiation.js'

const myERC725 = getInstance();
const myERC725 = getInstance()

const dataAllKeys = await myERC725.fetchData();
const dataAllKeys = await myERC725.fetchData()
/**
[
{
Expand Down Expand Up @@ -41,7 +41,7 @@ const dataAllKeys = await myERC725.fetchData();
]
*/

const dataOneKey = await myERC725.fetchData('LSP3Profile');
const dataOneKey = await myERC725.fetchData('LSP3Profile')
/**
{
key: '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5',
Expand All @@ -61,8 +61,8 @@ const dataOneKey = await myERC725.fetchData('LSP3Profile');

const dataManyKeys = await myERC725.fetchData([
'LSP3Profile',
'LSP1UniversalReceiverDelegate',
]);
'LSP1UniversalReceiverDelegate'
])
/**
[
{
Expand All @@ -78,17 +78,17 @@ const dataManyKeys = await myERC725.fetchData([
]
*/

console.log('/*--------------------------------------------/*');
console.log('/* fetchData - all keys /*');
console.log('/*--------------------------------------------/*');
console.log(dataAllKeys);
console.log('/*--------------------------------------------/*')
console.log('/* fetchData - all keys /*')
console.log('/*--------------------------------------------/*')
console.log(dataAllKeys)

console.log('/*--------------------------------------------/*');
console.log('/* fetchData - one key /*');
console.log('/*--------------------------------------------/*');
console.log(dataOneKey);
console.log('/*--------------------------------------------/*')
console.log('/* fetchData - one key /*')
console.log('/*--------------------------------------------/*')
console.log(dataOneKey)

console.log('/*--------------------------------------------/*');
console.log('/* fetchData - many keys /*');
console.log('/*--------------------------------------------/*');
console.log(dataManyKeys);
console.log('/*--------------------------------------------/*')
console.log('/* fetchData - many keys /*')
console.log('/*--------------------------------------------/*')
console.log(dataManyKeys)
36 changes: 18 additions & 18 deletions examples/src/getData.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// https://stackoverflow.com/questions/60059121/nodejs-es6-imports-cannot-find-module#comment106219502_60059121
// eslint-disable-next-line import/extensions
import { getInstance } from './instantiation.js';
import { getInstance } from './instantiation.js'

const myERC725 = getInstance();
const myERC725 = getInstance()

const dataAllKeys = await myERC725.getData();
const dataAllKeys = await myERC725.getData()
/**
[
{
Expand Down Expand Up @@ -42,7 +42,7 @@ const dataAllKeys = await myERC725.getData();
]
*/

const dataOneKey = await myERC725.getData('LSP3Profile');
const dataOneKey = await myERC725.getData('LSP3Profile')
/**
{
key: '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5',
Expand All @@ -59,8 +59,8 @@ const dataOneKey = await myERC725.getData('LSP3Profile');

const dataManyKeys = await myERC725.getData([
'LSP3Profile',
'LSP1UniversalReceiverDelegate',
]);
'LSP1UniversalReceiverDelegate'
])
/**
[
{
Expand All @@ -82,17 +82,17 @@ const dataManyKeys = await myERC725.getData([
]
*/

console.log('/*--------------------------------------------/*');
console.log('/* getData - all keys /*');
console.log('/*--------------------------------------------/*');
console.log(dataAllKeys);
console.log('/*--------------------------------------------/*')
console.log('/* getData - all keys /*')
console.log('/*--------------------------------------------/*')
console.log(dataAllKeys)

console.log('/*--------------------------------------------/*');
console.log('/* getData - one key /*');
console.log('/*--------------------------------------------/*');
console.log(dataOneKey);
console.log('/*--------------------------------------------/*')
console.log('/* getData - one key /*')
console.log('/*--------------------------------------------/*')
console.log(dataOneKey)

console.log('/*--------------------------------------------/*');
console.log('/* getData - many keys /*');
console.log('/*--------------------------------------------/*');
console.log(dataManyKeys);
console.log('/*--------------------------------------------/*')
console.log('/* getData - many keys /*')
console.log('/*--------------------------------------------/*')
console.log(dataManyKeys)
Loading

0 comments on commit d10f47c

Please sign in to comment.