format
This commit is contained in:
parent
50e580cdd4
commit
8a7d13f6ee
|
@ -49,8 +49,6 @@ npm i --save @switchboard-xyz/solana.js
|
|||
|
||||
### Load Switchboard Program
|
||||
|
||||
|
||||
|
||||
```ts
|
||||
import { Connection } from '@solana/web3.js';
|
||||
import {
|
||||
|
@ -65,13 +63,8 @@ const program = await SwitchboardProgram.load(
|
|||
);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
### Create a Queue
|
||||
|
||||
|
||||
|
||||
```ts
|
||||
import { QueueAccount } from '@switchboard-xyz/solana.js';
|
||||
|
||||
|
@ -89,7 +82,3 @@ const [queueAccount, txnSignature] = await QueueAccount.create(program, {
|
|||
});
|
||||
const queue = await queueAccount.loadData();
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -53,8 +53,6 @@ switchboard-v2 = "0.1.23"
|
|||
|
||||
### Read Latest Result
|
||||
|
||||
|
||||
|
||||
```rust
|
||||
use anchor_lang::solana_program::clock;
|
||||
use std::convert::TryInto;
|
||||
|
@ -63,7 +61,7 @@ use switchboard_v2::{AggregatorAccountData, SwitchboardDecimal, SWITCHBOARD_PROG
|
|||
// check feed owner
|
||||
let owner = *aggregator.owner;
|
||||
if owner != SWITCHBOARD_PROGRAM_ID {
|
||||
return Err(error!(ErrorCode::InvalidSwitchboardAccount));
|
||||
return Err(error!(ErrorCode::InvalidSwitchboardAccount));
|
||||
}
|
||||
|
||||
// deserialize account info
|
||||
|
@ -82,4 +80,3 @@ feed.check_confidence_interval(SwitchboardDecimal::from_f64(0.80))?;
|
|||
```
|
||||
|
||||
',
|
||||
|
||||
|
|
Loading…
Reference in New Issue