@ton-pay/ui-react 0.3.0 → 0.3.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.
- package/dist/index.js +2 -5
- package/dist/index.mjs +2 -5
- package/package.json +8 -16
package/dist/index.js
CHANGED
|
@@ -1736,15 +1736,13 @@ var TONCENTER_MAINNET = "https://toncenter.com";
|
|
|
1736
1736
|
var TONCENTER_TESTNET = "https://testnet.toncenter.com";
|
|
1737
1737
|
var GAS_FEE_TON_TRANSFER = 0.05;
|
|
1738
1738
|
var GAS_FEE_JETTON_TRANSFER = 0.1;
|
|
1739
|
-
var TONCENTER_API_KEY = "ad90d423e5e6e1392753f0070f99aae79f1ab9c7da80bf11e3057731b2663fc2";
|
|
1740
1739
|
function getToncenterEndpoint(network) {
|
|
1741
1740
|
return network === "testnet" ? TONCENTER_TESTNET : TONCENTER_MAINNET;
|
|
1742
1741
|
}
|
|
1743
1742
|
async function fetchTonBalance(address, network) {
|
|
1744
1743
|
const endpoint = getToncenterEndpoint(network);
|
|
1745
1744
|
const response = await fetch(
|
|
1746
|
-
`${endpoint}/api/v3/account?address=${encodeURIComponent(address)}
|
|
1747
|
-
{ headers: { "X-API-Key": TONCENTER_API_KEY } }
|
|
1745
|
+
`${endpoint}/api/v3/account?address=${encodeURIComponent(address)}`
|
|
1748
1746
|
);
|
|
1749
1747
|
if (!response.ok) {
|
|
1750
1748
|
throw new Error(`Failed to fetch TON balance: ${response.status}`);
|
|
@@ -1758,8 +1756,7 @@ async function fetchJettonBalance(ownerAddress, jettonMasterAddress, network) {
|
|
|
1758
1756
|
const response = await fetch(
|
|
1759
1757
|
`${endpoint}/api/v3/jetton/wallets?owner_address=${encodeURIComponent(
|
|
1760
1758
|
ownerAddress
|
|
1761
|
-
)}&jetton_address=${encodeURIComponent(jettonMasterAddress)}&limit=1
|
|
1762
|
-
{ headers: { "X-API-Key": TONCENTER_API_KEY } }
|
|
1759
|
+
)}&jetton_address=${encodeURIComponent(jettonMasterAddress)}&limit=1`
|
|
1763
1760
|
);
|
|
1764
1761
|
if (!response.ok) {
|
|
1765
1762
|
throw new Error(`Failed to fetch jetton balance: ${response.status}`);
|
package/dist/index.mjs
CHANGED
|
@@ -1736,15 +1736,13 @@ var TONCENTER_MAINNET = "https://toncenter.com";
|
|
|
1736
1736
|
var TONCENTER_TESTNET = "https://testnet.toncenter.com";
|
|
1737
1737
|
var GAS_FEE_TON_TRANSFER = 0.05;
|
|
1738
1738
|
var GAS_FEE_JETTON_TRANSFER = 0.1;
|
|
1739
|
-
var TONCENTER_API_KEY = "ad90d423e5e6e1392753f0070f99aae79f1ab9c7da80bf11e3057731b2663fc2";
|
|
1740
1739
|
function getToncenterEndpoint(network) {
|
|
1741
1740
|
return network === "testnet" ? TONCENTER_TESTNET : TONCENTER_MAINNET;
|
|
1742
1741
|
}
|
|
1743
1742
|
async function fetchTonBalance(address, network) {
|
|
1744
1743
|
const endpoint = getToncenterEndpoint(network);
|
|
1745
1744
|
const response = await fetch(
|
|
1746
|
-
`${endpoint}/api/v3/account?address=${encodeURIComponent(address)}
|
|
1747
|
-
{ headers: { "X-API-Key": TONCENTER_API_KEY } }
|
|
1745
|
+
`${endpoint}/api/v3/account?address=${encodeURIComponent(address)}`
|
|
1748
1746
|
);
|
|
1749
1747
|
if (!response.ok) {
|
|
1750
1748
|
throw new Error(`Failed to fetch TON balance: ${response.status}`);
|
|
@@ -1758,8 +1756,7 @@ async function fetchJettonBalance(ownerAddress, jettonMasterAddress, network) {
|
|
|
1758
1756
|
const response = await fetch(
|
|
1759
1757
|
`${endpoint}/api/v3/jetton/wallets?owner_address=${encodeURIComponent(
|
|
1760
1758
|
ownerAddress
|
|
1761
|
-
)}&jetton_address=${encodeURIComponent(jettonMasterAddress)}&limit=1
|
|
1762
|
-
{ headers: { "X-API-Key": TONCENTER_API_KEY } }
|
|
1759
|
+
)}&jetton_address=${encodeURIComponent(jettonMasterAddress)}&limit=1`
|
|
1763
1760
|
);
|
|
1764
1761
|
if (!response.ok) {
|
|
1765
1762
|
throw new Error(`Failed to fetch jetton balance: ${response.status}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ton-pay/ui-react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "React components and hooks for TON Pay SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -61,27 +61,19 @@
|
|
|
61
61
|
"@telegram-apps/sdk"
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@telegram-apps/sdk": "^3.11.8",
|
|
66
|
+
"@ton-pay/api": "^0.3.0",
|
|
67
|
+
"@tonconnect/sdk": "^3.3.1",
|
|
68
|
+
"qrcode.react": "^3.1.0"
|
|
69
|
+
},
|
|
64
70
|
"peerDependencies": {
|
|
65
71
|
"react": ">=18.0.0",
|
|
66
|
-
"@tonconnect/ui-react": "^2.2.0"
|
|
67
|
-
"@ton-pay/api": ">=0.1.0",
|
|
68
|
-
"qrcode.react": "^3.1.0",
|
|
69
|
-
"@telegram-apps/sdk": ""
|
|
70
|
-
},
|
|
71
|
-
"peerDependenciesMeta": {
|
|
72
|
-
"qrcode.react": {
|
|
73
|
-
"optional": true
|
|
74
|
-
},
|
|
75
|
-
"@telegram-apps/sdk": {
|
|
76
|
-
"optional": true
|
|
77
|
-
}
|
|
72
|
+
"@tonconnect/ui-react": "^2.2.0"
|
|
78
73
|
},
|
|
79
74
|
"devDependencies": {
|
|
80
|
-
"@telegram-apps/sdk": "^3.11.8",
|
|
81
|
-
"@tonconnect/sdk": "^3.3.1",
|
|
82
75
|
"@types/react": "^18.0.0",
|
|
83
76
|
"@types/react-dom": "^18.0.0",
|
|
84
|
-
"qrcode.react": "^3.1.0",
|
|
85
77
|
"react-dom": "18.3.1"
|
|
86
78
|
},
|
|
87
79
|
"keywords": [
|