Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Commit 74fdd5c

Browse files
fix: Ensure correct context in encode function (#17)
* fix: upload finish error & scroll style on edge (#15) * fix: scroll style on edge (#6) * chore: update versions (alpha) (#7) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix: upload finish error (#8) * chore: update versions (alpha) (#9) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix: upload finish error & scroll style on edge --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update versions (#16) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix: Ensure correct context in encode function --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent a889cf5 commit 74fdd5c

File tree

8 files changed

+60
-35
lines changed

8 files changed

+60
-35
lines changed

.changeset/heavy-terms-rule.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@node-real/greenfield-uploadkit': patch
3+
---
4+
5+
fix: Ensure correct context in encode function

.changeset/pre.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"mode": "exit",
3+
"tag": "alpha",
4+
"initialVersions": {
5+
"docs": "0.0.1",
6+
"uploadkit-with-nextjs-rainbowkit": "0.0.1",
7+
"uploadkit-with-nextjs-walletkit": "0.0.1",
8+
"uploadkit-with-vite-walletkit": "0.0.1",
9+
"@node-real/greenfield-uploadkit": "0.0.3"
10+
},
11+
"changesets": []
12+
}

examples/uploadkit-with-nextjs-rainbowkit/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"lint": "next lint"
1111
},
1212
"dependencies": {
13-
"@bnb-chain/greenfield-cosmos-types": "0.4.0-alpha.30",
14-
"@bnb-chain/greenfield-js-sdk": "1.2.0",
15-
"@bnb-chain/reed-solomon": "^1.1.3",
16-
"@node-real/greenfield-uploadkit": "workspace:*",
13+
"@bnb-chain/greenfield-cosmos-types": "latest",
14+
"@bnb-chain/greenfield-js-sdk": "latest",
15+
"@bnb-chain/reed-solomon": "latest",
16+
"@node-real/greenfield-uploadkit": "latest",
1717
"@rainbow-me/rainbowkit": "^1.3.3",
1818
"@totejs/walletkit": "^1.0.8",
1919
"axios": "^1.6.3",

examples/uploadkit-with-nextjs-walletkit/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"lint": "next lint"
1111
},
1212
"dependencies": {
13-
"@bnb-chain/greenfield-cosmos-types": "0.4.0-alpha.30",
14-
"@bnb-chain/greenfield-js-sdk": "1.2.0",
15-
"@bnb-chain/reed-solomon": "^1.1.3",
16-
"@node-real/greenfield-uploadkit": "workspace:*",
13+
"@bnb-chain/greenfield-cosmos-types": "latest",
14+
"@bnb-chain/greenfield-js-sdk": "latest",
15+
"@bnb-chain/reed-solomon": "latest",
16+
"@node-real/greenfield-uploadkit": "latest",
1717
"axios": "^1.6.3",
1818
"next": "^13.5.6",
1919
"react": "^18.2.0",

examples/uploadkit-with-vite-walletkit/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"@bnb-chain/greenfield-cosmos-types": "0.4.0-alpha.30",
14-
"@bnb-chain/greenfield-js-sdk": "1.2.0",
15-
"@bnb-chain/reed-solomon": "^1.1.3",
16-
"@node-real/greenfield-uploadkit": "workspace:*",
13+
"@bnb-chain/greenfield-cosmos-types": "latest",
14+
"@bnb-chain/greenfield-js-sdk": "latest",
15+
"@bnb-chain/reed-solomon": "latest",
16+
"@node-real/greenfield-uploadkit": "latest",
1717
"@totejs/walletkit": "^1.0.8",
1818
"react": "^18.2.0",
1919
"react-dom": "^18.2.0",

packages/uploadkit/dev/App.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,11 @@ const options: WalletKitOptions = {
4141
const uploadOptions: UploadKitOptions = {
4242
client: client,
4343
bucketName: 'test-upload-kit',
44-
seedString:
45-
'0xa25fa0de5d5e82b84826a0bce8c84a1bf1b0c8786c586ec696dc52300a9ffe007bb7e10d9901a32b67ed06fdef1d296f6d6fa00fdd33deaeadbd2363fe87708d1c',
46-
checksumFn: async (data: Uint8Array) => {
47-
const rs = new ReedSolomon();
48-
return rs.encode(data);
49-
},
44+
// seedString: '0xa25fa0de5d5e82b84826a0bce8c84a1bf1b0c8786c586ec696dc52300a9ffe007bb7e10d9901a32b67ed06fdef1d296f6d6fa00fdd33deaeadbd2363fe87708d1c',
45+
// checksumFn: async (data: Uint8Array) => {
46+
// const rs = new ReedSolomon();
47+
// return rs.encode(data);
48+
// },
5049
sp: {
5150
operatorAddress: '0x89A1CC91B642DECbC4789474694C606E0E0c420b',
5251
endpoint: 'https://gnfd-testnet-sp1.bnbchain.org',

packages/uploadkit/src/components/GlobalTasks/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ export const GlobalTasks = () => {
5757
},
5858
});
5959
const fileBytes = await hashTask.waitObject.file.arrayBuffer();
60-
const calChecksumFn = typeof checksumFn === 'function' ? checksumFn : rs.encode;
61-
const checkSumRes = await calChecksumFn(new Uint8Array(fileBytes));
60+
const checkSumRes =
61+
typeof checksumFn === 'function'
62+
? await checksumFn(new Uint8Array(fileBytes))
63+
: await rs.encode(new Uint8Array(fileBytes));
6264
if (!checkSumRes) {
6365
return dispatch({
6466
type: 'SET_UPLOAD_TASK_ERROR_MSG',

pnpm-lock.yaml

Lines changed: 22 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)