+2
-1
@@ -103,2 +103,3 @@ declare enum Currency { | ||
| }>; | ||
| declare const makeInterWalletTransferTxn: (senderAddr: string, senderPwd: string, receiverAddr: string, amount: string, currencyName: string) => Promise<any>; | ||
@@ -178,2 +179,2 @@ declare const importWalletFromPrivateKeyAndPassword: ({ pvKey, password, }: { | ||
| export { type CreateKeystoreInput, Currency, type GetAddressBalanceInput, type GetAddressBalanceOutput, type InitializeDepositInput, type KYCParams, type PaymentExtrasInput, type SetNameInput, configureTNS, confirmDeposit, createVirtualWallet, createWallet, depositFunds, fetchVirtualWallet, fetchVirtualWalletByAddress, getAddressBalance, getAddressRole, getAddressTransactions, getAddressTransactionsAuth, getAddressTransactionsDollar, getAddressTransactionsEGP, getAddressTransactionsETH, getAddressTransactionsEuro, getAddressTransactionsKSH, getAddressTransactionsNaira, getAddressTransactionsPound, getAddressTransactionsToro, getAddressTransactionsZAR, getBalance, getBlockById, getBlockchainStatus, getBlockchainTransactions, getBlocksData, getEventById, getLatestBlockData, getReceipt, getRevertReason, getSupportedAssetsExchangeRates, getTransaction, getTransactionById, getTransactionReceiptById, getTransactionsDollarWrapper, getTransactionsEGPWrapper, getTransactionsETHWrapper, getTransactionsEuroWrapper, getTransactionsKSHWrapper, getTransactionsNairaWrapper, getTransactionsPoundWrapper, getTransactionsRangeWrapper, getTransactionsToroWrapper, getTransactionsZARWrapper, getWalletKey, importWalletFromPrivateKeyAndPassword, isAddressKYCVerified, isAddressUtil, isTNSAvailable, performKYCForCustomer, updateVirtualWalletTxs, verifyWalletPassword }; | ||
| export { type CreateKeystoreInput, Currency, type GetAddressBalanceInput, type GetAddressBalanceOutput, type InitializeDepositInput, type KYCParams, type PaymentExtrasInput, type SetNameInput, configureTNS, confirmDeposit, createVirtualWallet, createWallet, depositFunds, fetchVirtualWallet, fetchVirtualWalletByAddress, getAddressBalance, getAddressRole, getAddressTransactions, getAddressTransactionsAuth, getAddressTransactionsDollar, getAddressTransactionsEGP, getAddressTransactionsETH, getAddressTransactionsEuro, getAddressTransactionsKSH, getAddressTransactionsNaira, getAddressTransactionsPound, getAddressTransactionsToro, getAddressTransactionsZAR, getBalance, getBlockById, getBlockchainStatus, getBlockchainTransactions, getBlocksData, getEventById, getLatestBlockData, getReceipt, getRevertReason, getSupportedAssetsExchangeRates, getTransaction, getTransactionById, getTransactionReceiptById, getTransactionsDollarWrapper, getTransactionsEGPWrapper, getTransactionsETHWrapper, getTransactionsEuroWrapper, getTransactionsKSHWrapper, getTransactionsNairaWrapper, getTransactionsPoundWrapper, getTransactionsRangeWrapper, getTransactionsToroWrapper, getTransactionsZARWrapper, getWalletKey, importWalletFromPrivateKeyAndPassword, isAddressKYCVerified, isAddressUtil, isTNSAvailable, makeInterWalletTransferTxn, performKYCForCustomer, updateVirtualWalletTxs, verifyWalletPassword }; |
+2
-1
@@ -103,2 +103,3 @@ declare enum Currency { | ||
| }>; | ||
| declare const makeInterWalletTransferTxn: (senderAddr: string, senderPwd: string, receiverAddr: string, amount: string, currencyName: string) => Promise<any>; | ||
@@ -178,2 +179,2 @@ declare const importWalletFromPrivateKeyAndPassword: ({ pvKey, password, }: { | ||
| export { type CreateKeystoreInput, Currency, type GetAddressBalanceInput, type GetAddressBalanceOutput, type InitializeDepositInput, type KYCParams, type PaymentExtrasInput, type SetNameInput, configureTNS, confirmDeposit, createVirtualWallet, createWallet, depositFunds, fetchVirtualWallet, fetchVirtualWalletByAddress, getAddressBalance, getAddressRole, getAddressTransactions, getAddressTransactionsAuth, getAddressTransactionsDollar, getAddressTransactionsEGP, getAddressTransactionsETH, getAddressTransactionsEuro, getAddressTransactionsKSH, getAddressTransactionsNaira, getAddressTransactionsPound, getAddressTransactionsToro, getAddressTransactionsZAR, getBalance, getBlockById, getBlockchainStatus, getBlockchainTransactions, getBlocksData, getEventById, getLatestBlockData, getReceipt, getRevertReason, getSupportedAssetsExchangeRates, getTransaction, getTransactionById, getTransactionReceiptById, getTransactionsDollarWrapper, getTransactionsEGPWrapper, getTransactionsETHWrapper, getTransactionsEuroWrapper, getTransactionsKSHWrapper, getTransactionsNairaWrapper, getTransactionsPoundWrapper, getTransactionsRangeWrapper, getTransactionsToroWrapper, getTransactionsZARWrapper, getWalletKey, importWalletFromPrivateKeyAndPassword, isAddressKYCVerified, isAddressUtil, isTNSAvailable, performKYCForCustomer, updateVirtualWalletTxs, verifyWalletPassword }; | ||
| export { type CreateKeystoreInput, Currency, type GetAddressBalanceInput, type GetAddressBalanceOutput, type InitializeDepositInput, type KYCParams, type PaymentExtrasInput, type SetNameInput, configureTNS, confirmDeposit, createVirtualWallet, createWallet, depositFunds, fetchVirtualWallet, fetchVirtualWalletByAddress, getAddressBalance, getAddressRole, getAddressTransactions, getAddressTransactionsAuth, getAddressTransactionsDollar, getAddressTransactionsEGP, getAddressTransactionsETH, getAddressTransactionsEuro, getAddressTransactionsKSH, getAddressTransactionsNaira, getAddressTransactionsPound, getAddressTransactionsToro, getAddressTransactionsZAR, getBalance, getBlockById, getBlockchainStatus, getBlockchainTransactions, getBlocksData, getEventById, getLatestBlockData, getReceipt, getRevertReason, getSupportedAssetsExchangeRates, getTransaction, getTransactionById, getTransactionReceiptById, getTransactionsDollarWrapper, getTransactionsEGPWrapper, getTransactionsETHWrapper, getTransactionsEuroWrapper, getTransactionsKSHWrapper, getTransactionsNairaWrapper, getTransactionsPoundWrapper, getTransactionsRangeWrapper, getTransactionsToroWrapper, getTransactionsZARWrapper, getWalletKey, importWalletFromPrivateKeyAndPassword, isAddressKYCVerified, isAddressUtil, isTNSAvailable, makeInterWalletTransferTxn, performKYCForCustomer, updateVirtualWalletTxs, verifyWalletPassword }; |
+51
-10
@@ -64,4 +64,4 @@ "use strict"; | ||
| getSupportedAssetsExchangeRates: () => getSupportedAssetsExchangeRates, | ||
| getTransaction: () => getTransaction3, | ||
| getTransactionById: () => getTransactionById, | ||
| getTransaction: () => getTransaction2, | ||
| getTransactionById: () => getTransactionById2, | ||
| getTransactionReceiptById: () => getTransactionReceiptById, | ||
@@ -83,2 +83,3 @@ getTransactionsDollarWrapper: () => getTransactionsDollarWrapper, | ||
| isTNSAvailable: () => isTNSAvailable, | ||
| makeInterWalletTransferTxn: () => makeInterWalletTransferTxn, | ||
| performKYCForCustomer: () => performKYCForCustomer, | ||
@@ -172,3 +173,3 @@ updateVirtualWalletTxs: () => updateVirtualWalletTxs, | ||
| const data = { | ||
| op: "get_exchange_rates", | ||
| op: "getexchangerates", | ||
| params: [] | ||
@@ -185,3 +186,2 @@ }; | ||
| const response = await (0, import_axios3.default)(config); | ||
| console.dir(response.data, { depth: null }); | ||
| return response.data; | ||
@@ -305,3 +305,3 @@ } catch (error) { | ||
| }; | ||
| var getTransaction = async ({ id }) => { | ||
| var getTransactionById = async ({ id }) => { | ||
| try { | ||
@@ -942,3 +942,3 @@ const url = `${BASE_URL}/api/query/`; | ||
| }; | ||
| var getTransaction2 = async (txHash) => { | ||
| var getTransaction = async (txHash) => { | ||
| try { | ||
@@ -1085,3 +1085,3 @@ const url = `${BASE_URL}/api/blockchain/`; | ||
| { name: "cancel_url", value: "https://toronet.org/cancel" }, | ||
| { name: "paymenttype", value: currency === "USD" ? "card" : "card" }, | ||
| { name: "paymenttype", value: currency === "USD" ? "card" : "bank" }, | ||
| { name: "feetype", value: (_a = extraData == null ? void 0 : extraData.feetype) != null ? _a : "1" }, | ||
@@ -1207,2 +1207,29 @@ { name: "exchange", value: (_b = extraData == null ? void 0 : extraData.exchange) != null ? _b : "72" }, | ||
| }; | ||
| var makeInterWalletTransfer = async (senderAddr, senderPwd, receiverAddr, amount, currencyName) => { | ||
| const currencyConfig = { | ||
| "NGN": "naira", | ||
| "USD": "dollar", | ||
| "EUR": "EUR", | ||
| "GBP": "GBP", | ||
| "KES": "KES", | ||
| "ZAR": "ZAR" | ||
| }; | ||
| const currencyValue = currencyConfig[currencyName]; | ||
| const url = `${BASE_URL}/api/currency/${currencyValue}/cl`; | ||
| console.log("URL:", url); | ||
| const data = { | ||
| op: "transfer", | ||
| params: [ | ||
| { name: "client", value: senderAddr }, | ||
| { name: "clientpwd", value: senderPwd }, | ||
| { name: "to", value: receiverAddr }, | ||
| { name: "val", value: amount.toString() } | ||
| ] | ||
| }; | ||
| const response = await import_axios6.default.post(url, data); | ||
| if (response.data.result == false) { | ||
| throw new Error(response.data.error); | ||
| } | ||
| return response.data; | ||
| }; | ||
@@ -1269,2 +1296,15 @@ // src/services/payments_service.ts | ||
| }; | ||
| var makeInterWalletTransferTxn = async (senderAddr, senderPwd, receiverAddr, amount, currencyName) => { | ||
| console.log( | ||
| `\u{1F50D} Making inter-wallet transfer from ${senderAddr} to ${receiverAddr} for ${amount} ${currencyName}` | ||
| ); | ||
| const response = await makeInterWalletTransfer( | ||
| senderAddr, | ||
| senderPwd, | ||
| receiverAddr, | ||
| amount, | ||
| currencyName | ||
| ); | ||
| return response; | ||
| }; | ||
@@ -1314,4 +1354,4 @@ // src/types/currency.ts | ||
| }; | ||
| var getTransaction3 = async (txHash) => { | ||
| return await getTransaction2(txHash); | ||
| var getTransaction2 = async (txHash) => { | ||
| return await getTransaction(txHash); | ||
| }; | ||
@@ -1356,3 +1396,3 @@ var getReceipt2 = async (txHash) => { | ||
| var getBlockById = async (id) => getBlock({ id }); | ||
| var getTransactionById = async (id) => getTransaction({ id }); | ||
| var getTransactionById2 = async (id) => getTransactionById({ id }); | ||
| var getTransactionReceiptById = async (id) => getTransactionReceipt({ id }); | ||
@@ -1577,2 +1617,3 @@ var getEventById = async (id) => getEvent({ id }); | ||
| isTNSAvailable, | ||
| makeInterWalletTransferTxn, | ||
| performKYCForCustomer, | ||
@@ -1579,0 +1620,0 @@ updateVirtualWalletTxs, |
+50
-10
@@ -83,3 +83,3 @@ // src/api/account.ts | ||
| const data = { | ||
| op: "get_exchange_rates", | ||
| op: "getexchangerates", | ||
| params: [] | ||
@@ -96,3 +96,2 @@ }; | ||
| const response = await axios3(config); | ||
| console.dir(response.data, { depth: null }); | ||
| return response.data; | ||
@@ -216,3 +215,3 @@ } catch (error) { | ||
| }; | ||
| var getTransaction = async ({ id }) => { | ||
| var getTransactionById = async ({ id }) => { | ||
| try { | ||
@@ -853,3 +852,3 @@ const url = `${BASE_URL}/api/query/`; | ||
| }; | ||
| var getTransaction2 = async (txHash) => { | ||
| var getTransaction = async (txHash) => { | ||
| try { | ||
@@ -996,3 +995,3 @@ const url = `${BASE_URL}/api/blockchain/`; | ||
| { name: "cancel_url", value: "https://toronet.org/cancel" }, | ||
| { name: "paymenttype", value: currency === "USD" ? "card" : "card" }, | ||
| { name: "paymenttype", value: currency === "USD" ? "card" : "bank" }, | ||
| { name: "feetype", value: (_a = extraData == null ? void 0 : extraData.feetype) != null ? _a : "1" }, | ||
@@ -1118,2 +1117,29 @@ { name: "exchange", value: (_b = extraData == null ? void 0 : extraData.exchange) != null ? _b : "72" }, | ||
| }; | ||
| var makeInterWalletTransfer = async (senderAddr, senderPwd, receiverAddr, amount, currencyName) => { | ||
| const currencyConfig = { | ||
| "NGN": "naira", | ||
| "USD": "dollar", | ||
| "EUR": "EUR", | ||
| "GBP": "GBP", | ||
| "KES": "KES", | ||
| "ZAR": "ZAR" | ||
| }; | ||
| const currencyValue = currencyConfig[currencyName]; | ||
| const url = `${BASE_URL}/api/currency/${currencyValue}/cl`; | ||
| console.log("URL:", url); | ||
| const data = { | ||
| op: "transfer", | ||
| params: [ | ||
| { name: "client", value: senderAddr }, | ||
| { name: "clientpwd", value: senderPwd }, | ||
| { name: "to", value: receiverAddr }, | ||
| { name: "val", value: amount.toString() } | ||
| ] | ||
| }; | ||
| const response = await axios6.post(url, data); | ||
| if (response.data.result == false) { | ||
| throw new Error(response.data.error); | ||
| } | ||
| return response.data; | ||
| }; | ||
@@ -1180,2 +1206,15 @@ // src/services/payments_service.ts | ||
| }; | ||
| var makeInterWalletTransferTxn = async (senderAddr, senderPwd, receiverAddr, amount, currencyName) => { | ||
| console.log( | ||
| `\u{1F50D} Making inter-wallet transfer from ${senderAddr} to ${receiverAddr} for ${amount} ${currencyName}` | ||
| ); | ||
| const response = await makeInterWalletTransfer( | ||
| senderAddr, | ||
| senderPwd, | ||
| receiverAddr, | ||
| amount, | ||
| currencyName | ||
| ); | ||
| return response; | ||
| }; | ||
@@ -1225,4 +1264,4 @@ // src/types/currency.ts | ||
| }; | ||
| var getTransaction3 = async (txHash) => { | ||
| return await getTransaction2(txHash); | ||
| var getTransaction2 = async (txHash) => { | ||
| return await getTransaction(txHash); | ||
| }; | ||
@@ -1267,3 +1306,3 @@ var getReceipt2 = async (txHash) => { | ||
| var getBlockById = async (id) => getBlock({ id }); | ||
| var getTransactionById = async (id) => getTransaction({ id }); | ||
| var getTransactionById2 = async (id) => getTransactionById({ id }); | ||
| var getTransactionReceiptById = async (id) => getTransactionReceipt({ id }); | ||
@@ -1469,4 +1508,4 @@ var getEventById = async (id) => getEvent({ id }); | ||
| getSupportedAssetsExchangeRates, | ||
| getTransaction3 as getTransaction, | ||
| getTransactionById, | ||
| getTransaction2 as getTransaction, | ||
| getTransactionById2 as getTransactionById, | ||
| getTransactionReceiptById, | ||
@@ -1488,2 +1527,3 @@ getTransactionsDollarWrapper, | ||
| isTNSAvailable, | ||
| makeInterWalletTransferTxn, | ||
| performKYCForCustomer, | ||
@@ -1490,0 +1530,0 @@ updateVirtualWalletTxs, |
+238
-217
@@ -13,49 +13,51 @@ import { | ||
| verifyWalletPassword, | ||
| makeInterWalletTransferTxn, | ||
| getSupportedAssetsExchangeRates | ||
| } from "../src/index"; | ||
| import { | ||
| getBlockchainStatus, | ||
| getLatestBlockData, | ||
| getTransaction, | ||
| getReceipt, | ||
| getRevertReason, | ||
| } from "../src/blockchain"; | ||
| import { | ||
| getSupportedAssetsExchangeRates, | ||
| getBlocksData, | ||
| getBlockchainTransactions, | ||
| getAddressRole, | ||
| getAddressBalance, | ||
| getBlockById, | ||
| getTransactionById, | ||
| getTransactionReceiptById, | ||
| getEventById, | ||
| getAddressTransactions, | ||
| getTransactionsToroWrapper, | ||
| getAddressTransactionsToro, | ||
| getTransactionsDollarWrapper, | ||
| getAddressTransactionsDollar, | ||
| getTransactionsNairaWrapper, | ||
| getAddressTransactionsNaira, | ||
| getTransactionsEuroWrapper, | ||
| getAddressTransactionsEuro, | ||
| getTransactionsPoundWrapper, | ||
| getAddressTransactionsPound, | ||
| getTransactionsEGPWrapper, | ||
| getAddressTransactionsEGP, | ||
| getTransactionsKSHWrapper, | ||
| getAddressTransactionsKSH, | ||
| getTransactionsZARWrapper, | ||
| getAddressTransactionsZAR, | ||
| getTransactionsETHWrapper, | ||
| getAddressTransactionsETH, | ||
| getTransactionsRangeWrapper, | ||
| getAddressTransactionsAuth, | ||
| isAddressUtil, | ||
| } from "../src/query"; | ||
| import { | ||
| createVirtualWallet, | ||
| fetchVirtualWallet, | ||
| fetchVirtualWalletByAddress, | ||
| updateVirtualWalletTxs, | ||
| } from "../src/virtualwallet"; | ||
| // import { | ||
| // getBlockchainStatus, | ||
| // getLatestBlockData, | ||
| // getTransaction, | ||
| // getReceipt, | ||
| // getRevertReason, | ||
| // } from "../src/blockchain"; | ||
| // import { | ||
| // getSupportedAssetsExchangeRates, | ||
| // getBlocksData, | ||
| // getBlockchainTransactions, | ||
| // getAddressRole, | ||
| // getAddressBalance, | ||
| // getBlockById, | ||
| // getTransactionById, | ||
| // getTransactionReceiptById, | ||
| // getEventById, | ||
| // getAddressTransactions, | ||
| // getTransactionsToroWrapper, | ||
| // getAddressTransactionsToro, | ||
| // getTransactionsDollarWrapper, | ||
| // getAddressTransactionsDollar, | ||
| // getTransactionsNairaWrapper, | ||
| // getAddressTransactionsNaira, | ||
| // getTransactionsEuroWrapper, | ||
| // getAddressTransactionsEuro, | ||
| // getTransactionsPoundWrapper, | ||
| // getAddressTransactionsPound, | ||
| // getTransactionsEGPWrapper, | ||
| // getAddressTransactionsEGP, | ||
| // getTransactionsKSHWrapper, | ||
| // getAddressTransactionsKSH, | ||
| // getTransactionsZARWrapper, | ||
| // getAddressTransactionsZAR, | ||
| // getTransactionsETHWrapper, | ||
| // getAddressTransactionsETH, | ||
| // getTransactionsRangeWrapper, | ||
| // getAddressTransactionsAuth, | ||
| // isAddressUtil, | ||
| // } from "../src/query"; | ||
| // import { | ||
| // createVirtualWallet, | ||
| // fetchVirtualWallet, | ||
| // fetchVirtualWalletByAddress, | ||
| // updateVirtualWalletTxs, | ||
| // } from "../src/virtualwallet"; | ||
| import { Currency } from "../src/types/currency"; | ||
@@ -67,182 +69,201 @@ | ||
| // Wallet creation and TNS | ||
| const username = "demoUser" + Math.floor(Math.random() * 10000); | ||
| const password = "SuperSecretPassword123!"; | ||
| const isAvailable = await isTNSAvailable({ username }); | ||
| console.log("Is TNS available:", isAvailable); | ||
| if (!isAvailable) return; | ||
| const address = await createWallet({ username, password }); | ||
| console.log("New Wallet Address:", address); | ||
| await configureTNS({ address, password, username }); | ||
| // const username = "demoUser" + Math.floor(Math.random() * 10000); | ||
| // const password = "SuperSecretPassword123!"; | ||
| // const isAvailable = await isTNSAvailable({ username }); | ||
| // console.log("Is TNS available:", isAvailable); | ||
| // if (!isAvailable) return; | ||
| // const address = await createWallet({ username, password }); | ||
| // console.log("New Wallet Address:", address); | ||
| // await configureTNS({ address, password, username }); | ||
| // Keystore operations | ||
| const importedAddress = await importWalletFromPrivateKeyAndPassword({ | ||
| pvKey: address, | ||
| password, | ||
| }); | ||
| console.log("Imported Address:", importedAddress); | ||
| const isPasswordValid = await verifyWalletPassword({ address, password }); | ||
| console.log("Is Password Valid:", isPasswordValid); | ||
| const walletKey = await getWalletKey({ address }); | ||
| console.log("Wallet Key:", walletKey); | ||
| // // Keystore operations | ||
| // const importedAddress = await importWalletFromPrivateKeyAndPassword({ | ||
| // pvKey: address, | ||
| // password, | ||
| // }); | ||
| // console.log("Imported Address:", importedAddress); | ||
| // const isPasswordValid = await verifyWalletPassword({ address, password }); | ||
| // console.log("Is Password Valid:", isPasswordValid); | ||
| // const walletKey = await getWalletKey({ address }); | ||
| // console.log("Wallet Key:", walletKey); | ||
| // Balance | ||
| const balance = await getBalance({ address }); | ||
| console.log("Wallet Balance:", balance); | ||
| // // Balance | ||
| // const balance = await getBalance({ address: "0x1cbbf1b2066311e465a8a2c1670e6c25f1a903d0" }); | ||
| // console.log("Wallet Balance:", balance); | ||
| // const transferResult = await makeInterWalletTransferTxn( | ||
| // "kfkfkfkkf", | ||
| // "jkfmjfmf", | ||
| // "0xfa1e3a944f60519c0a6ec856ae5fe23a38e2ba50", | ||
| // "200", | ||
| // Currency.Naira | ||
| // ); | ||
| // console.log("Transfer Result:", transferResult); | ||
| // const balance = await getBalance({ address: "0xfa1e3a944f60519c0a6ec856ae5fe23a38e2ba50" }); | ||
| // console.log("Wallet Balance:", balance); | ||
| // Payments & KYC | ||
| const depositDetails = await depositFunds( | ||
| { | ||
| userAddress: address, | ||
| username, | ||
| amount: "5000", | ||
| currency: Currency.Naira, | ||
| admin: "0xadminaddress", | ||
| adminpwd: "adminpassword", | ||
| }, | ||
| { | ||
| payeraddress: "123 Main St", | ||
| payercity: "Lagos", | ||
| payerstate: "Lagos", | ||
| payercountry: "Nigeria", | ||
| payerzipcode: "100001", | ||
| payerphone: "+2348012345678", | ||
| description: "Initial deposit", | ||
| success_url: "https://example.com/success", | ||
| cancel_url: "https://example.com/cancel", | ||
| paymenttype: "deposit", | ||
| feetype: "1", | ||
| exchange: "72", | ||
| reusewallet: "0", | ||
| } | ||
| ); | ||
| console.log("Deposit Details:", depositDetails); | ||
| const isDepositConfirmed = await confirmDeposit({ | ||
| currency: Currency.Naira, | ||
| transactionId: "TX1234567890", | ||
| }); | ||
| console.log("Deposit Confirmed:", isDepositConfirmed); | ||
| // const depositDetails = await depositFunds( | ||
| // { | ||
| // userAddress: "0xfa1e3a944f60519c0a6ec856ae5fe23a38e2ba50", | ||
| // username: "toroaccessadmin", | ||
| // amount: "300", | ||
| // currency: Currency.Naira, | ||
| // admin: "lfllff", | ||
| // adminpwd: "mfmkfmf", | ||
| // } | ||
| // // { | ||
| // // payeraddress: "123 Main St", | ||
| // // payercity: "Lagos", | ||
| // // payerstate: "Lagos", | ||
| // // payercountry: "Nigeria", | ||
| // // payerzipcode: "100001", | ||
| // // payerphone: "+2348012345678", | ||
| // // description: "Initial deposit", | ||
| // // success_url: "https://example.com/success", | ||
| // // cancel_url: "https://example.com/cancel", | ||
| // // paymenttype: "deposit", | ||
| // // feetype: "1", | ||
| // // exchange: "72", | ||
| // // reusewallet: "0", | ||
| // // } | ||
| // ); | ||
| // console.log("Deposit Details:", depositDetails); | ||
| // const structuredDepositDetails ={ | ||
| // instrctions: depositDetails.instruction as string, | ||
| // transactionId: depositDetails.accountnumber as string, | ||
| // bankName: depositDetails.bankname as string, | ||
| // accountNumber: depositDetails.accountnumber as string, | ||
| // accountName: depositDetails.accountname as string, | ||
| // amount: depositDetails.amount as number, | ||
| // } | ||
| const kycParams = { | ||
| firstName: "John", | ||
| middleName: "Doe", | ||
| lastName: "Smith", | ||
| bvn: "12345678901", | ||
| currency: Currency.Naira, | ||
| phoneNumber: "+2348012345678", | ||
| dob: "1990-01-01", | ||
| address, | ||
| admin: "0xadminaddress", | ||
| adminpwd: "adminpassword", | ||
| }; | ||
| const kycResult = await performKYCForCustomer(kycParams); | ||
| console.log("KYC Result:", kycResult); | ||
| const kycVerified = await isAddressKYCVerified({ address }); | ||
| console.log("KYC Verified:", kycVerified); | ||
| // console.log("Structured Deposit Details:", structuredDepositDetails); | ||
| // const isDepositConfirmed = await confirmDeposit({ | ||
| // currency: Currency.Naira, | ||
| // transactionId: "TX1234567890", | ||
| // }); | ||
| // console.log("Deposit Confirmed:", isDepositConfirmed); | ||
| // Blockchain | ||
| const latestBlock = await getLatestBlockData(); | ||
| console.log("Latest Block:", latestBlock); | ||
| const blockchainStatus = await getBlockchainStatus(); | ||
| console.log("Blockchain Status:", blockchainStatus); | ||
| const txHash = "0x1234567890abcdef"; | ||
| const transaction = await getTransaction(txHash); | ||
| console.log("Transaction:", transaction); | ||
| const receipt = await getReceipt(txHash); | ||
| console.log("Receipt:", receipt); | ||
| const revertReason = await getRevertReason(txHash); | ||
| console.log("Revert Reason:", revertReason); | ||
| // const kycParams = { | ||
| // firstName: "John", | ||
| // middleName: "Doe", | ||
| // lastName: "Smith", | ||
| // bvn: "12345678901", | ||
| // currency: Currency.Naira, | ||
| // phoneNumber: "+2348012345678", | ||
| // dob: "1990-01-01", | ||
| // address, | ||
| // admin: "0xadminaddress", | ||
| // adminpwd: "adminpassword", | ||
| // }; | ||
| // const kycResult = await performKYCForCustomer(kycParams); | ||
| // console.log("KYC Result:", kycResult); | ||
| // const kycVerified = await isAddressKYCVerified({ address }); | ||
| // console.log("KYC Verified:", kycVerified); | ||
| // Query endpoints | ||
| const exchangeRates = await getSupportedAssetsExchangeRates(); | ||
| console.log("Exchange Rates:", exchangeRates); | ||
| const blocks = await getBlocksData(5); | ||
| console.log("Blocks:", blocks); | ||
| const transactions = await getBlockchainTransactions(10); | ||
| console.log("Blockchain Transactions:", transactions); | ||
| const addrRole = await getAddressRole(address); | ||
| console.log("Address Role:", addrRole); | ||
| const addrBalance = await getAddressBalance(address); | ||
| console.log("Address Balance:", addrBalance); | ||
| const blockById = await getBlockById("latest"); | ||
| console.log("Block By ID:", blockById); | ||
| const txById = await getTransactionById(txHash); | ||
| console.log("Transaction By ID:", txById); | ||
| const txReceiptById = await getTransactionReceiptById(txHash); | ||
| console.log("Transaction Receipt By ID:", txReceiptById); | ||
| const eventById = await getEventById("event123"); | ||
| console.log("Event By ID:", eventById); | ||
| const addrTxs = await getAddressTransactions(address, 5); | ||
| console.log("Address Transactions:", addrTxs); | ||
| const txsToro = await getTransactionsToroWrapper(5); | ||
| console.log("Transactions Toro:", txsToro); | ||
| const addrTxsToro = await getAddressTransactionsToro(address, 5); | ||
| console.log("Address Transactions Toro:", addrTxsToro); | ||
| const txsDollar = await getTransactionsDollarWrapper(5); | ||
| console.log("Transactions Dollar:", txsDollar); | ||
| const addrTxsDollar = await getAddressTransactionsDollar(address, 5); | ||
| console.log("Address Transactions Dollar:", addrTxsDollar); | ||
| const txsNaira = await getTransactionsNairaWrapper(5); | ||
| console.log("Transactions Naira:", txsNaira); | ||
| const addrTxsNaira = await getAddressTransactionsNaira(address, 5); | ||
| console.log("Address Transactions Naira:", addrTxsNaira); | ||
| const txsEuro = await getTransactionsEuroWrapper(5); | ||
| console.log("Transactions Euro:", txsEuro); | ||
| const addrTxsEuro = await getAddressTransactionsEuro(address, 5); | ||
| console.log("Address Transactions Euro:", addrTxsEuro); | ||
| const txsPound = await getTransactionsPoundWrapper(5); | ||
| console.log("Transactions Pound:", txsPound); | ||
| const addrTxsPound = await getAddressTransactionsPound(address, 5); | ||
| console.log("Address Transactions Pound:", addrTxsPound); | ||
| const txsEGP = await getTransactionsEGPWrapper(5); | ||
| console.log("Transactions EGP:", txsEGP); | ||
| const addrTxsEGP = await getAddressTransactionsEGP(address, 5); | ||
| console.log("Address Transactions EGP:", addrTxsEGP); | ||
| const txsKSH = await getTransactionsKSHWrapper(5); | ||
| console.log("Transactions KSH:", txsKSH); | ||
| const addrTxsKSH = await getAddressTransactionsKSH(address, 5); | ||
| console.log("Address Transactions KSH:", addrTxsKSH); | ||
| const txsZAR = await getTransactionsZARWrapper(5); | ||
| console.log("Transactions ZAR:", txsZAR); | ||
| const addrTxsZAR = await getAddressTransactionsZAR(address, 5); | ||
| console.log("Address Transactions ZAR:", addrTxsZAR); | ||
| const txsETH = await getTransactionsETHWrapper(5); | ||
| console.log("Transactions ETH:", txsETH); | ||
| const addrTxsETH = await getAddressTransactionsETH(address, 5); | ||
| console.log("Address Transactions ETH:", addrTxsETH); | ||
| const txsRange = await getTransactionsRangeWrapper(0, 10); | ||
| console.log("Transactions Range:", txsRange); | ||
| const addrTxsAuth = await getAddressTransactionsAuth(address, 5); | ||
| console.log("Address Transactions Auth:", addrTxsAuth); | ||
| const isAddrValid = await isAddressUtil(address); | ||
| console.log("Is Address Valid:", isAddrValid); | ||
| // // Blockchain | ||
| // const latestBlock = await getLatestBlockData(); | ||
| // console.log("Latest Block:", latestBlock); | ||
| // const blockchainStatus = await getBlockchainStatus(); | ||
| // console.log("Blockchain Status:", blockchainStatus); | ||
| // const txHash = "0x1234567890abcdef"; | ||
| // const transaction = await getTransaction(txHash); | ||
| // console.log("Transaction:", transaction); | ||
| // const receipt = await getReceipt(txHash); | ||
| // console.log("Receipt:", receipt); | ||
| // const revertReason = await getRevertReason(txHash); | ||
| // console.log("Revert Reason:", revertReason); | ||
| // Virtual Wallet | ||
| const virtualWallet = await createVirtualWallet({ | ||
| address, | ||
| payername: "Demo User", | ||
| currency: Currency.Naira, | ||
| admin: "0xadminaddress", | ||
| adminpwd: "adminpassword", | ||
| }); | ||
| console.log("Created Virtual Wallet:", virtualWallet); | ||
| const fetchedVirtualWallet = await fetchVirtualWallet({ | ||
| virtualwallet: "8900610225", | ||
| admin: "0xadminaddress", | ||
| adminpwd: "adminpassword", | ||
| }); | ||
| console.log("Fetched Virtual Wallet:", fetchedVirtualWallet); | ||
| const fetchedVirtualWalletByAddress = await fetchVirtualWalletByAddress({ | ||
| address, | ||
| admin: "0xadminaddress", | ||
| adminpwd: "adminpassword", | ||
| }); | ||
| console.log("Fetched Virtual Wallet By Address:", fetchedVirtualWalletByAddress); | ||
| const updatedVirtualWalletTxs = await updateVirtualWalletTxs({ | ||
| walletaddress: "8900610225", | ||
| admin: "0xadminaddress", | ||
| adminpwd: "adminpassword", | ||
| }); | ||
| console.log("Updated Virtual Wallet Transactions:", updatedVirtualWalletTxs); | ||
| // // Query endpoints | ||
| const exchangeRates = await getSupportedAssetsExchangeRates(); | ||
| console.log("Exchange Rates:", exchangeRates); | ||
| // const blocks = await getBlocksData(5); | ||
| // console.log("Blocks:", blocks); | ||
| // const transactions = await getBlockchainTransactions(10); | ||
| // console.log("Blockchain Transactions:", transactions); | ||
| // const addrRole = await getAddressRole(address); | ||
| // console.log("Address Role:", addrRole); | ||
| // const addrBalance = await getAddressBalance(address); | ||
| // console.log("Address Balance:", addrBalance); | ||
| // const blockById = await getBlockById("latest"); | ||
| // console.log("Block By ID:", blockById); | ||
| // const txById = await getTransactionById(txHash); | ||
| // console.log("Transaction By ID:", txById); | ||
| // const txReceiptById = await getTransactionReceiptById(txHash); | ||
| // console.log("Transaction Receipt By ID:", txReceiptById); | ||
| // const eventById = await getEventById("event123"); | ||
| // console.log("Event By ID:", eventById); | ||
| // const addrTxs = await getAddressTransactions(address, 5); | ||
| // console.log("Address Transactions:", addrTxs); | ||
| // const txsToro = await getTransactionsToroWrapper(5); | ||
| // console.log("Transactions Toro:", txsToro); | ||
| // const addrTxsToro = await getAddressTransactionsToro(address, 5); | ||
| // console.log("Address Transactions Toro:", addrTxsToro); | ||
| // const txsDollar = await getTransactionsDollarWrapper(5); | ||
| // console.log("Transactions Dollar:", txsDollar); | ||
| // const addrTxsDollar = await getAddressTransactionsDollar(address, 5); | ||
| // console.log("Address Transactions Dollar:", addrTxsDollar); | ||
| // const txsNaira = await getTransactionsNairaWrapper(5); | ||
| // console.log("Transactions Naira:", txsNaira); | ||
| // const addrTxsNaira = await getAddressTransactionsNaira(address, 5); | ||
| // console.log("Address Transactions Naira:", addrTxsNaira); | ||
| // const txsEuro = await getTransactionsEuroWrapper(5); | ||
| // console.log("Transactions Euro:", txsEuro); | ||
| // const addrTxsEuro = await getAddressTransactionsEuro(address, 5); | ||
| // console.log("Address Transactions Euro:", addrTxsEuro); | ||
| // const txsPound = await getTransactionsPoundWrapper(5); | ||
| // console.log("Transactions Pound:", txsPound); | ||
| // const addrTxsPound = await getAddressTransactionsPound(address, 5); | ||
| // console.log("Address Transactions Pound:", addrTxsPound); | ||
| // const txsEGP = await getTransactionsEGPWrapper(5); | ||
| // console.log("Transactions EGP:", txsEGP); | ||
| // const addrTxsEGP = await getAddressTransactionsEGP(address, 5); | ||
| // console.log("Address Transactions EGP:", addrTxsEGP); | ||
| // const txsKSH = await getTransactionsKSHWrapper(5); | ||
| // console.log("Transactions KSH:", txsKSH); | ||
| // const addrTxsKSH = await getAddressTransactionsKSH(address, 5); | ||
| // console.log("Address Transactions KSH:", addrTxsKSH); | ||
| // const txsZAR = await getTransactionsZARWrapper(5); | ||
| // console.log("Transactions ZAR:", txsZAR); | ||
| // const addrTxsZAR = await getAddressTransactionsZAR(address, 5); | ||
| // console.log("Address Transactions ZAR:", addrTxsZAR); | ||
| // const txsETH = await getTransactionsETHWrapper(5); | ||
| // console.log("Transactions ETH:", txsETH); | ||
| // const addrTxsETH = await getAddressTransactionsETH(address, 5); | ||
| // console.log("Address Transactions ETH:", addrTxsETH); | ||
| // const txsRange = await getTransactionsRangeWrapper(0, 10); | ||
| // console.log("Transactions Range:", txsRange); | ||
| // const addrTxsAuth = await getAddressTransactionsAuth(address, 5); | ||
| // console.log("Address Transactions Auth:", addrTxsAuth); | ||
| // const isAddrValid = await isAddressUtil(address); | ||
| // console.log("Is Address Valid:", isAddrValid); | ||
| // // Virtual Wallet | ||
| // const virtualWallet = await createVirtualWallet({ | ||
| // address, | ||
| // payername: "Demo User", | ||
| // currency: Currency.Naira, | ||
| // admin: "0xadminaddress", | ||
| // adminpwd: "adminpassword", | ||
| // }); | ||
| // console.log("Created Virtual Wallet:", virtualWallet); | ||
| // const fetchedVirtualWallet = await fetchVirtualWallet({ | ||
| // virtualwallet: "8900610225", | ||
| // admin: "0xadminaddress", | ||
| // adminpwd: "adminpassword", | ||
| // }); | ||
| // console.log("Fetched Virtual Wallet:", fetchedVirtualWallet); | ||
| // const fetchedVirtualWalletByAddress = await fetchVirtualWalletByAddress({ | ||
| // address, | ||
| // admin: "0xadminaddress", | ||
| // adminpwd: "adminpassword", | ||
| // }); | ||
| // console.log("Fetched Virtual Wallet By Address:", fetchedVirtualWalletByAddress); | ||
| // const updatedVirtualWalletTxs = await updateVirtualWalletTxs({ | ||
| // walletaddress: "8900610225", | ||
| // admin: "0xadminaddress", | ||
| // adminpwd: "adminpassword", | ||
| // }); | ||
| // console.log("Updated Virtual Wallet Transactions:", updatedVirtualWalletTxs); | ||
| } | ||
| main(); |
+1
-1
| { | ||
| "name": "torosdk", | ||
| "version": "0.0.7", | ||
| "version": "0.0.8", | ||
| "description": "A comprehensive Node.js library for interacting with the Toronet blockchain. This package simplifies wallet management, TNS setup, balance queries, fiat deposits, inter-wallet transfers, KYC verification, and smart contract deployment on Toronet's EVM-compatible network. Perfect for developers building blockchain-based applications with Toronet.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
2885384
0.16%102526
0.1%0
-100%