@idosgames/core 0.22.0 → 0.22.1

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.
@@ -3091,7 +3091,7 @@ declare const PlayAccessMode: {
3091
3091
  };
3092
3092
  type PlayAccessMode = (typeof PlayAccessMode)[keyof typeof PlayAccessMode];
3093
3093
  type BlockchainPlayAccessPolicy = { Mode?: null | 'Open' | 'AnyWithLinkedWallet' | 'WalletOnly'; TokenGates?: null | Array<WalletPlayTokenGate>; [key: string]: unknown; };
3094
- type BlockchainDefinitions = { SystemState?: null | BlockchainSystemState; Networks?: null | Record<string, BlockchainNetworkDefinition>; AccountSafety?: null | BlockchainAccountSafetyPolicy; WalletLogin?: null | { Enabled?: null | boolean; WalletConnectProjectId?: null | string; [key: string]: unknown; }; PlayAccess?: null | BlockchainPlayAccessPolicy; IframeConnectHosts?: null | Array<string>; [key: string]: unknown; };
3094
+ type BlockchainDefinitions = { SystemState?: null | BlockchainSystemState; Networks?: null | Record<string, BlockchainNetworkDefinition>; AccountSafety?: null | BlockchainAccountSafetyPolicy; WalletLogin?: null | { Enabled?: null | boolean; WalletConnectProjectId?: null | string; ShowOnLoginScreen?: null | boolean; [key: string]: unknown; }; PlayAccess?: null | BlockchainPlayAccessPolicy; IframeConnectHosts?: null | Array<string>; [key: string]: unknown; };
3095
3095
  type LinkedWalletInfo = { NetworkID?: null | string; Address?: null | string; LinkedAt?: null | string; LastUsedAt?: null | string; LinkType?: null | 'AutoLinkedFromTransaction' | 'SignatureVerified' | 'ManuallyLinked'; IsSignatureVerified?: null | boolean; [key: string]: unknown; };
3096
3096
  type PendingWithdrawalRef = { TitleTransactionID?: null | string; Type?: null | 'Token' | 'Nft'; NetworkID?: null | string; AssetID?: null | string; Amount?: null | string; CreatedAt?: null | string; ExpiresAt?: null | string; [key: string]: unknown; };
3097
3097
  type UserKycState = { Status?: null | 'Expired' | 'Pending' | 'Rejected' | 'NotRequested' | 'Verified'; Tier?: null | 'None' | 'Tier1' | 'Tier2' | 'Tier3'; VerifiedAt?: null | string; ExpiresAt?: null | string; RejectedAt?: null | string; ProviderReference?: null | string; RejectionReason?: null | string; [key: string]: unknown; };
