@jolibox/implement 1.2.5-beta.3 → 1.2.6

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.
@@ -1,9 +1,9 @@
1
1
  Invoking: npm run clean && npm run build:esm && tsc
2
2
 
3
- > @jolibox/implement@1.2.5-beta.3 clean
3
+ > @jolibox/implement@1.2.6 clean
4
4
  > rimraf ./dist
5
5
 
6
6
 
7
- > @jolibox/implement@1.2.5-beta.3 build:esm
7
+ > @jolibox/implement@1.2.6 build:esm
8
8
  > BUILD_VERSION=$(node -p "require('./package.json').version") node esbuild.config.js --format=esm
9
9
 
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@jolibox/implement",
3
3
  "description": "This project is Jolibox JS-SDk implement for Native && H5",
4
- "version": "1.2.5-beta.3",
4
+ "version": "1.2.6",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "@jolibox/common": "1.2.5-beta.3",
10
- "@jolibox/types": "1.2.5-beta.3",
11
- "@jolibox/native-bridge": "1.2.5-beta.3",
12
- "@jolibox/ads": "1.2.5-beta.3",
9
+ "@jolibox/common": "1.2.6",
10
+ "@jolibox/types": "1.2.6",
11
+ "@jolibox/native-bridge": "1.2.6",
12
+ "@jolibox/ads": "1.2.6",
13
13
  "localforage": "1.10.0",
14
- "@jolibox/ui": "1.2.5-beta.3",
14
+ "@jolibox/ui": "1.0.0",
15
15
  "web-vitals": "4.2.4"
16
16
  },
17
17
  "devDependencies": {
@@ -20,7 +20,7 @@
20
20
  "@types/node": "18.0.0",
21
21
  "rimraf": "6.0.1",
22
22
  "esbuild": "0.24.2",
23
- "@jolibox/eslint-config": "1.0.1-beta.11"
23
+ "@jolibox/eslint-config": "1.0.0"
24
24
  },
25
25
  "scripts": {
26
26
  "clean": "rimraf ./dist",
@@ -10,6 +10,8 @@ import {
10
10
  InvokePaymentEventName
11
11
  } from '@/common/rewards/reward-emitter';
12
12
  import { CURRENCY_HANDLERS, CurrencyType } from './currency-handlers';
13
+ import { refreshGemBalanceCache } from '../joligem/cached-fetch-gem-balance';
14
+ import { refreshBalanceCache } from '../jolicoin/cached-fetch-balance';
13
15
 
14
16
  export const registerUsePaymentCommand = <T extends IJoliCoin | IGem>(
15
17
  prefix: 'JOLI_COIN' | 'ADS-JOLI_COIN' | 'JOLI_GEM' | 'ADS-JOLI_GEM',
@@ -48,6 +50,12 @@ export const registerUsePaymentCommand = <T extends IJoliCoin | IGem>(
48
50
  currency: currency as T extends IJoliCoin ? 'JOLI_COIN' : 'JOLI_GEM'
49
51
  });
50
52
 
53
+ if (currency === 'JOLI_GEM') {
54
+ refreshGemBalanceCache(httpClient);
55
+ } else {
56
+ refreshBalanceCache(httpClient);
57
+ }
58
+
51
59
  return {
52
60
  result: paymentResult === 'SUCCESS' ? 'SUCCESS' : 'FAILED'
53
61
  };
package/src/h5/api/ads.ts CHANGED
@@ -130,6 +130,14 @@ const adsContext: IAdsContext<'GAME'> = {
130
130
  }
131
131
  };
132
132
 
133
+ const handleUnlockSuccess = (params: { quantity: number; balance: number }) => {
134
+ notifyCustomEvent('JOLIBOX_CUSTOM_REWARDS_EVENT', {
135
+ JOLI_COIN: params
136
+ });
137
+ track('jolicoin_unlock_success', {
138
+ quantity: params.quantity
139
+ });
140
+ };
133
141
 
134
142
  const handleUnlockWithSubscriptionSuccess = () => {
135
143
  track('subscription_unlock_success', {});
@@ -142,11 +150,14 @@ rewardsHelper.registerRewardHandler('ADS', createAdsRewardHandler(adsHandler.get
142
150
  rewardsHelper.registerRewardHandler(
143
151
  'JOLI_COIN',
144
152
  createJolicoinRewardHandler(httpClient, {
145
- onUnlockSuccess: (params: { quantity: number; balance: number }) => {
146
- notifyCustomEvent('JOLIBOX_CUSTOM_REWARDS_EVENT', {
147
- JOLI_COIN: params
148
- });
149
- }
153
+ onUnlockSuccess: handleUnlockSuccess.bind(this)
154
+ }) as unknown as (params?: unknown) => Promise<boolean>
155
+ );
156
+
157
+ rewardsHelper.registerRewardHandler(
158
+ 'JOLI_COIN_ONLY',
159
+ createJolicoinOnlyRewardHandler(httpClient, {
160
+ onUnlockSuccess: handleUnlockSuccess.bind(this)
150
161
  }) as unknown as (params?: unknown) => Promise<boolean>
151
162
  );
152
163
 
package/CHANGELOG.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "name": "@jolibox/implement",
3
- "entries": [
4
- {
5
- "version": "1.1.43",
6
- "tag": "@jolibox/implement_v1.1.43",
7
- "date": "Mon, 21 Jul 2025 10:06:33 GMT",
8
- "comments": {}
9
- }
10
- ]
11
- }
package/CHANGELOG.md DELETED
@@ -1,9 +0,0 @@
1
- # Change Log - @jolibox/implement
2
-
3
- This log was last generated on Mon, 21 Jul 2025 10:06:33 GMT and should not be manually modified.
4
-
5
- ## 1.1.43
6
- Mon, 21 Jul 2025 10:06:33 GMT
7
-
8
- _Initial release_
9
-