@raac/rpc 1.1.0-beta.49 → 1.1.0-beta.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -73,6 +73,16 @@
73
73
  "id": "raactokencollector",
74
74
  "name": "RAAC Token Collector",
75
75
  "contract": "0x0000000000000000000000000000000000000000"
76
+ },
77
+ "raachousepriceoracle": {
78
+ "id": "raachousepriceoracle",
79
+ "name": "RAAC House Price Oracle",
80
+ "contract": "0xCF52942B8B4aB535FFD7926E27e26f6D1f7Ba8FA"
81
+ },
82
+ "raacprimerateoracle": {
83
+ "id": "raacprimerateoracle",
84
+ "name": "RAAC Prime Rate Oracle",
85
+ "contract": "0x5E6C0eAdD343369DB98fAebA90e5027aAB233EC6"
76
86
  }
77
87
  },
78
88
  "pools": {
@@ -73,6 +73,16 @@
73
73
  "id": "raactokencollector",
74
74
  "name": "RAAC Token Collector",
75
75
  "contract": "0x0000000000000000000000000000000000000000"
76
+ },
77
+ "raachousepriceoracle": {
78
+ "id": "raachousepriceoracle",
79
+ "name": "RAAC House Price Oracle",
80
+ "contract": "0x0000000000000000000000000000000000000000"
81
+ },
82
+ "raacprimerateoracle": {
83
+ "id": "raacprimerateoracle",
84
+ "name": "RAAC Prime Rate Oracle",
85
+ "contract": "0x0000000000000000000000000000000000000000"
76
86
  }
77
87
  },
78
88
  "pools": {
@@ -73,6 +73,16 @@
73
73
  "id": "raactokencollector",
74
74
  "name": "RAAC Token Collector",
75
75
  "contract": "0x0000000000000000000000000000000000000000"
76
+ },
77
+ "raachousepriceoracle": {
78
+ "id": "raachousepriceoracle",
79
+ "name": "RAAC House Price Oracle",
80
+ "contract": "0x0000000000000000000000000000000000000000"
81
+ },
82
+ "raacprimerateoracle": {
83
+ "id": "raacprimerateoracle",
84
+ "name": "RAAC Prime Rate Oracle",
85
+ "contract": "0x0000000000000000000000000000000000000000"
76
86
  }
77
87
  },
78
88
  "pools": {
@@ -73,6 +73,16 @@
73
73
  "id": "raactokencollector",
74
74
  "name": "RAAC Token Collector",
75
75
  "contract": "0x0000000000000000000000000000000000000000"
76
+ },
77
+ "raachousepriceoracle": {
78
+ "id": "raachousepriceoracle",
79
+ "name": "RAAC House Price Oracle",
80
+ "contract": "0x0000000000000000000000000000000000000000"
81
+ },
82
+ "raacprimerateoracle": {
83
+ "id": "raacprimerateoracle",
84
+ "name": "RAAC Prime Rate Oracle",
85
+ "contract": "0x0000000000000000000000000000000000000000"
76
86
  }
77
87
  },
