Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.

Add ABI for all contracts in the sdk #21

Merged
merged 4 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/abi-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- name: Check ABI changes
# Fails if the ABI files are not up to date. Please use npm run generate-abi to regenerate the ABI files for
# the current version of the contracts.
run: git diff --exit-code IPythAbi.json
run: git diff --exit-code abis/*
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ You can find a list of available price feeds [here](https://pyth.network/develop

## Development

When making changes to the contract, please make sure to update the ABI. You can update it using `npm run generate-abi` and it will update `IPythAbi.json` file.
### ABIs

When making changes to a contract interface, please make sure to update the ABI files too. You can update it using `npm run generate-abi` and it will update the ABI files in [abis](./abis) directory. If you create a new contract, you also need to add the contract name in [the ABI generation script](./scripts/generateAbi.js#L5) so the script can create the ABI file for the new contract as well.

### Releases

Expand Down
349 changes: 349 additions & 0 deletions abis/AbstractPyth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,349 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "chainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "uint64",
"name": "sequenceNumber",
"type": "uint64"
},
{
"indexed": false,
"internalType": "uint256",
"name": "batchSize",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "freshPricesInBatch",
"type": "uint256"
}
],
"name": "BatchPriceFeedUpdate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "id",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "bool",
"name": "fresh",
"type": "bool"
},
{
"indexed": false,
"internalType": "uint16",
"name": "chainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "uint64",
"name": "sequenceNumber",
"type": "uint64"
},
{
"indexed": false,
"internalType": "uint64",
"name": "lastPublishTime",
"type": "uint64"
},
{
"indexed": false,
"internalType": "uint64",
"name": "publishTime",
"type": "uint64"
},
{
"indexed": false,
"internalType": "int64",
"name": "price",
"type": "int64"
},
{
"indexed": false,
"internalType": "uint64",
"name": "conf",
"type": "uint64"
}
],
"name": "PriceFeedUpdate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "batchCount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "fee",
"type": "uint256"
}
],
"name": "UpdatePriceFeeds",
"type": "event"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "id",
"type": "bytes32"
}
],
"name": "getCurrentPrice",
"outputs": [
{
"components": [
{
"internalType": "int64",
"name": "price",
"type": "int64"
},
{
"internalType": "uint64",
"name": "conf",
"type": "uint64"
},
{
"internalType": "int32",
"name": "expo",
"type": "int32"
}
],
"internalType": "struct PythStructs.Price",
"name": "price",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "id",
"type": "bytes32"
}
],
"name": "getEmaPrice",
"outputs": [
{
"components": [
{
"internalType": "int64",
"name": "price",
"type": "int64"
},
{
"internalType": "uint64",
"name": "conf",
"type": "uint64"
},
{
"internalType": "int32",
"name": "expo",
"type": "int32"
}
],
"internalType": "struct PythStructs.Price",
"name": "price",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "id",
"type": "bytes32"
}
],
"name": "getPrevPriceUnsafe",
"outputs": [
{
"components": [
{
"internalType": "int64",
"name": "price",
"type": "int64"
},
{
"internalType": "uint64",
"name": "conf",
"type": "uint64"
},
{
"internalType": "int32",
"name": "expo",
"type": "int32"
}
],
"internalType": "struct PythStructs.Price",
"name": "price",
"type": "tuple"
},
{
"internalType": "uint64",
"name": "publishTime",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "updateDataSize",
"type": "uint256"
}
],
"name": "getUpdateFee",
"outputs": [
{
"internalType": "uint256",
"name": "feeAmount",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "id",
"type": "bytes32"
}
],
"name": "queryPriceFeed",
"outputs": [
{
"components": [
{
"internalType": "bytes32",
"name": "id",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "productId",
"type": "bytes32"
},
{
"internalType": "int64",
"name": "price",
"type": "int64"
},
{
"internalType": "uint64",
"name": "conf",
"type": "uint64"
},
{
"internalType": "int32",
"name": "expo",
"type": "int32"
},
{
"internalType": "enum PythStructs.PriceStatus",
"name": "status",
"type": "uint8"
},
{
"internalType": "uint32",
"name": "maxNumPublishers",
"type": "uint32"
},
{
"internalType": "uint32",
"name": "numPublishers",
"type": "uint32"
},
{
"internalType": "int64",
"name": "emaPrice",
"type": "int64"
},
{
"internalType": "uint64",
"name": "emaConf",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "publishTime",
"type": "uint64"
},
{
"internalType": "int64",
"name": "prevPrice",
"type": "int64"
},
{
"internalType": "uint64",
"name": "prevConf",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "prevPublishTime",
"type": "uint64"
}
],
"internalType": "struct PythStructs.PriceFeed",
"name": "priceFeed",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes[]",
"name": "updateData",
"type": "bytes[]"
}
],
"name": "updatePriceFeeds",
"outputs": [],
"stateMutability": "payable",
"type": "function"
}
]
File renamed without changes.
Loading