coinley-test 0.0.49 → 0.0.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.esm.js
CHANGED
|
@@ -1835,7 +1835,6 @@ const SimpleCoinleyPayment = ({
|
|
|
1835
1835
|
] }) });
|
|
1836
1836
|
};
|
|
1837
1837
|
const logo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABxCAYAAAAj+QZ8AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAzrSURBVHgB7V3dcRs5Em4MtXWPq41gZ1+v7mwrgh3rArAUgagITNcFYDmAK9ERSBuBfQGsxY3Aku26V/MiOO7j1nqAQwMgRQ4xQONnhqOfr8q2TA4H1HzoRqO70c1g4JhUH/dhNKqgrhfT2cEMOoQaqxidyx+P5J8F8PpYjnkNPYLBgPGq+vxSFOJM/rhvXpp39ZAkGaUk40r+WK69jKT8JMdbQE8oYKDAByTJmMItGQj10OR7zyA3itFr2CQD1NhFMYYeMVhCHA8C1co7pV4yYXL4aSz/GVvfFFBBjxguIcCeOt4szYxOhiG2/V7M+T2yY7iEMOaTgIl8mBWkoth7Cduqah2u97JjuIQIUXqvYWlSohZyUEaDE/88/M+P0BMGrLIIYFAZ/R+HTGovJ+42IRqvYxZ485kKBob7QEgZZZoWoyMgrg//+vDX/0JPuA+ESLCXEApG/kxvm0LEkK2secDVZYjFpRZzIWibSyHm0COGSwjnYWoiyOIqjujXskcJUWCBqgItLuriPipOgAombqBH7EEGTKovUvz/xIdxnc8Rx8IdiHpxn7ouCVJXGnPIBD1h9p5BIU6kS6ZkBXt//uvf365fk0SIcvJJv5LUL6Wcdvq1w09z+c9MeknfSHLmEAteX8t7B30EBHsBHkLkPSsI+h482bOs3froERAT+UdLMcPlSch91M0P0w9Pz5bXpqksRcaW6Yj/H8v3vkpyLvRuOBzGxd6F2voZwpBEyKT6XMln8dF4BCzfj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GJ/KScFtoc9bVqWGc6pOytTL1Lrmci4AlZM9etxDseU7pzB98WGXldPD6AnJCdbm9k+lsScgSpEY2qb6JomQR0Umghqlwr1DEKAXagpnoY+6oStIVv2uyFmDnlB1d/hR+GwCzUbUVw/+6E5XynotOVROogLKrWz8yZQgkkP2ZwM7gXDJoTSkJ7Y2bkJPeNpxT5r/sdP0BMGLiHMX6FUQHy7V+oxjFxeCcpQMGQwRljQ48+29NZfNwADlxAvLpOzz/vqQk3E3SYkw7n2oUnJsAkRwmEFiXzn/gYkJQOXEGFP51Eue07zhREwJCkZupVldxYWLH/VB1cXat5fdaJhE8JriwUl3nTRrk4T3Bbdq1NCDUEYNCFm87Z8SAtzUukMOoK94bHo7Yw6orMjbTmxDOD05U/SBz2l2wab3ncgjS78H0eagrHjdQciAAAAAElFTkSuQmCC";
|
|
1838
|
-
var define_Buffer_default = ["buffer", "Buffer"];
|
|
1839
1838
|
class SimplePaymentAPI2 {
|
|
1840
1839
|
constructor(baseURL, apiKey, apiSecret) {
|
|
1841
1840
|
this.baseURL = baseURL.endsWith("/") ? baseURL.slice(0, -1) : baseURL;
|
|
@@ -2044,31 +2043,54 @@ class SimplePhantomWallet {
|
|
|
2044
2043
|
}
|
|
2045
2044
|
try {
|
|
2046
2045
|
console.log("👻 Sending Phantom transaction:", txParams);
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2046
|
+
if (txParams.type === "solana") {
|
|
2047
|
+
const { recipientAddress, amount, currency, tokenMintAddress } = txParams;
|
|
2048
|
+
if (!recipientAddress) {
|
|
2049
|
+
throw new Error("Recipient address is required for Solana transactions");
|
|
2050
|
+
}
|
|
2051
|
+
console.log("🔄 Processing Solana transaction:", {
|
|
2052
|
+
from: this.account,
|
|
2053
|
+
to: recipientAddress,
|
|
2054
|
+
amount,
|
|
2055
|
+
currency,
|
|
2056
|
+
isToken: !!tokenMintAddress
|
|
2057
|
+
});
|
|
2058
|
+
const simulatedTxHash = `solana_tx_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
2059
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
2060
|
+
console.log("✅ Phantom Solana transaction simulation complete:", simulatedTxHash);
|
|
2061
|
+
return simulatedTxHash;
|
|
2062
|
+
} else if (txParams.type === "evm") {
|
|
2063
|
+
console.log("🔄 Processing EVM transaction via Phantom...");
|
|
2064
|
+
if (window.ethereum) {
|
|
2065
|
+
console.log("🔄 Using Ethereum provider for EVM transaction...");
|
|
2066
|
+
const evmParams = {
|
|
2067
|
+
from: this.account,
|
|
2068
|
+
// This might need conversion for EVM
|
|
2069
|
+
to: txParams.to,
|
|
2070
|
+
value: txParams.value || "0x0",
|
|
2071
|
+
data: txParams.data || "0x"
|
|
2072
|
+
};
|
|
2073
|
+
console.log("🔄 Simulating EVM transaction via Phantom:", evmParams);
|
|
2074
|
+
const simulatedTxHash = `phantom_evm_tx_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
2075
|
+
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
2076
|
+
console.log("✅ Phantom EVM transaction simulation complete:", simulatedTxHash);
|
|
2077
|
+
return simulatedTxHash;
|
|
2078
|
+
} else {
|
|
2079
|
+
throw new Error("Ethereum provider not available. Please ensure Phantom supports EVM transactions.");
|
|
2080
|
+
}
|
|
2081
|
+
} else {
|
|
2082
|
+
console.log("🔄 Processing legacy transaction format...");
|
|
2083
|
+
const simulatedTxHash = `phantom_legacy_tx_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
2084
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
2085
|
+
console.log("✅ Phantom legacy transaction simulation complete:", simulatedTxHash);
|
|
2086
|
+
return simulatedTxHash;
|
|
2087
|
+
}
|
|
2066
2088
|
} catch (error) {
|
|
2067
2089
|
console.error("Phantom transaction failed:", error);
|
|
2068
2090
|
if (error.code === 4001) {
|
|
2069
2091
|
throw new Error("Transaction cancelled by user");
|
|
2070
2092
|
} else if (error.message.includes("insufficient funds")) {
|
|
2071
|
-
throw new Error("Insufficient
|
|
2093
|
+
throw new Error("Insufficient funds for transaction fees");
|
|
2072
2094
|
} else {
|
|
2073
2095
|
throw new Error(error.message || "Transaction failed");
|
|
2074
2096
|
}
|
|
@@ -2505,9 +2527,19 @@ const WalletSelector = ({
|
|
|
2505
2527
|
type: "metamask",
|
|
2506
2528
|
name: "MetaMask",
|
|
2507
2529
|
icon: "🦊",
|
|
2508
|
-
description: "
|
|
2530
|
+
description: "Recommended for Ethereum-based networks",
|
|
2509
2531
|
isInstalled: !!window.ethereum,
|
|
2510
|
-
networks: ["ethereum", "bsc", "polygon", "arbitrum", "optimism", "avalanche"]
|
|
2532
|
+
networks: ["ethereum", "bsc", "polygon", "arbitrum", "optimism", "avalanche"],
|
|
2533
|
+
isPrimary: true
|
|
2534
|
+
});
|
|
2535
|
+
wallets.push({
|
|
2536
|
+
type: "phantom",
|
|
2537
|
+
name: "Phantom",
|
|
2538
|
+
icon: "👻",
|
|
2539
|
+
description: "Multi-chain wallet (also supports EVM)",
|
|
2540
|
+
isInstalled: !!window.solana,
|
|
2541
|
+
networks: ["ethereum", "bsc", "polygon", "solana"],
|
|
2542
|
+
isAlternative: true
|
|
2511
2543
|
});
|
|
2512
2544
|
}
|
|
2513
2545
|
if (networkType === "solana") {
|
|
@@ -2515,46 +2547,32 @@ const WalletSelector = ({
|
|
|
2515
2547
|
type: "phantom",
|
|
2516
2548
|
name: "Phantom",
|
|
2517
2549
|
icon: "👻",
|
|
2518
|
-
description: "
|
|
2550
|
+
description: "Recommended for Solana network",
|
|
2519
2551
|
isInstalled: !!window.solana,
|
|
2520
|
-
networks: ["solana"]
|
|
2552
|
+
networks: ["solana"],
|
|
2553
|
+
isPrimary: true
|
|
2521
2554
|
});
|
|
2522
2555
|
}
|
|
2523
|
-
if (["ethereum", "bsc", "polygon"].includes(networkType)) {
|
|
2556
|
+
if (!["ethereum", "bsc", "polygon", "arbitrum", "optimism", "avalanche", "solana"].includes(networkType)) {
|
|
2557
|
+
wallets.push({
|
|
2558
|
+
type: "metamask",
|
|
2559
|
+
name: "MetaMask",
|
|
2560
|
+
icon: "🦊",
|
|
2561
|
+
description: "Popular wallet for various networks",
|
|
2562
|
+
isInstalled: !!window.ethereum,
|
|
2563
|
+
networks: ["multiple"],
|
|
2564
|
+
isAlternative: true
|
|
2565
|
+
});
|
|
2524
2566
|
wallets.push({
|
|
2525
2567
|
type: "phantom",
|
|
2526
2568
|
name: "Phantom",
|
|
2527
2569
|
icon: "👻",
|
|
2528
|
-
description: "
|
|
2570
|
+
description: "Multi-chain wallet option",
|
|
2529
2571
|
isInstalled: !!window.solana,
|
|
2530
|
-
networks: ["
|
|
2572
|
+
networks: ["multiple"],
|
|
2531
2573
|
isAlternative: true
|
|
2532
2574
|
});
|
|
2533
2575
|
}
|
|
2534
|
-
if (window.ethereum && window.solana) {
|
|
2535
|
-
const hasMetaMask = wallets.some((w) => w.type === "metamask");
|
|
2536
|
-
const hasPhantom = wallets.some((w) => w.type === "phantom");
|
|
2537
|
-
if (!hasMetaMask && ["ethereum", "bsc", "polygon", "arbitrum", "optimism", "avalanche"].includes(networkType)) {
|
|
2538
|
-
wallets.push({
|
|
2539
|
-
type: "metamask",
|
|
2540
|
-
name: "MetaMask",
|
|
2541
|
-
icon: "🦊",
|
|
2542
|
-
description: "Connect using MetaMask wallet",
|
|
2543
|
-
isInstalled: true,
|
|
2544
|
-
networks: ["ethereum", "bsc", "polygon", "arbitrum", "optimism", "avalanche"]
|
|
2545
|
-
});
|
|
2546
|
-
}
|
|
2547
|
-
if (!hasPhantom && networkType === "solana") {
|
|
2548
|
-
wallets.push({
|
|
2549
|
-
type: "phantom",
|
|
2550
|
-
name: "Phantom",
|
|
2551
|
-
icon: "👻",
|
|
2552
|
-
description: "Connect using Phantom wallet",
|
|
2553
|
-
isInstalled: true,
|
|
2554
|
-
networks: ["solana"]
|
|
2555
|
-
});
|
|
2556
|
-
}
|
|
2557
|
-
}
|
|
2558
2576
|
return wallets;
|
|
2559
2577
|
};
|
|
2560
2578
|
const availableWallets = getAvailableWallets();
|
|
@@ -3097,26 +3115,70 @@ const EnhancedSimpleCoinleyPayment = ({
|
|
|
3097
3115
|
console.log(`🔄 Preparing ${selectedWalletType} transaction to:`, recipientAddress);
|
|
3098
3116
|
let txParams;
|
|
3099
3117
|
let txHash;
|
|
3100
|
-
if (selectedWalletType === "phantom"
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3118
|
+
if (selectedWalletType === "phantom") {
|
|
3119
|
+
if (selectedNetwork.shortName === "solana") {
|
|
3120
|
+
console.log("🔄 Preparing Solana transaction with Phantom...");
|
|
3121
|
+
const amount = selectedToken.contractAddress ? Math.floor(paymentData.totalAmount * Math.pow(10, selectedToken.decimals || 6)) : Math.floor(paymentData.totalAmount * Math.pow(10, 9));
|
|
3122
|
+
txParams = {
|
|
3123
|
+
type: "solana",
|
|
3124
|
+
recipientAddress,
|
|
3125
|
+
amount,
|
|
3126
|
+
currency: selectedToken.symbol,
|
|
3127
|
+
tokenMintAddress: selectedToken.contractAddress || null,
|
|
3128
|
+
decimals: selectedToken.decimals || (selectedToken.contractAddress ? 6 : 9),
|
|
3129
|
+
network: "solana"
|
|
3130
|
+
};
|
|
3131
|
+
console.log("🔄 Solana Transaction Params:", {
|
|
3132
|
+
token: selectedToken.symbol,
|
|
3133
|
+
amount: paymentData.totalAmount,
|
|
3134
|
+
amountWithDecimals: amount,
|
|
3135
|
+
to: recipientAddress,
|
|
3136
|
+
isToken: !!selectedToken.contractAddress,
|
|
3137
|
+
tokenMint: selectedToken.contractAddress
|
|
3138
|
+
});
|
|
3139
|
+
} else {
|
|
3140
|
+
console.log("🔄 Preparing EVM transaction with Phantom...");
|
|
3141
|
+
if (selectedToken.contractAddress) {
|
|
3142
|
+
const decimals = selectedToken.decimals || 6;
|
|
3143
|
+
const amount = Math.floor(paymentData.totalAmount * Math.pow(10, decimals));
|
|
3144
|
+
const methodId = "0xa9059cbb";
|
|
3145
|
+
const recipientPadded = recipientAddress.slice(2).toLowerCase().padStart(64, "0");
|
|
3146
|
+
const amountPadded = amount.toString(16).padStart(64, "0");
|
|
3147
|
+
const data = `${methodId}${recipientPadded}${amountPadded}`;
|
|
3148
|
+
txParams = {
|
|
3149
|
+
type: "evm",
|
|
3150
|
+
to: selectedToken.contractAddress,
|
|
3151
|
+
data,
|
|
3152
|
+
value: "0x0",
|
|
3153
|
+
network: selectedNetwork.shortName
|
|
3154
|
+
};
|
|
3155
|
+
console.log("🔄 ERC-20 Transaction via Phantom:", {
|
|
3156
|
+
token: selectedToken.symbol,
|
|
3157
|
+
amount: paymentData.totalAmount,
|
|
3158
|
+
amountWithDecimals: amount,
|
|
3159
|
+
to: selectedToken.contractAddress,
|
|
3160
|
+
recipient: recipientAddress
|
|
3161
|
+
});
|
|
3162
|
+
} else {
|
|
3163
|
+
const value = Math.floor(paymentData.totalAmount * Math.pow(10, 18));
|
|
3164
|
+
txParams = {
|
|
3165
|
+
type: "evm",
|
|
3166
|
+
to: recipientAddress,
|
|
3167
|
+
value: `0x${value.toString(16)}`,
|
|
3168
|
+
network: selectedNetwork.shortName
|
|
3169
|
+
};
|
|
3170
|
+
console.log("🔄 Native EVM Transaction via Phantom:", {
|
|
3171
|
+
amount: paymentData.totalAmount,
|
|
3172
|
+
to: recipientAddress,
|
|
3173
|
+
network: selectedNetwork.shortName
|
|
3174
|
+
});
|
|
3175
|
+
}
|
|
3176
|
+
}
|
|
3119
3177
|
} else if (selectedWalletType === "metamask") {
|
|
3178
|
+
console.log("🔄 Preparing EVM transaction with MetaMask...");
|
|
3179
|
+
if (selectedNetwork.shortName === "solana") {
|
|
3180
|
+
throw new Error("MetaMask does not support Solana network. Please use Phantom wallet for Solana transactions.");
|
|
3181
|
+
}
|
|
3120
3182
|
if (selectedToken.contractAddress) {
|
|
3121
3183
|
const decimals = selectedToken.decimals || 6;
|
|
3122
3184
|
const amount = Math.floor(paymentData.totalAmount * Math.pow(10, decimals));
|
|
@@ -3129,7 +3191,7 @@ const EnhancedSimpleCoinleyPayment = ({
|
|
|
3129
3191
|
data,
|
|
3130
3192
|
value: "0x0"
|
|
3131
3193
|
};
|
|
3132
|
-
console.log("🔄 ERC-20 Transaction:", {
|
|
3194
|
+
console.log("🔄 ERC-20 Transaction via MetaMask:", {
|
|
3133
3195
|
token: selectedToken.symbol,
|
|
3134
3196
|
amount: paymentData.totalAmount,
|
|
3135
3197
|
amountWithDecimals: amount,
|
|
@@ -3142,13 +3204,19 @@ const EnhancedSimpleCoinleyPayment = ({
|
|
|
3142
3204
|
to: recipientAddress,
|
|
3143
3205
|
value: `0x${value.toString(16)}`
|
|
3144
3206
|
};
|
|
3145
|
-
console.log("🔄 Native Transaction:", {
|
|
3207
|
+
console.log("🔄 Native EVM Transaction via MetaMask:", {
|
|
3146
3208
|
amount: paymentData.totalAmount,
|
|
3147
3209
|
to: recipientAddress
|
|
3148
3210
|
});
|
|
3149
3211
|
}
|
|
3212
|
+
} else {
|
|
3213
|
+
throw new Error(`Unsupported wallet type: ${selectedWalletType}`);
|
|
3150
3214
|
}
|
|
3151
3215
|
setCurrentStep("processing");
|
|
3216
|
+
if (!txParams) {
|
|
3217
|
+
throw new Error("Failed to construct transaction parameters");
|
|
3218
|
+
}
|
|
3219
|
+
console.log("📤 Final transaction params for", selectedWalletType, ":", txParams);
|
|
3152
3220
|
txHash = await connectedWallet.sendTransaction(txParams);
|
|
3153
3221
|
console.log(`✅ ${selectedWalletType} transaction sent! Hash:`, txHash);
|
|
3154
3222
|
setTimeout(() => {
|