78
88
  "pools": {
@@ -0,0 +1,252 @@
1
+ "use strict";
2
+ // All supported networks and related contract addresses are defined here.
3
+ //
4
+ // LINK token addresses: https://docs.chain.link/resources/link-token-contracts/
5
+ // Price feeds addresses: https://docs.chain.link/data-feeds/price-feeds/addresses
6
+ // Chain IDs: https://chainlist.org/?testnets=true
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ const DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS = 2;
9
+ const chainlinkNetworksConfig = {
10
+ 1: {
11
+ name: "Ethereum",
12
+ url: process.env.ETHEREUM_RPC_URL || "UNSET",
13
+ gasPrice: undefined, // gas price for the functions request - default's to auto as per HH https://hardhat.org/hardhat-network/docs/reference#eth_gasprice
14
+ nonce: undefined,
15
+ verifyApiKey: process.env.ETHERSCAN_API_KEY || "UNSET",
16
+ chainId: 1,
17
+ confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
18
+ nativeCurrencySymbol: "ETH",
19
+ linkToken: "0x514910771AF9Ca656af840dff83E8264EcF986CA",
20
+ linkPriceFeed: "0xDC530D9457755926550b59e8ECcdaE7624181557", // LINK/ETH
21
+ functionsRouter: "0x65Dcc24F8ff9e51F10DCc7Ed1e4e2A61e6E14bd6",
22
+ donId: "fun-ethereum-mainnet-1",
23
+ gatewayUrls: ["https://01.functions-gateway.chain.link/", "https://02.functions-gateway.chain.link/"],
24
+ },
25
+ 43114: {
26
+ name: "Avalanche",
27
+ url: process.env.AVALANCHE_RPC_URL || "UNSET",
28
+ gasPrice: undefined,
29
+ nonce: undefined,
30
+ verifyApiKey: process.env.SNOWTRACE_API_KEY || "UNSET",
31
+ chainId: 43114,
32
+ confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
33
+ nativeCurrencySymbol: "AVAX",
34
+ linkToken: "0x5947BB275c521040051D82396192181b413227A3",
35
+ linkPriceFeed: "0x1b8a25F73c9420dD507406C3A3816A276b62f56a", // LINK/AVAX
36
+ functionsRouter: "0x9f82a6A0758517FD0AfA463820F586999AF314a0",
37
+ donId: "fun-avalanche-mainnet-1",
38
+ gatewayUrls: ["https://01.functions-gateway.chain.link/", "https://02.functions-gateway.chain.link/"],
39
+ },
40
+ 137: {
41
+ name: "Polygon",
42
+ url: process.env.POLYGON_RPC_URL || "UNSET",
43
+ gasPrice: undefined,
44
+ nonce: undefined,
45
+ verifyApiKey: process.env.POLYGONSCAN_API_KEY || "UNSET",
46
+ chainId: 137,
47
+ confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
48
+ nativeCurrencySymbol: "ETH",
49
+ linkToken: "0xb0897686c545045aFc77CF20eC7A532E3120E0F1",
50
+ linkPriceFeed: "0x5787BefDc0ECd210Dfa948264631CD53E68F7802", // LINK/MATIC
51
+ functionsRouter: "0xdc2AAF042Aeff2E68B3e8E33F19e4B9fA7C73F10",
52
+ donId: "fun-polygon-mainnet-1",
53
+ gatewayUrls: ["https://01.functions-gateway.chain.link/", "https://02.functions-gateway.chain.link/"],
54
+ },
55
+ 11155111: {
56
+ name: "Sepolia",
57
+ url: process.env.ETHEREUM_SEPOLIA_RPC_URL || "UNSET",
58
+ gasPrice: undefined,
59
+ nonce: undefined,
60
+ verifyApiKey: process.env.ETHERSCAN_API_KEY || "UNSET",
61
+ chainId: 11155111,
62
+ confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
63
+ nativeCurrencySymbol: "ETH",
64
+ linkToken: "0x779877A7B0D9E8603169DdbD7836e478b4624789",
65
+ linkPriceFeed: "0x42585eD362B3f1BCa95c640FdFf35Ef899212734", // LINK/ETH
66
+ functionsRouter: "0xb83E47C2bC239B3bf370bc41e1459A34b41238D0",
67
+ donId: "fun-ethereum-sepolia-1",
68
+ gatewayUrls: [
69
+ "https://01.functions-gateway.testnet.chain.link/",
70
+ "https://02.functions-gateway.testnet.chain.link/",
71
+ ],
72
+ },
73
+ 43113: {
74
+ name: "Avalanche Fuji",
75
+ url: process.env.AVALANCHE_FUJI_RPC_URL || "UNSET",
76
+ gasPrice: undefined,
77
+ nonce: undefined,
78
+ verifyApiKey: process.env.SNOWTRACE_API_KEY || "UNSET",
79
+ chainId: 43113,
80
+ confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
81
+ nativeCurrencySymbol: "AVAX",
82
+ linkToken: "0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846",
83
+ linkPriceFeed: "0x79c91fd4F8b3DaBEe17d286EB11cEE4D83521775", // LINK/AVAX
84
+ functionsRouter: "0xA9d587a00A31A52Ed70D6026794a8FC5E2F5dCb0",
85
+ donId: "fun-avalanche-fuji-1",
86
+ gatewayUrls: [
87
+ "https://01.functions-gateway.testnet.chain.link/",
88
+ "https://02.functions-gateway.testnet.chain.link/",
89
+ ],
90
+ },
91
+ 42161: {
92
+ name: "Arbitrum",
93
+ url: process.env.ARBITRUM_RPC_URL || "UNSET",
94
+ gasPrice: undefined,
95
+ nonce: undefined,
96
+ verifyApiKey: process.env.ARBISCAN_API_KEY || "UNSET",
97
+ chainId: 42161,
98
+ confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
99
+ nativeCurrencySymbol: "ETH",
100
+ linkToken: "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4",
101
+ linkPriceFeed: "0xb7c8Fb1dB45007F98A68Da0588e1AA524C317f27", // LINK/ETH
102
+ functionsRouter: "0x97083E831F8F0638855e2A515c90EdCF158DF238",
103
+ donId: "fun-arbitrum-mainnet-1",
104
+ gatewayUrls: ["https://01.functions-gateway.chain.link/", "https://02.functions-gateway.chain.link/"],
105
+ },
106
+ 421614: {
107
+ name: "Arbitrum Sepolia",
108
+ url: process.env.ARBITRUM_SEPOLIA_RPC_URL || "UNSET",
109
+ gasPrice: undefined,
110
+ nonce: undefined,
111
+ verifyApiKey: process.env.ARBISCAN_API_KEY || "UNSET",
112
+ chainId: 421614,
113
+ confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
114
+ nativeCurrencySymbol: "ETH",
115
+ linkToken: "0xb1D4538B4571d411F07960EF2838Ce337FE1E80E",
116
+ linkPriceFeed: "0x3ec8593F930EA45ea58c968260e6e9FF53FC934f", // LINK/ETH
117
+ functionsRouter: "0x234a5fb5Bd614a7AA2FfAB244D603abFA0Ac5C5C",
118
+ donId: "fun-arbitrum-sepolia-1",
119
+ gatewayUrls: [
120
+ "https://01.functions-gateway.testnet.chain.link/",
121
+ "https://02.functions-gateway.testnet.chain.link/",
122
+ ],
123
+ },
124
+ 84532: {
125
+ name: "Base Sepolia",
126
+ url: process.env.BASE_SEPOLIA_RPC_URL || "UNSET", // https://docs.basescan.org/v/sepolia-basescan/
127
+ gasPrice: undefined,
128
+ nonce: undefined,
129
+ verifyApiKey: process.env.BASESCAN_API_KEY || "UNSET",
130
+ chainId: 84532,
131
+ confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
132
+ nativeCurrencySymbol: "ETH",
133
+ linkToken: "0xE4aB69C077896252FAFBD49EFD26B5D171A32410",
134
+ linkPriceFeed: "0x56a43EB56Da12C0dc1D972ACb089c06a5dEF8e69", // https://docs.chain.link/data-feeds/price-feeds/addresses?network=base&page=1
135
+ functionsRouter: "0xf9B8fc078197181C841c296C876945aaa425B278",
136
+ donId: "fun-base-sepolia-1",
137
+ gatewayUrls: [
138
+ "https://01.functions-gateway.testnet.chain.link/",
139
+ "https://02.functions-gateway.testnet.chain.link/",
140
+ ],
141
+ },
142
+ 11155420: {
143
+ name: "Optimism Sepolia",
144
+ url: process.env.OPTIMISM_SEPOLIA_RPC_URL || "UNSET", // https://docs.optimism.io/chain/networks#op-sepolia
145
+ gasPrice: undefined,
146
+ nonce: undefined,
147
+ verifyApiKey: process.env.OPTIMISM_API_KEY || "UNSET",
148
+ chainId: 11155420,
149
+ confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
150
+ nativeCurrencySymbol: "ETH",
151
+ linkToken: "0xE4aB69C077896252FAFBD49EFD26B5D171A32410",
152
+ linkPriceFeed: "0x98EeB02BC20c5e7079983e8F0D0D839dFc8F74fA", //https://docs.chain.link/data-feeds/price-feeds/addresses?network=optimism&page=1#optimism-sepolia
153
+ functionsRouter: "0xC17094E3A1348E5C7544D4fF8A36c28f2C6AAE28",
154
+ donId: "fun-optimism-sepolia-1",
155
+ gatewayUrls: [
156
+ "https://01.functions-gateway.testnet.chain.link/",
157
+ "https://02.functions-gateway.testnet.chain.link/",
158
+ ],
159
+ },
160
+ 80002: {
161
+ name: "Polygon Amoy",
162
+ url: process.env.AMOY_RPC_URL || "UNSET", // h
163
+ gasPrice: undefined,
164
+ nonce: undefined,
165
+ verifyApiKey: process.env.POLYGONSCAN_API_KEY || "UNSET",
166
+ chainId: 80002,
167
+ confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
168
+ nativeCurrencySymbol: "MATIC",
169
+ linkToken: "0x0Fd9e8d3aF1aaee056EB9e802c3A762a667b1904",
170
+ linkPriceFeed: "0x408D97c89c141e60872C0835e18Dd1E670CD8781", // LINK/MATIC
171
+ functionsRouter: "0xC22a79eBA640940ABB6dF0f7982cc119578E11De",
172
+ donId: "fun-polygon-amoy-1",
173
+ gatewayUrls: [
174
+ "https://01.functions-gateway.testnet.chain.link/",
175
+ "https://02.functions-gateway.testnet.chain.link/",
176
+ ],
177
+ },
178
+ 8453: {
179
+ name: "Base",
180
+ url: process.env.BASE_RPC_URL || "UNSET",
181
+ gasPrice: undefined,
182
+ nonce: undefined,
183
+ verifyApiKey: process.env.BASESCAN_API_KEY || "UNSET",
184
+ chainId: 8453,
185
+ confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
186
+ nativeCurrencySymbol: "ETH",
187
+ linkToken: "0x88Fb150BDc53A65fe94Dea0c9BA0a6dAf8C6e196",
188
+ linkPriceFeed: "0xc5E65227fe3385B88468F9A01600017cDC9F3A12", // LINK/ETH
189
+ functionsRouter: "0xf9b8fc078197181c841c296c876945aaa425b278",
190
+ donId: "fun-base-mainnet-1",
191
+ gatewayUrls: ["https://01.functions-gateway.chain.link/", "https://02.functions-gateway.chain.link/"],
192
+ },
193
+ 10: {
194
+ name: "Optimism",
195
+ url: process.env.OPTIMISM_RPC_URL || "UNSET",
196
+ gasPrice: undefined,
197
+ nonce: undefined,
198
+ verifyApiKey: process.env.OP_ETHERSCAN_API_KEY || "UNSET",
199
+ chainId: 10,
200
+ confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
201
+ nativeCurrencySymbol: "ETH",
202
+ linkToken: "0x350a791Bfc2C21F9Ed5d10980Dad2e2638ffa7f6",
203
+ linkPriceFeed: "0x464A1515ADc20de946f8d0DEB99cead8CEAE310d", // LINK/ETH
204
+ functionsRouter: "0xaA8AaA682C9eF150C0C8E96a8D60945BCB21faad",
205
+ donId: "fun-optimism-mainnet-1",
206
+ gatewayUrls: ["https://01.functions-gateway.chain.link/", "https://02.functions-gateway.chain.link/"],
207
+ },
208
+ 44787: {
209
+ name: "Celo Alfajores",
210
+ url: process.env.CELO_ALFAJORES_RPC_URL || "UNSET",
211
+ gasPrice: undefined,
212
+ nonce: undefined,
213
+ verifyApiKey: process.env.CELOSCAN_API_KEY || "UNSET",
214
+ chainId: 44787,
215
+ confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
216
+ nativeCurrencySymbol: "ETH",
217
+ linkToken: "0x32e08557b14fad8908025619797221281d439071",
218
+ linkPriceFeed: "0xeA11fA4307B8BD6D6074Cf1c0caAc9790cf96857", // LINK/CELO
219
+ functionsRouter: "0x53BA5D8E5aab0cf9589aCE139666Be2b9Fd268e2",
220
+ donId: "fun-celo-alfajores-1",
221
+ gatewayUrls: [
222
+ "https://01.functions-gateway.testnet.chain.link/",
223
+ "https://02.functions-gateway.testnet.chain.link/",
224
+ ],
225
+ },
226
+ 42220: {
227
+ name: "Celo",
228
+ url: process.env.CELO_RPC_URL || "UNSET",
229
+ gasPrice: undefined,
230
+ nonce: undefined,
231
+ verifyApiKey: process.env.CELOSCAN_API_KEY || "UNSET",
232
+ chainId: 42220,
233
+ confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
234
+ nativeCurrencySymbol: "ETH",
235
+ linkToken: "0xd07294e6E917e07dfDcee882dd1e2565085C2ae0",
236
+ linkPriceFeed: "0xBa45f0a1a2fa3FB62a4D6dC135741E2aeb1b14e7", // LINK/CELO
237
+ functionsRouter: "0xd74646C75163f9dA0F3666C3BE8A9C42F4b3b261",
238
+ donId: "fun-celo-mainnet-1",
239
+ gatewayUrls: ["https://01.functions-gateway.chain.link/", "https://02.functions-gateway.chain.link/"],
240
+ },
241
+ // localFunctionsTestnet is updated dynamically by scripts/startLocalFunctionsTestnet.js so it should not be modified here
242
+ 0: {
243
+ name: "Sepolia",
244
+ url: "http://localhost:8545/",
245
+ confirmations: 1,
246
+ nativeCurrencySymbol: "ETH",
247
+ linkToken: "0x94d3C68A91C972388d7863D25EDD2Be7e2F21F21",
248
+ functionsRouter: "0xCbfD616baE0F13EFE0528c446184C9C0EAa8040e",
249
+ donId: "local-functions-testnet",
250
+ },
251
+ };
252
+ exports.default = chainlinkNetworksConfig;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const fs_1 = __importDefault(require("fs"));
7
+ const functions_toolkit_1 = require("@chainlink/functions-toolkit");
8
+ const requestConfig = {
9
+ source: fs_1.default.readFileSync("./oracles/houses/api.js").toString(),
10
+ codeLocation: functions_toolkit_1.Location.Inline,
11
+ // Optional
12
+ secrets: { apiKey: process.env.RAAC_HOUSING_API_KEY ?? "" },
13
+ // Optional
14
+ secretsLocation: functions_toolkit_1.Location.DONHosted,
15
+ args: [],
16
+ codeLanguage: functions_toolkit_1.CodeLanguage.JavaScript,
17
+ expectedReturnType: functions_toolkit_1.ReturnType.uint256,
18
+ };
19
+ exports.default = requestConfig;
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.request = request;
7
+ const functions_toolkit_1 = require("@chainlink/functions-toolkit");
8
+ const configs_1 = require("../../configs");
9
+ const getContractAddress_1 = __importDefault(require("../../contracts/getContractAddress"));
10
+ const ethers5_1 = require("ethers5");
11
+ const config_1 = __importDefault(require("./config"));
12
+ const chainlink_networks_config_1 = __importDefault(require("../chainlink-networks-config"));
13
+ const artifacts_1 = require("../../utils/artifacts");
14
+ const subscriptionIds = {
15
+ 8453: 4392,
16
+ 17000: 4392,
17
+ 11155111: 4392,
18
+ 18453: 4392,
19
+ };
20
+ async function request(chainId, houseId, privateKey) {
21
+ const chain = (0, configs_1.getChainConfig)(chainId);
22
+ const network = chainlink_networks_config_1.default[chainId];
23
+ if (!chain) {
24
+ throw new Error(`Chain configuration not found for chainId: ${chainId}`);
25
+ }
26
+ // Simulate the request first
27
+ {
28
+ const { responseBytesHexstring, errorString } = await (0, functions_toolkit_1.simulateScript)({
29
+ ...config_1.default,
30
+ args: [houseId],
31
+ });
32
+ if (responseBytesHexstring) {
33
+ console.log(`\nResponse returned by script during local simulation: ${(0, functions_toolkit_1.decodeResult)(responseBytesHexstring, config_1.default.expectedReturnType).toString()}\n`);
34
+ }
35
+ if (errorString) {
36
+ console.log(`\nError returned by simulated script:\n${errorString}\n`);
37
+ }
38
+ console.log("Local simulation of source code completed...");
39
+ }
40
+ // Get the RPC endpoint from the chain config and derive a v5 provider
41
+ const rpcUrl = chain.rpcs?.[0] ?? chain.rpc ?? undefined;
42
+ if (!rpcUrl)
43
+ throw new Error("No RPC URL found in chain configuration");
44
+ const providerV5 = new ethers5_1.ethers.providers.JsonRpcProvider(rpcUrl);
45
+ // Recreate the wallet in ethers v5 using the same private key
46
+ if (!privateKey) {
47
+ throw new Error("Signer passed to request() must expose a privateKey so an ethers v5 wallet can be derived.");
48
+ }
49
+ const signerV5 = new ethers5_1.ethers.Wallet(privateKey, providerV5);
50
+ const contractAddress = (0, getContractAddress_1.default)(chainId, "raachousepriceoracle");
51
+ const contractAbi = (0, artifacts_1.getABI)("raachousepriceoracle");
52
+ const subscriptionId = subscriptionIds[chainId];
53
+ const slotId = 0;
54
+ const callbackGasLimit = 300_000;
55
+ const consumerContract = new ethers5_1.ethers.Contract(contractAddress, contractAbi, signerV5);
56
+ const linkTokenAddress = network.linkToken;
57
+ const functionsRouterAddress = network.functionsRouter;
58
+ const subscriptionManager = new functions_toolkit_1.SubscriptionManager({
59
+ // Use the v5 signer here (toolkit expects ethers v5 types)
60
+ signer: signerV5,
61
+ linkTokenAddress,
62
+ functionsRouterAddress,
63
+ });
64
+ await subscriptionManager.initialize();
65
+ const donId = network.donId;
66
+ const secretsManager = new functions_toolkit_1.SecretsManager({
67
+ // ethers v5 signer again
68
+ signer: signerV5,
69
+ functionsRouterAddress,
70
+ donId,
71
+ });
72
+ await secretsManager.initialize();
73
+ const subInfo = await subscriptionManager.getSubscriptionInfo(subscriptionId);
74
+ if (!subInfo.consumers
75
+ .map((c) => c.toLowerCase())
76
+ .includes(contractAddress.toLowerCase())) {
77
+ throw Error(`Consumer contract ${contractAddress} has not been added to subscription ${subscriptionId}`);
78
+ }
79
+ // Use the v5 provider for gas data (to avoid type mismatches)
80
+ const { gasPrice } = await providerV5.getFeeData();
81
+ // @ts-ignore
82
+ const gasPriceWei = BigInt(Math.ceil(ethers5_1.ethers.utils.formatUnits(gasPrice, "wei").toString()));
83
+ const estimatedCostJuels = await subscriptionManager.estimateFunctionsRequestCost({
84
+ donId,
85
+ subscriptionId,
86
+ callbackGasLimit,
87
+ gasPriceWei,
88
+ });
89
+ const estimatedCostLink = ethers5_1.ethers.utils.formatUnits(estimatedCostJuels.toString(), 18);
90
+ const subBalanceLink = ethers5_1.ethers.utils.formatUnits(subInfo.balance.toString(), 18);
91
+ if (subInfo.balance <= estimatedCostJuels) {
92
+ throw Error(`Subscription ${subscriptionId} does not have sufficient funds. The estimated cost is ${estimatedCostLink} LINK, but the subscription only has ${subBalanceLink} LINK.`);
93
+ }
94
+ const encryptedSecrets = await secretsManager.encryptSecrets(config_1.default.secrets);
95
+ // DONHoster secrets
96
+ const { version } = await secretsManager.uploadEncryptedSecretsToDON({
97
+ encryptedSecretsHexstring: encryptedSecrets.encryptedSecrets,
98
+ gatewayUrls: network.gatewayUrls,
99
+ slotId,
100
+ minutesUntilExpiration: 5,
101
+ });
102
+ const encryptedSecretsReference = await secretsManager.buildDONHostedEncryptedSecretsReference({
103
+ slotId,
104
+ version,
105
+ });
106
+ const responseListener = new functions_toolkit_1.ResponseListener({
107
+ provider: providerV5,
108
+ functionsRouterAddress,
109
+ });
110
+ console.log(`Waiting for transaction for RAACHousePriceOracle contract ${contractAddress} on network ${network.name} to be confirmed...`);
111
+ const overrides = {
112
+ gasLimit: 1_500_000,
113
+ };
114
+ const requestTx = await consumerContract.sendRequest(config_1.default.source, config_1.default.secretsLocation, encryptedSecretsReference, [houseId], [], subscriptionId, callbackGasLimit, overrides);
115
+ const requestTxReceipt = await requestTx.wait(1);
116
+ console.log(`Transaction confirmed, see https://sepolia.etherscan.io/tx/${requestTx.hash} for more details.`);
117
+ console.log(`Functions request has been initiated in transaction ${requestTx.hash} with request ID ${requestTxReceipt?.events[2]?.args?.id}. Note the request ID may change if a re-org occurs, but the transaction hash will remain constant.\nWaiting for fulfillment from the Decentralized Oracle Network...\n`);
118
+ try {
119
+ // localFunctionsTestnet needs 0 or 1 confirmations to work correctly as it's local.
120
+ // If on live testnet or mainnet, setting to undefined then uses the functions-toolkit default of 2 confirmations.
121
+ const NUM_CONFIRMATIONS = network.confirmations;
122
+ // Get response data
123
+ const { requestId, totalCostInJuels, responseBytesHexstring, errorString, fulfillmentCode, } = await responseListener.listenForResponseFromTransaction(requestTx.hash, undefined, NUM_CONFIRMATIONS, undefined);
124
+ switch (fulfillmentCode) {
125
+ case functions_toolkit_1.FulfillmentCode.FULFILLED:
126
+ if (responseBytesHexstring !== "0x") {
127
+ console.log(`Request ${requestId} fulfilled!\nResponse has been sent to consumer contract: ${(0, functions_toolkit_1.decodeResult)(responseBytesHexstring, config_1.default.expectedReturnType).toString()}\n`);
128
+ }
129
+ else if (errorString.length > 0) {
130
+ console.error(`Request ${requestId} fulfilled with error: ${errorString}\n`);
131
+ }
132
+ else {
133
+ console.warn(`Request ${requestId} fulfilled with empty response data.\n`);
134
+ }
135
+ const linkCost = ethers5_1.ethers.utils.formatUnits(totalCostInJuels.toString(), 18);
136
+ console.log(`Total request cost: ${linkCost + " LINK"}`);
137
+ break;
138
+ case functions_toolkit_1.FulfillmentCode.USER_CALLBACK_ERROR:
139
+ console.error("Error encountered when calling consumer contract callback.\nEnsure the fulfillRequest function in RAACHousePriceOracle is correct and the --callbackgaslimit is sufficient.");
140
+ break;
141
+ case functions_toolkit_1.FulfillmentCode.COST_EXCEEDS_COMMITMENT:
142
+ console.error(`Request ${requestId} failed due to a gas price spike when attempting to respond.`);
143
+ break;
144
+ default:
145
+ console.error(`Request ${requestId} failed with fulfillment code: ${fulfillmentCode}. Please contact Chainlink support.`);
146
+ }
147
+ }
148
+ catch (error) {
149
+ console.error("Request fulfillment was not received within 5 minute response period.");
150
+ throw error;
151
+ }
152
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const fs = __importStar(require("fs"));
37
+ const functions_toolkit_1 = require("@chainlink/functions-toolkit");
38
+ const requestConfig = {
39
+ source: fs.readFileSync("./oracles/prime-rate/api.js").toString(),
40
+ codeLocation: functions_toolkit_1.Location["Inline"],
41
+ // Optional
42
+ secrets: { apiKey: process.env.RAAC_HOUSING_API_KEY ?? "" },
43
+ // Optional
44
+ secretsLocation: functions_toolkit_1.Location["DONHosted"],
45
+ args: [],
46
+ codeLanguage: functions_toolkit_1.CodeLanguage.JavaScript,
47
+ expectedReturnType: functions_toolkit_1.ReturnType.uint256,
48
+ };
49
+ exports.default = requestConfig;
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.request = request;
7
+ const functions_toolkit_1 = require("@chainlink/functions-toolkit");
8
+ const configs_1 = require("../../configs");
9
+ const getContractAddress_1 = __importDefault(require("../../contracts/getContractAddress"));
10
+ const ethers5_1 = require("ethers5");
11
+ const config_1 = __importDefault(require("./config"));
12
+ const chainlink_networks_config_1 = __importDefault(require("../chainlink-networks-config"));
13
+ const artifacts_1 = require("../../utils/artifacts");
14
+ const subscriptionIds = {
15
+ 8453: 4392,
16
+ 17000: 4392,
17
+ 11155111: 4392,
18
+ 18453: 4392,
19
+ };
20
+ async function request(chainId, countryCode = "us", privateKey) {
21
+ const chain = (0, configs_1.getChainConfig)(chainId);
22
+ const network = chainlink_networks_config_1.default[chainId];
23
+ if (!chain) {
24
+ throw new Error(`Chain configuration not found for chainId: ${chainId}`);
25
+ }
26
+ // Simulate the request first
27
+ {
28
+ const { responseBytesHexstring, errorString } = await (0, functions_toolkit_1.simulateScript)({
29
+ ...config_1.default,
30
+ args: [countryCode],
31
+ });
32
+ if (responseBytesHexstring) {
33
+ console.log(`\nResponse returned by script during local simulation: ${(0, functions_toolkit_1.decodeResult)(responseBytesHexstring, config_1.default.expectedReturnType).toString()}\n`);
34
+ }
35
+ if (errorString) {
36
+ console.log(`\nError returned by simulated script:\n${errorString}\n`);
37
+ }
38
+ console.log("Local simulation of source code completed...");
39
+ }
40
+ // Get the RPC endpoint from the chain config and derive a v5 provider
41
+ const rpcUrl = chain.rpcs?.[0] ?? chain.rpc ?? undefined;
42
+ if (!rpcUrl)
43
+ throw new Error("No RPC URL found in chain configuration");
44
+ const providerV5 = new ethers5_1.ethers.providers.JsonRpcProvider(rpcUrl);
45
+ // Recreate the wallet in ethers v5 using the same private key
46
+ if (!privateKey) {
47
+ throw new Error("Signer passed to request() must expose a privateKey so an ethers v5 wallet can be derived.");
48
+ }
49
+ const signerV5 = new ethers5_1.ethers.Wallet(privateKey, providerV5);
50
+ const contractAddress = (0, getContractAddress_1.default)(chainId, "raacprimerateoracle");
51
+ const contractAbi = (0, artifacts_1.getABI)("raacprimerateoracle");
52
+ const subscriptionId = subscriptionIds[chainId];
53
+ const slotId = 0;
54
+ const callbackGasLimit = 300_000;
55
+ const consumerContract = new ethers5_1.ethers.Contract(contractAddress, contractAbi, signerV5);
56
+ const linkTokenAddress = network.linkToken;
57
+ const functionsRouterAddress = network.functionsRouter;
58
+ const subscriptionManager = new functions_toolkit_1.SubscriptionManager({
59
+ // Use the v5 signer here (toolkit expects ethers v5 types)
60
+ signer: signerV5,
61
+ linkTokenAddress,
62
+ functionsRouterAddress,
63
+ });
64
+ await subscriptionManager.initialize();
65
+ const donId = network.donId;
66
+ const secretsManager = new functions_toolkit_1.SecretsManager({
67
+ // ethers v5 signer again
68
+ signer: signerV5,
69
+ functionsRouterAddress,
70
+ donId,
71
+ });
72
+ await secretsManager.initialize();
73
+ const subInfo = await subscriptionManager.getSubscriptionInfo(subscriptionId);
74
+ if (!subInfo.consumers
75
+ .map((c) => c.toLowerCase())
76
+ .includes(contractAddress.toLowerCase())) {
77
+ throw Error(`Consumer contract ${contractAddress} has not been added to subscription ${subscriptionId}`);
78
+ }
79
+ // Use the v5 provider for gas data (to avoid type mismatches)
80
+ const { gasPrice } = await providerV5.getFeeData();
81
+ // @ts-ignore
82
+ const gasPriceWei = BigInt(Math.ceil(ethers5_1.ethers.utils.formatUnits(gasPrice, "wei").toString()));
83
+ const estimatedCostJuels = await subscriptionManager.estimateFunctionsRequestCost({
84
+ donId,
85
+ subscriptionId,
86
+ callbackGasLimit,
87
+ gasPriceWei,
88
+ });
89
+ const estimatedCostLink = ethers5_1.ethers.utils.formatUnits(estimatedCostJuels.toString(), 18);
90
+ const subBalanceLink = ethers5_1.ethers.utils.formatUnits(subInfo.balance.toString(), 18);
91
+ if (subInfo.balance <= estimatedCostJuels) {
92
+ throw Error(`Subscription ${subscriptionId} does not have sufficient funds. The estimated cost is ${estimatedCostLink} LINK, but the subscription only has ${subBalanceLink} LINK.`);
93
+ }
94
+ const encryptedSecrets = await secretsManager.encryptSecrets(config_1.default.secrets);
95
+ // DONHoster secrets
96
+ const { version } = await secretsManager.uploadEncryptedSecretsToDON({
97
+ encryptedSecretsHexstring: encryptedSecrets.encryptedSecrets,
98
+ gatewayUrls: network.gatewayUrls,
99
+ slotId,
100
+ minutesUntilExpiration: 5,
101
+ });
102
+ const encryptedSecretsReference = await secretsManager.buildDONHostedEncryptedSecretsReference({
103
+ slotId,
104
+ version,
105
+ });
106
+ const responseListener = new functions_toolkit_1.ResponseListener({
107
+ provider: providerV5,
108
+ functionsRouterAddress,
109
+ });
110
+ console.log(`Waiting for transaction for RAACPrimeRateOracle contract ${contractAddress} on network ${network.name} to be confirmed...`);
111
+ const overrides = {
112
+ gasLimit: 1_500_000,
113
+ };
114
+ const requestTx = await consumerContract.sendRequest(config_1.default.source, config_1.default.secretsLocation, encryptedSecretsReference, [countryCode], [], subscriptionId, callbackGasLimit, overrides);
115
+ const requestTxReceipt = await requestTx.wait(1);
116
+ console.log(`Transaction confirmed, see https://sepolia.etherscan.io/tx/${requestTx.hash} for more details.`);
117
+ console.log(`Functions request has been initiated in transaction ${requestTx.hash} with request ID ${requestTxReceipt?.events[2]?.args?.id}. Note the request ID may change if a re-org occurs, but the transaction hash will remain constant.\nWaiting for fulfillment from the Decentralized Oracle Network...\n`);
118
+ try {
119
+ // localFunctionsTestnet needs 0 or 1 confirmations to work correctly as it's local.
120
+ // If on live testnet or mainnet, setting to undefined then uses the functions-toolkit default of 2 confirmations.
121
+ const NUM_CONFIRMATIONS = network.confirmations;
122
+ // Get response data
123
+ const { requestId, totalCostInJuels, responseBytesHexstring, errorString, fulfillmentCode, } = await responseListener.listenForResponseFromTransaction(requestTx.hash, undefined, NUM_CONFIRMATIONS, undefined);
124
+ switch (fulfillmentCode) {
125
+ case functions_toolkit_1.FulfillmentCode.FULFILLED:
126
+ if (responseBytesHexstring !== "0x") {
127
+ console.log(`Request ${requestId} fulfilled!\nResponse has been sent to consumer contract: ${(0, functions_toolkit_1.decodeResult)(responseBytesHexstring, config_1.default.expectedReturnType).toString()}\n`);
128
+ }
129
+ else if (errorString.length > 0) {
130
+ console.error(`Request ${requestId} fulfilled with error: ${errorString}\n`);
131
+ }
132
+ else {
133
+ console.warn(`Request ${requestId} fulfilled with empty response data.\n`);
134
+ }
135
+ const linkCost = ethers5_1.ethers.utils.formatUnits(totalCostInJuels.toString(), 18);
136
+ console.log(`Total request cost: ${linkCost + " LINK"}`);
137
+ break;
138
+ case functions_toolkit_1.FulfillmentCode.USER_CALLBACK_ERROR:
139
+ console.error("Error encountered when calling consumer contract callback.\nEnsure the fulfillRequest function in RAACPrimeRateOracle is correct and the --callbackgaslimit is sufficient.");
140
+ break;
141
+ case functions_toolkit_1.FulfillmentCode.COST_EXCEEDS_COMMITMENT:
142
+ console.error(`Request ${requestId} failed due to a gas price spike when attempting to respond.`);
143
+ break;
144
+ default:
145
+ console.error(`Request ${requestId} failed with fulfillment code: ${fulfillmentCode}. Please contact Chainlink support.`);
146
+ }
147
+ }
148
+ catch (error) {
149
+ console.error("Request fulfillment was not received within 5 minute response period.");
150
+ throw error;
151
+ }
152
+ }
@@ -10,6 +10,7 @@ const RPCLibrary_1 = __importDefault(require("../RPCLibrary"));
10
10
  const contracts_1 = require("../utils/contracts");
11
11
  const artifacts_1 = require("../utils/artifacts");
12
12
  const _helpers_1 = require("../pools/rwaVault/_helpers");
13
+ const request_1 = require("../oracles/prime-rate/request");
13
14
  const chainId = 11155111;
14
15
  const config = chains_1.default[chainId];
15
16
  const TEST_MNEMONIC = process.env.TEST_MNEMONIC;
@@ -39,6 +40,10 @@ async function setup() {
39
40
  rpc.address = signer.address;
40
41
  rpc.provider = provider;
41
42
  rpc.chainId = chainId;
43
+ const RAACPrimeRateOracleAddress = (0, contracts_1.getContractAddress)(chainId, "raacprimerateoracle");
44
+ const RAACPrimeRateOracleABI = (0, artifacts_1.getABI)("raacprimerateoracle");
45
+ const RAACPrimeRateOracleContract = new ethers_1.ethers.Contract(RAACPrimeRateOracleAddress, RAACPrimeRateOracleABI, signer);
46
+ await (0, request_1.request)(chainId, "us", TEST_PRIVATE_KEY);
42
47
  const LendingPoolAddress = (0, contracts_1.getContractAddress)(chainId, "lendingpool");
43
48
  const LendingPoolABI = (0, artifacts_1.getABI)("lendingpool");
44
49
  const LendingPoolContract = new ethers_1.ethers.Contract(LendingPoolAddress, LendingPoolABI, signer);
@@ -172,6 +177,7 @@ const execute = async () => {
172
177
  rpc.address = signer.address;
173
178
  rpc.provider = provider;
174
179
  rpc.chainId = chainId;
180
+ return;
175
181
  // await rpc.wallet.assets.mintAsset(
176
182
  // chainId,
177
183
  // "crvusd",
@@ -250,7 +256,7 @@ const fulfillRequest = async () => {
250
256
  const redemptionToken = await rwaVaultContract.getNextRandomNFT();
251
257
  console.log("Redemption token", redemptionToken);
252
258
  };
253
- // execute();
259
+ execute();
254
260
  setup();
255
261
  // fulfillRequest();
256
262
  // setup();
@@ -0,0 +1,222 @@
1
+ declare const chainlinkNetworksConfig: {
2
+ 1: {
3
+ name: string;
4
+ url: string;
5
+ gasPrice: any;
6
+ nonce: any;
7
+ verifyApiKey: string;
8
+ chainId: number;
9
+ confirmations: number;
10
+ nativeCurrencySymbol: string;
11
+ linkToken: string;
12
+ linkPriceFeed: string;
13
+ functionsRouter: string;
14
+ donId: string;
15
+ gatewayUrls: string[];
16
+ };
17
+ 43114: {
18
+ name: string;
19
+ url: string;
20
+ gasPrice: any;
21
+ nonce: any;
22
+ verifyApiKey: string;
23
+ chainId: number;
24
+ confirmations: number;
25
+ nativeCurrencySymbol: string;
26
+ linkToken: string;
27
+ linkPriceFeed: string;
28
+ functionsRouter: string;
29
+ donId: string;
30
+ gatewayUrls: string[];
31
+ };
32
+ 137: {
33
+ name: string;
34
+ url: string;
35
+ gasPrice: any;
36
+ nonce: any;
37
+ verifyApiKey: string;
38
+ chainId: number;
39
+ confirmations: number;
40
+ nativeCurrencySymbol: string;
41
+ linkToken: string;
42
+ linkPriceFeed: string;
43
+ functionsRouter: string;
44
+ donId: string;
45
+ gatewayUrls: string[];
46
+ };
47
+ 11155111: {
48
+ name: string;
49
+ url: string;
50
+ gasPrice: any;
51
+ nonce: any;
52
+ verifyApiKey: string;
53
+ chainId: number;
54
+ confirmations: number;
55
+ nativeCurrencySymbol: string;
56
+ linkToken: string;
57
+ linkPriceFeed: string;
58
+ functionsRouter: string;
59
+ donId: string;
60
+ gatewayUrls: string[];
61
+ };
62
+ 43113: {
63
+ name: string;
64
+ url: string;
65
+ gasPrice: any;
66
+ nonce: any;
67
+ verifyApiKey: string;
68
+ chainId: number;
69
+ confirmations: number;
70
+ nativeCurrencySymbol: string;
71
+ linkToken: string;
72
+ linkPriceFeed: string;
73
+ functionsRouter: string;
74
+ donId: string;
75
+ gatewayUrls: string[];
76
+ };
77
+ 42161: {
78
+ name: string;
79
+ url: string;
80
+ gasPrice: any;
81
+ nonce: any;
82
+ verifyApiKey: string;
83
+ chainId: number;
84
+ confirmations: number;
85
+ nativeCurrencySymbol: string;
86
+ linkToken: string;
87
+ linkPriceFeed: string;
88
+ functionsRouter: string;
89
+ donId: string;
90
+ gatewayUrls: string[];
91
+ };
92
+ 421614: {
93
+ name: string;
94
+ url: string;
95
+ gasPrice: any;
96
+ nonce: any;
97
+ verifyApiKey: string;
98
+ chainId: number;
99
+ confirmations: number;
100
+ nativeCurrencySymbol: string;
101
+ linkToken: string;
102
+ linkPriceFeed: string;
103
+ functionsRouter: string;
104
+ donId: string;
105
+ gatewayUrls: string[];
106
+ };
107
+ 84532: {
108
+ name: string;
109
+ url: string;
110
+ gasPrice: any;
111
+ nonce: any;
112
+ verifyApiKey: string;
113
+ chainId: number;
114
+ confirmations: number;
115
+ nativeCurrencySymbol: string;
116
+ linkToken: string;
117
+ linkPriceFeed: string;
118
+ functionsRouter: string;
119
+ donId: string;
120
+ gatewayUrls: string[];
121
+ };
122
+ 11155420: {
123
+ name: string;
124
+ url: string;
125
+ gasPrice: any;
126
+ nonce: any;
127
+ verifyApiKey: string;
128
+ chainId: number;
129
+ confirmations: number;
130
+ nativeCurrencySymbol: string;
131
+ linkToken: string;
132
+ linkPriceFeed: string;
133
+ functionsRouter: string;
134
+ donId: string;
135
+ gatewayUrls: string[];
136
+ };
137
+ 80002: {
138
+ name: string;
139
+ url: string;
140
+ gasPrice: any;
141
+ nonce: any;
142
+ verifyApiKey: string;
143
+ chainId: number;
144
+ confirmations: number;
145
+ nativeCurrencySymbol: string;
146
+ linkToken: string;
147
+ linkPriceFeed: string;
148
+ functionsRouter: string;
149
+ donId: string;
150
+ gatewayUrls: string[];
151
+ };
152
+ 8453: {
153
+ name: string;
154
+ url: string;
155
+ gasPrice: any;
156
+ nonce: any;
157
+ verifyApiKey: string;
158
+ chainId: number;
159
+ confirmations: number;
160
+ nativeCurrencySymbol: string;
161
+ linkToken: string;
162
+ linkPriceFeed: string;
163
+ functionsRouter: string;
164
+ donId: string;
165
+ gatewayUrls: string[];
166
+ };
167
+ 10: {
168
+ name: string;
169
+ url: string;
170
+ gasPrice: any;
171
+ nonce: any;
172
+ verifyApiKey: string;
173
+ chainId: number;
174
+ confirmations: number;
175
+ nativeCurrencySymbol: string;
176
+ linkToken: string;
177
+ linkPriceFeed: string;
178
+ functionsRouter: string;
179
+ donId: string;
180
+ gatewayUrls: string[];
181
+ };
182
+ 44787: {
183
+ name: string;
184
+ url: string;
185
+ gasPrice: any;
186
+ nonce: any;
187
+ verifyApiKey: string;
188
+ chainId: number;
189
+ confirmations: number;
190
+ nativeCurrencySymbol: string;
191
+ linkToken: string;
192
+ linkPriceFeed: string;
193
+ functionsRouter: string;
194
+ donId: string;
195
+ gatewayUrls: string[];
196
+ };
197
+ 42220: {
198
+ name: string;
199
+ url: string;
200
+ gasPrice: any;
201
+ nonce: any;
202
+ verifyApiKey: string;
203
+ chainId: number;
204
+ confirmations: number;
205
+ nativeCurrencySymbol: string;
206
+ linkToken: string;
207
+ linkPriceFeed: string;
208
+ functionsRouter: string;
209
+ donId: string;
210
+ gatewayUrls: string[];
211
+ };
212
+ 0: {
213
+ name: string;
214
+ url: string;
215
+ confirmations: number;
216
+ nativeCurrencySymbol: string;
217
+ linkToken: string;
218
+ functionsRouter: string;
219
+ donId: string;
220
+ };
221
+ };
222
+ export default chainlinkNetworksConfig;
@@ -0,0 +1,13 @@
1
+ import { Location, ReturnType, CodeLanguage } from "@chainlink/functions-toolkit";
2
+ declare const requestConfig: {
3
+ source: string;
4
+ codeLocation: Location;
5
+ secrets: {
6
+ apiKey: string;
7
+ };
8
+ secretsLocation: Location;
9
+ args: any[];
10
+ codeLanguage: CodeLanguage;
11
+ expectedReturnType: ReturnType;
12
+ };
13
+ export default requestConfig;
@@ -0,0 +1 @@
1
+ export declare function request(chainId: number, houseId: string, privateKey: string): Promise<void>;
@@ -0,0 +1,13 @@
1
+ import { Location, ReturnType, CodeLanguage } from "@chainlink/functions-toolkit";
2
+ declare const requestConfig: {
3
+ source: string;
4
+ codeLocation: Location;
5
+ secrets: {
6
+ apiKey: string;
7
+ };
8
+ secretsLocation: Location;
9
+ args: any[];
10
+ codeLanguage: CodeLanguage;
11
+ expectedReturnType: ReturnType;
12
+ };
13
+ export default requestConfig;
@@ -0,0 +1 @@
1
+ export declare function request(chainId: number, countryCode: string, privateKey: string): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raac/rpc",
3
- "version": "1.1.0-beta.49",
3
+ "version": "1.1.0-beta.50",
4
4
  "description": "RPC Library for RAAC ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -25,7 +25,9 @@
25
25
  "author": "RAAC",
26
26
  "license": "MIT",
27
27
  "dependencies": {
28
- "ethers": "^6.0.0"
28
+ "@chainlink/functions-toolkit": "^0.3.2",
29
+ "ethers": "^6.0.0",
30
+ "ethers5": "npm:ethers@5.7.2"
29
31
  },
30
32
  "devDependencies": {
31
33
  "eslint": "^8.0.0",