@robertprp/intents-sdk
Version:
Shogun Network Intent-based cross-chain swaps SDK
26 lines • 918 B
JavaScript
import { AUCTIONEER_URL } from '../constants.js';
export async function fetchSiweMessage(params) {
const url = `${AUCTIONEER_URL}/siwe?wallet=${params.wallet}&chainId=${params.chainId}`;
const response = await fetch(url);
if (!response.ok) {
throw new Error(`Failed to fetch SIWE message: ${response.status} ${response.statusText}`);
}
const data = await response.json();
return data;
}
export async function fetchJWTToken(params, token) {
const url = `${AUCTIONEER_URL}/siwe`;
const response = await fetch(url, {
method: 'POST',
body: JSON.stringify(params),
headers: {
Authorization: `Bearer ${token}`,
},
});
if (!response.ok) {
throw new Error(`Failed to fetch JWT token: ${response.status} ${response.statusText}`);
}
const data = await response.json();
return data;
}
//# sourceMappingURL=siwe.js.map