@azuro-org/toolkit 5.1.0-beta.2 → 5.1.0-beta.3
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.
- package/dist/global.d.ts +27 -0
- package/dist/index.js +62 -7
- package/dist/index.js.map +1 -1
- package/dist/utils/bonus/getBonuses.d.ts +16 -2
- package/package.json +1 -1
package/dist/global.d.ts
CHANGED
|
@@ -61,6 +61,20 @@ export declare enum BonusStatus {
|
|
|
61
61
|
Used = "Used",
|
|
62
62
|
Available = "Available"
|
|
63
63
|
}
|
|
64
|
+
export declare enum FreebetType {
|
|
65
|
+
OnlyWin = "OnlyWin",
|
|
66
|
+
AllWin = "AllWin"
|
|
67
|
+
}
|
|
68
|
+
export declare enum BetRestrictionType {
|
|
69
|
+
All = "All",
|
|
70
|
+
Ordinar = "Ordinar",
|
|
71
|
+
Combo = "Combo"
|
|
72
|
+
}
|
|
73
|
+
export declare enum EventRestrictionState {
|
|
74
|
+
All = "All",
|
|
75
|
+
Live = "Live",
|
|
76
|
+
Prematch = "Prematch"
|
|
77
|
+
}
|
|
64
78
|
type BonusBase = {
|
|
65
79
|
id: string;
|
|
66
80
|
type: BonusType;
|
|
@@ -78,6 +92,19 @@ export type Freebet = {
|
|
|
78
92
|
isFeeSponsored: boolean;
|
|
79
93
|
isSponsoredBetReturnable: boolean;
|
|
80
94
|
};
|
|
95
|
+
settings: {
|
|
96
|
+
type: FreebetType;
|
|
97
|
+
feeSponsored: boolean;
|
|
98
|
+
betRestriction: {
|
|
99
|
+
type: BetRestrictionType | undefined;
|
|
100
|
+
minOdds: string;
|
|
101
|
+
maxOdds: string | undefined;
|
|
102
|
+
};
|
|
103
|
+
eventRestriction: {
|
|
104
|
+
state: EventRestrictionState | undefined;
|
|
105
|
+
};
|
|
106
|
+
periodOfValidityMs: number;
|
|
107
|
+
};
|
|
81
108
|
} & BonusBase;
|
|
82
109
|
export type Bonus = Freebet;
|
|
83
110
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -6187,7 +6187,24 @@ var BonusStatus;
|
|
|
6187
6187
|
(function (BonusStatus) {
|
|
6188
6188
|
BonusStatus["Used"] = "Used";
|
|
6189
6189
|
BonusStatus["Available"] = "Available";
|
|
6190
|
-
})(BonusStatus || (BonusStatus = {}));
|
|
6190
|
+
})(BonusStatus || (BonusStatus = {}));
|
|
6191
|
+
var FreebetType;
|
|
6192
|
+
(function (FreebetType) {
|
|
6193
|
+
FreebetType["OnlyWin"] = "OnlyWin";
|
|
6194
|
+
FreebetType["AllWin"] = "AllWin";
|
|
6195
|
+
})(FreebetType || (FreebetType = {}));
|
|
6196
|
+
var BetRestrictionType;
|
|
6197
|
+
(function (BetRestrictionType) {
|
|
6198
|
+
BetRestrictionType["All"] = "All";
|
|
6199
|
+
BetRestrictionType["Ordinar"] = "Ordinar";
|
|
6200
|
+
BetRestrictionType["Combo"] = "Combo";
|
|
6201
|
+
})(BetRestrictionType || (BetRestrictionType = {}));
|
|
6202
|
+
var EventRestrictionState;
|
|
6203
|
+
(function (EventRestrictionState) {
|
|
6204
|
+
EventRestrictionState["All"] = "All";
|
|
6205
|
+
EventRestrictionState["Live"] = "Live";
|
|
6206
|
+
EventRestrictionState["Prematch"] = "Prematch";
|
|
6207
|
+
})(EventRestrictionState || (EventRestrictionState = {}));const BettorFragmentDoc = gql `
|
|
6191
6208
|
fragment Bettor on Bettor {
|
|
6192
6209
|
id
|
|
6193
6210
|
rawToPayout
|
|
@@ -8306,7 +8323,8 @@ const createCashout = async (props) => {
|
|
|
8306
8323
|
}
|
|
8307
8324
|
const data = await response.json();
|
|
8308
8325
|
return data;
|
|
8309
|
-
};const getBonuses = async (
|
|
8326
|
+
};const getBonuses = async (props) => {
|
|
8327
|
+
const { chainId, account, affiliate, bonusStatus = BonusStatus.Available } = props;
|
|
8310
8328
|
const { api } = chainsData[chainId];
|
|
8311
8329
|
const response = await fetch(`${api}/bonus/get-by-addresses`, {
|
|
8312
8330
|
method: 'POST',
|
|
@@ -8317,6 +8335,7 @@ const createCashout = async (props) => {
|
|
|
8317
8335
|
body: JSON.stringify({
|
|
8318
8336
|
bettorAddress: account,
|
|
8319
8337
|
poolAddress: affiliate,
|
|
8338
|
+
status: bonusStatus,
|
|
8320
8339
|
}),
|
|
8321
8340
|
});
|
|
8322
8341
|
if (response.status === 404) {
|
|
@@ -8331,11 +8350,29 @@ const createCashout = async (props) => {
|
|
|
8331
8350
|
const { chain, betToken } = chainsDataByEnv[environment];
|
|
8332
8351
|
// TODO: need to add environement to request params
|
|
8333
8352
|
if (chain.id === chainId) {
|
|
8353
|
+
const { id, freebetParam: { isBetSponsored, isFeeSponsored, isSponsoredBetReturnable, settings, }, } = bonus;
|
|
8334
8354
|
acc.push({
|
|
8335
|
-
id
|
|
8355
|
+
id,
|
|
8336
8356
|
amount: formatUnits(BigInt(bonus.amount), betToken.decimals),
|
|
8337
8357
|
type: bonus.bonusType,
|
|
8338
|
-
params:
|
|
8358
|
+
params: {
|
|
8359
|
+
isBetSponsored,
|
|
8360
|
+
isFeeSponsored,
|
|
8361
|
+
isSponsoredBetReturnable,
|
|
8362
|
+
},
|
|
8363
|
+
settings: {
|
|
8364
|
+
type: settings.bonusType,
|
|
8365
|
+
feeSponsored: settings.feeSponsored,
|
|
8366
|
+
betRestriction: {
|
|
8367
|
+
type: settings.betRestriction.betType === 'All' ? undefined : settings.betRestriction.betType,
|
|
8368
|
+
minOdds: settings.betRestriction.minOdds,
|
|
8369
|
+
maxOdds: settings.betRestriction?.maxOdds,
|
|
8370
|
+
},
|
|
8371
|
+
eventRestriction: {
|
|
8372
|
+
state: settings.eventRestriction.eventStatus === 'All' ? undefined : settings.eventRestriction.eventStatus,
|
|
8373
|
+
},
|
|
8374
|
+
periodOfValidityMs: settings.periodOfValidityMs,
|
|
8375
|
+
},
|
|
8339
8376
|
status: bonus.status,
|
|
8340
8377
|
chainId: chain.id,
|
|
8341
8378
|
expiresAt: +new Date(bonus.expiresAt),
|
|
@@ -8372,11 +8409,29 @@ const createCashout = async (props) => {
|
|
|
8372
8409
|
const { bonuses } = await response.json();
|
|
8373
8410
|
return bonuses.map(bonus => {
|
|
8374
8411
|
const environment = `${bonus.network}${bonus.currency}`;
|
|
8412
|
+
const { id, freebetParam: { isBetSponsored, isFeeSponsored, isSponsoredBetReturnable, settings, }, } = bonus;
|
|
8375
8413
|
return {
|
|
8376
|
-
id
|
|
8414
|
+
id,
|
|
8377
8415
|
amount: formatUnits(BigInt(bonus.amount), betToken.decimals),
|
|
8378
8416
|
type: BonusType.FreeBet,
|
|
8379
|
-
params:
|
|
8417
|
+
params: {
|
|
8418
|
+
isBetSponsored,
|
|
8419
|
+
isFeeSponsored,
|
|
8420
|
+
isSponsoredBetReturnable,
|
|
8421
|
+
},
|
|
8422
|
+
settings: {
|
|
8423
|
+
type: settings.bonusType,
|
|
8424
|
+
feeSponsored: settings.feeSponsored,
|
|
8425
|
+
betRestriction: {
|
|
8426
|
+
type: settings.betRestriction.betType === 'All' ? undefined : settings.betRestriction.betType,
|
|
8427
|
+
minOdds: settings.betRestriction.minOdds,
|
|
8428
|
+
maxOdds: settings.betRestriction?.maxOdds,
|
|
8429
|
+
},
|
|
8430
|
+
eventRestriction: {
|
|
8431
|
+
state: settings.eventRestriction.eventStatus === 'All' ? undefined : settings.eventRestriction.eventStatus,
|
|
8432
|
+
},
|
|
8433
|
+
periodOfValidityMs: settings.periodOfValidityMs,
|
|
8434
|
+
},
|
|
8380
8435
|
status: bonus.status,
|
|
8381
8436
|
chainId: chainsDataByEnv[environment].chain.id,
|
|
8382
8437
|
expiresAt: +new Date(bonus.expiresAt),
|
|
@@ -8384,4 +8439,4 @@ const createCashout = async (props) => {
|
|
|
8384
8439
|
createdAt: +new Date(bonus.createdAt),
|
|
8385
8440
|
};
|
|
8386
8441
|
});
|
|
8387
|
-
};export{Aggregation_Interval,BET_DATA_TYPES,ConditionStatus as BetConditionStatus,BetFragmentDoc,BetResult,BetState,BetStatus,V3_Bet_OrderBy as Bet_OrderBy,BetsDocument,BettorFragmentDoc,BettorsDocument,BonusStatus,BonusType,CASHOUT_DATA_TYPES,CASHOUT_TYPED_DATA_DOMAIN_NAME,CASHOUT_TYPED_DATA_DOMAIN_VERSION,CLIENT_DATA_TYPES,COMBO_BET_DATA_TYPES,CashoutState,ConditionDocument,ConditionFragmentDoc,ConditionState,Condition_OrderBy,ConditionsBatchDocument,ConditionsDocument,Country_OrderBy,Environment,EventName,Event_OrderBy,GameBetsDocument,GameDocument,GameInfoFragmentDoc,GameState,Game_OrderBy,GamesDocument,BetStatus$1 as GraphBetStatus,League_OrderBy,LegacyBetsDocument,GameStatus as LegacyGameStatus,LegacyLiveBetFragmentDoc,LegacyLiveGamesDocument,LegacyPrematchBetFragmentDoc,Bet_OrderBy as Legacy_Bet_OrderBy,NavigationDocument,ODDS_DECIMALS,OrderDirection,OutcomeResult,Outcome_OrderBy,Participant_OrderBy,V3_SelectionConditionKind as SelectionKind,SelectionResult,SportHub_OrderBy,Sport_OrderBy,SportsDocument,SportsNavigationDocument,TYPED_DATA_DOMAIN_NAME,TYPED_DATA_DOMAIN_VERSION,VirtualCondition_OrderBy,VirtualGame_OrderBy,WaveLevelName,_SubgraphErrorPolicy_,activateWave,azuroBetAbi,baseData,baseSepoliaData,calcMindOdds,cashoutAbi,chainsData,chainsDataByEnv,chilizData,coreAbi,createBet,createCashout,createComboBet,environments,getApiEndpoint,getAvailableFreebets,getBet,getBetFee,getBetStatus,getBetTypedData,getBetsGraphqlEndpoint,getBonuses,getCalculatedCashout,getCashout,getCashoutTypedData,getComboBetTypedData,getFeedGraphqlEndpoint,getIsPendingResolution,getMaxBet,getPrecalculatedCashouts,getProviderFromId,getSocketEndpoint,getWaveLeaderBoard,getWaveLevels,getWavePeriods,getWaveStats,gnosisData,gnosisDevData,groupConditionsByMarket,lpAbi,paymasterAbi,polygonAmoyData,polygonData,relayerAbi,setupContracts,spicyData,vaultAbi};//# sourceMappingURL=index.js.map
|
|
8442
|
+
};export{Aggregation_Interval,BET_DATA_TYPES,ConditionStatus as BetConditionStatus,BetFragmentDoc,BetRestrictionType,BetResult,BetState,BetStatus,V3_Bet_OrderBy as Bet_OrderBy,BetsDocument,BettorFragmentDoc,BettorsDocument,BonusStatus,BonusType,CASHOUT_DATA_TYPES,CASHOUT_TYPED_DATA_DOMAIN_NAME,CASHOUT_TYPED_DATA_DOMAIN_VERSION,CLIENT_DATA_TYPES,COMBO_BET_DATA_TYPES,CashoutState,ConditionDocument,ConditionFragmentDoc,ConditionState,Condition_OrderBy,ConditionsBatchDocument,ConditionsDocument,Country_OrderBy,Environment,EventName,EventRestrictionState,Event_OrderBy,FreebetType,GameBetsDocument,GameDocument,GameInfoFragmentDoc,GameState,Game_OrderBy,GamesDocument,BetStatus$1 as GraphBetStatus,League_OrderBy,LegacyBetsDocument,GameStatus as LegacyGameStatus,LegacyLiveBetFragmentDoc,LegacyLiveGamesDocument,LegacyPrematchBetFragmentDoc,Bet_OrderBy as Legacy_Bet_OrderBy,NavigationDocument,ODDS_DECIMALS,OrderDirection,OutcomeResult,Outcome_OrderBy,Participant_OrderBy,V3_SelectionConditionKind as SelectionKind,SelectionResult,SportHub_OrderBy,Sport_OrderBy,SportsDocument,SportsNavigationDocument,TYPED_DATA_DOMAIN_NAME,TYPED_DATA_DOMAIN_VERSION,VirtualCondition_OrderBy,VirtualGame_OrderBy,WaveLevelName,_SubgraphErrorPolicy_,activateWave,azuroBetAbi,baseData,baseSepoliaData,calcMindOdds,cashoutAbi,chainsData,chainsDataByEnv,chilizData,coreAbi,createBet,createCashout,createComboBet,environments,getApiEndpoint,getAvailableFreebets,getBet,getBetFee,getBetStatus,getBetTypedData,getBetsGraphqlEndpoint,getBonuses,getCalculatedCashout,getCashout,getCashoutTypedData,getComboBetTypedData,getFeedGraphqlEndpoint,getIsPendingResolution,getMaxBet,getPrecalculatedCashouts,getProviderFromId,getSocketEndpoint,getWaveLeaderBoard,getWaveLevels,getWavePeriods,getWaveStats,gnosisData,gnosisDevData,groupConditionsByMarket,lpAbi,paymasterAbi,polygonAmoyData,polygonData,relayerAbi,setupContracts,spicyData,vaultAbi};//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Address } from 'viem';
|
|
2
2
|
import { type ChainId } from '../../config';
|
|
3
|
-
import { type BonusType, type Bonus, type
|
|
3
|
+
import { BonusStatus, type BonusType, type Bonus, type FreebetType, type BetRestrictionType, type EventRestrictionState } from '../../global';
|
|
4
4
|
export type RawBonus = {
|
|
5
5
|
id: string;
|
|
6
6
|
bonusType: BonusType;
|
|
@@ -8,6 +8,19 @@ export type RawBonus = {
|
|
|
8
8
|
isBetSponsored: true;
|
|
9
9
|
isFeeSponsored: true;
|
|
10
10
|
isSponsoredBetReturnable: true;
|
|
11
|
+
settings: {
|
|
12
|
+
bonusType: FreebetType;
|
|
13
|
+
feeSponsored: boolean;
|
|
14
|
+
betRestriction: {
|
|
15
|
+
betType: BetRestrictionType | 'All';
|
|
16
|
+
minOdds: string;
|
|
17
|
+
maxOdds?: string;
|
|
18
|
+
};
|
|
19
|
+
eventRestriction: {
|
|
20
|
+
eventStatus: EventRestrictionState | 'All';
|
|
21
|
+
};
|
|
22
|
+
periodOfValidityMs: 86400000;
|
|
23
|
+
};
|
|
11
24
|
};
|
|
12
25
|
address: string;
|
|
13
26
|
amount: string;
|
|
@@ -23,6 +36,7 @@ type Props = {
|
|
|
23
36
|
chainId: ChainId;
|
|
24
37
|
account: Address;
|
|
25
38
|
affiliate: Address;
|
|
39
|
+
bonusStatus?: BonusStatus;
|
|
26
40
|
};
|
|
27
|
-
export declare const getBonuses: (
|
|
41
|
+
export declare const getBonuses: (props: Props) => Promise<GetBonuses>;
|
|
28
42
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azuro-org/toolkit",
|
|
3
|
-
"version": "5.1.0-beta.
|
|
3
|
+
"version": "5.1.0-beta.3",
|
|
4
4
|
"description": "This framework-agnostic package provides essential utilities for building applications on the Azuro Protocol.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|