Skip to content

Commit

Permalink
feat: chainlink example
Browse files Browse the repository at this point in the history
gitignore

gitignore

enc

gitignore
  • Loading branch information
Dustin-Ray committed Nov 26, 2024
1 parent 42f9a97 commit 4260664
Show file tree
Hide file tree
Showing 5 changed files with 625 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
**/node_modules
!node/src/package.json
!examples/node/package.json
!examples/chainlink/package.json
!examples/chainlink/abi/functionsClient.json

# Rust
# Generated by Cargo
Expand Down
326 changes: 326 additions & 0 deletions examples/chainlink/abi/functionsClient.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,326 @@
[
{
"inputs": [
{
"internalType": "address",
"name": "router",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "EmptyArgs",
"type": "error"
},
{
"inputs": [],
"name": "EmptySecrets",
"type": "error"
},
{
"inputs": [],
"name": "EmptySource",
"type": "error"
},
{
"inputs": [],
"name": "NoInlineSecrets",
"type": "error"
},
{
"inputs": [],
"name": "OnlyRouterCanFulfill",
"type": "error"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "requestId",
"type": "bytes32"
}
],
"name": "UnexpectedRequestID",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
}
],
"name": "OwnershipTransferRequested",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "id",
"type": "bytes32"
}
],
"name": "RequestFulfilled",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "id",
"type": "bytes32"
}
],
"name": "RequestSent",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "requestId",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "bytes",
"name": "response",
"type": "bytes"
},
{
"indexed": false,
"internalType": "bytes",
"name": "err",
"type": "bytes"
}
],
"name": "Response",
"type": "event"
},
{
"inputs": [],
"name": "acceptOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "requestId",
"type": "bytes32"
},
{
"internalType": "bytes",
"name": "response",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "err",
"type": "bytes"
}
],
"name": "handleOracleFulfillment",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "s_lastError",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "s_lastRequestId",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "s_lastResponse",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "source",
"type": "string"
},
{
"internalType": "bytes",
"name": "encryptedSecretsUrls",
"type": "bytes"
},
{
"internalType": "uint8",
"name": "donHostedSecretsSlotID",
"type": "uint8"
},
{
"internalType": "uint64",
"name": "donHostedSecretsVersion",
"type": "uint64"
},
{
"internalType": "string[]",
"name": "args",
"type": "string[]"
},
{
"internalType": "bytes[]",
"name": "bytesArgs",
"type": "bytes[]"
},
{
"internalType": "uint64",
"name": "subscriptionId",
"type": "uint64"
},
{
"internalType": "uint32",
"name": "gasLimit",
"type": "uint32"
},
{
"internalType": "bytes32",
"name": "jobId",
"type": "bytes32"
}
],
"name": "sendRequest",
"outputs": [
{
"internalType": "bytes32",
"name": "requestId",
"type": "bytes32"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "request",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "subscriptionId",
"type": "uint64"
},
{
"internalType": "uint32",
"name": "gasLimit",
"type": "uint32"
},
{
"internalType": "bytes32",
"name": "jobId",
"type": "bytes32"
}
],
"name": "sendRequestCBOR",
"outputs": [
{
"internalType": "bytes32",
"name": "requestId",
"type": "bytes32"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
18 changes: 18 additions & 0 deletions examples/chainlink/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "chainlink-example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"dependencies": {
"@chainlink/env-enc": "^1.0.5",
"@chainlink/functions-toolkit": "^0.2.7",
"ethers": "^5.7.2"
},
"devDependencies": {
"dotenv": "^16.4.5"
}
}
Loading

0 comments on commit 4260664

Please sign in to comment.