-
-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into edkek/remove-react-workingdemo
- Loading branch information
Showing
7 changed files
with
223 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Deploy to CDN | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag to deploy' | ||
required: true | ||
default: '' | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.tag }} | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install Yarn 3 | ||
run: yarn set version 3.5.1 | ||
|
||
- name: Install Dependencies | ||
run: yarn install --immutable | ||
|
||
- name: Run deploy script | ||
env: | ||
tag: ${{ github.event.inputs.tag }} | ||
run: bash ./scripts/deploy-cdn.sh | ||
|
||
- name: Deploy dapps | ||
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 | ||
with: | ||
personal_token: ${{ secrets.DEPLOY_TOKEN }} | ||
# force_orphan: true # removing for now as it is incompatible with keep_files | ||
keep_files: true # Important to keep the rest of the files deployed previously | ||
publish_dir: ./deployments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Deploy to CDN | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag to deploy' | ||
required: true | ||
default: '' | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.tag }} | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install Yarn 3 | ||
run: yarn set version 3.5.1 | ||
|
||
- name: Install Dependencies | ||
run: yarn install --immutable | ||
|
||
- name: Run deploy script | ||
env: | ||
tag: ${{ github.event.inputs.tag }} | ||
run: bash ./scripts/deploy-static.sh | ||
|
||
- name: Deploy dapps | ||
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 | ||
with: | ||
personal_token: ${{ secrets.DEPLOY_TOKEN }} | ||
# force_orphan: true # removing for now as it is incompatible with keep_files | ||
keep_files: true # Important to keep the rest of the files deployed previously | ||
publish_dir: ./deployments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,19 +35,37 @@ export class Ethereum { | |
autoRequestAccounts: false, | ||
}); | ||
|
||
const proxiedProvieer = new Proxy(provider, { | ||
// some common libraries, e.g. [email protected], can confict with our API. | ||
const proxiedProvider = new Proxy(provider, { | ||
// some common libraries, e.g. [email protected], can conflict with our API. | ||
deleteProperty: () => true, | ||
}); | ||
|
||
this.provider = proxiedProvieer; | ||
this.provider = proxiedProvider; | ||
this.sdkInstance = sdkInstance; | ||
|
||
// Add try-catch block around window modifications | ||
if (shouldSetOnWindow && typeof window !== 'undefined') { | ||
setGlobalProvider(provider); | ||
try { | ||
setGlobalProvider(provider); | ||
} catch (error) { | ||
logger( | ||
'[Ethereum] Unable to set global provider - window.ethereum may be read-only', | ||
error, | ||
); | ||
// Continue execution without throwing | ||
} | ||
} | ||
|
||
if (shouldShimWeb3 && typeof window !== 'undefined') { | ||
shimWeb3(this.provider); | ||
try { | ||
shimWeb3(this.provider); | ||
} catch (error) { | ||
logger( | ||
'[Ethereum] Unable to shim web3 - window.web3 may be read-only', | ||
error, | ||
); | ||
// Continue execution without throwing | ||
} | ||
} | ||
|
||
// Propagate display_uri events to the SDK | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.