@infernetprotocol/config 0.1.22
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.
- package/LICENSE +15 -0
- package/deposit-addresses.js +52 -0
- package/index.js +10 -0
- package/package.json +26 -0
- package/payment-coins.js +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Infernet Protocol
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical Infernet platform deposit addresses — the single source of truth.
|
|
3
|
+
*
|
|
4
|
+
* These are the wallets the platform receives inference payments into.
|
|
5
|
+
* They are mirrored into Supabase by the `platform_wallets` migration seed
|
|
6
|
+
* so both the CLI (which imports this module) and the web app (which reads
|
|
7
|
+
* the table) stay in sync.
|
|
8
|
+
*
|
|
9
|
+
* DO NOT modify without direct instruction — these are treasury addresses.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export const DEPOSIT_ADDRESSES = [
|
|
13
|
+
{ coin: "BTC", network: "bitcoin", address: "1HvEHWHAYW53cP6aQxWEcNaPb35sZZKFwF", label: "treasury-1" },
|
|
14
|
+
{ coin: "BTC", network: "bitcoin", address: "17xz382FDrKZj25aFkkc5CZuFpQcbFAgur", label: "treasury-2" },
|
|
15
|
+
{ coin: "BTC", network: "bitcoin", address: "1GTB6S6UGn9rkrKSTGpcEhpHi8SzXzWx6q", label: "treasury-3" },
|
|
16
|
+
{ coin: "ETH", network: "ethereum", address: "0xCC3b072391AE7A8d10cF00DdC5F61DB2cA5541E5", label: "treasury-1" },
|
|
17
|
+
{ coin: "ETH", network: "ethereum", address: "0xdDeef601c86C651DD20d6EE3FE4318fC4343D95f", label: "treasury-2" },
|
|
18
|
+
{ coin: "SOL", network: "solana", address: "B3zn7yeoL6NP8JCpis9ikGX8U4uCbrybCu5QeFyqkKpr", label: "treasury-1" },
|
|
19
|
+
{ coin: "SOL", network: "solana", address: "7tKgJsSWPQGKk3wSijwbLf4qL8Tno4GPXrwGvkmiz39g", label: "treasury-2" },
|
|
20
|
+
{ coin: "POL", network: "polygon", address: "0xCC3b072391AE7A8d10cF00DdC5F61DB2cA5541E5", label: "treasury-1" },
|
|
21
|
+
{ coin: "BCH", network: "bitcoin-cash", address: "bitcoincash:qryu0va3022eafyv6dhmdd7kylxszm5myqncfxjkaj", label: "treasury-1" },
|
|
22
|
+
{ coin: "BCH", network: "bitcoin-cash", address: "bitcoincash:qpw9mk5gmalaj9mjnndjkyenjz3rxgtt8grllxcmvd", label: "treasury-2" },
|
|
23
|
+
{ coin: "BCH", network: "bitcoin-cash", address: "bitcoincash:qqppxsqwekrpsn5lk56sjjpvhpv424zetudh8szzx7", label: "treasury-3" },
|
|
24
|
+
{ coin: "DOGE", network: "dogecoin", address: "DPsNhvoJT5h7FGyh9uiWLeFJLsyLh7f3Wf", label: "treasury-1" },
|
|
25
|
+
{ coin: "DOGE", network: "dogecoin", address: "DSKkQtcPirS2H5kGyc5pU8PHSVqx6DdUyV", label: "treasury-2" },
|
|
26
|
+
{ coin: "XRP", network: "ripple", address: "r4MoVnbkHbeJGiDx7GyVCCCHyhSPoqXfHR", label: "treasury-1" },
|
|
27
|
+
{ coin: "XRP", network: "ripple", address: "rsmeBkmDYGPxtYmbad8iBxnikePABUEZJx", label: "treasury-2" },
|
|
28
|
+
{ coin: "XRP", network: "ripple", address: "rKduygNv5nAP9u7y952Fhs9EPHTzgHguUi", label: "treasury-3" },
|
|
29
|
+
{ coin: "ADA", network: "cardano", address: "addr1v9j4u56udhkav64gm9qrp48lsymvwu3qm649vq9s0hnmzrqumlavc", label: "treasury-1" },
|
|
30
|
+
{ coin: "ADA", network: "cardano", address: "addr1v9euqha76gav45zwne6tu06gdu9mf3c8hqxlnx07km6xfxc4u9pyl", label: "treasury-2" },
|
|
31
|
+
{ coin: "BNB", network: "bsc", address: "0xCC3b072391AE7A8d10cF00DdC5F61DB2cA5541E5", label: "treasury-1" },
|
|
32
|
+
{ coin: "USDT", network: "ethereum", address: "0xCC3b072391AE7A8d10cF00DdC5F61DB2cA5541E5", label: "usdt-erc20" },
|
|
33
|
+
{ coin: "USDT", network: "polygon", address: "0xCC3b072391AE7A8d10cF00DdC5F61DB2cA5541E5", label: "usdt-polygon" },
|
|
34
|
+
{ coin: "USDT", network: "solana", address: "B3zn7yeoL6NP8JCpis9ikGX8U4uCbrybCu5QeFyqkKpr", label: "usdt-spl" },
|
|
35
|
+
{ coin: "USDC", network: "ethereum", address: "0xCC3b072391AE7A8d10cF00DdC5F61DB2cA5541E5", label: "usdc-erc20" },
|
|
36
|
+
{ coin: "USDC", network: "polygon", address: "0xCC3b072391AE7A8d10cF00DdC5F61DB2cA5541E5", label: "usdc-polygon" },
|
|
37
|
+
{ coin: "USDC", network: "solana", address: "B3zn7yeoL6NP8JCpis9ikGX8U4uCbrybCu5QeFyqkKpr", label: "usdc-spl" },
|
|
38
|
+
{ coin: "USDC", network: "base", address: "0xCC3b072391AE7A8d10cF00DdC5F61DB2cA5541E5", label: "usdc-base" }
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
export function getAddressesFor(coin, network) {
|
|
42
|
+
const upper = String(coin).toUpperCase();
|
|
43
|
+
return DEPOSIT_ADDRESSES.filter(
|
|
44
|
+
(a) => a.coin === upper && (!network || a.network === network)
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function pickAddress(coin, network) {
|
|
49
|
+
const options = getAddressesFor(coin, network);
|
|
50
|
+
if (options.length === 0) return null;
|
|
51
|
+
return options[Math.floor(Math.random() * options.length)];
|
|
52
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @infernetprotocol/config — canonical runtime constants shared across apps.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports:
|
|
5
|
+
* - PAYMENT_COINS, PAYMENT_COIN_CODES, findCoin (from ./payment-coins.js)
|
|
6
|
+
* - DEPOSIT_ADDRESSES, getAddressesFor, pickAddress (from ./deposit-addresses.js)
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from "./payment-coins.js";
|
|
10
|
+
export * from "./deposit-addresses.js";
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@infernetprotocol/config",
|
|
3
|
+
"version": "0.1.22",
|
|
4
|
+
"description": "Shared constants for the Infernet Protocol — supported payment coins and platform deposit addresses.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./index.js",
|
|
10
|
+
"./payment-coins": "./payment-coins.js",
|
|
11
|
+
"./deposit-addresses": "./deposit-addresses.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"*.js",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/profullstack/infernet-protocol.git",
|
|
23
|
+
"directory": "packages/config"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/profullstack/infernet-protocol#readme"
|
|
26
|
+
}
|
package/payment-coins.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical list of cryptocurrencies accepted by Infernet for inference payments.
|
|
3
|
+
*
|
|
4
|
+
* The enabled coins here drive:
|
|
5
|
+
* - The web UI's "Pay with…" selector
|
|
6
|
+
* - Allowed `jobs.payment_coin` values
|
|
7
|
+
* - The provider payout picker
|
|
8
|
+
* - The CoinPayPortal integration (it will advertise these currencies)
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const PAYMENT_COINS = [
|
|
12
|
+
{ code: "BTC", name: "Bitcoin", network: "bitcoin", stablecoin: false },
|
|
13
|
+
{ code: "BCH", name: "Bitcoin Cash", network: "bitcoin-cash", stablecoin: false },
|
|
14
|
+
{ code: "ETH", name: "Ethereum", network: "ethereum", stablecoin: false },
|
|
15
|
+
{ code: "SOL", name: "Solana", network: "solana", stablecoin: false },
|
|
16
|
+
{ code: "POL", name: "Polygon", network: "polygon", stablecoin: false },
|
|
17
|
+
{ code: "BNB", name: "BNB", network: "bsc", stablecoin: false },
|
|
18
|
+
{ code: "XRP", name: "XRP", network: "ripple", stablecoin: false },
|
|
19
|
+
{ code: "ADA", name: "Cardano", network: "cardano", stablecoin: false },
|
|
20
|
+
{ code: "DOGE", name: "Dogecoin", network: "dogecoin", stablecoin: false },
|
|
21
|
+
{ code: "USDT", name: "Tether (USDT-ERC20)", network: "ethereum", stablecoin: true },
|
|
22
|
+
{ code: "USDT", name: "Tether (USDT-Polygon)", network: "polygon", stablecoin: true },
|
|
23
|
+
{ code: "USDT", name: "Tether (USDT-SPL)", network: "solana", stablecoin: true },
|
|
24
|
+
{ code: "USDC", name: "USD Coin (USDC-ERC20)", network: "ethereum", stablecoin: true },
|
|
25
|
+
{ code: "USDC", name: "USD Coin (USDC-Polygon)", network: "polygon", stablecoin: true },
|
|
26
|
+
{ code: "USDC", name: "USD Coin (USDC-SPL)", network: "solana", stablecoin: true },
|
|
27
|
+
{ code: "USDC", name: "USD Coin (USDC-Base)", network: "base", stablecoin: true }
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
export const PAYMENT_COIN_CODES = [...new Set(PAYMENT_COINS.map((c) => c.code))];
|
|
31
|
+
|
|
32
|
+
export function findCoin(code, network) {
|
|
33
|
+
const upper = String(code).toUpperCase();
|
|
34
|
+
return PAYMENT_COINS.find(
|
|
35
|
+
(c) => c.code === upper && (!network || c.network === network)
|
|
36
|
+
) ?? null;
|
|
37
|
+
}
|