12.0.0 • Published 10 months ago

@monaco-protocol/client v12.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Monaco Protocol Client

NPM package to interface with the Monaco Protocol program on the Solana network. The Monaco Protocol provides a decentralized liquidity network for wagering on binary-outcome events.

The package opens up the consumer-facing interactions with the protocol to facilitate exchanged-based applications including:

  • Get markets by status/event/wagering token
  • Place orders for markets
  • Cancel orders
  • Get market position for wallets
  • Get wallet token balances

The package does not contain functionality to administer markets on the protocol. Admin functionality will be exposed through a separate package - coming soon.

Getting Started

Examples for working with the client can be found in the Monaco Protocol SDK Examples repository.

Documentation

All endpoints exported by the library contain detailed doc strings and examples confirming to the JSDoc format. These doc strings can be viewed separately in the docs directory.

Supplementary documentation can be accessed from the Monaco Protocol SDK.

Generating Docs

Docs are generated using documentationjs.

npm run generateDocs

Client Response Format

All endpoints in the client return the same response format:

export type ClientResponse<T> = {
  success: boolean;
  errors: object[];
  data: T;
};

Each endpoint defines its own data type used in the response, for example: createOrderUiStake returns Promise<ClientResponse<CreateOrderResponse>>

export type CreateOrderResponse = {
  orderPk: PublicKey;
  tnxID: string | void;
};

Errors

Errors are purposely left loosely typed as an object[] so that the client can remain as agnostic as possible and pass through unfiltered errors regardless of origin.

If any error is encountered during a request, the client will return success: false and data may come back undefined.

12.0.0

10 months ago

12.0.0-rc4

11 months ago

12.0.0-cm-dev

1 year ago

11.2.0

1 year ago

11.2.1

1 year ago

12.0.0-rc1

12 months ago

12.0.0-rc2

12 months ago

12.0.1-cm-dev

1 year ago

12.0.0-rc3

11 months ago

12.0.0-dev

1 year ago

11.2.0-dev

1 year ago

11.1.0

1 year ago

11.1.0-dev

1 year ago

10.0.0

1 year ago

10.0.1

1 year ago

8.0.0

2 years ago

8.0.0-1694616096

2 years ago

9.0.0

2 years ago

7.1.0

2 years ago

6.0.0-rc4

2 years ago

6.0.0-rc1

2 years ago

6.0.0-rc3

2 years ago

7.0.0

2 years ago

5.0.0

2 years ago

6.0.0

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

4.0.0

2 years ago

5.0.0-rc2

2 years ago

3.0.0-rc2

2 years ago

1.2.0

3 years ago

3.0.0-rc1

2 years ago

1.1.5

3 years ago

1.2.1

3 years ago

2.0.0

3 years ago

1.1.1

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.1.0

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago