@ember-finance/sdk 2.0.0-beta.1 → 2.0.0
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/README.md +60 -64
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -1
- package/dist/src/abis/index.js +22 -10
- package/dist/src/api/api.d.ts +2 -2
- package/dist/src/api/api.js +18 -2
- package/dist/src/api/apis/accounts-api.d.ts +9 -9
- package/dist/src/api/apis/accounts-api.js +73 -63
- package/dist/src/api/apis/vaults-api.d.ts +20 -20
- package/dist/src/api/apis/vaults-api.js +140 -130
- package/dist/src/api/base.d.ts +1 -1
- package/dist/src/api/base.js +15 -7
- package/dist/src/api/common.d.ts +2 -2
- package/dist/src/api/common.js +25 -13
- package/dist/src/api/configuration.js +6 -2
- package/dist/src/api/index.d.ts +3 -3
- package/dist/src/api/index.js +19 -3
- package/dist/src/api/models/account-transaction-transaction-data.d.ts +5 -5
- package/dist/src/api/models/account-transaction-transaction-data.js +2 -1
- package/dist/src/api/models/account-transaction.d.ts +1 -1
- package/dist/src/api/models/account-transaction.js +4 -1
- package/dist/src/api/models/account-withdrawal-request.d.ts +2 -2
- package/dist/src/api/models/account-withdrawal-request.js +4 -1
- package/dist/src/api/models/apy-history-v2.d.ts +1 -1
- package/dist/src/api/models/apy-history-v2.js +2 -1
- package/dist/src/api/models/apy-history.js +2 -1
- package/dist/src/api/models/asset.js +2 -1
- package/dist/src/api/models/borrowed.d.ts +1 -1
- package/dist/src/api/models/borrowed.js +2 -1
- package/dist/src/api/models/chain.js +4 -1
- package/dist/src/api/models/coin-price.js +2 -1
- package/dist/src/api/models/deposit-transaction.d.ts +2 -2
- package/dist/src/api/models/deposit-transaction.js +2 -1
- package/dist/src/api/models/ember-position.d.ts +1 -1
- package/dist/src/api/models/ember-position.js +2 -1
- package/dist/src/api/models/exposure-coin.d.ts +1 -1
- package/dist/src/api/models/exposure-coin.js +2 -1
- package/dist/src/api/models/exposure-protocol.d.ts +6 -6
- package/dist/src/api/models/exposure-protocol.js +2 -1
- package/dist/src/api/models/exposure.d.ts +2 -2
- package/dist/src/api/models/exposure.js +2 -1
- package/dist/src/api/models/fee.d.ts +1 -1
- package/dist/src/api/models/fee.js +2 -1
- package/dist/src/api/models/fees.js +2 -1
- package/dist/src/api/models/history-interval.js +4 -1
- package/dist/src/api/models/index.d.ts +78 -78
- package/dist/src/api/models/index.js +94 -78
- package/dist/src/api/models/lp.d.ts +3 -3
- package/dist/src/api/models/lp.js +2 -1
- package/dist/src/api/models/manager.js +2 -1
- package/dist/src/api/models/min-withdrawal-shares-updated-event.js +2 -1
- package/dist/src/api/models/perps.d.ts +1 -1
- package/dist/src/api/models/perps.js +2 -1
- package/dist/src/api/models/pnl-history-interval.js +4 -1
- package/dist/src/api/models/pnl-history.js +2 -1
- package/dist/src/api/models/poc-report-asset.js +2 -1
- package/dist/src/api/models/poc-report-assets.d.ts +1 -1
- package/dist/src/api/models/poc-report-assets.js +2 -1
- package/dist/src/api/models/poc-report-exchange.d.ts +1 -1
- package/dist/src/api/models/poc-report-exchange.js +2 -1
- package/dist/src/api/models/poc-report-exchanges.d.ts +1 -1
- package/dist/src/api/models/poc-report-exchanges.js +2 -1
- package/dist/src/api/models/poc-report-protocol.js +2 -1
- package/dist/src/api/models/poc-report-token.js +2 -1
- package/dist/src/api/models/poc-report-wallet.d.ts +2 -2
- package/dist/src/api/models/poc-report-wallet.js +2 -1
- package/dist/src/api/models/poc-report-wallets.d.ts +1 -1
- package/dist/src/api/models/poc-report-wallets.js +2 -1
- package/dist/src/api/models/position-history-interval.js +4 -1
- package/dist/src/api/models/position-history.js +4 -1
- package/dist/src/api/models/position-value.js +4 -1
- package/dist/src/api/models/position.js +2 -1
- package/dist/src/api/models/process-requests-summary-event.js +2 -1
- package/dist/src/api/models/proof-of-capital-report.d.ts +3 -3
- package/dist/src/api/models/proof-of-capital-report.js +2 -1
- package/dist/src/api/models/protocol-fee-collected-event.js +2 -1
- package/dist/src/api/models/protocol-info.d.ts +3 -3
- package/dist/src/api/models/protocol-info.js +2 -1
- package/dist/src/api/models/protocol.js +2 -1
- package/dist/src/api/models/raw-event-event-data.d.ts +17 -17
- package/dist/src/api/models/raw-event-event-data.js +2 -1
- package/dist/src/api/models/raw-event.d.ts +1 -1
- package/dist/src/api/models/raw-event.js +4 -1
- package/dist/src/api/models/redeem-request-cancelled-transaction.d.ts +2 -2
- package/dist/src/api/models/redeem-request-cancelled-transaction.js +2 -1
- package/dist/src/api/models/redeem-request-processed-transaction.d.ts +2 -2
- package/dist/src/api/models/redeem-request-processed-transaction.js +2 -1
- package/dist/src/api/models/redeem-request-skipped-transaction.d.ts +2 -2
- package/dist/src/api/models/redeem-request-skipped-transaction.js +2 -1
- package/dist/src/api/models/redeem-request-transaction.d.ts +2 -2
- package/dist/src/api/models/redeem-request-transaction.js +2 -1
- package/dist/src/api/models/reported-apy.js +2 -1
- package/dist/src/api/models/request-processed-event.js +2 -1
- package/dist/src/api/models/request-redeemed-event.js +2 -1
- package/dist/src/api/models/reward-token.js +2 -1
- package/dist/src/api/models/reward.d.ts +1 -1
- package/dist/src/api/models/reward.js +2 -1
- package/dist/src/api/models/share-price-history.js +2 -1
- package/dist/src/api/models/strategy-account.d.ts +1 -1
- package/dist/src/api/models/strategy-account.js +2 -1
- package/dist/src/api/models/strategy.js +2 -1
- package/dist/src/api/models/sub-account.d.ts +1 -1
- package/dist/src/api/models/sub-account.js +2 -1
- package/dist/src/api/models/supplied.d.ts +1 -1
- package/dist/src/api/models/supplied.js +2 -1
- package/dist/src/api/models/tag.js +2 -1
- package/dist/src/api/models/tvl-history.js +2 -1
- package/dist/src/api/models/ultra-coin-info.js +2 -1
- package/dist/src/api/models/update-vault-strategies.d.ts +1 -1
- package/dist/src/api/models/update-vault-strategies.js +2 -1
- package/dist/src/api/models/vault-admin-changed-event.js +2 -1
- package/dist/src/api/models/vault-created-event.js +2 -1
- package/dist/src/api/models/vault-deposit-event.js +2 -1
- package/dist/src/api/models/vault-deposit-without-minting-shares-event.js +2 -1
- package/dist/src/api/models/vault-detail.d.ts +7 -7
- package/dist/src/api/models/vault-detail.js +4 -1
- package/dist/src/api/models/vault-fee-percentage-updated-event.js +2 -1
- package/dist/src/api/models/vault-info.js +2 -1
- package/dist/src/api/models/vault-max-tvl-updated-event.js +2 -1
- package/dist/src/api/models/vault-operator-changed-event.js +2 -1
- package/dist/src/api/models/vault-paused-status-updated-event.js +2 -1
- package/dist/src/api/models/vault-platform-fee-charged-event.js +2 -1
- package/dist/src/api/models/vault-protocol.js +2 -1
- package/dist/src/api/models/vault-rate-updated-event.js +2 -1
- package/dist/src/api/models/vault-slice.js +2 -1
- package/dist/src/api/models/vault-sub-account-updated-event.js +2 -1
- package/dist/src/api/models/vault-withdrawal-without-redeeming-shares-event.js +2 -1
- package/dist/src/api/models/vaults-stats.js +2 -1
- package/dist/src/api/models/yield-aggregate-value.js +2 -1
- package/dist/src/api/v2/api.d.ts +2 -2
- package/dist/src/api/v2/api.js +18 -2
- package/dist/src/api/v2/apis/accounts-api.d.ts +9 -9
- package/dist/src/api/v2/apis/accounts-api.js +66 -56
- package/dist/src/api/v2/apis/vaults-api.d.ts +20 -20
- package/dist/src/api/v2/apis/vaults-api.js +124 -114
- package/dist/src/api/v2/base.d.ts +1 -1
- package/dist/src/api/v2/base.js +15 -7
- package/dist/src/api/v2/common.d.ts +2 -2
- package/dist/src/api/v2/common.js +25 -13
- package/dist/src/api/v2/configuration.js +6 -2
- package/dist/src/api/v2/index.d.ts +3 -3
- package/dist/src/api/v2/index.js +19 -3
- package/dist/src/api/v2/models/account-transaction-transaction-data.d.ts +5 -5
- package/dist/src/api/v2/models/account-transaction-transaction-data.js +2 -1
- package/dist/src/api/v2/models/account-transaction.d.ts +1 -1
- package/dist/src/api/v2/models/account-transaction.js +4 -1
- package/dist/src/api/v2/models/account-vault-position-history.js +4 -1
- package/dist/src/api/v2/models/account-withdrawal-request.d.ts +2 -2
- package/dist/src/api/v2/models/account-withdrawal-request.js +4 -1
- package/dist/src/api/v2/models/aggregated-account-position-history.js +4 -1
- package/dist/src/api/v2/models/aggregated-proof-of-capital-report.d.ts +2 -2
- package/dist/src/api/v2/models/aggregated-proof-of-capital-report.js +2 -1
- package/dist/src/api/v2/models/apy-averages.d.ts +1 -1
- package/dist/src/api/v2/models/apy-averages.js +2 -1
- package/dist/src/api/v2/models/apy-history-response.d.ts +1 -1
- package/dist/src/api/v2/models/apy-history-response.js +2 -1
- package/dist/src/api/v2/models/apy-history.js +2 -1
- package/dist/src/api/v2/models/apy-period-average.js +2 -1
- package/dist/src/api/v2/models/asset.js +2 -1
- package/dist/src/api/v2/models/borrowed.d.ts +1 -1
- package/dist/src/api/v2/models/borrowed.js +2 -1
- package/dist/src/api/v2/models/chain-vault-details.d.ts +2 -2
- package/dist/src/api/v2/models/chain-vault-details.js +2 -1
- package/dist/src/api/v2/models/chain.js +4 -1
- package/dist/src/api/v2/models/coin-price.js +2 -1
- package/dist/src/api/v2/models/deposit-transaction.d.ts +2 -2
- package/dist/src/api/v2/models/deposit-transaction.js +2 -1
- package/dist/src/api/v2/models/ember-position.d.ts +1 -1
- package/dist/src/api/v2/models/ember-position.js +2 -1
- package/dist/src/api/v2/models/evm-contracts.d.ts +5 -5
- package/dist/src/api/v2/models/evm-contracts.js +2 -1
- package/dist/src/api/v2/models/evm-deposit-token.js +2 -1
- package/dist/src/api/v2/models/evm-price-feed.js +2 -1
- package/dist/src/api/v2/models/evm-protocol-config.js +2 -1
- package/dist/src/api/v2/models/evm-protocol-info.d.ts +1 -1
- package/dist/src/api/v2/models/evm-protocol-info.js +2 -1
- package/dist/src/api/v2/models/evm-receipt-token.js +2 -1
- package/dist/src/api/v2/models/evm-vault.js +2 -1
- package/dist/src/api/v2/models/exposure-coin.d.ts +1 -1
- package/dist/src/api/v2/models/exposure-coin.js +2 -1
- package/dist/src/api/v2/models/exposure-protocol.d.ts +6 -6
- package/dist/src/api/v2/models/exposure-protocol.js +2 -1
- package/dist/src/api/v2/models/exposure.d.ts +2 -2
- package/dist/src/api/v2/models/exposure.js +2 -1
- package/dist/src/api/v2/models/fee.d.ts +1 -1
- package/dist/src/api/v2/models/fee.js +2 -1
- package/dist/src/api/v2/models/fees.js +2 -1
- package/dist/src/api/v2/models/history-interval.js +4 -1
- package/dist/src/api/v2/models/index.d.ts +100 -100
- package/dist/src/api/v2/models/index.js +116 -100
- package/dist/src/api/v2/models/lp.d.ts +3 -3
- package/dist/src/api/v2/models/lp.js +2 -1
- package/dist/src/api/v2/models/manager.js +2 -1
- package/dist/src/api/v2/models/min-withdrawal-shares-updated-event.js +2 -1
- package/dist/src/api/v2/models/perps.d.ts +1 -1
- package/dist/src/api/v2/models/perps.js +2 -1
- package/dist/src/api/v2/models/pnl-by-chain.js +2 -1
- package/dist/src/api/v2/models/pnl-history-interval.js +4 -1
- package/dist/src/api/v2/models/pnl-history.js +2 -1
- package/dist/src/api/v2/models/poc-report-asset.js +2 -1
- package/dist/src/api/v2/models/poc-report-assets.d.ts +1 -1
- package/dist/src/api/v2/models/poc-report-assets.js +2 -1
- package/dist/src/api/v2/models/poc-report-exchange.d.ts +1 -1
- package/dist/src/api/v2/models/poc-report-exchange.js +2 -1
- package/dist/src/api/v2/models/poc-report-exchanges.d.ts +1 -1
- package/dist/src/api/v2/models/poc-report-exchanges.js +2 -1
- package/dist/src/api/v2/models/poc-report-protocol.js +2 -1
- package/dist/src/api/v2/models/poc-report-token.js +2 -1
- package/dist/src/api/v2/models/poc-report-wallet.d.ts +2 -2
- package/dist/src/api/v2/models/poc-report-wallet.js +2 -1
- package/dist/src/api/v2/models/poc-report-wallets.d.ts +1 -1
- package/dist/src/api/v2/models/poc-report-wallets.js +2 -1
- package/dist/src/api/v2/models/position-history-interval.js +4 -1
- package/dist/src/api/v2/models/position-value.js +4 -1
- package/dist/src/api/v2/models/position.js +2 -1
- package/dist/src/api/v2/models/process-requests-summary-event.js +2 -1
- package/dist/src/api/v2/models/proof-of-capital-report-status.js +4 -1
- package/dist/src/api/v2/models/proof-of-capital-report.d.ts +4 -4
- package/dist/src/api/v2/models/proof-of-capital-report.js +2 -1
- package/dist/src/api/v2/models/protocol-fee-collected-event.js +2 -1
- package/dist/src/api/v2/models/protocol-pnl-history.js +2 -1
- package/dist/src/api/v2/models/protocol-tvl-history.js +2 -1
- package/dist/src/api/v2/models/protocol.js +2 -1
- package/dist/src/api/v2/models/raw-event-event-data.d.ts +17 -17
- package/dist/src/api/v2/models/raw-event-event-data.js +2 -1
- package/dist/src/api/v2/models/raw-event.d.ts +1 -1
- package/dist/src/api/v2/models/raw-event.js +4 -1
- package/dist/src/api/v2/models/redeem-request-cancelled-transaction.d.ts +2 -2
- package/dist/src/api/v2/models/redeem-request-cancelled-transaction.js +2 -1
- package/dist/src/api/v2/models/redeem-request-processed-transaction.d.ts +2 -2
- package/dist/src/api/v2/models/redeem-request-processed-transaction.js +2 -1
- package/dist/src/api/v2/models/redeem-request-skipped-transaction.d.ts +2 -2
- package/dist/src/api/v2/models/redeem-request-skipped-transaction.js +2 -1
- package/dist/src/api/v2/models/redeem-request-transaction.d.ts +2 -2
- package/dist/src/api/v2/models/redeem-request-transaction.js +2 -1
- package/dist/src/api/v2/models/reported-apy.js +2 -1
- package/dist/src/api/v2/models/request-processed-event.js +2 -1
- package/dist/src/api/v2/models/request-redeemed-event.js +2 -1
- package/dist/src/api/v2/models/reward-token.js +2 -1
- package/dist/src/api/v2/models/reward.d.ts +1 -1
- package/dist/src/api/v2/models/reward.js +2 -1
- package/dist/src/api/v2/models/share-price-history.js +2 -1
- package/dist/src/api/v2/models/strategy-account.d.ts +1 -1
- package/dist/src/api/v2/models/strategy-account.js +2 -1
- package/dist/src/api/v2/models/strategy.js +2 -1
- package/dist/src/api/v2/models/sub-account.d.ts +1 -1
- package/dist/src/api/v2/models/sub-account.js +2 -1
- package/dist/src/api/v2/models/sui-protocol-info.d.ts +3 -3
- package/dist/src/api/v2/models/sui-protocol-info.js +2 -1
- package/dist/src/api/v2/models/supplied.d.ts +1 -1
- package/dist/src/api/v2/models/supplied.js +2 -1
- package/dist/src/api/v2/models/tag.js +2 -1
- package/dist/src/api/v2/models/tvl-by-chain.js +2 -1
- package/dist/src/api/v2/models/tvl-history.d.ts +1 -1
- package/dist/src/api/v2/models/tvl-history.js +2 -1
- package/dist/src/api/v2/models/ultra-coin-info.js +2 -1
- package/dist/src/api/v2/models/update-vault-strategies.d.ts +1 -1
- package/dist/src/api/v2/models/update-vault-strategies.js +2 -1
- package/dist/src/api/v2/models/vault-admin-changed-event.js +2 -1
- package/dist/src/api/v2/models/vault-created-event.js +2 -1
- package/dist/src/api/v2/models/vault-deposit-eligibility.js +2 -1
- package/dist/src/api/v2/models/vault-deposit-event.js +2 -1
- package/dist/src/api/v2/models/vault-deposit-without-minting-shares-event.js +2 -1
- package/dist/src/api/v2/models/vault-detail.d.ts +14 -8
- package/dist/src/api/v2/models/vault-detail.js +4 -1
- package/dist/src/api/v2/models/vault-fee-percentage-updated-event.js +2 -1
- package/dist/src/api/v2/models/vault-info.js +2 -1
- package/dist/src/api/v2/models/vault-max-tvl-updated-event.js +2 -1
- package/dist/src/api/v2/models/vault-operator-changed-event.js +2 -1
- package/dist/src/api/v2/models/vault-paused-status-updated-event.js +2 -1
- package/dist/src/api/v2/models/vault-platform-fee-charged-event.js +2 -1
- package/dist/src/api/v2/models/vault-proof-of-capital-summary.d.ts +2 -2
- package/dist/src/api/v2/models/vault-proof-of-capital-summary.js +2 -1
- package/dist/src/api/v2/models/vault-protocol.js +2 -1
- package/dist/src/api/v2/models/vault-rate-updated-event.js +2 -1
- package/dist/src/api/v2/models/vault-slice.js +2 -1
- package/dist/src/api/v2/models/vault-sub-account-updated-event.js +2 -1
- package/dist/src/api/v2/models/vault-tag.js +2 -1
- package/dist/src/api/v2/models/vault-withdrawal-without-redeeming-shares-event.js +2 -1
- package/dist/src/api/v2/models/vaults-deployment-config-config.d.ts +2 -2
- package/dist/src/api/v2/models/vaults-deployment-config-config.js +2 -1
- package/dist/src/api/v2/models/vaults-deployment-config.d.ts +1 -1
- package/dist/src/api/v2/models/vaults-deployment-config.js +4 -1
- package/dist/src/api/v2/models/vaults-stats.js +2 -1
- package/dist/src/api/v2/models/yield-aggregate-value.js +2 -1
- package/dist/src/common/types.js +2 -1
- package/dist/src/ember-vaults.d.ts +17 -17
- package/dist/src/ember-vaults.js +37 -33
- package/dist/src/evm-vaults/index.d.ts +3 -3
- package/dist/src/evm-vaults/index.js +19 -3
- package/dist/src/evm-vaults/interfaces/index.js +2 -1
- package/dist/src/evm-vaults/on-chain-calls/admin.d.ts +3 -3
- package/dist/src/evm-vaults/on-chain-calls/admin.js +6 -2
- package/dist/src/evm-vaults/on-chain-calls/index.d.ts +7 -7
- package/dist/src/evm-vaults/on-chain-calls/index.js +23 -7
- package/dist/src/evm-vaults/on-chain-calls/onchain-calls.d.ts +3 -3
- package/dist/src/evm-vaults/on-chain-calls/onchain-calls.js +13 -9
- package/dist/src/evm-vaults/on-chain-calls/operator.d.ts +3 -3
- package/dist/src/evm-vaults/on-chain-calls/operator.js +6 -2
- package/dist/src/evm-vaults/on-chain-calls/tx-builder.d.ts +3 -3
- package/dist/src/evm-vaults/on-chain-calls/tx-builder.js +41 -34
- package/dist/src/evm-vaults/on-chain-calls/user.d.ts +3 -3
- package/dist/src/evm-vaults/on-chain-calls/user.js +15 -8
- package/dist/src/evm-vaults/on-chain-calls/vault-admin.d.ts +3 -3
- package/dist/src/evm-vaults/on-chain-calls/vault-admin.js +6 -2
- package/dist/src/evm-vaults/on-chain-calls/vault-reader.d.ts +3 -3
- package/dist/src/evm-vaults/on-chain-calls/vault-reader.js +19 -12
- package/dist/src/evm-vaults/utils/deployment-parser.d.ts +1 -1
- package/dist/src/evm-vaults/utils/deployment-parser.js +5 -1
- package/dist/src/evm-vaults/utils/index.d.ts +2 -2
- package/dist/src/evm-vaults/utils/index.js +18 -2
- package/dist/src/evm-vaults/utils/permit-utils.d.ts +2 -2
- package/dist/src/evm-vaults/utils/permit-utils.js +53 -12
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.js +19 -3
- package/dist/src/sui-vaults/index.d.ts +4 -4
- package/dist/src/sui-vaults/index.js +20 -4
- package/dist/src/sui-vaults/interfaces/bcs.js +18 -15
- package/dist/src/sui-vaults/interfaces/index.js +2 -1
- package/dist/src/sui-vaults/on-chain-calls/admin.d.ts +2 -2
- package/dist/src/sui-vaults/on-chain-calls/admin.js +17 -13
- package/dist/src/sui-vaults/on-chain-calls/index.d.ts +6 -6
- package/dist/src/sui-vaults/on-chain-calls/index.js +22 -6
- package/dist/src/sui-vaults/on-chain-calls/onchain-calls.d.ts +3 -3
- package/dist/src/sui-vaults/on-chain-calls/onchain-calls.js +12 -8
- package/dist/src/sui-vaults/on-chain-calls/operator.d.ts +2 -2
- package/dist/src/sui-vaults/on-chain-calls/operator.js +19 -15
- package/dist/src/sui-vaults/on-chain-calls/tx-builder.d.ts +2 -2
- package/dist/src/sui-vaults/on-chain-calls/tx-builder.js +50 -46
- package/dist/src/sui-vaults/on-chain-calls/user.d.ts +2 -2
- package/dist/src/sui-vaults/on-chain-calls/user.js +22 -18
- package/dist/src/sui-vaults/on-chain-calls/vault-admin.d.ts +2 -2
- package/dist/src/sui-vaults/on-chain-calls/vault-admin.js +14 -10
- package/dist/src/sui-vaults/on-chain-calls/vault.d.ts +1 -1
- package/dist/src/sui-vaults/on-chain-calls/vault.js +7 -3
- package/dist/src/sui-vaults/utils/common.js +7 -3
- package/dist/src/sui-vaults/utils/deployment-parser.d.ts +1 -1
- package/dist/src/sui-vaults/utils/deployment-parser.js +5 -1
- package/dist/src/sui-vaults/utils/index.d.ts +2 -2
- package/dist/src/sui-vaults/utils/index.js +18 -2
- package/package.json +14 -24
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TxBuilder = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const library_sui_1 = require("@firefly-exchange/library-sui");
|
|
6
|
+
const utils_2 = require("@mysten/sui/utils");
|
|
7
|
+
class TxBuilder {
|
|
5
8
|
constructor(_deployment) {
|
|
6
|
-
this.parser = new SuiDeploymentParser(_deployment);
|
|
9
|
+
this.parser = new utils_1.SuiDeploymentParser(_deployment);
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
9
12
|
* Updates the deployment configuration
|
|
@@ -19,7 +22,7 @@ export class TxBuilder {
|
|
|
19
22
|
* @returns TransactionBlock
|
|
20
23
|
*/
|
|
21
24
|
pauseNonAdminOperations(pause, options) {
|
|
22
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
25
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
23
26
|
txb.moveCall({
|
|
24
27
|
arguments: [
|
|
25
28
|
txb.object(this.parser.getProtocolConfig()),
|
|
@@ -40,7 +43,7 @@ export class TxBuilder {
|
|
|
40
43
|
* @returns TransactionBlock
|
|
41
44
|
*/
|
|
42
45
|
increaseProtocolVersion(options) {
|
|
43
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
46
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
44
47
|
txb.moveCall({
|
|
45
48
|
arguments: [
|
|
46
49
|
txb.object(this.parser.getProtocolConfig()),
|
|
@@ -61,7 +64,7 @@ export class TxBuilder {
|
|
|
61
64
|
* @returns TransactionBlock
|
|
62
65
|
*/
|
|
63
66
|
updatePlatformFeeRecipient(recipient, options) {
|
|
64
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
67
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
65
68
|
txb.moveCall({
|
|
66
69
|
arguments: [
|
|
67
70
|
txb.object(this.parser.getProtocolConfig()),
|
|
@@ -83,7 +86,7 @@ export class TxBuilder {
|
|
|
83
86
|
* @returns TransactionBlock
|
|
84
87
|
*/
|
|
85
88
|
updateMinRate(minRate, options) {
|
|
86
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
89
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
87
90
|
txb.moveCall({
|
|
88
91
|
arguments: [
|
|
89
92
|
txb.object(this.parser.getProtocolConfig()),
|
|
@@ -105,7 +108,7 @@ export class TxBuilder {
|
|
|
105
108
|
* @returns TransactionBlock
|
|
106
109
|
*/
|
|
107
110
|
updateMaxRate(maxRate, options) {
|
|
108
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
111
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
109
112
|
txb.moveCall({
|
|
110
113
|
arguments: [
|
|
111
114
|
txb.object(this.parser.getProtocolConfig()),
|
|
@@ -127,7 +130,7 @@ export class TxBuilder {
|
|
|
127
130
|
* @returns TransactionBlock
|
|
128
131
|
*/
|
|
129
132
|
updateMaxRateInterval(maxRateInterval, options) {
|
|
130
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
133
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
131
134
|
txb.moveCall({
|
|
132
135
|
arguments: [
|
|
133
136
|
txb.object(this.parser.getProtocolConfig()),
|
|
@@ -149,7 +152,7 @@ export class TxBuilder {
|
|
|
149
152
|
* @returns TransactionBlock
|
|
150
153
|
*/
|
|
151
154
|
updateDefaultRate(defaultRate, options) {
|
|
152
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
155
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
153
156
|
txb.moveCall({
|
|
154
157
|
arguments: [
|
|
155
158
|
txb.object(this.parser.getProtocolConfig()),
|
|
@@ -171,7 +174,7 @@ export class TxBuilder {
|
|
|
171
174
|
* @returns TransactionBlock
|
|
172
175
|
*/
|
|
173
176
|
updateMaxFeePercentage(maxFeePercentage, options) {
|
|
174
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
177
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
175
178
|
txb.moveCall({
|
|
176
179
|
arguments: [
|
|
177
180
|
txb.object(this.parser.getProtocolConfig()),
|
|
@@ -203,7 +206,7 @@ export class TxBuilder {
|
|
|
203
206
|
* @returns TransactionBlock
|
|
204
207
|
*/
|
|
205
208
|
createVault(depositCoinType, receiptCoinType, name, admin, operator, maxRateChangePerUpdate, feePercentage, minWithdrawalShares, rateUpdateInterval, maxTVL, subAccounts, options) {
|
|
206
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
209
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
207
210
|
const receiptTokenTreasuryCap = this.parser.getReceiptCoinTreasuryCap(receiptCoinType);
|
|
208
211
|
txb.moveCall({
|
|
209
212
|
arguments: [
|
|
@@ -237,7 +240,7 @@ export class TxBuilder {
|
|
|
237
240
|
* @returns TransactionBlock
|
|
238
241
|
*/
|
|
239
242
|
updateVaultAdmin(vaultId, admin, options) {
|
|
240
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
243
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
241
244
|
txb.moveCall({
|
|
242
245
|
arguments: [
|
|
243
246
|
txb.object(vaultId),
|
|
@@ -265,7 +268,7 @@ export class TxBuilder {
|
|
|
265
268
|
* @returns TransactionBlock
|
|
266
269
|
*/
|
|
267
270
|
updateVaultPausedStatus(vaultId, paused, options) {
|
|
268
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
271
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
269
272
|
txb.moveCall({
|
|
270
273
|
arguments: [
|
|
271
274
|
txb.object(vaultId),
|
|
@@ -292,7 +295,7 @@ export class TxBuilder {
|
|
|
292
295
|
* @returns TransactionBlock
|
|
293
296
|
*/
|
|
294
297
|
updateVaultOperator(vaultId, operator, options) {
|
|
295
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
298
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
296
299
|
txb.moveCall({
|
|
297
300
|
arguments: [
|
|
298
301
|
txb.object(vaultId),
|
|
@@ -319,7 +322,7 @@ export class TxBuilder {
|
|
|
319
322
|
* @returns TransactionBlock
|
|
320
323
|
*/
|
|
321
324
|
updateVaultMinWithdrawalShares(vaultId, minWithdrawalShares, options) {
|
|
322
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
325
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
323
326
|
txb.moveCall({
|
|
324
327
|
arguments: [
|
|
325
328
|
txb.object(vaultId),
|
|
@@ -343,7 +346,7 @@ export class TxBuilder {
|
|
|
343
346
|
* @returns TransactionBlock
|
|
344
347
|
*/
|
|
345
348
|
setSubAccount(vaultId, subAccount, isActive, options) {
|
|
346
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
349
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
347
350
|
txb.moveCall({
|
|
348
351
|
arguments: [
|
|
349
352
|
txb.object(vaultId),
|
|
@@ -371,7 +374,7 @@ export class TxBuilder {
|
|
|
371
374
|
* @returns TransactionBlock
|
|
372
375
|
*/
|
|
373
376
|
updateVaultMaxTVL(vaultId, maxTVL, options) {
|
|
374
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
377
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
375
378
|
txb.moveCall({
|
|
376
379
|
arguments: [
|
|
377
380
|
txb.object(vaultId),
|
|
@@ -398,7 +401,7 @@ export class TxBuilder {
|
|
|
398
401
|
* @returns TransactionBlock
|
|
399
402
|
*/
|
|
400
403
|
updateVaultRateUpdateInterval(vaultId, rateUpdateInterval, options) {
|
|
401
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
404
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
402
405
|
txb.moveCall({
|
|
403
406
|
arguments: [
|
|
404
407
|
txb.object(vaultId),
|
|
@@ -425,13 +428,13 @@ export class TxBuilder {
|
|
|
425
428
|
* @returns TransactionBlock
|
|
426
429
|
*/
|
|
427
430
|
updateVaultFeePercentage(vaultId, feePercentage, options) {
|
|
428
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
431
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
429
432
|
txb.moveCall({
|
|
430
433
|
arguments: [
|
|
431
434
|
txb.object(vaultId),
|
|
432
435
|
txb.object(this.parser.getProtocolConfig()),
|
|
433
436
|
txb.pure.u64(feePercentage),
|
|
434
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
437
|
+
txb.object(utils_2.SUI_CLOCK_OBJECT_ID)
|
|
435
438
|
],
|
|
436
439
|
typeArguments: [
|
|
437
440
|
this.parser.getDepositCoinType(vaultId),
|
|
@@ -453,7 +456,7 @@ export class TxBuilder {
|
|
|
453
456
|
* @returns TransactionBlock
|
|
454
457
|
*/
|
|
455
458
|
setMinWithdrawalShares(vaultId, minWithdrawalShares, options) {
|
|
456
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
459
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
457
460
|
txb.moveCall({
|
|
458
461
|
arguments: [
|
|
459
462
|
txb.object(vaultId),
|
|
@@ -481,7 +484,7 @@ export class TxBuilder {
|
|
|
481
484
|
* @returns TransactionBlock
|
|
482
485
|
*/
|
|
483
486
|
setBlacklistedAccount(vaultId, account, isBlacklisted, options) {
|
|
484
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
487
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
485
488
|
txb.moveCall({
|
|
486
489
|
arguments: [
|
|
487
490
|
txb.object(vaultId),
|
|
@@ -509,13 +512,13 @@ export class TxBuilder {
|
|
|
509
512
|
* @returns TransactionBlock
|
|
510
513
|
*/
|
|
511
514
|
updateVaultRate(vaultId, rate, options) {
|
|
512
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
515
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
513
516
|
txb.moveCall({
|
|
514
517
|
arguments: [
|
|
515
518
|
txb.object(vaultId),
|
|
516
519
|
txb.object(this.parser.getProtocolConfig()),
|
|
517
520
|
txb.pure.u64(rate),
|
|
518
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
521
|
+
txb.object(utils_2.SUI_CLOCK_OBJECT_ID)
|
|
519
522
|
],
|
|
520
523
|
typeArguments: [
|
|
521
524
|
this.parser.getDepositCoinType(vaultId),
|
|
@@ -538,7 +541,7 @@ export class TxBuilder {
|
|
|
538
541
|
* @returns TransactionBlock
|
|
539
542
|
*/
|
|
540
543
|
depositToVaultWithoutMintingShares(vaultId, subAccount, coinId, options) {
|
|
541
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
544
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
542
545
|
txb.moveCall({
|
|
543
546
|
arguments: [
|
|
544
547
|
txb.object(vaultId),
|
|
@@ -567,7 +570,7 @@ export class TxBuilder {
|
|
|
567
570
|
* @returns TransactionBlock
|
|
568
571
|
*/
|
|
569
572
|
depositToVaultWithoutMintingSharesV2(vaultId, subAccount, coinId, options) {
|
|
570
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
573
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
571
574
|
txb.moveCall({
|
|
572
575
|
arguments: [
|
|
573
576
|
txb.object(vaultId),
|
|
@@ -596,7 +599,7 @@ export class TxBuilder {
|
|
|
596
599
|
* @returns TransactionBlock
|
|
597
600
|
*/
|
|
598
601
|
withdrawFromVaultWithoutRedeemingShares(vaultId, subAccount, amount, options) {
|
|
599
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
602
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
600
603
|
txb.moveCall({
|
|
601
604
|
arguments: [
|
|
602
605
|
txb.object(vaultId),
|
|
@@ -624,13 +627,13 @@ export class TxBuilder {
|
|
|
624
627
|
* @returns TransactionBlock
|
|
625
628
|
*/
|
|
626
629
|
processWithdrawalRequests(vaultId, requestCount, options) {
|
|
627
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
630
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
628
631
|
txb.moveCall({
|
|
629
632
|
arguments: [
|
|
630
633
|
txb.object(vaultId),
|
|
631
634
|
txb.object(this.parser.getProtocolConfig()),
|
|
632
635
|
txb.pure.u64(requestCount),
|
|
633
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
636
|
+
txb.object(utils_2.SUI_CLOCK_OBJECT_ID)
|
|
634
637
|
],
|
|
635
638
|
typeArguments: [
|
|
636
639
|
this.parser.getDepositCoinType(vaultId),
|
|
@@ -652,13 +655,13 @@ export class TxBuilder {
|
|
|
652
655
|
* @returns TransactionBlock
|
|
653
656
|
*/
|
|
654
657
|
processWithdrawalRequestsUpToTimestamp(vaultId, timestamp, options) {
|
|
655
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
658
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
656
659
|
txb.moveCall({
|
|
657
660
|
arguments: [
|
|
658
661
|
txb.object(vaultId),
|
|
659
662
|
txb.object(this.parser.getProtocolConfig()),
|
|
660
663
|
txb.pure.u64(timestamp),
|
|
661
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
664
|
+
txb.object(utils_2.SUI_CLOCK_OBJECT_ID)
|
|
662
665
|
],
|
|
663
666
|
typeArguments: [
|
|
664
667
|
this.parser.getDepositCoinType(vaultId),
|
|
@@ -679,12 +682,12 @@ export class TxBuilder {
|
|
|
679
682
|
* @returns TransactionBlock
|
|
680
683
|
*/
|
|
681
684
|
chargePlatformFee(vaultId, options) {
|
|
682
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
685
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
683
686
|
txb.moveCall({
|
|
684
687
|
arguments: [
|
|
685
688
|
txb.object(vaultId),
|
|
686
689
|
txb.object(this.parser.getProtocolConfig()),
|
|
687
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
690
|
+
txb.object(utils_2.SUI_CLOCK_OBJECT_ID)
|
|
688
691
|
],
|
|
689
692
|
typeArguments: [
|
|
690
693
|
this.parser.getDepositCoinType(vaultId),
|
|
@@ -705,7 +708,7 @@ export class TxBuilder {
|
|
|
705
708
|
* @returns TransactionBlock
|
|
706
709
|
*/
|
|
707
710
|
collectPlatformFee(vaultId, options) {
|
|
708
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
711
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
709
712
|
txb.moveCall({
|
|
710
713
|
arguments: [txb.object(vaultId), txb.object(this.parser.getProtocolConfig())],
|
|
711
714
|
typeArguments: [
|
|
@@ -729,7 +732,7 @@ export class TxBuilder {
|
|
|
729
732
|
* @returns TransactionBlock
|
|
730
733
|
*/
|
|
731
734
|
depositAsset(vaultId, coinId, minSharesToMint, receiver, options) {
|
|
732
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
735
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
733
736
|
txb.moveCall({
|
|
734
737
|
arguments: [
|
|
735
738
|
txb.object(vaultId),
|
|
@@ -737,7 +740,7 @@ export class TxBuilder {
|
|
|
737
740
|
txb.object(coinId),
|
|
738
741
|
txb.pure.u64(minSharesToMint),
|
|
739
742
|
txb.pure.vector("address", [receiver]),
|
|
740
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
743
|
+
txb.object(utils_2.SUI_CLOCK_OBJECT_ID)
|
|
741
744
|
],
|
|
742
745
|
typeArguments: [
|
|
743
746
|
this.parser.getDepositCoinType(vaultId),
|
|
@@ -760,7 +763,7 @@ export class TxBuilder {
|
|
|
760
763
|
* @returns TransactionBlock
|
|
761
764
|
*/
|
|
762
765
|
depositAssetInternal(vaultId, coinId, minSharesToMint, options) {
|
|
763
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
766
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
764
767
|
const balance = txb.moveCall({
|
|
765
768
|
target: `0x2::coin::into_balance`,
|
|
766
769
|
typeArguments: [this.parser.getDepositCoinType(vaultId)],
|
|
@@ -772,7 +775,7 @@ export class TxBuilder {
|
|
|
772
775
|
txb.object(this.parser.getProtocolConfig()),
|
|
773
776
|
txb.object(balance),
|
|
774
777
|
txb.pure.u64(minSharesToMint),
|
|
775
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
778
|
+
txb.object(utils_2.SUI_CLOCK_OBJECT_ID)
|
|
776
779
|
],
|
|
777
780
|
typeArguments: [
|
|
778
781
|
this.parser.getDepositCoinType(vaultId),
|
|
@@ -799,7 +802,7 @@ export class TxBuilder {
|
|
|
799
802
|
* @returns TransactionBlock
|
|
800
803
|
*/
|
|
801
804
|
mintShares(vaultId, coinId, shares, maxAmountToDeposit, receiver, options) {
|
|
802
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
805
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
803
806
|
txb.moveCall({
|
|
804
807
|
arguments: [
|
|
805
808
|
txb.object(vaultId),
|
|
@@ -808,7 +811,7 @@ export class TxBuilder {
|
|
|
808
811
|
txb.pure.u64(shares),
|
|
809
812
|
txb.pure.u64(maxAmountToDeposit),
|
|
810
813
|
txb.pure.vector("address", [receiver]),
|
|
811
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
814
|
+
txb.object(utils_2.SUI_CLOCK_OBJECT_ID)
|
|
812
815
|
],
|
|
813
816
|
typeArguments: [
|
|
814
817
|
this.parser.getDepositCoinType(vaultId),
|
|
@@ -831,10 +834,10 @@ export class TxBuilder {
|
|
|
831
834
|
* @returns TransactionBlock
|
|
832
835
|
*/
|
|
833
836
|
redeemShares(vaultId, sharesCoinId, receiver, options) {
|
|
834
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
837
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
835
838
|
txb.moveCall({
|
|
836
839
|
arguments: [
|
|
837
|
-
txb.object(SUI_CLOCK_OBJECT_ID),
|
|
840
|
+
txb.object(utils_2.SUI_CLOCK_OBJECT_ID),
|
|
838
841
|
txb.object(vaultId),
|
|
839
842
|
txb.object(this.parser.getProtocolConfig()),
|
|
840
843
|
txb.object(sharesCoinId),
|
|
@@ -860,7 +863,7 @@ export class TxBuilder {
|
|
|
860
863
|
* @returns TransactionBlock
|
|
861
864
|
*/
|
|
862
865
|
cancelPendingWithdrawalRequest(vaultId, sequenceNumber, options) {
|
|
863
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
866
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
864
867
|
txb.moveCall({
|
|
865
868
|
arguments: [
|
|
866
869
|
txb.object(vaultId),
|
|
@@ -880,3 +883,4 @@ export class TxBuilder {
|
|
|
880
883
|
return txb;
|
|
881
884
|
}
|
|
882
885
|
}
|
|
886
|
+
exports.TxBuilder = TxBuilder;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OnChainCalls } from "./onchain-calls
|
|
2
|
-
import { ISuiDeployment, IVaultOptionalParams } from "../interfaces
|
|
1
|
+
import { OnChainCalls } from "./onchain-calls";
|
|
2
|
+
import { ISuiDeployment, IVaultOptionalParams } from "../interfaces";
|
|
3
3
|
import { OnChainCallResponse, Signer, SuiAddress, SuiClient, SuiTransactionBlockResponseOptions, NumStr } from "@firefly-exchange/library-sui";
|
|
4
4
|
import { TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
5
5
|
export declare class UserCalls extends OnChainCalls {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserCalls = void 0;
|
|
4
|
+
const onchain_calls_1 = require("./onchain-calls");
|
|
5
|
+
const library_sui_1 = require("@firefly-exchange/library-sui");
|
|
6
|
+
const vault_1 = require("./vault");
|
|
7
|
+
class UserCalls extends onchain_calls_1.OnChainCalls {
|
|
5
8
|
constructor(_network, _suiClient, _deployment, _signer, _walletAddress, _isUIWallet) {
|
|
6
9
|
super(_network, _suiClient, _deployment, _signer, _walletAddress, _isUIWallet);
|
|
7
10
|
}
|
|
@@ -14,16 +17,16 @@ export class UserCalls extends OnChainCalls {
|
|
|
14
17
|
*/
|
|
15
18
|
async depositAsset(vaultId, amount, minSharesToMint, options) {
|
|
16
19
|
let coinId = options?.coinId;
|
|
17
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
20
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
18
21
|
let split;
|
|
19
22
|
let merged;
|
|
20
23
|
if (!coinId) {
|
|
21
24
|
const coinType = this.parser.getDepositCoinType(vaultId);
|
|
22
|
-
[split, merged] = await CoinUtils.createCoinWithBalance(this.suiClient, txb, bigNumber(amount).toFixed(0), coinType, this.walletAddress);
|
|
25
|
+
[split, merged] = await library_sui_1.CoinUtils.createCoinWithBalance(this.suiClient, txb, (0, library_sui_1.bigNumber)(amount).toFixed(0), coinType, this.walletAddress);
|
|
23
26
|
coinId = split;
|
|
24
27
|
}
|
|
25
28
|
else {
|
|
26
|
-
[split, merged] = await CoinUtils.validateCoinBalance(this.suiClient, txb, bigNumber(amount).toFixed(0), coinId);
|
|
29
|
+
[split, merged] = await library_sui_1.CoinUtils.validateCoinBalance(this.suiClient, txb, (0, library_sui_1.bigNumber)(amount).toFixed(0), coinId);
|
|
27
30
|
coinId = split;
|
|
28
31
|
}
|
|
29
32
|
this.txBuilder.depositAsset(vaultId, coinId, minSharesToMint, options?.receiver || this.walletAddress, { ...options, txBlock: txb });
|
|
@@ -41,7 +44,7 @@ export class UserCalls extends OnChainCalls {
|
|
|
41
44
|
* @returns OnChainCallResponse
|
|
42
45
|
*/
|
|
43
46
|
async depositAssetInternal(vaultId, coinId, sender, minSharesToMint, options) {
|
|
44
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
47
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
45
48
|
this.txBuilder.depositAssetInternal(vaultId, coinId, minSharesToMint, {
|
|
46
49
|
...options,
|
|
47
50
|
txBlock: txb,
|
|
@@ -59,21 +62,21 @@ export class UserCalls extends OnChainCalls {
|
|
|
59
62
|
*/
|
|
60
63
|
async mintShares(vaultId, numberOfShares, options) {
|
|
61
64
|
let coinId = options?.coinId;
|
|
62
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
63
|
-
const vaultRate = await Vault.getVaultRate(this.suiClient, vaultId);
|
|
64
|
-
const vaultRateBN = bigNumber(vaultRate).shiftedBy(-SUI_NATIVE_BASE);
|
|
65
|
-
const assetAmountRequired = bigNumber(numberOfShares)
|
|
65
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
66
|
+
const vaultRate = await vault_1.Vault.getVaultRate(this.suiClient, vaultId);
|
|
67
|
+
const vaultRateBN = (0, library_sui_1.bigNumber)(vaultRate).shiftedBy(-library_sui_1.SUI_NATIVE_BASE);
|
|
68
|
+
const assetAmountRequired = (0, library_sui_1.bigNumber)(numberOfShares)
|
|
66
69
|
.multipliedBy(vaultRateBN)
|
|
67
70
|
.toFixed(0);
|
|
68
71
|
let split;
|
|
69
72
|
let merged;
|
|
70
73
|
if (!coinId) {
|
|
71
74
|
const coinType = this.parser.getDepositCoinType(vaultId);
|
|
72
|
-
[split, merged] = await CoinUtils.createCoinWithBalance(this.suiClient, txb, assetAmountRequired, coinType, this.walletAddress);
|
|
75
|
+
[split, merged] = await library_sui_1.CoinUtils.createCoinWithBalance(this.suiClient, txb, assetAmountRequired, coinType, this.walletAddress);
|
|
73
76
|
coinId = split;
|
|
74
77
|
}
|
|
75
78
|
else {
|
|
76
|
-
[split, merged] = await CoinUtils.validateCoinBalance(this.suiClient, txb, assetAmountRequired, coinId);
|
|
79
|
+
[split, merged] = await library_sui_1.CoinUtils.validateCoinBalance(this.suiClient, txb, assetAmountRequired, coinId);
|
|
77
80
|
coinId = split;
|
|
78
81
|
}
|
|
79
82
|
this.txBuilder.mintShares(vaultId, coinId, numberOfShares, assetAmountRequired, options?.receiver || this.walletAddress, { ...options, txBlock: txb });
|
|
@@ -91,16 +94,16 @@ export class UserCalls extends OnChainCalls {
|
|
|
91
94
|
*/
|
|
92
95
|
async redeemShares(vaultId, amountOfShares, options) {
|
|
93
96
|
let coinId = options?.coinId;
|
|
94
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
97
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
95
98
|
let merged;
|
|
96
99
|
let split;
|
|
97
100
|
if (!coinId) {
|
|
98
101
|
const coinType = this.parser.getReceiptCoinType(vaultId);
|
|
99
|
-
[split, merged] = await CoinUtils.createCoinWithBalance(this.suiClient, txb, bigNumber(amountOfShares).toFixed(0), coinType, this.walletAddress);
|
|
102
|
+
[split, merged] = await library_sui_1.CoinUtils.createCoinWithBalance(this.suiClient, txb, (0, library_sui_1.bigNumber)(amountOfShares).toFixed(0), coinType, this.walletAddress);
|
|
100
103
|
coinId = split;
|
|
101
104
|
}
|
|
102
105
|
else {
|
|
103
|
-
[split, merged] = await CoinUtils.validateCoinBalance(this.suiClient, txb, bigNumber(amountOfShares).toFixed(0), coinId);
|
|
106
|
+
[split, merged] = await library_sui_1.CoinUtils.validateCoinBalance(this.suiClient, txb, (0, library_sui_1.bigNumber)(amountOfShares).toFixed(0), coinId);
|
|
104
107
|
coinId = split;
|
|
105
108
|
}
|
|
106
109
|
this.txBuilder.redeemShares(vaultId, coinId, options?.receiver || this.walletAddress, { ...options, txBlock: txb });
|
|
@@ -117,7 +120,7 @@ export class UserCalls extends OnChainCalls {
|
|
|
117
120
|
* @returns OnChainCallResponse
|
|
118
121
|
*/
|
|
119
122
|
async cancelPendingWithdrawalRequest(vaultId, sequenceNumber, options) {
|
|
120
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
123
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
121
124
|
this.txBuilder.cancelPendingWithdrawalRequest(vaultId, sequenceNumber, {
|
|
122
125
|
...options,
|
|
123
126
|
txBlock: txb
|
|
@@ -125,3 +128,4 @@ export class UserCalls extends OnChainCalls {
|
|
|
125
128
|
return this.execCall(txb, options);
|
|
126
129
|
}
|
|
127
130
|
}
|
|
131
|
+
exports.UserCalls = UserCalls;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OnChainCalls } from "./onchain-calls
|
|
2
|
-
import { ISuiDeployment, IVaultOptionalParams } from "../interfaces
|
|
1
|
+
import { OnChainCalls } from "./onchain-calls";
|
|
2
|
+
import { ISuiDeployment, IVaultOptionalParams } from "../interfaces";
|
|
3
3
|
import { NumStr } from "@firefly-exchange/library-sui";
|
|
4
4
|
import { OnChainCallResponse, Signer, SuiClient, SuiTransactionBlockResponseOptions } from "@firefly-exchange/library-sui";
|
|
5
5
|
export declare class VaultAdminCalls extends OnChainCalls {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VaultAdminCalls = void 0;
|
|
4
|
+
const onchain_calls_1 = require("./onchain-calls");
|
|
5
|
+
const library_sui_1 = require("@firefly-exchange/library-sui");
|
|
6
|
+
class VaultAdminCalls extends onchain_calls_1.OnChainCalls {
|
|
4
7
|
constructor(_network, _suiClient, _deployment, _signer, _walletAddress) {
|
|
5
8
|
super(_network, _suiClient, _deployment, _signer, _walletAddress);
|
|
6
9
|
}
|
|
@@ -12,7 +15,7 @@ export class VaultAdminCalls extends OnChainCalls {
|
|
|
12
15
|
* @returns OnChainCallResponse
|
|
13
16
|
*/
|
|
14
17
|
async setMinWithdrawalShares(vaultId, minWithdrawalShares, options) {
|
|
15
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
18
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
16
19
|
this.txBuilder.setMinWithdrawalShares(vaultId, minWithdrawalShares, {
|
|
17
20
|
...options,
|
|
18
21
|
txBlock: txb
|
|
@@ -27,7 +30,7 @@ export class VaultAdminCalls extends OnChainCalls {
|
|
|
27
30
|
* @returns OnChainCallResponse
|
|
28
31
|
*/
|
|
29
32
|
async updateVaultFeePercentage(vaultId, feePercentage, options) {
|
|
30
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
33
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
31
34
|
this.txBuilder.updateVaultFeePercentage(vaultId, feePercentage, {
|
|
32
35
|
...options,
|
|
33
36
|
txBlock: txb
|
|
@@ -43,7 +46,7 @@ export class VaultAdminCalls extends OnChainCalls {
|
|
|
43
46
|
* @returns OnChainCallResponse
|
|
44
47
|
*/
|
|
45
48
|
async setSubAccount(vaultId, subAccount, isSubAccount, options) {
|
|
46
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
49
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
47
50
|
this.txBuilder.setSubAccount(vaultId, subAccount, isSubAccount, {
|
|
48
51
|
...options,
|
|
49
52
|
txBlock: txb
|
|
@@ -58,7 +61,7 @@ export class VaultAdminCalls extends OnChainCalls {
|
|
|
58
61
|
* @returns OnChainCallResponse
|
|
59
62
|
*/
|
|
60
63
|
async updateVaultOperator(vaultId, operator, options) {
|
|
61
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
64
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
62
65
|
this.txBuilder.updateVaultOperator(vaultId, operator, {
|
|
63
66
|
...options,
|
|
64
67
|
txBlock: txb
|
|
@@ -73,7 +76,7 @@ export class VaultAdminCalls extends OnChainCalls {
|
|
|
73
76
|
* @returns OnChainCallResponse
|
|
74
77
|
*/
|
|
75
78
|
async updateVaultPausedStatus(vaultId, paused, options) {
|
|
76
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
79
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
77
80
|
this.txBuilder.updateVaultPausedStatus(vaultId, paused, {
|
|
78
81
|
...options,
|
|
79
82
|
txBlock: txb
|
|
@@ -88,7 +91,7 @@ export class VaultAdminCalls extends OnChainCalls {
|
|
|
88
91
|
* @returns OnChainCallResponse
|
|
89
92
|
*/
|
|
90
93
|
async updateVaultRateUpdateInterval(vaultId, rateUpdateInterval, options) {
|
|
91
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
94
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
92
95
|
this.txBuilder.updateVaultRateUpdateInterval(vaultId, rateUpdateInterval, {
|
|
93
96
|
...options,
|
|
94
97
|
txBlock: txb
|
|
@@ -103,8 +106,9 @@ export class VaultAdminCalls extends OnChainCalls {
|
|
|
103
106
|
* @returns OnChainCallResponse
|
|
104
107
|
*/
|
|
105
108
|
async updateVaultMaxTVL(vaultId, maxTVL, options) {
|
|
106
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
109
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
107
110
|
this.txBuilder.updateVaultMaxTVL(vaultId, maxTVL, { ...options, txBlock: txb });
|
|
108
111
|
return this.execCall(txb, options);
|
|
109
112
|
}
|
|
110
113
|
}
|
|
114
|
+
exports.VaultAdminCalls = VaultAdminCalls;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Vault = void 0;
|
|
4
|
+
const bcs_1 = require("../interfaces/bcs");
|
|
5
|
+
class Vault {
|
|
3
6
|
/**
|
|
4
7
|
* Fetches the vault rate from on-chain
|
|
5
8
|
* @param suiClient Sui Client
|
|
@@ -90,7 +93,7 @@ export class Vault {
|
|
|
90
93
|
}
|
|
91
94
|
static async signUpdateVaultStrategyRequest(payload, signer) {
|
|
92
95
|
const now = Date.now();
|
|
93
|
-
const bcsPayload = BcsUpdateVaultStrategyRequest.serialize({
|
|
96
|
+
const bcsPayload = bcs_1.BcsUpdateVaultStrategyRequest.serialize({
|
|
94
97
|
vaultId: payload.vaultId,
|
|
95
98
|
strategies: payload.strategies,
|
|
96
99
|
targetApyE9: payload.targetApyE9,
|
|
@@ -113,3 +116,4 @@ export class Vault {
|
|
|
113
116
|
};
|
|
114
117
|
}
|
|
115
118
|
}
|
|
119
|
+
exports.Vault = Vault;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTxBytes = void 0;
|
|
4
|
+
const utils_1 = require("@mysten/sui/utils");
|
|
5
|
+
const getTxBytes = async (tx, client) => {
|
|
6
|
+
return (0, utils_1.toBase64)(await tx.build({ client: client, onlyTransactionKind: false }));
|
|
4
7
|
};
|
|
8
|
+
exports.getTxBytes = getTxBytes;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SuiDeploymentParser = void 0;
|
|
4
|
+
class SuiDeploymentParser {
|
|
2
5
|
constructor(_deployment) {
|
|
3
6
|
this.deployment = _deployment;
|
|
4
7
|
}
|
|
@@ -50,3 +53,4 @@ export class SuiDeploymentParser {
|
|
|
50
53
|
return vault.DepositCoinDecimals;
|
|
51
54
|
}
|
|
52
55
|
}
|
|
56
|
+
exports.SuiDeploymentParser = SuiDeploymentParser;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./deployment-parser
|
|
2
|
-
export * from "./common
|
|
1
|
+
export * from "./deployment-parser";
|
|
2
|
+
export * from "./common";
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./deployment-parser"), exports);
|
|
18
|
+
__exportStar(require("./common"), exports);
|