@@ -4617,7 +4617,7 @@ declare const WorkshopAction: {
4617
4617
  type WorkshopAction = (typeof WorkshopAction)[keyof typeof WorkshopAction];
4618
4618
  type PlatformLoginResponse = { TitleUserID: string; TitleClientSessionTicket: string; TitleClientSessionTicketExpiration: string; PlatformUserID?: null | string; PlatformAuthToken?: null | string; PlatformAuthTokenExpiration?: null | string; PlayAccess?: null | PlayAccessStatus; RefreshToken?: null | string; RefreshTokenExpiration?: null | string; };
4619
4619
  type RefreshSessionResponse = { TitleUserID: string; TitleClientSessionTicket: string; TitleClientSessionTicketExpiration: string; RefreshToken: string; RefreshTokenExpiration?: null | string; PlayAccess?: null | PlayAccessStatus; };
4620
- type AuthOptionsResponse = { Google?: null | { Enabled?: null | boolean; WebClientID?: null | string; PlatformFallback?: null | boolean; AndroidClientID?: null | string; IosClientID?: null | string; DesktopClientID?: null | string; [key: string]: unknown; }; Apple?: null | { Enabled?: null | boolean; BundleID?: null | string; ServiceID?: null | string; [key: string]: unknown; }; PlayAccessMode?: null | 'Open' | 'AnyWithLinkedWallet' | 'WalletOnly'; WalletLoginNetworks?: null | Array<{ NetworkID?: null | string; Type?: null | string; [key: string]: unknown; }>; NativeSso?: null | { ReturnMode?: null | string; UrlScheme?: null | string; UserCodeSupported?: null | boolean; PollIntervalSeconds?: null | number; [key: string]: unknown; }; [key: string]: unknown; };
4620
+ type AuthOptionsResponse = { Google?: null | { Enabled?: null | boolean; WebClientID?: null | string; PlatformFallback?: null | boolean; AndroidClientID?: null | string; IosClientID?: null | string; DesktopClientID?: null | string; [key: string]: unknown; }; Apple?: null | { Enabled?: null | boolean; BundleID?: null | string; ServiceID?: null | string; [key: string]: unknown; }; PlayAccessMode?: null | 'Open' | 'AnyWithLinkedWallet' | 'WalletOnly'; WalletLoginNetworks?: null | Array<{ NetworkID?: null | string; Type?: null | string; [key: string]: unknown; }>; ShowWalletLogin?: null | boolean; NativeSso?: null | { ReturnMode?: null | string; UrlScheme?: null | string; UserCodeSupported?: null | boolean; PollIntervalSeconds?: null | number; [key: string]: unknown; }; [key: string]: unknown; };
4621
4621
  type WalletLinkResponse = { Linked?: null | boolean; Challenge?: null | string; ExpiresAt?: null | string; NetworkID?: null | string; Address?: null | string; PlayAccess?: null | PlayAccessStatus; [key: string]: unknown; };
4622
4622
  type WalletUnlinkResponse = { NetworkID?: null | string; Address?: null | string; CooldownUntil?: null | string; PlayAccess?: null | PlayAccessStatus; [key: string]: unknown; };
4623
4623
  type EmailRegistrationResponse = { CodeTtlMinutes?: null | number; ResendCooldownSeconds?: null | number; };
@@ -3091,7 +3091,7 @@ declare const PlayAccessMode: {
3091
3091
  };
3092
3092
  type PlayAccessMode = (typeof PlayAccessMode)[keyof typeof PlayAccessMode];
3093
3093
  type BlockchainPlayAccessPolicy = { Mode?: null | 'Open' | 'AnyWithLinkedWallet' | 'WalletOnly'; TokenGates?: null | Array<WalletPlayTokenGate>; [key: string]: unknown; };
3094
- type BlockchainDefinitions = { SystemState?: null | BlockchainSystemState; Networks?: null | Record<string, BlockchainNetworkDefinition>; AccountSafety?: null | BlockchainAccountSafetyPolicy; WalletLogin?: null | { Enabled?: null | boolean; WalletConnectProjectId?: null | string; [key: string]: unknown; }; PlayAccess?: null | BlockchainPlayAccessPolicy; IframeConnectHosts?: null | Array<string>; [key: string]: unknown; };
3094
+ type BlockchainDefinitions = { SystemState?: null | BlockchainSystemState; Networks?: null | Record<string, BlockchainNetworkDefinition>; AccountSafety?: null | BlockchainAccountSafetyPolicy; WalletLogin?: null | { Enabled?: null | boolean; WalletConnectProjectId?: null | string; ShowOnLoginScreen?: null | boolean; [key: string]: unknown; }; PlayAccess?: null | BlockchainPlayAccessPolicy; IframeConnectHosts?: null | Array<string>; [key: string]: unknown; };
3095
3095
  type LinkedWalletInfo = { NetworkID?: null | string; Address?: null | string; LinkedAt?: null | string; LastUsedAt?: null | string; LinkType?: null | 'AutoLinkedFromTransaction' | 'SignatureVerified' | 'ManuallyLinked'; IsSignatureVerified?: null | boolean; [key: string]: unknown; };
3096
3096
  type PendingWithdrawalRef = { TitleTransactionID?: null | string; Type?: null | 'Token' | 'Nft'; NetworkID?: null | string; AssetID?: null | string; Amount?: null | string; CreatedAt?: null | string; ExpiresAt?: null | string; [key: string]: unknown; };
3097
3097
  type UserKycState = { Status?: null | 'Expired' | 'Pending' | 'Rejected' | 'NotRequested' | 'Verified'; Tier?: null | 'None' | 'Tier1' | 'Tier2' | 'Tier3'; VerifiedAt?: null | string; ExpiresAt?: null | string; RejectedAt?: null | string; ProviderReference?: null | string; RejectionReason?: null | string; [key: string]: unknown; };
@@ -4617,7 +4617,7 @@ declare const WorkshopAction: {
4617
4617
  type WorkshopAction = (typeof WorkshopAction)[keyof typeof WorkshopAction];
4618
4618
  type PlatformLoginResponse = { TitleUserID: string; TitleClientSessionTicket: string; TitleClientSessionTicketExpiration: string; PlatformUserID?: null | string; PlatformAuthToken?: null | string; PlatformAuthTokenExpiration?: null | string; PlayAccess?: null | PlayAccessStatus; RefreshToken?: null | string; RefreshTokenExpiration?: null | string; };
4619
4619
  type RefreshSessionResponse = { TitleUserID: string; TitleClientSessionTicket: string; TitleClientSessionTicketExpiration: string; RefreshToken: string; RefreshTokenExpiration?: null | string; PlayAccess?: null | PlayAccessStatus; };
4620
- type AuthOptionsResponse = { Google?: null | { Enabled?: null | boolean; WebClientID?: null | string; PlatformFallback?: null | boolean; AndroidClientID?: null | string; IosClientID?: null | string; DesktopClientID?: null | string; [key: string]: unknown; }; Apple?: null | { Enabled?: null | boolean; BundleID?: null | string; ServiceID?: null | string; [key: string]: unknown; }; PlayAccessMode?: null | 'Open' | 'AnyWithLinkedWallet' | 'WalletOnly'; WalletLoginNetworks?: null | Array<{ NetworkID?: null | string; Type?: null | string; [key: string]: unknown; }>; NativeSso?: null | { ReturnMode?: null | string; UrlScheme?: null | string; UserCodeSupported?: null | boolean; PollIntervalSeconds?: null | number; [key: string]: unknown; }; [key: string]: unknown; };
4620
+ type AuthOptionsResponse = { Google?: null | { Enabled?: null | boolean; WebClientID?: null | string; PlatformFallback?: null | boolean; AndroidClientID?: null | string; IosClientID?: null | string; DesktopClientID?: null | string; [key: string]: unknown; }; Apple?: null | { Enabled?: null | boolean; BundleID?: null | string; ServiceID?: null | string; [key: string]: unknown; }; PlayAccessMode?: null | 'Open' | 'AnyWithLinkedWallet' | 'WalletOnly'; WalletLoginNetworks?: null | Array<{ NetworkID?: null | string; Type?: null | string; [key: string]: unknown; }>; ShowWalletLogin?: null | boolean; NativeSso?: null | { ReturnMode?: null | string; UrlScheme?: null | string; UserCodeSupported?: null | boolean; PollIntervalSeconds?: null | number; [key: string]: unknown; }; [key: string]: unknown; };
4621
4621
  type WalletLinkResponse = { Linked?: null | boolean; Challenge?: null | string; ExpiresAt?: null | string; NetworkID?: null | string; Address?: null | string; PlayAccess?: null | PlayAccessStatus; [key: string]: unknown; };
4622
4622
  type WalletUnlinkResponse = { NetworkID?: null | string; Address?: null | string; CooldownUntil?: null | string; PlayAccess?: null | PlayAccessStatus; [key: string]: unknown; };
4623
4623
  type EmailRegistrationResponse = { CodeTtlMinutes?: null | number; ResendCooldownSeconds?: null | number; };
@@ -0,0 +1,2 @@
1
+ var s=class{getString(e){if(typeof localStorage>"u")return null;try{return localStorage.getItem(e)}catch{return null}}setString(e,r){if(!(typeof localStorage>"u"))try{localStorage.setItem(e,r);}catch{}}remove(e){if(!(typeof localStorage>"u"))try{localStorage.removeItem(e);}catch{}}},l=class{map=new Map;getString(e){return this.map.get(e)??null}setString(e,r){this.map.set(e,r);}remove(e){this.map.delete(e);}};function o(){return globalThis.Telegram?.WebApp??null}function y(){return crypto.randomUUID()}var R="idos_device_id",c=class{storage;constructor(e=new s){this.storage=e;}getPlatform(){return o()?.platform??"Web"}getFullURL(){return typeof location<"u"?location.href:""}getStartParameter(){let e=o()?.initDataUnsafe?.start_param;return typeof e=="string"?e:null}getReferrer(){if(typeof document>"u")return null;let e=document.referrer;return e&&e.length>0?e:null}getTelegramInitDataRaw(){let e=o()?.initData;return e&&e.length>0?e:null}getDeviceID(){let e=this.storage.getString(R);return e||(e=y(),this.storage.setString(R,e)),e}getDeviceModel(){return typeof navigator<"u"&&navigator.userAgent?navigator.userAgent:"Web"}shareLink(e){let r=o();if(r?.openTelegramLink){r.openTelegramLink(e);return}typeof window<"u"&&window.open(e,"_blank");}openInvoice(e){let r=o();if(r?.openInvoice){r.openInvoice(e);return}typeof window<"u"&&window.open(e,"_blank");}async showAd(e){let r=globalThis;typeof r.showAd=="function"&&await r.showAd(e);}async copyToClipboard(e){typeof navigator<"u"&&navigator.clipboard&&await navigator.clipboard.writeText(e);}};var E="idos_device_id",d=class{storage;constructor(e=new l){this.storage=e;}getPlatform(){return "Web"}getFullURL(){return ""}getStartParameter(){return null}getTelegramInitDataRaw(){return null}getDeviceID(){let e=this.storage.getString(E);return e||(e="noop-device",this.storage.setString(E,e)),e}getDeviceModel(){return "Noop"}shareLink(){}openInvoice(){}async showAd(){}async copyToClipboard(){}};var i=["https://idosgames.com","https://www.idosgames.com"];function v(t){return t==="localhost"||t==="127.0.0.1"||t==="[::1]"||t.endsWith(".localhost")}function p(t){if(i.includes(t))return true;if(typeof window>"u"||!v(window.location.hostname))return false;try{return v(new URL(t).hostname)}catch{return false}}var O="IDOS_PLATFORM_WALLET_ACK",D="PLATFORM_WALLET_UNAVAILABLE",M=5e3,x=18e4;function k(){let t=[...i],e=window.location.ancestorOrigins?.[0];return e&&!t.includes(e)&&p(e)&&t.push(e),t}function b(){return `wallet-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function g(t,e,r,U={}){let u={ok:false,error:D,data:{}};if(typeof window>"u"||window.self===window.top)return Promise.resolve(u);let S=window.parent;if(!S)return Promise.resolve(u);let I=b(),h=U.answerTimeoutMs??x;return new Promise(L=>{let A=false,f,m=a=>{A||(A=true,window.removeEventListener("message",_),clearTimeout(f),L(a));},_=a=>{if(!p(a.origin))return;let n=a.data;if(!(!n||n.requestId!==I)){if(n.type===O){clearTimeout(f),f=setTimeout(()=>m({ok:false,error:"TIMEOUT",data:{}}),h);return}n.type===e&&m({ok:n.ok===true,error:typeof n.error=="string"?n.error:void 0,data:n});}};f=setTimeout(()=>m(u),M),window.addEventListener("message",_);for(let a of k())try{S.postMessage({type:t,requestId:I,...r},a);}catch{}})}var w={request:"IDOS_PLATFORM_TOPUP_REQUEST",response:"IDOS_PLATFORM_TOPUP_RESPONSE"},F=15*6e4,N=/^[a-z0-9]{8}-preview\.idos\.games$/;function W(){if(typeof window>"u")return false;try{if(window.self===window.top||window.parent!==window.top)return !1}catch{return false}return !N.test(window.location.hostname.toLowerCase())}async function K(t){let e=await g(w.request,w.response,{titleID:t.titleID,userID:t.userID,currencyID:t.currencyID,amount:t.amount},{answerTimeoutMs:F});return e.ok?{ok:true}:{ok:false,error:e.error}}var P={request:"IDOS_PLATFORM_AUTH_REQUEST",response:"IDOS_PLATFORM_AUTH_RESPONSE"},V=30*6e4,G=/^[a-z0-9]{8}-preview\.idos\.games$/,T="idos:platformSignIn:declined:";function q(){if(typeof window>"u")return false;try{if(window.self===window.top||window.parent!==window.top)return !1}catch{return false}if(G.test(window.location.hostname.toLowerCase()))return false;let t=window.location.ancestorOrigins?.[0];if(t&&!i.includes(t))try{let e=new URL(t).hostname;if(e!=="localhost"&&e!=="127.0.0.1")return !1}catch{return false}return true}async function C(t){let e=await g(P.request,P.response,{titleID:t},{answerTimeoutMs:V}),r=e.data.code;return e.ok&&typeof r=="string"&&r.length>0?{code:r}:{error:e.error??"no_code"}}function B(t){try{window.localStorage.setItem(T+t,"1");}catch{}}function H(t){try{window.localStorage.removeItem(T+t);}catch{}}function $(t){try{return window.localStorage.getItem(T+t)==="1"}catch{return false}}
2
+ export{s as a,l as b,o as c,y as d,c as e,i as f,p as g,O as h,D as i,g as j,w as k,W as l,K as m,d as n,P as o,q as p,C as q,B as r,H as s,$ as t};