https://github.com/minterteam/minter-js-web3-sdk
https://github.com/minterteam/minter-js-web3-sdk
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/minterteam/minter-js-web3-sdk
- Owner: MinterTeam
- License: mit
- Created: 2023-04-07T13:23:33.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-17T09:42:24.000Z (almost 2 years ago)
- Last Synced: 2025-10-20T04:51:15.650Z (8 months ago)
- Language: JavaScript
- Size: 325 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# minter-js-web3-sdk
[](https://www.npmjs.org/package/minterjs-util)
[](https://github.com/MinterTeam/minter-js-web3-sdk/blob/master/LICENSE)
Please note that this package is under active development and is subject to change.
## Install
`npm install minter-js-web3-sdk`
## Usage
```js
// - calculation of smart-wallet address
// - methods to build, sign, and broadcast combined tx from multiple internal txs
import useWeb3SmartWallet from 'minter-js-web3-sdk/src/composables/use-web3-smartwallet.js';
// - calculates reward amount (in erc20 tokens or native coin) for relay service
// - build internal txs to swap erc20 token to native coin and send it to relay service as reward
import useWeb3SmartWalletWithRelayReward from 'minter-js-web3-sdk/src/composables/use-web3-smartwallet-relay-reward.js';
// swap tokens via 1inch, makes estimation and build internal swap tx
import useWeb3SmartWalletSwap from 'minter-js-web3-sdk/src/composables/use-web3-smartwallet-swap.js';
```
## Examples
Transfer ERC20 token and pay fee with it
https://github.com/MinterTeam/honee-app-web/blob/dev/components/ActionSendWeb3.vue
Swap via 1inch (spend on Minter and receive on Minter)
https://github.com/MinterTeam/honee-app-web/blob/master/components/ActionSwapWeb3.vue