|
@@ -24,6 +24,7 @@ import {
|
|
|
KeyGenInfo,
|
|
|
WorkingGroupModuleName,
|
|
|
ProposalType,
|
|
|
+ FaucetInfo,
|
|
|
} from './types'
|
|
|
|
|
|
import { ProposalParameters } from '@joystream/types/proposals'
|
|
@@ -57,6 +58,9 @@ export class ApiFactory {
|
|
|
// source of funds for all new accounts
|
|
|
private readonly treasuryAccount: string
|
|
|
|
|
|
+ // faucet details
|
|
|
+ public faucetInfo: FaucetInfo
|
|
|
+
|
|
|
public static async create(
|
|
|
provider: WsProvider,
|
|
|
treasuryAccountUri: string,
|
|
@@ -97,12 +101,17 @@ export class ApiFactory {
|
|
|
this.addressesToKeyId = new Map()
|
|
|
this.addressesToSuri = new Map()
|
|
|
this.keyId = 0
|
|
|
+ this.faucetInfo = { suri: '', memberId: 0 }
|
|
|
}
|
|
|
|
|
|
public getApi(label: string): Api {
|
|
|
return new Api(this, this.api, this.treasuryAccount, this.keyring, label)
|
|
|
}
|
|
|
|
|
|
+ public setFaucetInfo(info: FaucetInfo): void {
|
|
|
+ this.faucetInfo = info
|
|
|
+ }
|
|
|
+
|
|
|
public createKeyPairs(n: number): { key: KeyringPair; id: number }[] {
|
|
|
const keys: { key: KeyringPair; id: number }[] = []
|
|
|
for (let i = 0; i < n; i++) {
|
|
@@ -1013,4 +1022,12 @@ export class Api {
|
|
|
accountFrom
|
|
|
)
|
|
|
}
|
|
|
+
|
|
|
+ public setFaucetInfo(info: FaucetInfo): void {
|
|
|
+ this.factory.setFaucetInfo(info)
|
|
|
+ }
|
|
|
+
|
|
|
+ public getFaucetInfo(): FaucetInfo {
|
|
|
+ return this.factory.faucetInfo
|
|
|
+ }
|
|
|
}
|