forked from MonacoProtocol/protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request MonacoProtocol#60 from BetDexLabs/main
merge main into develop
- Loading branch information
Showing
15 changed files
with
208 additions
and
37 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
|
||
### Table of Contents | ||
|
||
* [initialiseOutcome][1] | ||
* [Parameters][2] | ||
* [Examples][3] | ||
* [initialiseOutcomes][4] | ||
* [Parameters][5] | ||
* [Examples][6] | ||
* [findMarketOutcomePda][7] | ||
* [Parameters][8] | ||
* [Examples][9] | ||
* [findNextOutcomePda][10] | ||
* [Parameters][11] | ||
* [Examples][12] | ||
|
||
## initialiseOutcome | ||
|
||
For the given market account, initialise an outcome account for the provided outcome. | ||
|
||
**Note** To add prices to an outcome use `batchAddPricesToOutcomePool`. | ||
|
||
### Parameters | ||
|
||
* `program` **Program** {program} anchor program initialized by the consuming client | ||
* `marketPk` **PublicKey** {PublicKey} publicKey of the market to initialise the outcome for | ||
* `outcome` **[string][13]** {string} string representation of the outcome | ||
|
||
### Examples | ||
|
||
```javascript | ||
const marketPk = new PublicKey('7o1PXyYZtBBDFZf9cEhHopn2C9R4G6GaPwFAxaNWM33D') | ||
const outcome = "Draw" | ||
const initialiseOutcomeRequest = await initialiseOutcome(program, marketPk, outcome) | ||
``` | ||
|
||
Returns **OutcomeInitialisationResponse** the outcome provided, the pda for the outcome account and the transaction ID of the request | ||
|
||
## initialiseOutcomes | ||
|
||
For the given market account, initialise outcome accounts for the provided outcomes | ||
|
||
### Parameters | ||
|
||
* `program` **Program** {program} anchor program initialized by the consuming client | ||
* `marketPk` **PublicKey** {PublicKey} publicKey of the market to initialise the outcome for | ||
* `outcomes` **[Array][14]<[string][13]>** {string\[]} list of strings representing the market outcomes | ||
|
||
### Examples | ||
|
||
```javascript | ||
const marketPk = new PublicKey('7o1PXyYZtBBDFZf9cEhHopn2C9R4G6GaPwFAxaNWM33D') | ||
const outcomes = ["Monaco Protocol", "Draw"] | ||
const initialiseOutcomeRequest = await initialiseOutcomes(program, marketPk, outcomes) | ||
``` | ||
|
||
Returns **OutcomeInitialisationsResponse** list of the outcomes provided, their pdas and the transaction IDs performed in the request | ||
|
||
## findMarketOutcomePda | ||
|
||
For the given market and outcome index, returns the pda for that outcome account | ||
|
||
### Parameters | ||
|
||
* `program` **Program** {program} anchor program initialized by the consuming client | ||
* `marketPk` **PublicKey** {PublicKey} publicKey of the market to initialise the outcome for | ||
* `marketOutcomeIndex` **[number][15]** {number} number representing the index of the outcome | ||
|
||
### Examples | ||
|
||
```javascript | ||
const marketPk = new PublicKey('7o1PXyYZtBBDFZf9cEhHopn2C9R4G6GaPwFAxaNWM33D') | ||
const outcomeIndex = 2 | ||
const outcomePda = await findMarketOutcomePda(program, marketPk, outcomeIndex) | ||
``` | ||
|
||
Returns **FindPdaResponse** pda of the market outcome account | ||
|
||
## findNextOutcomePda | ||
|
||
For the given market, return the pda for the next possible outcome account based off how many outcomes already exist on that market account | ||
|
||
### Parameters | ||
|
||
* `program` **Program** {program} anchor program initialized by the consuming client | ||
* `marketPk` **PublicKey** {PublicKey} publicKey of the market to initialise the outcome for | ||
|
||
### Examples | ||
|
||
```javascript | ||
const marketPk = new PublicKey('7o1PXyYZtBBDFZf9cEhHopn2C9R4G6GaPwFAxaNWM33D') | ||
const outcomeIndex = 2 | ||
const outcomePda = await findNextOutcomePda(program, marketPk) | ||
``` | ||
|
||
Returns **FindPdaResponse** pda of the next possible market outcome account | ||
|
||
[1]: #initialiseoutcome | ||
|
||
[2]: #parameters | ||
|
||
[3]: #examples | ||
|
||
[4]: #initialiseoutcomes | ||
|
||
[5]: #parameters-1 | ||
|
||
[6]: #examples-1 | ||
|
||
[7]: #findmarketoutcomepda | ||
|
||
[8]: #parameters-2 | ||
|
||
[9]: #examples-2 | ||
|
||
[10]: #findnextoutcomepda | ||
|
||
[11]: #parameters-3 | ||
|
||
[12]: #examples-3 | ||
|
||
[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String | ||
|
||
[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array | ||
|
||
[15]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.