Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Network_v2

Hierarchy

Implements

Index

Constructors

Properties

Params: { cancelFee: number; cancelableTime: number; councilAmount: number; disputableTime: number; draftTime: number; mergeCreatorFeeShare: number; oracleExchangeRate: number; percentageNeededForDispute: number } = ...

Type declaration

  • cancelFee: number
  • cancelableTime: number
  • councilAmount: number
  • disputableTime: number
  • draftTime: number
  • mergeCreatorFeeShare: number
  • oracleExchangeRate: number
  • percentageNeededForDispute: number
_governed: Governed
_nftToken: BountyToken
_settlerToken: ERC20
abi: AbiItem[]
contractAddress?: string

Accessors

  • get account(): Account
  • Returns the Account associated with this connection

    Returns Account

  • get settlerToken(): ERC20
  • get web3(): default
  • Returns the Web3 class assigned to this connection

    Returns default

Methods

  • bountiesIndex(): Promise<number>
  • bountyNftUri(): Promise<string>
  • callTx<ReturnData>(method: ContractCallMethod<ReturnData>, value?: any): Promise<ReturnData>
  • cancelBounty(id: number): Promise<TransactionReceipt>
  • cancelFundRequest(id: number): Promise<TransactionReceipt>
  • cancelPullRequest(ofBounty: number, prId: number): Promise<TransactionReceipt>
  • cancelableTime(): Promise<number>
  • canceledBounties(): Promise<number>
  • changeCancelFee(_cancelFee: number): Promise<TransactionReceipt>
  • changeCancelableTime(value: number): Promise<TransactionReceipt>
  • changeCouncilAmount(newAmount: number): Promise<TransactionReceipt>
  • changeDisputableTime(disputableTime: number): Promise<TransactionReceipt>
  • changeDraftTime(_draftTime: number): Promise<TransactionReceipt>
  • changeMergeCreatorFeeShare(mergeCreatorFeeShare: number): Promise<TransactionReceipt>
  • Parameters

    • mergeCreatorFeeShare: number

      percentage is per 10,000; 3 = 0,0003

    Returns Promise<TransactionReceipt>

  • changeOracleExchangeRate(oracleExchangeRate: number): Promise<TransactionReceipt>
  • Parameters

    • oracleExchangeRate: number

      percentage is per 10,000; 3 = 0,0003

    Returns Promise<TransactionReceipt>

  • changePercentageNeededForDispute(percentageNeededForDispute: number): Promise<TransactionReceipt>
  • Parameters

    • percentageNeededForDispute: number

      percentage is per 10,000; 3 = 0,0003

    Returns Promise<TransactionReceipt>

  • cidBountyId(cid: string): Promise<number>
  • closeBounty(id: number, proposalId: number): Promise<TransactionReceipt>
  • close bounty with the selected proposal id

    Parameters

    • id: number
    • proposalId: number

    Returns Promise<TransactionReceipt>

  • closedBounties(): Promise<number>
  • connect(): Promise<boolean>
  • councilAmount(): Promise<number>
  • createBountyProposal(id: number, prId: number, recipients: string[], percentages: number[]): Promise<TransactionReceipt>
  • create a proposal with a pull request for a bounty

    Parameters

    • id: number
    • prId: number
    • recipients: string[]
    • percentages: number[]

    Returns Promise<TransactionReceipt>

  • createPullRequest(forBountyId: number, originRepo: string, originBranch: string, originCID: string, userRepo: string, userBranch: string, cid: number): Promise<TransactionReceipt>
  • create pull request for bounty id

    Parameters

    • forBountyId: number
    • originRepo: string
    • originBranch: string
    • originCID: string
    • userRepo: string
    • userBranch: string
    • cid: number

    Returns Promise<TransactionReceipt>

  • delegateOracles(tokenAmount: number, recipient: string): Promise<TransactionReceipt>
  • Gives oracles from msg.sender to recipient

    Parameters

    • tokenAmount: number
    • recipient: string

    Returns Promise<TransactionReceipt>

  • deploy(deployOptions: DeployOptions, account?: Account): Promise<TransactionReceipt>
  • Deploy the loaded abi contract

    Parameters

    • deployOptions: DeployOptions
    • Optional account: Account

    Returns Promise<TransactionReceipt>

  • deployJsonAbi(_settlerToken: string, _nftTokenAddress: string, _bountyNftUri: string, treasury?: string, cancelFee?: number, closeFee?: number): Promise<TransactionReceipt>
  • Parameters

    • _settlerToken: string
    • _nftTokenAddress: string
    • _bountyNftUri: string
    • treasury: string = nativeZeroAddress
    • cancelFee: number = 0
    • closeFee: number = 0

    Returns Promise<TransactionReceipt>

  • disputableTime(): Promise<number>
  • disputeBountyProposal(bountyId: number, proposalId: number): Promise<TransactionReceipt>
  • dispute a proposal for a bounty

    Parameters

    • bountyId: number
    • proposalId: number

    Returns Promise<TransactionReceipt>

  • disputes(address: string, bountyId: string | number, proposalId: string | number): Promise<number>
  • draftTime(): Promise<number>
  • fundBounty(id: number, fundingAmount: number, decimals?: number): Promise<TransactionReceipt>
  • enable users to fund a bounty

    Parameters

    • id: number
    • fundingAmount: number
    • decimals: number = 18

      decimals of the transactional for this bounty

    Returns Promise<TransactionReceipt>

  • getBountiesOfAddress(_address: string): Promise<number[]>
  • getBounty(id: number): Promise<Bounty>
  • getBountyAmountUpdatedEvents(filter: PastEventOptions): Promise<XEvents<BountyAmountUpdatedEvent>[]>
  • getBountyCanceledEvents(filter: PastEventOptions): Promise<XEvents<BountyCanceledEvent>[]>
  • getBountyClosedEvents(filter: PastEventOptions): Promise<XEvents<BountyClosedEvent>[]>
  • getBountyCreatedEvents(filter: PastEventOptions): Promise<XEvents<BountyCreatedEvent>[]>
  • getBountyFundedEvents(filter: PastEventOptions): Promise<XEvents<GovernorTransferredEvent>[]>
  • getBountyProposalCreatedEvents(filter: PastEventOptions): XPromiseEvent<BountyProposalCreatedEvent>
  • getBountyProposalDisputedEvents(filter: PastEventOptions): XPromiseEvent<BountyProposalDisputedEvent>
  • getBountyProposalRefusedEvents(filter: PastEventOptions): XPromiseEvent<BountyProposalRefusedEvent>
  • getBountyPullRequestCanceledEvents(filter: PastEventOptions): XPromiseEvent<BountyPullRequestCanceledEvent>
  • getBountyPullRequestCreatedEvents(filter: PastEventOptions): XPromiseEvent<BountyPullRequestCreatedEvent>
  • getBountyPullRequestReadyForReviewEvents(filter: PastEventOptions): XPromiseEvent<BountyPullRequestReadyForReviewEvent>
  • getDelegationsOf(address: string): Promise<Delegation[]>
  • getGovernorTransferredEvents(filter: PastEventOptions): Promise<XEvents<GovernorTransferredEvent>[]>
  • getOraclesChangedEvents(filter: PastEventOptions): Promise<XEvents<OraclesChangedEvent>[]>
  • getOraclesOf(_address: string): Promise<number>
  • hardCancel(id: number): Promise<TransactionReceipt>
  • cancels a bounty or a funding request if user is governor or owner and after cancelableTime has passed

    Parameters

    • id: number

      bounty or funding request id

    Returns Promise<TransactionReceipt>

  • isBountyInDraft(bountyId: number): Promise<boolean>
  • A bounty is in Draft when now is earlier than the creation date + draft time

    Parameters

    • bountyId: number

    Returns Promise<boolean>

    boolean

  • isProposalDisputed(bountyId: number, proposalId: number): Promise<boolean>
  • A proposal is disputed if its weight is greater than the percentage needed for dispute

    Parameters

    • bountyId: number
    • proposalId: number

    Returns Promise<boolean>

    boolean

  • loadAbi(): void
  • loadContract(): Promise<void>
  • lock(tokenAmount: number): Promise<TransactionReceipt>
  • Lock given amount into the oracle mapping

    Parameters

    • tokenAmount: number

    Returns Promise<TransactionReceipt>

  • markPullRequestReadyForReview(bountyId: number, pullRequestId: number): Promise<TransactionReceipt>
  • mark a PR ready for review

    Parameters

    • bountyId: number
    • pullRequestId: number

    Returns Promise<TransactionReceipt>

  • mergeCreatorFeeShare(): Promise<number>
  • nftTokenAddress(): Promise<string>
  • openBounties(): Promise<number>
  • openBounty(tokenAmount?: number, transactional?: string, rewardToken?: string, rewardAmount?: number, fundingAmount?: number, cid: string, title: string, repoPath: string, branch: string, githubUser: string): Promise<TransactionReceipt>
  • Creates a bounty on the network You can open a funding-request-bounty by providing rewardToken, rewardAmount, and fundingAmount

    Parameters

    • tokenAmount: number = 0
    • transactional: string = nativeZeroAddress
    • rewardToken: string = nativeZeroAddress
    • rewardAmount: number = 0
    • fundingAmount: number = 0
    • cid: string

      custom id of this bounty

    • title: string

      title for this bounty

    • repoPath: string

      repository path for this bounty

    • branch: string

      branch inside the provided repo path

    • githubUser: string

    Returns Promise<TransactionReceipt>

  • oracleExchangeRate(): Promise<number>
  • oraclesDistributed(): Promise<number>
  • percentageNeededForDispute(): Promise<number>
  • proposerFeeShare(): Promise<number>
  • refuseBountyProposal(bountyId: number, proposalId: number): Promise<TransactionReceipt>
  • retractFunds(id: number, fundingIds: number[]): Promise<TransactionReceipt>
  • enable users to retract their funding

    Parameters

    • id: number
    • fundingIds: number[]

    Returns Promise<TransactionReceipt>

  • sendTx(method: ContractSendMethod, value?: any, debug?: undefined | boolean): Promise<TransactionReceipt>
  • Interact with, or change a value of, a property on the contract

    Parameters

    • method: ContractSendMethod
    • Optional value: any
    • debug: undefined | boolean = ...

    Returns Promise<TransactionReceipt>

  • sendUnsignedTx(method: ContractSendMethod, value?: any, debug?: boolean): Promise<TransactionReceipt>
  • Send unsigned transaction

    Parameters

    • method: ContractSendMethod
    • Optional value: any
    • Optional debug: boolean

    Returns Promise<TransactionReceipt>

  • settlerTokenAddress(): Promise<string>
  • start(): Promise<void>
  • takeBackOracles(entryId: number): Promise<TransactionReceipt>
  • Takes back oracles from the entryId related to msg.sender

    Parameters

    • entryId: number

    Returns Promise<TransactionReceipt>

  • totalSettlerLocked(): Promise<number>
  • treasuryInfo(): Promise<{ cancelFee: number; closeFee: number; treasury: string }>
  • unlock(tokenAmount: number): Promise<TransactionReceipt>
  • updateBountyAmount(id: number, newTokenAmount: number, decimals?: number): Promise<TransactionReceipt>
  • update the value of a bounty with a new amount

    Parameters

    • id: number
    • newTokenAmount: number
    • decimals: number = 18

      decimals of the transactional for this bounty

    Returns Promise<TransactionReceipt>

  • updateTresuryAddress(_address: string): Promise<TransactionReceipt>

Generated using TypeDoc