FAQ
A list of frequently asked questions can be found below. If you still can't find the answer to your question below, please follow up on Discord
Yes, multisig accounts are natively supported. Here is a simple example of how you can set up a multisig account:
// Create 2 accounts
seid keys add ms1
seid keys add ms2
// Create a multisig account requiring the above 2 accounts
seid keys add ms1ms2 --multisig-threshold=2 --multisig=ms1,ms2
For all the Sei provided public nodes, we have set a maximum gas of 300,000. If your contract requires more gas, you will need to set up your own node and rpc url.
Additionally it is important that you run all your smart contracts through rust-optimizer so that your gas is low and your contract is optimized.
import { restoreWallet } from '@sei-js/core';
//Takes an optional account index
const wallet = await restoreWallet(YOUR_SEED_PHRASE, 2);
// Now your wallet can be used with other @sei-js helper functions
const client = await getSigningCosmWasmClient(RPC_URL, wallet);
The "ReferenceError: process is not defined" error often occurs when developing web3 applications that rely on Node.js-specific libraries, such as
process
or Buffer
. This error shows up because web browsers do not natively support these Node.js modules.While the @sei-js package internally handles these discrepancies by including the necessary polyfills, you might encounter this or similar errors due to other third-party libraries not bundling those dependencies. When this happens, you'll have to manually include the required polyfills in your project.
If you are using Vite or rollup you can add the following to the entry point of your app.
import * as process from 'process';
import { Buffer } from 'buffer';
// Polyfill self for browser and global for Node.js
const globalObject = typeof self !== 'undefined' ? self : global;
Object.assign(globalObject, {
process: process,
Buffer: Buffer
});
If you are using Webpack you can use the following plugin in you Webpack config.
yarn add -D node-polyfill-webpack-plugin
import NodePolyfillPlugin from 'node-polyfill-webpack-plugin';
... // the rest of your webpack config
plugins: [
...
new NodePolyfillPlugin(),
...
],
...
Last modified 28d ago