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

Fix/verify contract #566

Merged
merged 6 commits into from
Sep 19, 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
5 changes: 5 additions & 0 deletions .changeset/seven-hornets-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bnb-chain/greenfield-js-sdk': minor
---

fix: Metamask now must using valid contract address
14 changes: 11 additions & 3 deletions examples/browser-file-management/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
# browser-file-management

## 0.1.3

### Patch Changes

- Updated dependencies
[[`3a2b8deecad7e4ba001151f4fc293d33ec2baa07`](https://github.com/bnb-chain/greenfield-js-sdk/commit/3a2b8deecad7e4ba001151f4fc293d33ec2baa07)]:
- @bnb-chain/[email protected]

## 0.1.2

### Patch Changes

- Updated dependencies
[[`64a62b1e1d0387148bbd621448a67b2bb2c2aa5b`](https://github.com/bnb-chain/greenfield-js-sdk/commit/64a62b1e1d0387148bbd621448a67b2bb2c2aa5b)]:
- @bnb-chain/[email protected]
[[`909b463c72a0c83bddc1e41b840d5c871325d54a`](https://github.com/bnb-chain/greenfield-js-sdk/commit/909b463c72a0c83bddc1e41b840d5c871325d54a),
[`34aa1c71d9ee1bc3856aa199a3eee9e50827376b`](https://github.com/bnb-chain/greenfield-js-sdk/commit/34aa1c71d9ee1bc3856aa199a3eee9e50827376b),
[`3e7f1cae3ac12215d5d46ef6755fd198ad450190`](https://github.com/bnb-chain/greenfield-js-sdk/commit/3e7f1cae3ac12215d5d46ef6755fd198ad450190)]:
[[`909b463c72a0c83bddc1e41b840d5c871325d54a`](https://github.com/bnb-chain/greenfield-js-sdk/commit/909b463c72a0c83bddc1e41b840d5c871325d54a),
[`34aa1c71d9ee1bc3856aa199a3eee9e50827376b`](https://github.com/bnb-chain/greenfield-js-sdk/commit/34aa1c71d9ee1bc3856aa199a3eee9e50827376b),
[`3e7f1cae3ac12215d5d46ef6755fd198ad450190`](https://github.com/bnb-chain/greenfield-js-sdk/commit/3e7f1cae3ac12215d5d46ef6755fd198ad450190)]:
- @bnb-chain/[email protected]

## 0.1.2-alpha.2
Expand Down
2 changes: 1 addition & 1 deletion examples/browser-file-management/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "browser-file-management",
"version": "0.1.2",
"version": "0.1.3",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
8 changes: 8 additions & 0 deletions examples/nextjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @demo/wallet

## 0.0.30

### Patch Changes

- Updated dependencies
[[`3a2b8deecad7e4ba001151f4fc293d33ec2baa07`](https://github.com/bnb-chain/greenfield-js-sdk/commit/3a2b8deecad7e4ba001151f4fc293d33ec2baa07)]:
- @bnb-chain/[email protected]

## 0.0.29

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@demo/wallet",
"version": "0.0.29",
"version": "0.0.30",
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development next dev",
Expand Down
8 changes: 8 additions & 0 deletions examples/nodejs-file-management/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @demo/nodejs

## 0.0.29

### Patch Changes

- Updated dependencies
[[`3a2b8deecad7e4ba001151f4fc293d33ec2baa07`](https://github.com/bnb-chain/greenfield-js-sdk/commit/3a2b8deecad7e4ba001151f4fc293d33ec2baa07)]:
- @bnb-chain/[email protected]

## 0.0.28

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/nodejs-file-management/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@demo/nodejs",
"version": "0.0.28",
"version": "0.0.29",
"type": "commonjs",
"private": true,
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions packages/js-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @bnb-chain/greenfield-js-sdk

## 2.1.1

### Patch Changes

- [#558](https://github.com/bnb-chain/greenfield-js-sdk/pull/558)
[`3a2b8deecad7e4ba001151f4fc293d33ec2baa07`](https://github.com/bnb-chain/greenfield-js-sdk/commit/3a2b8deecad7e4ba001151f4fc293d33ec2baa07)
Thanks [@rrr523](https://github.com/rrr523)! - feat: Remove warning in browser.

## 2.1.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/js-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bnb-chain/greenfield-js-sdk",
"version": "2.1.0",
"version": "2.1.1",
"description": "greenfield js chain and sp sdk",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
Expand Down
31 changes: 14 additions & 17 deletions packages/js-sdk/src/clients/spclient/spClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ export class SpClient implements ISpClient {
},
) {
const R = superagent.put(url);
R.buffer(true);
R.timeout(timeout);
R.ok((res) => res.status < 500);

Expand All @@ -179,25 +178,23 @@ export class SpClient implements ISpClient {
});
}

try {
if (options.headers) {
(options.headers as Headers).forEach((v: string, k: string) => {
R.set(k, v);
});
}
if (callback && callback.onProgress) {
R.on('progress', (e) => {
callback.onProgress?.(e);
});
}

if (callback && callback.onProgress) {
R.on('progress', (e) => {
callback.onProgress?.(e);
});
}
const file = assertFileType(uploadFile) ? uploadFile.content : uploadFile;

const file = assertFileType(uploadFile) ? uploadFile.content : uploadFile;
// https://ladjs.github.io/superagent/docs/index.html#serializing-request-body
const sendFile =
isNode && R.get('Content-Type') === 'application/json' ? file.toString() : file;
if (isNode) {
R.buffer(true);
}

// https://ladjs.github.io/superagent/docs/index.html#serializing-request-body
const serializeFile =
isNode && R.get('Content-Type') === 'application/json' ? file.toString() : file;
const response = await R.send(serializeFile);
try {
const response = await R.send(sendFile);
const { status } = response;

if (status === SP_NOT_AVAILABLE_ERROR_CODE) {
Expand Down
2 changes: 1 addition & 1 deletion packages/js-sdk/src/messages/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const createEIP712 = (types: object, chainId: string, message: object) =>
name: 'Greenfield Tx',
version: '1.0.0',
chainId,
verifyingContract: 'greenfield',
verifyingContract: '0x71e835aff094655dEF897fbc85534186DbeaB75d',
salt: '0',
},
message,
Expand Down
Loading
Loading