@rarible/flow-test-common v0.5.78
Test account
For generating and funding flow accounts we're using flow-js-testing library Usage example for flow emulator.
import { createEmulatorAccount, createFlowEmulator, createTestAuth } from "@rarible/flow-test-common"
import { createFlowSdk } from "@rarible/flow-sdk"
/* Firstly we create an emulator instance that starts and stops flow emulator in before/after test hooks*/
createFlowEmulator(fcl, network, accountAddress, accountPrivateKey, AccountKeyIndex)
const account = createEmulatorAccount("accountNameString") // may be any string
const auth = createTestAuth(fcl, "emulator", account.address, account.pk)
/* then we can create Sdk */
const sdk = createFlowSdk(fcl, "emulator", {}, auth)
For testnet we must create and fund testnet account to create a flow account on the testnet you need to do the following steps:
- Generate keys for account with command
flow keys generate
- Create account with your created public key here
- (Optional) fund your account by FLOW or FUSD tokens if needed here
Now we can create test auth for SDK with account private key and address
import { createTestAuth } from "@rarible/flow-test-common"
import { createFlowSdk } from "@rarible/flow-sdk"
const auth = createTestAuth(fcl, "emulator", account.address, account.pk)
const sdk = createFlowSdk(fcl, "emulator", {}, auth)
3 months ago
4 months ago
4 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
11 months ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago