-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
constants.ts
50 lines (42 loc) · 1.75 KB
/
constants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { Network } from "@wpdas/naxios";
import { utils } from "near-api-js";
// NETWORK
export const NETWORK = (process.env.NEXT_PUBLIC_NETWORK ||
"testnet") as Network;
export const RPC_NODE_URL = `https://${NETWORK.toLowerCase() === "mainnet" ? "free.rpc.fastnear.com" : "rpc.testnet.near.org"}`;
// SYBIL CONTRACT
export const CONTRACT_ID = process.env.NEXT_PUBLIC_CONTRACT_NAME as string;
// SOCIAL DB CONTRACT
export const SOCIAL_DB_CONTRACT_ID = process.env
.NEXT_PUBLIC_SOCIAL_DB_CONTRACT_ID as string;
// 1 NEAR
export const ONE_NEAR = utils.format.parseNearAmount("1")!;
// 0.5 NEAR
export const HALF_NEAR = utils.format.parseNearAmount("0.5")!;
// 0.1 NEAR
export const ONE_TENTH_NEAR = utils.format.parseNearAmount("0.1")!;
// 0.01 NEAR
export const ONE_HUNDREDTH_NEAR = utils.format.parseNearAmount("0.01")!;
// 0.02 NEAR
export const TWO_HUNDREDTHS_NEAR = utils.format.parseNearAmount("0.02")!;
// 300 Gas (full)
export const FULL_TGAS = "300000000000000";
// 30 Gas
export const THIRTY_TGAS = "30000000000000";
// 20 Gas
export const TWENTY_TGAS = "20000000000000";
// 10 Gas
export const TEN_TGAS = "10000000000000";
// 0 Gas
export const NO_DEPOSIT_TGAS = "0";
// IPFS GATEWAY TO RENDER NEAR SOCIAL PROFILE IMAGE
export const IPFS_NEAR_SOCIAL_THUMBNAIL_URL =
"https://i.near.social/thumbnail/https://ipfs.near.social/ipfs/";
// Input Validation
// https://github.com/PotLock/core/tree/main/contracts/sybil#constants--input-validation
export const MAX_PROVIDER_NAME_LENGTH = 64;
export const MAX_PROVIDER_DESCRIPTION_LENGTH = 256;
export const MAX_PROVIDER_EXTERNAL_URL_LENGTH = 256;
export const MAX_PROVIDER_ICON_URL_LENGTH = 256;
export const MAX_GAS = 100; //100_000_000_000_000;
export const IGNORED_PROVIDER_CONTRACT_IDS = ["registry.i-am-human.near"];