Install
@starfun/sdk-vault? Every function keeps its name; import from @starfun/sdk/raise instead.
Set up
The examples use a connectedwallet with publicKey and signTransaction.
new BN('25000000'). Read mint.decimals; keep amounts as decimal strings or BN, never floating-point numbers. Users also need SOL for transaction fees and account rent.
Precommit
Refresh the vault before showing an action. Precommits lock funds until conversion or cancellation; users cannot withdraw at will.buildConvertCommitmentTx.
Deposit during the live raise
Number.MAX_SAFE_INTEGER.
Read positions with fetchCommitmentRecord(connection, vaultAddress, wallet.publicKey, programId) and StarVault.fetchDepositorRecord(...) using the same arguments. Their null result can mean a missing account or a read error.
Withdrawals and refunds
An unconverted commitment is withdrawable only after cancellation:claimRefund. After accepted launch allocation, use claimExcessRefund for unclaimed excess:
buildClaimTransaction from the same @starfun/sdk/raise import, or the project’s claim link on Star.
Disable repeat submissions while signing/sending. Refresh the position and fundraise totals after confirmation. If confirmation times out, check the saved signature before submitting another contribution. Test the package in your production browser bundle; its CommonJS dependencies may require bundler configuration.