@redzone/taunt-logins-ui-react 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -92,6 +92,7 @@ const TauntContext = react.createContext({
92
92
  coinbaseLogin: ()=>{},
93
93
  refreshToken: (token)=>cc._async_to_generator(function*() {})(),
94
94
  getClaimrToken: ()=>Promise.resolve(undefined),
95
+ getClaimrData: ()=>Promise.resolve(undefined),
95
96
  logout: ()=>{}
96
97
  });
97
98
  function useTaunt() {
@@ -609,6 +610,12 @@ const TauntProvider = ({ children, tauntServiceEndpoint, magicKey })=>{
609
610
  setIsLoading(false);
610
611
  }
611
612
  })(), []);
613
+ const getClaimrData = react.useCallback(()=>cc._async_to_generator(function*() {
614
+ if (!loggedIn) return undefined;
615
+ return taunt.getClaimrData();
616
+ })(), [
617
+ loggedIn
618
+ ]);
612
619
  if (!tauntServiceEndpoint) {
613
620
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
614
621
  children: "tauntServiceEndpoint is required"
@@ -620,6 +627,7 @@ const TauntProvider = ({ children, tauntServiceEndpoint, magicKey })=>{
620
627
  loggedIn,
621
628
  isLoading,
622
629
  deets,
630
+ getClaimrData,
623
631
  getClaimrToken,
624
632
  otpMagicLogin,
625
633
  metamaskLogin,
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
+ import { ClaimrCampaignData } from '@redzone/taunt-logins';
3
4
 
4
5
  interface CoinbaseButtonProps {
5
6
  openCoinbase?: () => void;
@@ -95,6 +96,7 @@ type ContextProps = {
95
96
  telegramLogin: () => void;
96
97
  metaLogin: () => void;
97
98
  coinbaseLogin: () => void;
99
+ getClaimrData: () => Promise<ClaimrCampaignData | undefined>;
98
100
  getClaimrToken: () => Promise<string | undefined>;
99
101
  refreshToken: (token: string) => Promise<void>;
100
102
  logout: () => void;
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
+ import { ClaimrCampaignData } from '@redzone/taunt-logins';
3
4
 
4
5
  interface CoinbaseButtonProps {
5
6
  openCoinbase?: () => void;
@@ -95,6 +96,7 @@ type ContextProps = {
95
96
  telegramLogin: () => void;
96
97
  metaLogin: () => void;
97
98
  coinbaseLogin: () => void;
99
+ getClaimrData: () => Promise<ClaimrCampaignData | undefined>;
98
100
  getClaimrToken: () => Promise<string | undefined>;
99
101
  refreshToken: (token: string) => Promise<void>;
100
102
  logout: () => void;
package/dist/es/index.js CHANGED
@@ -92,6 +92,7 @@ const TauntContext = createContext({
92
92
  coinbaseLogin: ()=>{},
93
93
  refreshToken: (token)=>_async_to_generator(function*() {})(),
94
94
  getClaimrToken: ()=>Promise.resolve(undefined),
95
+ getClaimrData: ()=>Promise.resolve(undefined),
95
96
  logout: ()=>{}
96
97
  });
97
98
  function useTaunt() {
@@ -609,6 +610,12 @@ const TauntProvider = ({ children, tauntServiceEndpoint, magicKey })=>{
609
610
  setIsLoading(false);
610
611
  }
611
612
  })(), []);
613
+ const getClaimrData = useCallback(()=>_async_to_generator(function*() {
614
+ if (!loggedIn) return undefined;
615
+ return taunt.getClaimrData();
616
+ })(), [
617
+ loggedIn
618
+ ]);
612
619
  if (!tauntServiceEndpoint) {
613
620
  return /*#__PURE__*/ jsx("div", {
614
621
  children: "tauntServiceEndpoint is required"
@@ -620,6 +627,7 @@ const TauntProvider = ({ children, tauntServiceEndpoint, magicKey })=>{
620
627
  loggedIn,
621
628
  isLoading,
622
629
  deets,
630
+ getClaimrData,
623
631
  getClaimrToken,
624
632
  otpMagicLogin,
625
633
  metamaskLogin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redzone/taunt-logins-ui-react",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "type": "module",
5
5
  "main": "./dist/es/index.js",
6
6
  "module": "./dist/es/index.js",