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

Fixed an issue with **UserOpReceipt** in /sdk #192

Merged
merged 2 commits into from
Oct 17, 2024
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
9 changes: 9 additions & 0 deletions .changeset/popular-dolls-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@soulwallet/decoder": patch
"@soulwallet/assets": patch
"@soulwallet/sdk": patch
---

1. Fixed an issue with **UserOpReceipt** in `/sdk`
2. Updated `/assets`
3. Updated `/decoder`
89 changes: 86 additions & 3 deletions packages/soulwallet-assets/src/tokens.ts

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions packages/soulwallet-decoder/src/dev/generateBytes4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,25 @@ async function generatEthereumListBytes4() {
const signaturesDir = resolve(ethereumList4bytesDir, 'signatures');
// read hotbytes4.txt
const hotbytes4 = fs.readFileSync(resolve(__dirname, 'src', 'templates', 'hotbytes4.txt'), { encoding: 'utf-8' });
const hotbytes4Arr = hotbytes4.split('\n');
const hotbytes4Json = JSON.parse(hotbytes4);
const hotbytes4Arr = hotbytes4Json.map((item: { bytes4: string }) => item.bytes4);
let eachBytes4Arr: string = '';
for (let index = 0; index < hotbytes4Arr.length; index++) {
const bytes4 = hotbytes4Arr[index].trim();
const file = resolve(signaturesDir, bytes4.slice(2));
let bytes4 = hotbytes4Arr[index].trim();
// remove '0x' prefix
if (bytes4.startsWith('0x') === true) {
bytes4 = bytes4.slice(2);
}
// padding to 4 bytes
if (bytes4.length < 8) {
bytes4 = bytes4.padStart(8, '0');
}
const file = resolve(signaturesDir, bytes4);
if (fs.existsSync(file)) {
// read
const text = fs.readFileSync(file, { encoding: 'utf-8' });
const _data = new function4bytes(text);
eachBytes4Arr += `b.set('${_data.bytes4}',{text:'${_data.text}',bytes4:'${_data.bytes4}'});\n`;
eachBytes4Arr += `b.set('0x${_data.bytes4}',{text:'${_data.text}',bytes4:'0x${_data.bytes4}'});\n`;
}
}

Expand Down
6,081 changes: 2,243 additions & 3,838 deletions packages/soulwallet-decoder/src/hotBytes4.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/soulwallet-decoder/src/templates/hotbytes4.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ SUBSTRING(CAST(data AS VARCHAR), 1, 10) AS bytes4
) AS t2
ORDER BY
c DESC NULLS FIRST
LIMIT 1000
LIMIT 6000
```

Loading
Loading