UNPKG

@sky-mavis/tanto-widget

Version:
40 lines 920 B
import {WAYPOINT_BASE_URL}from'../constants.mjs';import {request}from'./request.mjs';const mutation = { generateNonce: () => ({ mutationKey: ['tantoGenerateNonce'], mutationFn: async ({ baseUrl = WAYPOINT_BASE_URL, clientId = '', address }) => { return request(`${baseUrl}/siwe/init`, { method: 'POST', headers: { 'sm-client-id': clientId }, body: { address } }); } }), createAccount: () => ({ mutationKey: ['tantoCreateAccount'], mutationFn: async ({ baseUrl = WAYPOINT_BASE_URL, clientId = '', message, signature }) => { return request(`${baseUrl}/siwe/authenticate`, { method: 'POST', headers: { 'sm-client-id': clientId }, body: { message, signature } }); } }) };export{mutation};