@unifold/ui-web 0.1.50 → 0.1.51
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/index.js +8 -4
- package/dist/index.mjs +8 -4
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -48906,11 +48906,13 @@ function useUserIp2() {
|
|
|
48906
48906
|
queryKey: ["unifold", "userIpInfo"],
|
|
48907
48907
|
queryFn: async () => {
|
|
48908
48908
|
const data = await getIpAddress();
|
|
48909
|
+
const subdivision = (data.subdivision_code || data.state || "").toLowerCase() || null;
|
|
48909
48910
|
return {
|
|
48910
48911
|
alpha2: data.alpha2.toLowerCase(),
|
|
48911
48912
|
alpha3: data.alpha3?.toLowerCase(),
|
|
48912
48913
|
country: data.country,
|
|
48913
|
-
state:
|
|
48914
|
+
state: subdivision,
|
|
48915
|
+
subdivisionCode: subdivision,
|
|
48914
48916
|
ipAddress: data.ip_address
|
|
48915
48917
|
};
|
|
48916
48918
|
},
|
|
@@ -50216,7 +50218,7 @@ function BuyWithCard({
|
|
|
50216
50218
|
const response = await getDefaultOnrampToken(
|
|
50217
50219
|
{
|
|
50218
50220
|
country_code: userIpInfo?.alpha2?.toUpperCase() || "US",
|
|
50219
|
-
subdivision_code: userIpInfo?.
|
|
50221
|
+
subdivision_code: userIpInfo?.subdivisionCode || void 0,
|
|
50220
50222
|
token_address: destinationTokenAddress,
|
|
50221
50223
|
chain_id: destinationChainId,
|
|
50222
50224
|
chain_type: destinationChainType
|
|
@@ -50299,7 +50301,7 @@ function BuyWithCard({
|
|
|
50299
50301
|
source_currency: currency.toLowerCase(),
|
|
50300
50302
|
destination_currency: defaultToken.destination_currency,
|
|
50301
50303
|
destination_network: defaultToken.destination_network,
|
|
50302
|
-
subdivision_code: userIpInfo?.
|
|
50304
|
+
subdivision_code: userIpInfo?.subdivisionCode || void 0
|
|
50303
50305
|
};
|
|
50304
50306
|
const response = await getOnrampQuotes(request, publishableKey);
|
|
50305
50307
|
setQuotes(response.data);
|
|
@@ -50406,7 +50408,7 @@ function BuyWithCard({
|
|
|
50406
50408
|
destination_currency: selectedProvider.destination_currency,
|
|
50407
50409
|
destination_network: selectedProvider.destination_network,
|
|
50408
50410
|
wallet_address: wallet.address,
|
|
50409
|
-
subdivision_code: userIpInfo?.
|
|
50411
|
+
subdivision_code: userIpInfo?.subdivisionCode || void 0,
|
|
50410
50412
|
external_id: externalId
|
|
50411
50413
|
};
|
|
50412
50414
|
const sessionStartUrl = getOnrampSessionStartUrl(
|
|
@@ -54436,10 +54438,12 @@ function useAllowedCountry(publishableKey) {
|
|
|
54436
54438
|
});
|
|
54437
54439
|
isAllowed = !isCountryBlocked && !isSubdivisionBlocked;
|
|
54438
54440
|
}
|
|
54441
|
+
const subdivisionCode = (ipData?.subdivision_code || ipData?.state || "").toLowerCase() || null;
|
|
54439
54442
|
return {
|
|
54440
54443
|
isAllowed,
|
|
54441
54444
|
alpha2: ipData?.alpha2?.toLowerCase() ?? null,
|
|
54442
54445
|
country: ipData?.country ?? null,
|
|
54446
|
+
subdivisionCode,
|
|
54443
54447
|
isLoading,
|
|
54444
54448
|
error
|
|
54445
54449
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -48893,11 +48893,13 @@ function useUserIp2() {
|
|
|
48893
48893
|
queryKey: ["unifold", "userIpInfo"],
|
|
48894
48894
|
queryFn: async () => {
|
|
48895
48895
|
const data = await getIpAddress();
|
|
48896
|
+
const subdivision = (data.subdivision_code || data.state || "").toLowerCase() || null;
|
|
48896
48897
|
return {
|
|
48897
48898
|
alpha2: data.alpha2.toLowerCase(),
|
|
48898
48899
|
alpha3: data.alpha3?.toLowerCase(),
|
|
48899
48900
|
country: data.country,
|
|
48900
|
-
state:
|
|
48901
|
+
state: subdivision,
|
|
48902
|
+
subdivisionCode: subdivision,
|
|
48901
48903
|
ipAddress: data.ip_address
|
|
48902
48904
|
};
|
|
48903
48905
|
},
|
|
@@ -50203,7 +50205,7 @@ function BuyWithCard({
|
|
|
50203
50205
|
const response = await getDefaultOnrampToken(
|
|
50204
50206
|
{
|
|
50205
50207
|
country_code: userIpInfo?.alpha2?.toUpperCase() || "US",
|
|
50206
|
-
subdivision_code: userIpInfo?.
|
|
50208
|
+
subdivision_code: userIpInfo?.subdivisionCode || void 0,
|
|
50207
50209
|
token_address: destinationTokenAddress,
|
|
50208
50210
|
chain_id: destinationChainId,
|
|
50209
50211
|
chain_type: destinationChainType
|
|
@@ -50286,7 +50288,7 @@ function BuyWithCard({
|
|
|
50286
50288
|
source_currency: currency.toLowerCase(),
|
|
50287
50289
|
destination_currency: defaultToken.destination_currency,
|
|
50288
50290
|
destination_network: defaultToken.destination_network,
|
|
50289
|
-
subdivision_code: userIpInfo?.
|
|
50291
|
+
subdivision_code: userIpInfo?.subdivisionCode || void 0
|
|
50290
50292
|
};
|
|
50291
50293
|
const response = await getOnrampQuotes(request, publishableKey);
|
|
50292
50294
|
setQuotes(response.data);
|
|
@@ -50393,7 +50395,7 @@ function BuyWithCard({
|
|
|
50393
50395
|
destination_currency: selectedProvider.destination_currency,
|
|
50394
50396
|
destination_network: selectedProvider.destination_network,
|
|
50395
50397
|
wallet_address: wallet.address,
|
|
50396
|
-
subdivision_code: userIpInfo?.
|
|
50398
|
+
subdivision_code: userIpInfo?.subdivisionCode || void 0,
|
|
50397
50399
|
external_id: externalId
|
|
50398
50400
|
};
|
|
50399
50401
|
const sessionStartUrl = getOnrampSessionStartUrl(
|
|
@@ -54423,10 +54425,12 @@ function useAllowedCountry(publishableKey) {
|
|
|
54423
54425
|
});
|
|
54424
54426
|
isAllowed = !isCountryBlocked && !isSubdivisionBlocked;
|
|
54425
54427
|
}
|
|
54428
|
+
const subdivisionCode = (ipData?.subdivision_code || ipData?.state || "").toLowerCase() || null;
|
|
54426
54429
|
return {
|
|
54427
54430
|
isAllowed,
|
|
54428
54431
|
alpha2: ipData?.alpha2?.toLowerCase() ?? null,
|
|
54429
54432
|
country: ipData?.country ?? null,
|
|
54433
|
+
subdivisionCode,
|
|
54430
54434
|
isLoading,
|
|
54431
54435
|
error
|
|
54432
54436
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unifold/ui-web",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.51",
|
|
4
4
|
"description": "Unifold UI Web - Framework-agnostic deposit widget",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"@types/react-dom": "^19.0.0",
|
|
31
31
|
"tsup": "^8.0.0",
|
|
32
32
|
"typescript": "^5.0.0",
|
|
33
|
-
"@unifold/connect-react": "0.1.
|
|
34
|
-
"@unifold/
|
|
35
|
-
"@unifold/react
|
|
36
|
-
"@unifold/
|
|
33
|
+
"@unifold/connect-react": "0.1.51",
|
|
34
|
+
"@unifold/core": "0.1.51",
|
|
35
|
+
"@unifold/ui-react": "0.1.51",
|
|
36
|
+
"@unifold/react-provider": "0.1.51"
|
|
37
37
|
},
|
|
38
38
|
"keywords": [
|
|
39
39
|
"unifold",
|