Strike Docs
Search…
Strike Constructor
Creates an instance of the Strike.js SDK.
  • [provider] (Provider | string) Optional Ethereum network provider. Defaults to Ethers.js fallback mainnet provider.
  • [options] (object) Optional provider options.
  • RETURN (object) Returns an instance of the Strike.js SDK.
1
var strike = new Strike(window.ethereum); // web browser
2
3
var strike = new Strike('http://127.0.0.1:8545'); // HTTP provider
4
5
var strike = new Strike(); // Uses Ethers.js fallback mainnet (for testing only)
6
7
var strike = new Strike('ropsten'); // Uses Ethers.js fallback (for testing only)
8
9
// Init with private key (server side)
10
var strike = new Strike('https://mainnet.infura.io/v3/_your_project_id_', {
11
privateKey: '0x_your_private_key_', // preferably with environment variable
12
});
13
14
// Init with HD mnemonic (server side)
15
var strike = new Strike('mainnet' {
16
mnemonic: 'clutch captain shoe...', // preferably with environment variable
17
});
Copied!
Copy link