Skip to content

Commit b2806fd

Browse files
feat: add solana contract versions
1 parent 7fc9613 commit b2806fd

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

src/solana/enums.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export enum Protocol {
2+
Airdrops = "airdrops",
3+
Lockup = "lockup",
4+
}
5+
6+
export namespace Version {
7+
export enum Airdrops {
8+
V1_0 = "v1.0",
9+
}
10+
11+
export enum Lockup {
12+
V1_0 = "v1.0",
13+
}
14+
}
15+
16+
export const enums = {
17+
Protocol,
18+
Version,
19+
};

src/solana/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export { chains } from "./chains";
22
export * from "./idl";
3+
export * from "./types";

src/solana/types.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Chain as ViemChain } from "viem";
2+
import type * as enums from "./enums";
23

34
/**
45
* @see https://github.com/wevm/viem/discussions/3678
@@ -46,4 +47,13 @@ export namespace Solana {
4647
cluster: Cluster;
4748
};
4849
};
50+
51+
export type Protocol = `${enums.Protocol}` | enums.Protocol;
52+
53+
export namespace Version {
54+
export type Airdrops = `${enums.Version.Airdrops}` | enums.Version.Airdrops;
55+
export type Lockup = `${enums.Version.Lockup}` | enums.Version.Lockup;
56+
}
57+
58+
export type Version = Version.Airdrops | Version.Lockup;
4959
}

0 commit comments

Comments
 (0)