Skip to content

Commit 7c291f5

Browse files
authored
Add XRPL endpoint to token-balance (#3869)
1 parent 9218c86 commit 7c291f5

File tree

13 files changed

+193
-36
lines changed

13 files changed

+193
-36
lines changed

.changeset/chatty-dolphins-juggle.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/gentle-mice-suffer.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/poor-sloths-tickle.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/strange-deers-reflect.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/strong-kings-double.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/sweet-pans-shake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@chainlink/token-balance-adapter': minor
3+
---
4+
5+
Add XRPL endpoint. This requires setting the XRPL_RPC_URL environment variable to work.

.changeset/tidy-turkeys-move.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/sources/token-balance/README.md

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Additional env vars in the form `${NETWORK}_RPC_URL` and `${NETWORK}_RPC_CHAIN_I
2424
| | ARBITRUM_RPC_CHAIN_ID | Arbitrum chain id | number | | `42161` |
2525
| | SOLANA_RPC_URL | RPC url of Solana node | string | | `` |
2626
| | SOLANA_COMMITMENT | Solana transaction commitment level | string | | `finalized` |
27+
| | XRPL_RPC_URL | RPC url of XRPL node | string | | `` |
2728
| | BACKGROUND_EXECUTE_MS | The amount of time the background execute should sleep before performing the next request | number | | `10000` |
2829
| | GROUP_SIZE | Number of requests to execute asynchronously before the adapter waits to execute the next group of requests. Setting this lower than the default may result in lower performance from the adapter. | number | | `25` |
2930

@@ -37,9 +38,9 @@ There are no rate limits for this adapter.
3738

3839
## Input Parameters
3940

40-
| Required? | Name | Description | Type | Options | Default |
41-
| :-------: | :------: | :-----------------: | :----: | :--------------------------------------------------------------------------------------------------------------------------------: | :-----: |
42-
| | endpoint | The endpoint to use | string | [erc20](#evm-endpoint), [etherfi](#etherfi-endpoint), [evm](#evm-endpoint), [solvjlp](#solvjlp-endpoint), [tbill](#tbill-endpoint) | `evm` |
41+
| Required? | Name | Description | Type | Options | Default |
42+
| :-------: | :------: | :-----------------: | :----: | :--------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----: |
43+
| | endpoint | The endpoint to use | string | [erc20](#evm-endpoint), [etherfi](#etherfi-endpoint), [evm](#evm-endpoint), [solvjlp](#solvjlp-endpoint), [tbill](#tbill-endpoint), [xrpl](#xrpl-endpoint) | `evm` |
4344

4445
## Evm Endpoint
4546

@@ -189,4 +190,40 @@ Request:
189190

190191
---
191192

193+
## Xrpl Endpoint
194+
195+
`xrpl` is the only supported name for this endpoint.
196+
197+
### Input Params
198+
199+
| Required? | Name | Aliases | Description | Type | Options | Default | Depends On | Not Valid With |
200+
| :-------: | :----------------: | :-----: | :---------------------------------------------------------------------------: | :------: | :-----: | :-----: | :--------: | :------------: |
201+
|| tokenIssuerAddress | | Identifies the token, e.g., TBILL, to fetch the balance of | string | | | | |
202+
|| priceOracleAddress | | Address of the price oracle contract to use to convert the above token to USD | string | | | | |
203+
|| priceOracleNetwork | | EVM network on which to query the price oracle (ethereum, arbitrum, etc.) | string | | | | |
204+
|| addresses | | List of addresses to read | object[] | | | | |
205+
|| addresses.address | | Address of the account to fetch the balance of | string | | | | |
206+
207+
### Example
208+
209+
Request:
210+
211+
```json
212+
{
213+
"data": {
214+
"endpoint": "xrpl",
215+
"tokenIssuerAddress": "rJNE2NNz83GJYtWVLwMvchDWEon3huWnFn",
216+
"priceOracleAddress": "0xCe9a6626Eb99eaeA829D7fA613d5D0A2eaE45F40",
217+
"priceOracleNetwork": "ethereum",
218+
"addresses": [
219+
{
220+
"address": "rGSA6YCGzywj2hsPA8DArSsLr1DMTBi2LH"
221+
}
222+
]
223+
}
224+
}
225+
```
226+
227+
---
228+
192229
MIT License
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
export { endpoint as etherFi } from './etherFi'
12
export { endpoint as evm } from './evm'
23
export { endpoint as solvJlp } from './solvJlp'
3-
export { endpoint as etherFi } from './etherFi'
44
export { endpoint as tbill } from './tbill'
5+
export { endpoint as xrpl } from './xrpl'
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { expose, ServerInstance } from '@chainlink/external-adapter-framework'
22
import { Adapter } from '@chainlink/external-adapter-framework/adapter'
33
import { config } from './config'
4-
import { evm, solvJlp, etherFi, tbill } from './endpoint'
4+
import { etherFi, evm, solvJlp, tbill, xrpl } from './endpoint'
55

66
export const adapter = new Adapter({
77
defaultEndpoint: evm.name,
88
name: 'TOKEN_BALANCE',
99
config,
10-
endpoints: [evm, solvJlp, etherFi, tbill],
10+
endpoints: [evm, solvJlp, etherFi, tbill, xrpl],
1111
})
1212

1313
export const server = (): Promise<ServerInstance | undefined> => expose(adapter)

0 commit comments

Comments
 (0)