@reyaxyz/common 0.334.1 → 0.336.0
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/README.md +1 -1
- package/dist/incentives-api-types.js.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/transactions/executeTransaction.js +1 -1
- package/dist/transactions/executeTransaction.js.map +1 -1
- package/dist/types/incentives-api-types.d.ts +22 -0
- package/dist/types/incentives-api-types.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +0 -5
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/consts.d.ts +1 -0
- package/dist/types/utils/consts.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +0 -2
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/consts.js +6 -1
- package/dist/utils/consts.js.map +1 -1
- package/dist/utils/index.js +0 -2
- package/dist/utils/index.js.map +1 -1
- package/package.json +2 -2
- package/src/incentives-api-types.ts +33 -0
- package/src/index.ts +0 -1
- package/src/transactions/executeTransaction.ts +1 -1
- package/src/types.ts +0 -6
- package/src/utils/consts.ts +4 -0
- package/src/utils/index.ts +0 -2
- package/dist/types/utils/minting-helpers.d.ts +0 -38
- package/dist/types/utils/minting-helpers.d.ts.map +0 -1
- package/dist/types/utils/sbt-helpers.d.ts +0 -22
- package/dist/types/utils/sbt-helpers.d.ts.map +0 -1
- package/dist/types/vltz-api-types.d.ts +0 -42
- package/dist/types/vltz-api-types.d.ts.map +0 -1
- package/dist/utils/minting-helpers.js +0 -65
- package/dist/utils/minting-helpers.js.map +0 -1
- package/dist/utils/sbt-helpers.js +0 -49
- package/dist/utils/sbt-helpers.js.map +0 -1
- package/dist/vltz-api-types.js +0 -3
- package/dist/vltz-api-types.js.map +0 -1
- package/src/utils/minting-helpers.ts +0 -95
- package/src/utils/sbt-helpers.ts +0 -76
- package/src/vltz-api-types.ts +0 -56
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.336.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"generate:coverage-badges": "npx istanbul-badges-readme --silent"
|
|
45
45
|
},
|
|
46
46
|
"packageManager": "pnpm@8.3.1",
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "9214f3587f4a89038d86f6e9781e995276cef5f4"
|
|
48
48
|
}
|
|
@@ -99,6 +99,25 @@ export type IncentivesPointsHistoryEntry = {
|
|
|
99
99
|
|
|
100
100
|
export type LeaderBoardParams = { type: 'weekly' | 'total' };
|
|
101
101
|
|
|
102
|
+
export type TradingCompetitionRoundParams = { round: number };
|
|
103
|
+
|
|
104
|
+
export type TradingCompetitionUserSummaryData =
|
|
105
|
+
| {
|
|
106
|
+
realizedPnl: number;
|
|
107
|
+
eligible: false;
|
|
108
|
+
}
|
|
109
|
+
| {
|
|
110
|
+
realizedPnl: number;
|
|
111
|
+
eligible: true;
|
|
112
|
+
position: number;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export type TradingCompetitionLeaderboardEntry = {
|
|
116
|
+
walletAddress: string;
|
|
117
|
+
realizedPnl: number;
|
|
118
|
+
position: number;
|
|
119
|
+
};
|
|
120
|
+
|
|
102
121
|
export type IncentivesApiSource = {
|
|
103
122
|
'incentives/points': ApiEndpoint<
|
|
104
123
|
{
|
|
@@ -147,6 +166,20 @@ export type IncentivesApiSource = {
|
|
|
147
166
|
IncentivesPointsHistoryEntry,
|
|
148
167
|
AddressParam
|
|
149
168
|
>;
|
|
169
|
+
|
|
170
|
+
'incentives/tradingCompetition/:round': ApiEndpoint<
|
|
171
|
+
{
|
|
172
|
+
entries: TradingCompetitionLeaderboardEntry[];
|
|
173
|
+
totalCount: number;
|
|
174
|
+
refreshedAt: number;
|
|
175
|
+
},
|
|
176
|
+
TradingCompetitionRoundParams
|
|
177
|
+
>;
|
|
178
|
+
|
|
179
|
+
'incentives/wallet/:address/tradingCompetition/:round': ApiEndpoint<
|
|
180
|
+
TradingCompetitionUserSummaryData,
|
|
181
|
+
AddressParam & TradingCompetitionRoundParams
|
|
182
|
+
>;
|
|
150
183
|
};
|
|
151
184
|
|
|
152
185
|
export type IncentivesApi = {
|
package/src/index.ts
CHANGED
|
@@ -167,7 +167,7 @@ async function estimateGasExternalChains(
|
|
|
167
167
|
const decodedError = await errorDecoder.decode(error);
|
|
168
168
|
const reason = customReasonMapper(decodedError);
|
|
169
169
|
console.error(
|
|
170
|
-
`Error simulating external transaction account address ${accountAddress} reason ${decodedError?.name} ${decodedError} ${error}`,
|
|
170
|
+
`Error simulating external transaction with value ${value}, account address ${accountAddress}, reason ${decodedError?.name} ${decodedError} ${error}`,
|
|
171
171
|
);
|
|
172
172
|
throw new Error(reason);
|
|
173
173
|
}
|
package/src/types.ts
CHANGED
|
@@ -531,12 +531,6 @@ export type VoteStatusEntity = {
|
|
|
531
531
|
hasVoted: boolean;
|
|
532
532
|
};
|
|
533
533
|
|
|
534
|
-
export type SbtMintedStatusEntity = {
|
|
535
|
-
ownerAddress: string;
|
|
536
|
-
isEligible: boolean;
|
|
537
|
-
hasMinted: boolean;
|
|
538
|
-
};
|
|
539
|
-
|
|
540
534
|
export type GetLpTvlResult = {
|
|
541
535
|
currentTVL: number;
|
|
542
536
|
currentLiquidity: number;
|
package/src/utils/consts.ts
CHANGED
|
@@ -152,6 +152,10 @@ export const MA_HEALTH_WARNING_THRESHOLD = 80;
|
|
|
152
152
|
|
|
153
153
|
export const SOCKET_BRIDGE_IN_MSG_GAS_LIMIT = BigInt('20000000');
|
|
154
154
|
export const SOCKET_EMPTY_PAYLOAD_SIZE = 160;
|
|
155
|
+
export const applySocketFeeBuffer = (fees: bigint): bigint => {
|
|
156
|
+
// apply 10% buffer
|
|
157
|
+
return (fees * BigInt(110)) / BigInt(100);
|
|
158
|
+
};
|
|
155
159
|
|
|
156
160
|
export const REYA_DEX_ID = 2;
|
|
157
161
|
|
package/src/utils/index.ts
CHANGED
|
@@ -11,7 +11,5 @@ export * from './token';
|
|
|
11
11
|
export * from './task-wrapper';
|
|
12
12
|
export * from './whitelisted-wallets';
|
|
13
13
|
export * from './stringify';
|
|
14
|
-
export * from './sbt-helpers';
|
|
15
|
-
export * from './minting-helpers';
|
|
16
14
|
export * from './delay';
|
|
17
15
|
export * from './transaction-receipt';
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { MoneyInOutChainId } from '../types';
|
|
3
|
-
type VltzMintingChainIds = MoneyInOutChainId.ethereumMainnet | MoneyInOutChainId.ethereumSepolia;
|
|
4
|
-
export declare const VLTZ_MINTING_DETAILS: Record<VltzMintingChainIds, {
|
|
5
|
-
contractAddress: string;
|
|
6
|
-
rounds: Record<number, {
|
|
7
|
-
mintDeadline: number;
|
|
8
|
-
mintStart: number;
|
|
9
|
-
totalAllocation: number;
|
|
10
|
-
root: string;
|
|
11
|
-
}>;
|
|
12
|
-
}>;
|
|
13
|
-
export declare enum VltzTierName {
|
|
14
|
-
tier1 = "tier1",
|
|
15
|
-
tier2 = "tier2",
|
|
16
|
-
tier3 = "tier3",
|
|
17
|
-
legendary = "legendary",
|
|
18
|
-
easterEgg = "easterEgg"
|
|
19
|
-
}
|
|
20
|
-
export declare enum VltzSeasons {
|
|
21
|
-
seasonOg = "0",
|
|
22
|
-
season1 = "1",
|
|
23
|
-
season2 = "2",
|
|
24
|
-
season3 = "3",
|
|
25
|
-
season4 = "4"
|
|
26
|
-
}
|
|
27
|
-
export type VltzAllocationInfo = {
|
|
28
|
-
walletAddress: string;
|
|
29
|
-
totalAllocation: number;
|
|
30
|
-
allocationPerSeasonBadge: Record<VltzSeasons, Record<VltzTierName, number>>;
|
|
31
|
-
};
|
|
32
|
-
export type VltzLeafInfo = {
|
|
33
|
-
walletAddress: string;
|
|
34
|
-
allocation: string;
|
|
35
|
-
};
|
|
36
|
-
export declare const getVltzLeaf: (walletAddress: string, allocation: string) => Buffer;
|
|
37
|
-
export {};
|
|
38
|
-
//# sourceMappingURL=minting-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"minting-helpers.d.ts","sourceRoot":"/","sources":["utils/minting-helpers.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,KAAK,mBAAmB,GACpB,iBAAiB,CAAC,eAAe,GACjC,iBAAiB,CAAC,eAAe,CAAC;AAGtC,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,mBAAmB,EACnB;IACE,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CACZ,MAAM,EACN;QACE,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;KACd,CACF,CAAC;CACH,CAoCF,CAAC;AAEF,oBAAY,YAAY;IACtB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,SAAS,cAAc;CACxB;AAED,oBAAY,WAAW;IACrB,QAAQ,MAAM;IACd,OAAO,MAAM;IACb,OAAO,MAAM;IACb,OAAO,MAAM;IACb,OAAO,MAAM;CACd;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,wBAAwB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;CAC7E,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,WAAW,kBACP,MAAM,cACT,MAAM,KACjB,MAKF,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { BigNumberish } from 'ethers';
|
|
3
|
-
import { ReyaChainId } from '../types';
|
|
4
|
-
export declare const SBT_ROOT: Record<ReyaChainId, string>;
|
|
5
|
-
export declare const SBT_ROOT_EXTRA_OGS: Record<ReyaChainId, string>;
|
|
6
|
-
export declare enum SBT_ROOT_TYPE {
|
|
7
|
-
SPECIAL_ROOT = "special_root",
|
|
8
|
-
OG_ROOT = "all_ogs_root",
|
|
9
|
-
EXTRA_ROOT = "extra_root"
|
|
10
|
-
}
|
|
11
|
-
export declare const getSbtRoot: (reyaChainId: ReyaChainId, ownerAddress: string, isAddressEligibleForSpecialSbt: boolean, isAddressEligibleForOgSbt: boolean, sbtEligibleExtraWallets: {
|
|
12
|
-
account: string;
|
|
13
|
-
root: string;
|
|
14
|
-
}[]) => string;
|
|
15
|
-
export declare const SBT_MINT_DEADLINE = 1743508800;
|
|
16
|
-
export type SbtLeafInfo = {
|
|
17
|
-
account: string;
|
|
18
|
-
tokenRootCounter: number;
|
|
19
|
-
};
|
|
20
|
-
export declare const getLeaf: (address: string, tokenRootCounter: number) => Buffer;
|
|
21
|
-
export declare const getSbtTokenId: (account: string, merkleRoot: string, tokenRootCounter: number) => BigNumberish;
|
|
22
|
-
//# sourceMappingURL=sbt-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sbt-helpers.d.ts","sourceRoot":"/","sources":["utils/sbt-helpers.ts"],"names":[],"mappings":";AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAKhD,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAK1D,CAAC;AAEF,oBAAY,aAAa;IACvB,YAAY,iBAAiB;IAC7B,OAAO,iBAAiB;IACxB,UAAU,eAAe;CAC1B;AAED,eAAO,MAAM,UAAU,gBACR,WAAW,gBACV,MAAM,kCACY,OAAO,6BACZ,OAAO,2BACT;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,KAC3D,MAcF,CAAC;AAEF,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,OAAO,YAAa,MAAM,oBAAoB,MAAM,KAAG,MAQnE,CAAC;AAEF,eAAO,MAAM,aAAa,YACf,MAAM,cACH,MAAM,oBACA,MAAM,KACvB,YASF,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { AddressParam, ApiEndpoint, PaginatedQueryMeta, PaginatedQueryParams, Stringified } from './api-types';
|
|
2
|
-
import { VltzAllocationInfo } from './utils';
|
|
3
|
-
export type VltzRoundInfo = {
|
|
4
|
-
deadlineMs: number;
|
|
5
|
-
mintedAmount: number;
|
|
6
|
-
totalAllocation: number;
|
|
7
|
-
totalRealizedPnl: number;
|
|
8
|
-
leaderboardCachedTimestampMs: number;
|
|
9
|
-
leaderboard: {
|
|
10
|
-
data: {
|
|
11
|
-
walletAddress: string;
|
|
12
|
-
realizedPnl: number;
|
|
13
|
-
}[];
|
|
14
|
-
meta: PaginatedQueryMeta;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export type VltzWalletInfo = {
|
|
18
|
-
minted: boolean;
|
|
19
|
-
mintedAmountSoFar: number;
|
|
20
|
-
allocationInfo: VltzAllocationInfo;
|
|
21
|
-
merkleRoot: string;
|
|
22
|
-
merkleProof: string[];
|
|
23
|
-
contractAddress: string;
|
|
24
|
-
realizedPnl: number;
|
|
25
|
-
positionInLeaderboard: number | null;
|
|
26
|
-
};
|
|
27
|
-
export type VltzApiSource = {
|
|
28
|
-
'vltz/round/:id': ApiEndpoint<VltzRoundInfo, {
|
|
29
|
-
id: string;
|
|
30
|
-
} & PaginatedQueryParams>;
|
|
31
|
-
'vltz/wallet/:address/:roundId': ApiEndpoint<VltzWalletInfo, AddressParam & {
|
|
32
|
-
roundId: string;
|
|
33
|
-
}>;
|
|
34
|
-
};
|
|
35
|
-
export type VltzApi = {
|
|
36
|
-
[K in keyof VltzApiSource]: {
|
|
37
|
-
params: VltzApiSource[K]['params'];
|
|
38
|
-
query: VltzApiSource[K]['query'];
|
|
39
|
-
response: Stringified<VltzApiSource[K]['response']>;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=vltz-api-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vltz-api-types.d.ts","sourceRoot":"/","sources":["vltz-api-types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,4BAA4B,EAAE,MAAM,CAAC;IACrC,WAAW,EAAE;QACX,IAAI,EAAE;YACJ,aAAa,EAAE,MAAM,CAAC;YACtB,WAAW,EAAE,MAAM,CAAC;SACrB,EAAE,CAAC;QACJ,IAAI,EAAE,kBAAkB,CAAC;KAC1B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,kBAAkB,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,gBAAgB,EAAE,WAAW,CAC3B,aAAa,EACb;QACE,EAAE,EAAE,MAAM,CAAC;KACZ,GAAG,oBAAoB,CACzB,CAAC;IAEF,+BAA+B,EAAE,WAAW,CAC1C,cAAc,EACd,YAAY,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CACnC,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;KACnB,CAAC,IAAI,MAAM,aAAa,GAAG;QAC1B,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACnC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACjC,QAAQ,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;KACrD;CACF,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getVltzLeaf = exports.VltzSeasons = exports.VltzTierName = exports.VLTZ_MINTING_DETAILS = void 0;
|
|
5
|
-
var ethers_1 = require("ethers");
|
|
6
|
-
var types_1 = require("../types");
|
|
7
|
-
// mapping from round, to network, to details
|
|
8
|
-
exports.VLTZ_MINTING_DETAILS = (_a = {},
|
|
9
|
-
_a[types_1.MoneyInOutChainId.ethereumSepolia] = {
|
|
10
|
-
contractAddress: '0x7A00255ebcBE36FbF469e0A6265A271749560aE4',
|
|
11
|
-
rounds: {
|
|
12
|
-
1: {
|
|
13
|
-
mintDeadline: 1761742800,
|
|
14
|
-
mintStart: 1760529600,
|
|
15
|
-
totalAllocation: 1000000000, // 1 Billion
|
|
16
|
-
root: '0x1aaeed7e414b0946dee1e5ddb2eb8bd63953c2f4f4a0f413998a1070a30b06d8',
|
|
17
|
-
},
|
|
18
|
-
2: {
|
|
19
|
-
mintDeadline: 0,
|
|
20
|
-
mintStart: 0,
|
|
21
|
-
totalAllocation: 0,
|
|
22
|
-
root: '',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
_a[types_1.MoneyInOutChainId.ethereumMainnet] = {
|
|
27
|
-
contractAddress: '0x28606bbC6DBdcd8953B480Ac4226fcC34a396950',
|
|
28
|
-
rounds: {
|
|
29
|
-
1: {
|
|
30
|
-
mintDeadline: 1762347600,
|
|
31
|
-
mintStart: 1761134400,
|
|
32
|
-
totalAllocation: 1000000000, // 1 Billion
|
|
33
|
-
root: '0x2055f18a8e96ea548a78552f33632989ab0afa5706e530b10bd24c8bfcdafe71',
|
|
34
|
-
},
|
|
35
|
-
2: {
|
|
36
|
-
mintDeadline: 0,
|
|
37
|
-
mintStart: 0,
|
|
38
|
-
totalAllocation: 0,
|
|
39
|
-
root: '0x0faccf7c41125fdde5e72990184527a8c1642ccf1fdaa5e9bf7c882edb7e4ea5',
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
_a);
|
|
44
|
-
var VltzTierName;
|
|
45
|
-
(function (VltzTierName) {
|
|
46
|
-
VltzTierName["tier1"] = "tier1";
|
|
47
|
-
VltzTierName["tier2"] = "tier2";
|
|
48
|
-
VltzTierName["tier3"] = "tier3";
|
|
49
|
-
VltzTierName["legendary"] = "legendary";
|
|
50
|
-
VltzTierName["easterEgg"] = "easterEgg";
|
|
51
|
-
})(VltzTierName || (exports.VltzTierName = VltzTierName = {}));
|
|
52
|
-
var VltzSeasons;
|
|
53
|
-
(function (VltzSeasons) {
|
|
54
|
-
VltzSeasons["seasonOg"] = "0";
|
|
55
|
-
VltzSeasons["season1"] = "1";
|
|
56
|
-
VltzSeasons["season2"] = "2";
|
|
57
|
-
VltzSeasons["season3"] = "3";
|
|
58
|
-
VltzSeasons["season4"] = "4";
|
|
59
|
-
})(VltzSeasons || (exports.VltzSeasons = VltzSeasons = {}));
|
|
60
|
-
var getVltzLeaf = function (walletAddress, allocation) {
|
|
61
|
-
var messageHash = ethers_1.ethers.keccak256(ethers_1.ethers.solidityPacked(['address', 'uint256'], [walletAddress, allocation]));
|
|
62
|
-
return Buffer.from(messageHash.slice(2), 'hex');
|
|
63
|
-
};
|
|
64
|
-
exports.getVltzLeaf = getVltzLeaf;
|
|
65
|
-
//# sourceMappingURL=minting-helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"minting-helpers.js","sourceRoot":"/","sources":["utils/minting-helpers.ts"],"names":[],"mappings":";;;;AAAA,iCAAgC;AAChC,kCAA6C;AAM7C,6CAA6C;AAChC,QAAA,oBAAoB;IAe/B,GAAC,yBAAiB,CAAC,eAAe,IAAG;QACnC,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE;YACN,CAAC,EAAE;gBACD,YAAY,EAAE,UAAU;gBACxB,SAAS,EAAE,UAAU;gBACrB,eAAe,EAAE,UAAU,EAAE,YAAY;gBACzC,IAAI,EAAE,oEAAoE;aAC3E;YACD,CAAC,EAAE;gBACD,YAAY,EAAE,CAAC;gBACf,SAAS,EAAE,CAAC;gBACZ,eAAe,EAAE,CAAC;gBAClB,IAAI,EAAE,EAAE;aACT;SACF;KACF;IACD,GAAC,yBAAiB,CAAC,eAAe,IAAG;QACnC,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE;YACN,CAAC,EAAE;gBACD,YAAY,EAAE,UAAU;gBACxB,SAAS,EAAE,UAAU;gBACrB,eAAe,EAAE,UAAU,EAAE,YAAY;gBACzC,IAAI,EAAE,oEAAoE;aAC3E;YACD,CAAC,EAAE;gBACD,YAAY,EAAE,CAAC;gBACf,SAAS,EAAE,CAAC;gBACZ,eAAe,EAAE,CAAC;gBAClB,IAAI,EAAE,oEAAoE;aAC3E;SACF;KACF;QACD;AAEF,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,+BAAe,CAAA;IACf,+BAAe,CAAA;IACf,uCAAuB,CAAA;IACvB,uCAAuB,CAAA;AACzB,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB;AAED,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,6BAAc,CAAA;IACd,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,4BAAa,CAAA;AACf,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AAaM,IAAM,WAAW,GAAG,UACzB,aAAqB,EACrB,UAAkB;IAElB,IAAM,WAAW,GAAG,eAAM,CAAC,SAAS,CAClC,eAAM,CAAC,cAAc,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAC3E,CAAC;IACF,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC,CAAC;AARW,QAAA,WAAW,eAQtB","sourcesContent":["import { ethers } from 'ethers';\nimport { MoneyInOutChainId } from '../types';\n\ntype VltzMintingChainIds =\n | MoneyInOutChainId.ethereumMainnet\n | MoneyInOutChainId.ethereumSepolia;\n\n// mapping from round, to network, to details\nexport const VLTZ_MINTING_DETAILS: Record<\n VltzMintingChainIds,\n {\n contractAddress: string;\n rounds: Record<\n number,\n {\n mintDeadline: number;\n mintStart: number;\n totalAllocation: number;\n root: string;\n }\n >;\n }\n> = {\n [MoneyInOutChainId.ethereumSepolia]: {\n contractAddress: '0x7A00255ebcBE36FbF469e0A6265A271749560aE4',\n rounds: {\n 1: {\n mintDeadline: 1761742800,\n mintStart: 1760529600,\n totalAllocation: 1000000000, // 1 Billion\n root: '0x1aaeed7e414b0946dee1e5ddb2eb8bd63953c2f4f4a0f413998a1070a30b06d8',\n },\n 2: {\n mintDeadline: 0,\n mintStart: 0,\n totalAllocation: 0,\n root: '',\n },\n },\n },\n [MoneyInOutChainId.ethereumMainnet]: {\n contractAddress: '0x28606bbC6DBdcd8953B480Ac4226fcC34a396950',\n rounds: {\n 1: {\n mintDeadline: 1762347600,\n mintStart: 1761134400,\n totalAllocation: 1000000000, // 1 Billion\n root: '0x2055f18a8e96ea548a78552f33632989ab0afa5706e530b10bd24c8bfcdafe71',\n },\n 2: {\n mintDeadline: 0,\n mintStart: 0,\n totalAllocation: 0,\n root: '0x0faccf7c41125fdde5e72990184527a8c1642ccf1fdaa5e9bf7c882edb7e4ea5',\n },\n },\n },\n};\n\nexport enum VltzTierName {\n tier1 = 'tier1',\n tier2 = 'tier2',\n tier3 = 'tier3',\n legendary = 'legendary',\n easterEgg = 'easterEgg',\n}\n\nexport enum VltzSeasons {\n seasonOg = '0',\n season1 = '1',\n season2 = '2',\n season3 = '3',\n season4 = '4',\n}\n\nexport type VltzAllocationInfo = {\n walletAddress: string;\n totalAllocation: number;\n allocationPerSeasonBadge: Record<VltzSeasons, Record<VltzTierName, number>>;\n};\n\nexport type VltzLeafInfo = {\n walletAddress: string;\n allocation: string;\n};\n\nexport const getVltzLeaf = (\n walletAddress: string,\n allocation: string,\n): Buffer => {\n const messageHash = ethers.keccak256(\n ethers.solidityPacked(['address', 'uint256'], [walletAddress, allocation]),\n );\n return Buffer.from(messageHash.slice(2), 'hex');\n};\n"]}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a, _b;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getSbtTokenId = exports.getLeaf = exports.SBT_MINT_DEADLINE = exports.getSbtRoot = exports.SBT_ROOT_TYPE = exports.SBT_ROOT_EXTRA_OGS = exports.SBT_ROOT = void 0;
|
|
5
|
-
var ethers_1 = require("ethers");
|
|
6
|
-
var types_1 = require("../types");
|
|
7
|
-
exports.SBT_ROOT = (_a = {},
|
|
8
|
-
_a[types_1.ReyaChainId.reyaNetwork] = '0x7d8254a884c4e1e8040d592fdbe3ce8986fb6c5c4f7dee3ce7b7f823fa127c52',
|
|
9
|
-
_a[types_1.ReyaChainId.reyaCronos] = '0x01f4d29a3aca5cb40663851d2d40d605636dd6448f251d77765dd0e40c422136',
|
|
10
|
-
_a);
|
|
11
|
-
exports.SBT_ROOT_EXTRA_OGS = (_b = {},
|
|
12
|
-
_b[types_1.ReyaChainId.reyaNetwork] = '0xbc6264e25255e1b3d456ec287615879c2525828345a3d4d4c09eb11baa2d201f',
|
|
13
|
-
_b[types_1.ReyaChainId.reyaCronos] = '0xdb3908dd08c4ccc9a39a3699999ff7043780ce76b245fffc4d551dc903594b61',
|
|
14
|
-
_b);
|
|
15
|
-
var SBT_ROOT_TYPE;
|
|
16
|
-
(function (SBT_ROOT_TYPE) {
|
|
17
|
-
SBT_ROOT_TYPE["SPECIAL_ROOT"] = "special_root";
|
|
18
|
-
SBT_ROOT_TYPE["OG_ROOT"] = "all_ogs_root";
|
|
19
|
-
SBT_ROOT_TYPE["EXTRA_ROOT"] = "extra_root";
|
|
20
|
-
})(SBT_ROOT_TYPE || (exports.SBT_ROOT_TYPE = SBT_ROOT_TYPE = {}));
|
|
21
|
-
var getSbtRoot = function (reyaChainId, ownerAddress, isAddressEligibleForSpecialSbt, isAddressEligibleForOgSbt, sbtEligibleExtraWallets) {
|
|
22
|
-
var merkleRoot = '';
|
|
23
|
-
if (isAddressEligibleForSpecialSbt) {
|
|
24
|
-
return exports.SBT_ROOT[reyaChainId];
|
|
25
|
-
}
|
|
26
|
-
else if (isAddressEligibleForOgSbt) {
|
|
27
|
-
return exports.SBT_ROOT_EXTRA_OGS[reyaChainId];
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
sbtEligibleExtraWallets.forEach(function (e) {
|
|
31
|
-
if (e.account.toLowerCase() == ownerAddress.toLowerCase()) {
|
|
32
|
-
merkleRoot = e.root;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
return merkleRoot;
|
|
37
|
-
};
|
|
38
|
-
exports.getSbtRoot = getSbtRoot;
|
|
39
|
-
exports.SBT_MINT_DEADLINE = 1743508800; // Tue Apr 01 2025 12:00:00 GMT+0000
|
|
40
|
-
var getLeaf = function (address, tokenRootCounter) {
|
|
41
|
-
var messageHash = ethers_1.ethers.keccak256(ethers_1.ethers.solidityPacked(['address', 'uint256'], [address, tokenRootCounter.toString()]));
|
|
42
|
-
return Buffer.from(messageHash.slice(2), 'hex');
|
|
43
|
-
};
|
|
44
|
-
exports.getLeaf = getLeaf;
|
|
45
|
-
var getSbtTokenId = function (account, merkleRoot, tokenRootCounter) {
|
|
46
|
-
return ethers_1.ethers.toBigInt(ethers_1.ethers.keccak256(ethers_1.ethers.solidityPacked(['address', 'bytes32', 'uint256'], [account, merkleRoot, tokenRootCounter.toString()])));
|
|
47
|
-
};
|
|
48
|
-
exports.getSbtTokenId = getSbtTokenId;
|
|
49
|
-
//# sourceMappingURL=sbt-helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sbt-helpers.js","sourceRoot":"/","sources":["utils/sbt-helpers.ts"],"names":[],"mappings":";;;;AAAA,iCAA8C;AAC9C,kCAAuC;AAE1B,QAAA,QAAQ;IACnB,GAAC,mBAAW,CAAC,WAAW,IACtB,oEAAoE;IACtE,GAAC,mBAAW,CAAC,UAAU,IACrB,oEAAoE;QACtE;AAEW,QAAA,kBAAkB;IAC7B,GAAC,mBAAW,CAAC,WAAW,IACtB,oEAAoE;IACtE,GAAC,mBAAW,CAAC,UAAU,IACrB,oEAAoE;QACtE;AAEF,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,8CAA6B,CAAA;IAC7B,yCAAwB,CAAA;IACxB,0CAAyB,CAAA;AAC3B,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAEM,IAAM,UAAU,GAAG,UACxB,WAAwB,EACxB,YAAoB,EACpB,8BAAuC,EACvC,yBAAkC,EAClC,uBAA4D;IAE5D,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAI,8BAA8B,EAAE,CAAC;QACnC,OAAO,gBAAQ,CAAC,WAAW,CAAC,CAAC;IAC/B,CAAC;SAAM,IAAI,yBAAyB,EAAE,CAAC;QACrC,OAAO,0BAAkB,CAAC,WAAW,CAAC,CAAC;IACzC,CAAC;SAAM,CAAC;QACN,uBAAuB,CAAC,OAAO,CAAC,UAAC,CAAC;YAChC,IAAI,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,YAAY,CAAC,WAAW,EAAE,EAAE,CAAC;gBAC1D,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC;YACtB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AApBW,QAAA,UAAU,cAoBrB;AAEW,QAAA,iBAAiB,GAAG,UAAU,CAAC,CAAC,oCAAoC;AAO1E,IAAM,OAAO,GAAG,UAAC,OAAe,EAAE,gBAAwB;IAC/D,IAAM,WAAW,GAAG,eAAM,CAAC,SAAS,CAClC,eAAM,CAAC,cAAc,CACnB,CAAC,SAAS,EAAE,SAAS,CAAC,EACtB,CAAC,OAAO,EAAE,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CACvC,CACF,CAAC;IACF,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC,CAAC;AARW,QAAA,OAAO,WAQlB;AAEK,IAAM,aAAa,GAAG,UAC3B,OAAe,EACf,UAAkB,EAClB,gBAAwB;IAExB,OAAO,eAAM,CAAC,QAAQ,CACpB,eAAM,CAAC,SAAS,CACd,eAAM,CAAC,cAAc,CACnB,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,EACjC,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CACnD,CACF,CACF,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,aAAa,iBAaxB","sourcesContent":["import { ethers, BigNumberish } from 'ethers';\nimport { ReyaChainId } from '../types';\n\nexport const SBT_ROOT: Record<ReyaChainId, string> = {\n [ReyaChainId.reyaNetwork]:\n '0x7d8254a884c4e1e8040d592fdbe3ce8986fb6c5c4f7dee3ce7b7f823fa127c52',\n [ReyaChainId.reyaCronos]:\n '0x01f4d29a3aca5cb40663851d2d40d605636dd6448f251d77765dd0e40c422136',\n};\n\nexport const SBT_ROOT_EXTRA_OGS: Record<ReyaChainId, string> = {\n [ReyaChainId.reyaNetwork]:\n '0xbc6264e25255e1b3d456ec287615879c2525828345a3d4d4c09eb11baa2d201f',\n [ReyaChainId.reyaCronos]:\n '0xdb3908dd08c4ccc9a39a3699999ff7043780ce76b245fffc4d551dc903594b61',\n};\n\nexport enum SBT_ROOT_TYPE {\n SPECIAL_ROOT = 'special_root',\n OG_ROOT = 'all_ogs_root',\n EXTRA_ROOT = 'extra_root',\n}\n\nexport const getSbtRoot = (\n reyaChainId: ReyaChainId,\n ownerAddress: string,\n isAddressEligibleForSpecialSbt: boolean,\n isAddressEligibleForOgSbt: boolean,\n sbtEligibleExtraWallets: { account: string; root: string }[],\n): string => {\n let merkleRoot = '';\n if (isAddressEligibleForSpecialSbt) {\n return SBT_ROOT[reyaChainId];\n } else if (isAddressEligibleForOgSbt) {\n return SBT_ROOT_EXTRA_OGS[reyaChainId];\n } else {\n sbtEligibleExtraWallets.forEach((e) => {\n if (e.account.toLowerCase() == ownerAddress.toLowerCase()) {\n merkleRoot = e.root;\n }\n });\n }\n return merkleRoot;\n};\n\nexport const SBT_MINT_DEADLINE = 1743508800; // Tue Apr 01 2025 12:00:00 GMT+0000\n\nexport type SbtLeafInfo = {\n account: string;\n tokenRootCounter: number;\n};\n\nexport const getLeaf = (address: string, tokenRootCounter: number): Buffer => {\n const messageHash = ethers.keccak256(\n ethers.solidityPacked(\n ['address', 'uint256'],\n [address, tokenRootCounter.toString()],\n ),\n );\n return Buffer.from(messageHash.slice(2), 'hex');\n};\n\nexport const getSbtTokenId = (\n account: string,\n merkleRoot: string,\n tokenRootCounter: number,\n): BigNumberish => {\n return ethers.toBigInt(\n ethers.keccak256(\n ethers.solidityPacked(\n ['address', 'bytes32', 'uint256'],\n [account, merkleRoot, tokenRootCounter.toString()],\n ),\n ),\n );\n};\n"]}
|
package/dist/vltz-api-types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vltz-api-types.js","sourceRoot":"/","sources":["vltz-api-types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n AddressParam,\n ApiEndpoint,\n PaginatedQueryMeta,\n PaginatedQueryParams,\n Stringified,\n} from './api-types';\nimport { VltzAllocationInfo } from './utils';\n\nexport type VltzRoundInfo = {\n deadlineMs: number;\n mintedAmount: number;\n totalAllocation: number;\n totalRealizedPnl: number;\n leaderboardCachedTimestampMs: number;\n leaderboard: {\n data: {\n walletAddress: string;\n realizedPnl: number;\n }[];\n meta: PaginatedQueryMeta;\n };\n};\n\nexport type VltzWalletInfo = {\n minted: boolean;\n mintedAmountSoFar: number;\n allocationInfo: VltzAllocationInfo;\n merkleRoot: string;\n merkleProof: string[];\n contractAddress: string;\n realizedPnl: number;\n positionInLeaderboard: number | null;\n};\n\nexport type VltzApiSource = {\n 'vltz/round/:id': ApiEndpoint<\n VltzRoundInfo,\n {\n id: string;\n } & PaginatedQueryParams\n >;\n\n 'vltz/wallet/:address/:roundId': ApiEndpoint<\n VltzWalletInfo,\n AddressParam & { roundId: string }\n >;\n};\n\nexport type VltzApi = {\n [K in keyof VltzApiSource]: {\n params: VltzApiSource[K]['params'];\n query: VltzApiSource[K]['query'];\n response: Stringified<VltzApiSource[K]['response']>;\n };\n};\n"]}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { ethers } from 'ethers';
|
|
2
|
-
import { MoneyInOutChainId } from '../types';
|
|
3
|
-
|
|
4
|
-
type VltzMintingChainIds =
|
|
5
|
-
| MoneyInOutChainId.ethereumMainnet
|
|
6
|
-
| MoneyInOutChainId.ethereumSepolia;
|
|
7
|
-
|
|
8
|
-
// mapping from round, to network, to details
|
|
9
|
-
export const VLTZ_MINTING_DETAILS: Record<
|
|
10
|
-
VltzMintingChainIds,
|
|
11
|
-
{
|
|
12
|
-
contractAddress: string;
|
|
13
|
-
rounds: Record<
|
|
14
|
-
number,
|
|
15
|
-
{
|
|
16
|
-
mintDeadline: number;
|
|
17
|
-
mintStart: number;
|
|
18
|
-
totalAllocation: number;
|
|
19
|
-
root: string;
|
|
20
|
-
}
|
|
21
|
-
>;
|
|
22
|
-
}
|
|
23
|
-
> = {
|
|
24
|
-
[MoneyInOutChainId.ethereumSepolia]: {
|
|
25
|
-
contractAddress: '0x7A00255ebcBE36FbF469e0A6265A271749560aE4',
|
|
26
|
-
rounds: {
|
|
27
|
-
1: {
|
|
28
|
-
mintDeadline: 1761742800,
|
|
29
|
-
mintStart: 1760529600,
|
|
30
|
-
totalAllocation: 1000000000, // 1 Billion
|
|
31
|
-
root: '0x1aaeed7e414b0946dee1e5ddb2eb8bd63953c2f4f4a0f413998a1070a30b06d8',
|
|
32
|
-
},
|
|
33
|
-
2: {
|
|
34
|
-
mintDeadline: 0,
|
|
35
|
-
mintStart: 0,
|
|
36
|
-
totalAllocation: 0,
|
|
37
|
-
root: '',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
[MoneyInOutChainId.ethereumMainnet]: {
|
|
42
|
-
contractAddress: '0x28606bbC6DBdcd8953B480Ac4226fcC34a396950',
|
|
43
|
-
rounds: {
|
|
44
|
-
1: {
|
|
45
|
-
mintDeadline: 1762347600,
|
|
46
|
-
mintStart: 1761134400,
|
|
47
|
-
totalAllocation: 1000000000, // 1 Billion
|
|
48
|
-
root: '0x2055f18a8e96ea548a78552f33632989ab0afa5706e530b10bd24c8bfcdafe71',
|
|
49
|
-
},
|
|
50
|
-
2: {
|
|
51
|
-
mintDeadline: 0,
|
|
52
|
-
mintStart: 0,
|
|
53
|
-
totalAllocation: 0,
|
|
54
|
-
root: '0x0faccf7c41125fdde5e72990184527a8c1642ccf1fdaa5e9bf7c882edb7e4ea5',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export enum VltzTierName {
|
|
61
|
-
tier1 = 'tier1',
|
|
62
|
-
tier2 = 'tier2',
|
|
63
|
-
tier3 = 'tier3',
|
|
64
|
-
legendary = 'legendary',
|
|
65
|
-
easterEgg = 'easterEgg',
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export enum VltzSeasons {
|
|
69
|
-
seasonOg = '0',
|
|
70
|
-
season1 = '1',
|
|
71
|
-
season2 = '2',
|
|
72
|
-
season3 = '3',
|
|
73
|
-
season4 = '4',
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export type VltzAllocationInfo = {
|
|
77
|
-
walletAddress: string;
|
|
78
|
-
totalAllocation: number;
|
|
79
|
-
allocationPerSeasonBadge: Record<VltzSeasons, Record<VltzTierName, number>>;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export type VltzLeafInfo = {
|
|
83
|
-
walletAddress: string;
|
|
84
|
-
allocation: string;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export const getVltzLeaf = (
|
|
88
|
-
walletAddress: string,
|
|
89
|
-
allocation: string,
|
|
90
|
-
): Buffer => {
|
|
91
|
-
const messageHash = ethers.keccak256(
|
|
92
|
-
ethers.solidityPacked(['address', 'uint256'], [walletAddress, allocation]),
|
|
93
|
-
);
|
|
94
|
-
return Buffer.from(messageHash.slice(2), 'hex');
|
|
95
|
-
};
|
package/src/utils/sbt-helpers.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { ethers, BigNumberish } from 'ethers';
|
|
2
|
-
import { ReyaChainId } from '../types';
|
|
3
|
-
|
|
4
|
-
export const SBT_ROOT: Record<ReyaChainId, string> = {
|
|
5
|
-
[ReyaChainId.reyaNetwork]:
|
|
6
|
-
'0x7d8254a884c4e1e8040d592fdbe3ce8986fb6c5c4f7dee3ce7b7f823fa127c52',
|
|
7
|
-
[ReyaChainId.reyaCronos]:
|
|
8
|
-
'0x01f4d29a3aca5cb40663851d2d40d605636dd6448f251d77765dd0e40c422136',
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const SBT_ROOT_EXTRA_OGS: Record<ReyaChainId, string> = {
|
|
12
|
-
[ReyaChainId.reyaNetwork]:
|
|
13
|
-
'0xbc6264e25255e1b3d456ec287615879c2525828345a3d4d4c09eb11baa2d201f',
|
|
14
|
-
[ReyaChainId.reyaCronos]:
|
|
15
|
-
'0xdb3908dd08c4ccc9a39a3699999ff7043780ce76b245fffc4d551dc903594b61',
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export enum SBT_ROOT_TYPE {
|
|
19
|
-
SPECIAL_ROOT = 'special_root',
|
|
20
|
-
OG_ROOT = 'all_ogs_root',
|
|
21
|
-
EXTRA_ROOT = 'extra_root',
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const getSbtRoot = (
|
|
25
|
-
reyaChainId: ReyaChainId,
|
|
26
|
-
ownerAddress: string,
|
|
27
|
-
isAddressEligibleForSpecialSbt: boolean,
|
|
28
|
-
isAddressEligibleForOgSbt: boolean,
|
|
29
|
-
sbtEligibleExtraWallets: { account: string; root: string }[],
|
|
30
|
-
): string => {
|
|
31
|
-
let merkleRoot = '';
|
|
32
|
-
if (isAddressEligibleForSpecialSbt) {
|
|
33
|
-
return SBT_ROOT[reyaChainId];
|
|
34
|
-
} else if (isAddressEligibleForOgSbt) {
|
|
35
|
-
return SBT_ROOT_EXTRA_OGS[reyaChainId];
|
|
36
|
-
} else {
|
|
37
|
-
sbtEligibleExtraWallets.forEach((e) => {
|
|
38
|
-
if (e.account.toLowerCase() == ownerAddress.toLowerCase()) {
|
|
39
|
-
merkleRoot = e.root;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
return merkleRoot;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export const SBT_MINT_DEADLINE = 1743508800; // Tue Apr 01 2025 12:00:00 GMT+0000
|
|
47
|
-
|
|
48
|
-
export type SbtLeafInfo = {
|
|
49
|
-
account: string;
|
|
50
|
-
tokenRootCounter: number;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const getLeaf = (address: string, tokenRootCounter: number): Buffer => {
|
|
54
|
-
const messageHash = ethers.keccak256(
|
|
55
|
-
ethers.solidityPacked(
|
|
56
|
-
['address', 'uint256'],
|
|
57
|
-
[address, tokenRootCounter.toString()],
|
|
58
|
-
),
|
|
59
|
-
);
|
|
60
|
-
return Buffer.from(messageHash.slice(2), 'hex');
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const getSbtTokenId = (
|
|
64
|
-
account: string,
|
|
65
|
-
merkleRoot: string,
|
|
66
|
-
tokenRootCounter: number,
|
|
67
|
-
): BigNumberish => {
|
|
68
|
-
return ethers.toBigInt(
|
|
69
|
-
ethers.keccak256(
|
|
70
|
-
ethers.solidityPacked(
|
|
71
|
-
['address', 'bytes32', 'uint256'],
|
|
72
|
-
[account, merkleRoot, tokenRootCounter.toString()],
|
|
73
|
-
),
|
|
74
|
-
),
|
|
75
|
-
);
|
|
76
|
-
};
|
package/src/vltz-api-types.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AddressParam,
|
|
3
|
-
ApiEndpoint,
|
|
4
|
-
PaginatedQueryMeta,
|
|
5
|
-
PaginatedQueryParams,
|
|
6
|
-
Stringified,
|
|
7
|
-
} from './api-types';
|
|
8
|
-
import { VltzAllocationInfo } from './utils';
|
|
9
|
-
|
|
10
|
-
export type VltzRoundInfo = {
|
|
11
|
-
deadlineMs: number;
|
|
12
|
-
mintedAmount: number;
|
|
13
|
-
totalAllocation: number;
|
|
14
|
-
totalRealizedPnl: number;
|
|
15
|
-
leaderboardCachedTimestampMs: number;
|
|
16
|
-
leaderboard: {
|
|
17
|
-
data: {
|
|
18
|
-
walletAddress: string;
|
|
19
|
-
realizedPnl: number;
|
|
20
|
-
}[];
|
|
21
|
-
meta: PaginatedQueryMeta;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export type VltzWalletInfo = {
|
|
26
|
-
minted: boolean;
|
|
27
|
-
mintedAmountSoFar: number;
|
|
28
|
-
allocationInfo: VltzAllocationInfo;
|
|
29
|
-
merkleRoot: string;
|
|
30
|
-
merkleProof: string[];
|
|
31
|
-
contractAddress: string;
|
|
32
|
-
realizedPnl: number;
|
|
33
|
-
positionInLeaderboard: number | null;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export type VltzApiSource = {
|
|
37
|
-
'vltz/round/:id': ApiEndpoint<
|
|
38
|
-
VltzRoundInfo,
|
|
39
|
-
{
|
|
40
|
-
id: string;
|
|
41
|
-
} & PaginatedQueryParams
|
|
42
|
-
>;
|
|
43
|
-
|
|
44
|
-
'vltz/wallet/:address/:roundId': ApiEndpoint<
|
|
45
|
-
VltzWalletInfo,
|
|
46
|
-
AddressParam & { roundId: string }
|
|
47
|
-
>;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export type VltzApi = {
|
|
51
|
-
[K in keyof VltzApiSource]: {
|
|
52
|
-
params: VltzApiSource[K]['params'];
|
|
53
|
-
query: VltzApiSource[K]['query'];
|
|
54
|
-
response: Stringified<VltzApiSource[K]['response']>;
|
|
55
|
-
};
|
|
56
|
-
};
|