Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahschwartz committed Apr 29, 2024
1 parent 28ca45e commit 3a30703
Show file tree
Hide file tree
Showing 17 changed files with 111 additions and 122 deletions.
4 changes: 2 additions & 2 deletions docs/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ The playground is an interactive and graphical IDE that includes a reference for

You can test out the Fuel GraphQL API playground here:

https://beta-5.fuel.network/playground
https://testnet.fuel.network/v1/playground

## RPC Endpoint

https://beta-5.fuel.network/graphql
https://testnet.fuel.network/v1/graphql
49 changes: 49 additions & 0 deletions docs/reference/enums.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,34 @@ category: Reference

# Enums

## `ConsensusParametersVersion`

The version of the consensus parameters.

`V1`:
Version 1.

## `ContractParametersVersion`

The version of the contract-specific consensus parameters.

`V1`:
Version 1.

## `FeeParametersVersion`

The version of the fee-specific consensus parameters.

`V1`:
Version 1.

## `GasCostsVersion`

The version of the gas-specific consensus parameters.

`V1`:
Version 1.

## `MessageState`

The state of a message, either `UNSPENT`, `SPENT`, or `NOT_FOUND`.
Expand Down Expand Up @@ -61,6 +89,13 @@ The receipt was generated from a mint.
`BURN`:
The receipt was generated from a burn.

## `PredicateParametersVersion`

The version of the predicate-specific consensus parameters.

`V1`:
Version 1.

## `ReturnType`

The type of return response for a transaction
Expand All @@ -83,3 +118,17 @@ All breakpoints have been processed, and the program has terminated.

`BREAKPOINT`:
The program stopped on a breakpoint.

## `ScriptParametersVersion`

The version of the script-specific consensus parameters.

`V1`:
Version 1.

## `TxParametersVersion`

The version of the transaction-specific consensus parameters.

`V1`:
Version 1.
10 changes: 1 addition & 9 deletions docs/reference/objects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Information about the base chain. At a very high level `chainInfo` helps you und

`name`: `String!`

The human-readable string name of the chain. i.e. `beta-5`.
The human-readable string name of the chain. i.e. `Upgradable Testnet`.

