moneyfiaptosmockup
v0.1.8
Published
📖 Function Reference
Maintainers
Readme
📖 Function Reference
This SDK provides simple methods to integrate deposit and withdraw flows into your frontend dApp.
🔹 getDepositTxPayload(sender, amount)
Builds a deposit transaction payload to deposit USDC into the MoneyFi strategy.
Parameters
sender → Aptos account address (the user’s wallet)
amount → Deposit amount in smallest unit (for USDC, 1 = 1,000,000 if decimals = 6)
Returns
Transaction payload that can be signed and submitted by the user’s wallet
Frontend Use Case
Call this function when a user wants to deposit
Pass the returned payload to the connected wallet for signing and submission
🔹 getWithdrawTxPayload(sender)
Builds a withdraw transaction payload to withdraw USDC from the MoneyFi strategy.
Parameters
sender → Aptos account address (the user’s wallet)
Returns
Transaction payload that can be signed and submitted by the user’s wallet
Frontend Use Case
Trigger this when a user initiates a withdraw
Pass the returned payload to the wallet for signing and submission
🔹 previewWithdraw(sender)
Provides a read-only preview of how much USDC can be withdrawn by a given account.
Parameters
sender → Aptos account address (the user’s wallet)
Returns
Estimated withdrawable balance
Frontend Use Case
Use this to display withdrawable balances in the UI
Helps users see available funds before actually submitting a withdraw transaction
https://dev.to/mendoza/how-to-build-a-simple-sdk-on-typescript-21gg
npm login #do all the steps necessary npm publish
Upgrade
npm run build npm publish --access public
