diff --git a/README.md b/README.md index c7bad0e..2f364f1 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ function LoginButton() { const scope = process.env.REACT_APP_SCOPE; const state = process.env.REACT_APP_STATE; - const redirectUrl = `https://moon-wallet-supabase-next-app.vercel.app/authorize?response_type=${response_type}&client_id=${client_id}&redirect_uri=${redirect_uri}&scope=${scope}&state=${state}`; + const redirectUrl = `https://dash.usemoon.ai/authorize?response_type=${response_type}&client_id=${client_id}&redirect_uri=${redirect_uri}&scope=${scope}&state=${state}`; window.location.href = redirectUrl; }; @@ -75,7 +75,7 @@ app.get('/callback', async (req: Request, res: Response) => { const { code, state } = req.query; console.log(process.env.REACT_APP_CLIENT_GRANT_TYPE); const response = await axios.post( - 'https://moon-wallet-supabase-next-app.vercel.app/api/oauth2/exchange', + 'https://dash.usemoon.ai/api/oauth2/exchange', { grant_type: process.env.REACT_APP_GRANT_TYPE, code: code, @@ -113,7 +113,7 @@ const MoonSIWE = async (addres) => { try { // 1. Get a nonce from the server - const nonceResponse = await fetch(`https://moon-wallet-supabase-next-app.vercel.app/api/ethereum/nonce`, { + const nonceResponse = await fetch(`https://dash.usemoon.ai/api/ethereum/nonce`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -142,7 +142,7 @@ const MoonSIWE = async (addres) => { }); // // 3. Send the signed message to our API - const response = await fetch(`https://moon-wallet-supabase-next-app.vercel.app/api/ethereum/login`, { + const response = await fetch(`https://dash.usemoon.ai/api/ethereum/login`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/examples/moon-sdk-authentication-chat-example-app/server/index.ts b/examples/moon-sdk-authentication-chat-example-app/server/index.ts index cc6d522..4e53bb6 100644 --- a/examples/moon-sdk-authentication-chat-example-app/server/index.ts +++ b/examples/moon-sdk-authentication-chat-example-app/server/index.ts @@ -99,7 +99,7 @@ app.get('/callback', async (req: Request, res: Response) => { const { code, state } = req.query; console.log(process.env.REACT_APP_CLIENT_GRANT_TYPE); const response = await axios.post( - 'https://moon-wallet-supabase-next-app.vercel.app/api/oauth2/exchange', + 'https://dash.usemoon.ai/api/oauth2/exchange', { grant_type: process.env.REACT_APP_GRANT_TYPE, code: code, diff --git a/examples/moon-sdk-authentication-chat-example-app/src/pages/oauth2.tsx b/examples/moon-sdk-authentication-chat-example-app/src/pages/oauth2.tsx index 05071b0..5ab85d3 100644 --- a/examples/moon-sdk-authentication-chat-example-app/src/pages/oauth2.tsx +++ b/examples/moon-sdk-authentication-chat-example-app/src/pages/oauth2.tsx @@ -6,7 +6,7 @@ function LoginButton() { const scope = process.env.REACT_APP_SCOPE; const state = process.env.REACT_APP_STATE; - const redirectUrl = `https://moon-wallet-supabase-next-app.vercel.app/authorize?response_type=${response_type}&client_id=${client_id}&redirect_uri=${redirect_uri}&scope=${scope}&state=${state}`; + const redirectUrl = `https://dash.usemoon.ai/authorize?response_type=${response_type}&client_id=${client_id}&redirect_uri=${redirect_uri}&scope=${scope}&state=${state}`; window.location.href = redirectUrl; }; diff --git a/examples/moon-sdk-authentication-chat-example-app/src/pages/siwe.tsx b/examples/moon-sdk-authentication-chat-example-app/src/pages/siwe.tsx index 42c778e..8cae4d7 100644 --- a/examples/moon-sdk-authentication-chat-example-app/src/pages/siwe.tsx +++ b/examples/moon-sdk-authentication-chat-example-app/src/pages/siwe.tsx @@ -21,7 +21,7 @@ function SIWE() { return accounts[0]; }); console.log(address); - return fetch('https://vault-api.usemoon.ai/auth/ethereum/challenge', { + return fetch('http://dash.usemoon.ai/api/ethereum/nonce', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -35,11 +35,13 @@ function SIWE() { return response.json(); }) .then(function (json) { + console.log(json); return ethereum.request({ method: 'eth_requestAccounts' }).then(function (accounts: any[]) { - return [accounts[0], json.nonce]; + return [accounts[0], json.user[0].auth.genNonce]; }); }) .then(function (args) { + console.log(args); const account = args[0]; const address = ethers.utils.getAddress(account); const message = new SiweMessage({ @@ -63,7 +65,8 @@ function SIWE() { }); }) .then(function (args) { - return fetch('https://vault-api.usemoon.ai/auth/ethereum', { + console.log(args); + return fetch('http://dash.usemoon.ai/api/ethereum/login', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -71,7 +74,7 @@ function SIWE() { }, body: JSON.stringify({ message: args[0], - signature: args[1], + signedMessage: args[1], address, }), }); diff --git a/packages/moon-rainbowkit/package.json b/packages/moon-rainbowkit/package.json index 666eb5d..9e62bcb 100644 --- a/packages/moon-rainbowkit/package.json +++ b/packages/moon-rainbowkit/package.json @@ -1,6 +1,6 @@ { "name": "@moonup/moon-rainbowkit", - "version": "1.0.14", + "version": "1.0.15", "license": "MIT", "author": "0xEwhal ", "type": "commonjs", diff --git a/packages/moon-rainbowkit/src/siwe.tsx b/packages/moon-rainbowkit/src/siwe.tsx index 984076c..da39300 100644 --- a/packages/moon-rainbowkit/src/siwe.tsx +++ b/packages/moon-rainbowkit/src/siwe.tsx @@ -32,7 +32,7 @@ export function RainbowMoonProvider({ getNonce: async (): Promise => { // 1. Get a nonce from the server const nonceResponse = await fetch( - `https://moon-wallet-supabase-next-app.vercel.app/api/ethereum/nonce`, + `https://dash.usemoon.ai/api/ethereum/nonce`, { method: 'POST', headers: { @@ -71,7 +71,7 @@ export function RainbowMoonProvider({ setIsLoading(true); // // 3. Send the signed message to our API const response = await fetch( - `https://moon-wallet-supabase-next-app.vercel.app/api/ethereum/login`, + `https://dash.usemoon.ai/api/ethereum/login`, { method: 'POST', headers: { diff --git a/packages/moon-sdk/src/moon.ts b/packages/moon-sdk/src/moon.ts index 3878206..cf1ea38 100644 --- a/packages/moon-sdk/src/moon.ts +++ b/packages/moon-sdk/src/moon.ts @@ -172,10 +172,6 @@ export class MoonSDK { this.http.setSecurityData({ token: token, }); - return await this.MoonAPIClient.auth.setSession({ - access_token: token, - refresh_token: refreshToken, - }); } public getSolanaSDK(): Solana {