Skip to content

Commit

Permalink
update health server and examples to beta.17
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrouid committed Aug 6, 2021
1 parent 06461ab commit c64ae0b
Show file tree
Hide file tree
Showing 7 changed files with 313 additions and 393 deletions.
59 changes: 30 additions & 29 deletions examples/react-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions examples/react-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "walletconnect-react-app",
"version": "2.0.0-beta.16",
"version": "2.0.0-beta.17",
"private": true,
"keywords": [
"walletconnect",
Expand Down Expand Up @@ -38,10 +38,10 @@
"@types/react": "^16.9.53",
"@types/react-dom": "^16.9.8",
"@types/styled-components": "^5.1.3",
"@walletconnect/client": "^2.0.0-beta.16",
"@walletconnect/client": "^2.0.0-beta.17",
"@walletconnect/qrcode-modal": "^2.0.0-alpha.20",
"@walletconnect/types": "^2.0.0-beta.16",
"@walletconnect/utils": "^2.0.0-beta.16",
"@walletconnect/types": "^2.0.0-beta.17",
"@walletconnect/utils": "^2.0.0-beta.17",
"axios": "^0.21.1",
"blockies-ts": "^1.0.0",
"caip-api": "^2.0.0-beta.1",
Expand Down
32 changes: 21 additions & 11 deletions examples/react-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class App extends React.Component<any, any> {
try {
const arr = await Promise.all(
this.state.accounts.map(async account => {
const [namespace, reference] = account.split(":");
const [namespace, reference, address] = account.split(":");
const chainId = `${namespace}:${reference}`;
const assets = await apiGetAccountAssets(address, chainId);
return { account, assets };
Expand Down Expand Up @@ -382,8 +382,10 @@ class App extends React.Component<any, any> {

try {
// get ethereum address
const address = this.state.accounts.find(account => account.startsWith(chainId));
const account = `${chainId}:${address}`;
const account = this.state.accounts.find(account => account.startsWith(chainId));
if (account === undefined) throw new Error("Account is not found");
const address = account.split(":").pop();
if (address === undefined) throw new Error("Address is invalid");

// open modal
this.openRequestModal();
Expand Down Expand Up @@ -443,8 +445,10 @@ class App extends React.Component<any, any> {
const hexMsg = encoding.utf8ToHex(message, true);

// get ethereum address
const address = this.state.accounts.find(account => account.startsWith(chainId));
if (address === undefined) throw new Error("Address is not valid");
const account = this.state.accounts.find(account => account.startsWith(chainId));
if (account === undefined) throw new Error("Account is not found");
const address = account.split(":").pop();
if (address === undefined) throw new Error("Address is invalid");

// personal_sign params
const params = [hexMsg, address];
Expand Down Expand Up @@ -505,8 +509,10 @@ class App extends React.Component<any, any> {
const message = JSON.stringify(eip712.example);

// get ethereum address
const address = this.state.accounts.find(account => account.startsWith(chainId));
if (address === undefined) throw new Error("Address is not valid");
const account = this.state.accounts.find(account => account.startsWith(chainId));
if (account === undefined) throw new Error("Account is not found");
const address = account.split(":").pop();
if (address === undefined) throw new Error("Address is invalid");

// eth_signTypedData params
const params = [address, message];
Expand Down Expand Up @@ -592,8 +598,10 @@ class App extends React.Component<any, any> {
);

// get cosmos address
const address = this.state.accounts.find(account => account.startsWith(chainId));
if (address === undefined) throw new Error("Address is not valid");
const account = this.state.accounts.find(account => account.startsWith(chainId));
if (account === undefined) throw new Error("Account is not found");
const address = account.split(":").pop();
if (address === undefined) throw new Error("Address is invalid");

// cosmos_signDirect params
const params = {
Expand Down Expand Up @@ -662,8 +670,10 @@ class App extends React.Component<any, any> {
};

// get cosmos address
const address = this.state.accounts.find(account => account.startsWith(chainId));
if (address === undefined) throw new Error("Address is not valid");
const account = this.state.accounts.find(account => account.startsWith(chainId));
if (account === undefined) throw new Error("Account is not found");
const address = account.split(":").pop();
if (address === undefined) throw new Error("Address is invalid");

// cosmos_signAmino params
const params = { signerAddress: address, signDoc };
Expand Down
59 changes: 30 additions & 29 deletions examples/react-wallet/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

2 comments on commit c64ae0b

@vercel
Copy link

@vercel vercel bot commented on c64ae0b Aug 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on c64ae0b Aug 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.