`latestBlock`: [`Block!`](#block)

Expand Down Expand Up @@ -1775,11 +1775,3 @@ The amount of coins in the output.
`assetId`: [`AssetId`](/docs/reference/scalars/#assetid)

The asset id for the coins sent.

## `Version`

The version of the consensus parameters.

**fields:**

`value`: [`U8`](/docs/reference/scalars/#u8)
4 changes: 0 additions & 4 deletions docs/reference/scalars.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ A unique 32 byte hash identifier for a transaction.

The location of the transaction in the block. It can be used by UTXOs as a reference to the transaction or by the transaction itself to make it unique.

## `U8`

Unsigned 8 bit integer.

## `U16`

Unsigned 16 bit integer.
Expand Down
56 changes: 0 additions & 56 deletions docs/reference/unions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,6 @@ The type of consensus mechanism used to validate a block.
[`PoAConsensus`](/docs/reference/objects/#poaconsensus): PoA
consensus

## `ConsensusParametersVersion`

The version of the consensus parameters.

**Types:**

[`Version`](/docs/reference/objects/#version): The version of the consensus parameters.

## `ContractParametersVersion`

The version of the contract-specific consensus parameters.

**Types:**

[`Version`](/docs/reference/objects/#version): The version of the contract-specific consensus parameters.

## `DependentCost`

Contains the dependent cost of opcodes.
Expand All @@ -62,22 +46,6 @@ The status of a transaction dry run.

[`DryRunFailureStatus`](/docs/reference/objects/#dryrunfailurestatus): The transaction dry run failed.

## `FeeParametersVersion`

The version of the fee-specific consensus parameters.

**Types:**

[`Version`](/docs/reference/objects/#version): The version of the consensus parameters.

## `GasCostsVersion`

The version of the gas-specific consensus parameters.

**Types:**

[`Version`](/docs/reference/objects/#version): The version of the consensus parameters.

## `Input`

An input type for a transaction.
Expand Down Expand Up @@ -120,22 +88,6 @@ they could be set to a non-zero value.
[`ContractCreated`](/docs/reference/objects/#contractcreated):
Indicates a contract was deployed.

## `PredicateParametersVersion`

The version of the predicate-specific consensus parameters.

**Types:**

[`Version`](/docs/reference/objects/#version): The version of the consensus parameters.

## `ScriptParametersVersion`

The version of the script-specific consensus parameters.

**Types:**

[`Version`](/docs/reference/objects/#version): The version of the consensus parameters.

## `TransactionStatus`

The status type of a transaction.
Expand All @@ -149,11 +101,3 @@ The status type of a transaction.
[`SqueezedOutStatus`](/docs/reference/objects/#squeezedoutstatus): The transaction was kicked out of the mempool.

[`FailureStatus`](/docs/reference/objects/#failurestatus): The transaction has failed.

## `TxParametersVersion`

The version of the transaction-specific consensus parameters.

**Types:**

[`Version`](/docs/reference/objects/#version): The version of the consensus parameters.
4 changes: 3 additions & 1 deletion examples/ContractBalances.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ import { CONTRACT_BALANCES_ARGS, CONTRACT_BALANCES_QUERY } from './queries';
import { Query } from './query';

export function ContractBalances() {
return <Query query={CONTRACT_BALANCES_QUERY} args={CONTRACT_BALANCES_ARGS} />;
return (
<Query query={CONTRACT_BALANCES_QUERY} args={CONTRACT_BALANCES_ARGS} />
);
}
51 changes: 22 additions & 29 deletions examples/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ export const BALANCE_QUERY = `query Balance($address: Address, $assetId: AssetId
}`;

export const BALANCE_ARGS = {
address:
'0xf65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871',
assetId:
'0x0000000000000000000000000000000000000000000000000000000000000000',
address: '0xf65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871',
assetId: '0x0000000000000000000000000000000000000000000000000000000000000000',
};

export const BALANCES_QUERY = `query Balances($filter: BalanceFilterInput) {
Expand All @@ -23,35 +21,33 @@ export const BALANCES_QUERY = `query Balances($filter: BalanceFilterInput) {
}`;

export const BALANCES_ARGS = {
filter: {
owner:
'0xf65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871',
},
};
filter: {
owner: '0xf65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871',
},
};

export const BLOCK_BY_HEIGHT_QUERY = `query Block($height: U64) {
block(height: $height) {
id
}
}`;

export const BLOCK_BY_HEIGHT_ARGS = {
height: '3412',
};
export const BLOCK_BY_HEIGHT_ARGS = {
height: '3412',
};

export const CONTRACT_BALANCE_QUERY = `query ContractBalance($contract: ContractId, $asset: AssetId) {
export const CONTRACT_BALANCE_QUERY = `query ContractBalance($contract: ContractId, $asset: AssetId) {
contractBalance(contract: $contract, asset: $asset) {
contract
amount
assetId
}
}`;


export const CONTRACT_BALANCE_ARGS = {
contract:
'0xc9a5366c269438d294ef942bc962dd2e6c86121e3bca00192723eb7eb58fa87d',
asset: '0x0000000000000000000000000000000000000000000000000000000000000000',
contract:
'0xc9a5366c269438d294ef942bc962dd2e6c86121e3bca00192723eb7eb58fa87d',
asset: '0x0000000000000000000000000000000000000000000000000000000000000000',
};

export const CONTRACT_BALANCES_QUERY = `query ContractBalances($filter: ContractBalanceFilterInput!) {
Expand All @@ -64,10 +60,10 @@ export const CONTRACT_BALANCES_QUERY = `query ContractBalances($filter: Contract
}`;

export const CONTRACT_BALANCES_ARGS = {
filter: {
contract:
'0x0a98320d39c03337401a4e46263972a9af6ce69ec2f35a5420b1bd35784c74b1',
},
filter: {
contract:
'0x0a98320d39c03337401a4e46263972a9af6ce69ec2f35a5420b1bd35784c74b1',
},
};

export const MESSAGE_INFO_QUERY = `query MessageInfo($address: Address) {
Expand All @@ -83,12 +79,10 @@ export const MESSAGE_INFO_QUERY = `query MessageInfo($address: Address) {
}
}`;


export const MESSAGE_INFO_ARGS = {
address:
'0xf65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871',
address: '0xf65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871',
};

export const LATEST_BLOCKS_QUERY = `query LatestBlocks {
blocks(last: 5) {
nodes {
Expand Down Expand Up @@ -147,7 +141,7 @@ export const LATEST_BLOCKS_QUERY = `query LatestBlocks {
}
}`;

export const LATEST_TRANSACTIONS_QUERY = `query LatestTransactions {
export const LATEST_TRANSACTIONS_QUERY = `query LatestTransactions {
transactions(last: 5) {
nodes {
id
Expand Down Expand Up @@ -274,8 +268,7 @@ export const TRANSACTIONS_QUERY = `query Transactions($address: Address) {
}`;

export const TRANSACTIONS_ARGS = {
address:
'0xf65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871',
address: '0xf65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871',
};

export const ALL_QUERY_CONSTANTS = {
Expand All @@ -295,4 +288,4 @@ export const ALL_QUERY_CONSTANTS = {
LATEST_TRANSACTIONS_QUERY,
TRANSACTIONS_QUERY,
TRANSACTIONS_ARGS,
};
};
4 changes: 3 additions & 1 deletion examples/tests/balance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ describe('Balance', () => {
// BALANCE_ARGS

const getBalance = async () => {
const response = await urqlClient.query(BALANCE_QUERY, BALANCE_ARGS).toPromise();
const response = await urqlClient
.query(BALANCE_QUERY, BALANCE_ARGS)
.toPromise();
console.log('BALANCE:', response.data.balance);
expect(response.data.balance.amount).toBeTruthy();
};
Expand Down
4 changes: 3 additions & 1 deletion examples/tests/balances.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ describe('Balances', () => {
// BALANCES_ARGS

const getBalances = async () => {
const response = await urqlClient.query(BALANCES_QUERY, BALANCES_ARGS).toPromise();
const response = await urqlClient
.query(BALANCES_QUERY, BALANCES_ARGS)
.toPromise();
console.log('BALANCES:', response.data.balances);
expect(response.data.balances.nodes).toBeTruthy();
};
Expand Down
2 changes: 1 addition & 1 deletion examples/tests/latest-transactions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const urqlClient = new Client({
describe('Latest transactions', () => {
test('get latest transactions with ts', async () => {
// LATEST_TRANSACTIONS_QUERY

const getLatestTransactions = async () => {
const response = await fetch(TESTNET_ENDPOINT, {
method: 'POST',
Expand Down
4 changes: 3 additions & 1 deletion examples/tests/messages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ describe('Messages', () => {
// MESSAGE_INFO_ARGS

const getMessages = async () => {
const response = await urqlClient.query(MESSAGE_INFO_QUERY, MESSAGE_INFO_ARGS).toPromise();
const response = await urqlClient
.query(MESSAGE_INFO_QUERY, MESSAGE_INFO_ARGS)
.toPromise();
console.log('MESSAGES:', response.data.messages);
expect(response.data.messages.nodes).toBeTruthy();
};
Expand Down
2 changes: 1 addition & 1 deletion jest.examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const config: JestConfigWithTsJest = {
verbose: true,
moduleNameMapper: {
// Maps all imports starting with "~/" to the correct directory
"^~/(.*)$": "<rootDir>/$1",
'^~/(.*)$': '<rootDir>/$1',
},
};

Expand Down
2 changes: 1 addition & 1 deletion scripts/coverage/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function getHeadings(filepath) {
}

export async function request(query) {
const response = await fetch('https://beta-5.fuel.network/graphql', {
const response = await fetch('https://testnet.swayswap.io/v1/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function Layout({ title, children }: LayoutProps) {
? `${title} | Fuel GraphQL Docs`
: 'Fuel GraphQL Docs';
const META_OGIMG = URL + ogImage.src;

return (
<>
<Head>
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export const DEFAULT_SLUG = ['overview'];

export const META_DESC = 'Official documentation for the Fuel GraphQL API';

export const TESTNET_ENDPOINT = 'https://beta-5.fuel.network/graphql';
export const TESTNET_ENDPOINT = 'https://testnet.fuel.network/v1/graphql';
Loading

0 comments on commit 3a30703

Please sign in to comment.