@sinai-standard/types 0.1.0 → 0.2.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 +46 -0
- package/dist/index.d.ts +150 -0
- package/dist/index.js +28 -0
- package/package.json +4 -2
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# @sinai-standard/types
|
|
2
|
+
|
|
3
|
+
Shared TypeScript types, program IDs, and PDA seeds for the Sinai Standard protocol.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @sinai-standard/types
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { PROGRAM_IDS, SEEDS } from "@sinai-standard/types";
|
|
15
|
+
import type { TokenCreateParams, RouterConfigData } from "@sinai-standard/types";
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Exports
|
|
19
|
+
|
|
20
|
+
### Constants
|
|
21
|
+
|
|
22
|
+
- `PROGRAM_IDS` — Deployed program addresses (allowlist, tax, hold, router, token factory, max balance)
|
|
23
|
+
- `SEEDS` — PDA seed buffers for all account derivations
|
|
24
|
+
|
|
25
|
+
### Types
|
|
26
|
+
|
|
27
|
+
| Type | Description |
|
|
28
|
+
|------|-------------|
|
|
29
|
+
| `TokenCreateParams` | Parameters for `AksumKit.createToken()` |
|
|
30
|
+
| `AllowlistRegistryData` | On-chain allowlist account state |
|
|
31
|
+
| `TaxConfigData` | Tax hook configuration account |
|
|
32
|
+
| `HoldConfigData` | Hold period configuration account |
|
|
33
|
+
| `WalletLockData` | Per-wallet lock state |
|
|
34
|
+
| `RouterConfigData` | Router hook with sub-hook program references |
|
|
35
|
+
| `MaxBalanceConfigData` | Max balance per wallet configuration |
|
|
36
|
+
| `TokenRecordData` | Token factory record |
|
|
37
|
+
| `ConfidentialTransferConfig` | Confidential transfer extension config |
|
|
38
|
+
| `AllowlistMode` | `"allowlist" \| "denylist"` |
|
|
39
|
+
|
|
40
|
+
## Network
|
|
41
|
+
|
|
42
|
+
All program IDs target Solana devnet. See [sinaistandard.org](https://sinaistandard.org) for details.
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
ISC
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,12 @@ export declare const PROGRAM_IDS: {
|
|
|
7
7
|
readonly routerHook: PublicKey;
|
|
8
8
|
readonly tokenFactory: PublicKey;
|
|
9
9
|
readonly maxBalanceHook: PublicKey;
|
|
10
|
+
readonly protocolFee: PublicKey;
|
|
11
|
+
readonly distribution: PublicKey;
|
|
12
|
+
readonly capTable: PublicKey;
|
|
13
|
+
readonly vesting: PublicKey;
|
|
14
|
+
readonly forcedTransfer: PublicKey;
|
|
15
|
+
readonly redemption: PublicKey;
|
|
10
16
|
};
|
|
11
17
|
export declare const SEEDS: {
|
|
12
18
|
readonly allowlist: Buffer<ArrayBuffer>;
|
|
@@ -19,6 +25,22 @@ export declare const SEEDS: {
|
|
|
19
25
|
readonly maxBalanceConfig: Buffer<ArrayBuffer>;
|
|
20
26
|
readonly tokenRecord: Buffer<ArrayBuffer>;
|
|
21
27
|
readonly freezeAuthority: Buffer<ArrayBuffer>;
|
|
28
|
+
readonly protocolFeeConfig: Buffer<ArrayBuffer>;
|
|
29
|
+
readonly distribution: Buffer<ArrayBuffer>;
|
|
30
|
+
readonly claimStatus: Buffer<ArrayBuffer>;
|
|
31
|
+
readonly distributionTracker: Buffer<ArrayBuffer>;
|
|
32
|
+
readonly distributionEscrow: Buffer<ArrayBuffer>;
|
|
33
|
+
readonly capTableConfig: Buffer<ArrayBuffer>;
|
|
34
|
+
readonly holder: Buffer<ArrayBuffer>;
|
|
35
|
+
readonly vesting: Buffer<ArrayBuffer>;
|
|
36
|
+
readonly vestingTracker: Buffer<ArrayBuffer>;
|
|
37
|
+
readonly vestingEscrow: Buffer<ArrayBuffer>;
|
|
38
|
+
readonly forcedTransferConfig: Buffer<ArrayBuffer>;
|
|
39
|
+
readonly ftRecord: Buffer<ArrayBuffer>;
|
|
40
|
+
readonly redemptionPool: Buffer<ArrayBuffer>;
|
|
41
|
+
readonly redemptionRecord: Buffer<ArrayBuffer>;
|
|
42
|
+
readonly redemptionTracker: Buffer<ArrayBuffer>;
|
|
43
|
+
readonly redemptionEscrow: Buffer<ArrayBuffer>;
|
|
22
44
|
};
|
|
23
45
|
export interface TokenCreateParams {
|
|
24
46
|
name: string;
|
|
@@ -39,6 +61,12 @@ export interface TokenCreateParams {
|
|
|
39
61
|
seconds: number;
|
|
40
62
|
};
|
|
41
63
|
};
|
|
64
|
+
protocolFee?: {
|
|
65
|
+
feeBps: number;
|
|
66
|
+
maxFee: number | bigint;
|
|
67
|
+
treasury: PublicKey;
|
|
68
|
+
};
|
|
69
|
+
capTable?: boolean;
|
|
42
70
|
}
|
|
43
71
|
export interface AllowlistRegistryData {
|
|
44
72
|
authority: PublicKey;
|
|
@@ -101,3 +129,125 @@ export interface ConfidentialTransferConfig {
|
|
|
101
129
|
autoApproveNewAccounts: boolean;
|
|
102
130
|
auditorElGamalPubkey?: Uint8Array;
|
|
103
131
|
}
|
|
132
|
+
export interface ProtocolFeeConfigData {
|
|
133
|
+
authority: PublicKey;
|
|
134
|
+
mint: PublicKey;
|
|
135
|
+
treasury: PublicKey;
|
|
136
|
+
feeBps: number;
|
|
137
|
+
maxFee: bigint;
|
|
138
|
+
isActive: boolean;
|
|
139
|
+
totalCollected: bigint;
|
|
140
|
+
}
|
|
141
|
+
export interface DistributionTrackerData {
|
|
142
|
+
authority: PublicKey;
|
|
143
|
+
mint: PublicKey;
|
|
144
|
+
nextDistributionId: bigint;
|
|
145
|
+
totalDistributed: bigint;
|
|
146
|
+
}
|
|
147
|
+
export interface DistributionData {
|
|
148
|
+
authority: PublicKey;
|
|
149
|
+
mint: PublicKey;
|
|
150
|
+
paymentMint: PublicKey;
|
|
151
|
+
distributionId: bigint;
|
|
152
|
+
merkleRoot: number[];
|
|
153
|
+
totalAmount: bigint;
|
|
154
|
+
claimedAmount: bigint;
|
|
155
|
+
recordDate: bigint;
|
|
156
|
+
createdAt: bigint;
|
|
157
|
+
escrow: PublicKey;
|
|
158
|
+
numHolders: number;
|
|
159
|
+
isFinalized: boolean;
|
|
160
|
+
isActive: boolean;
|
|
161
|
+
}
|
|
162
|
+
export interface ClaimStatusData {
|
|
163
|
+
isClaimed: boolean;
|
|
164
|
+
claimedAmount: bigint;
|
|
165
|
+
claimedAt: bigint;
|
|
166
|
+
}
|
|
167
|
+
export interface CapTableConfigData {
|
|
168
|
+
authority: PublicKey;
|
|
169
|
+
mint: PublicKey;
|
|
170
|
+
totalHolders: number;
|
|
171
|
+
isActive: boolean;
|
|
172
|
+
}
|
|
173
|
+
export interface HolderRecordData {
|
|
174
|
+
holder: PublicKey;
|
|
175
|
+
mint: PublicKey;
|
|
176
|
+
balance: bigint;
|
|
177
|
+
firstAcquired: bigint;
|
|
178
|
+
lastTransfer: bigint;
|
|
179
|
+
transferCount: number;
|
|
180
|
+
isActive: boolean;
|
|
181
|
+
}
|
|
182
|
+
export interface VestingTrackerData {
|
|
183
|
+
authority: PublicKey;
|
|
184
|
+
mint: PublicKey;
|
|
185
|
+
nextScheduleId: bigint;
|
|
186
|
+
totalVestingAmount: bigint;
|
|
187
|
+
totalReleased: bigint;
|
|
188
|
+
}
|
|
189
|
+
export interface VestingScheduleData {
|
|
190
|
+
authority: PublicKey;
|
|
191
|
+
beneficiary: PublicKey;
|
|
192
|
+
mint: PublicKey;
|
|
193
|
+
escrow: PublicKey;
|
|
194
|
+
totalAmount: bigint;
|
|
195
|
+
releasedAmount: bigint;
|
|
196
|
+
startTs: bigint;
|
|
197
|
+
cliffTs: bigint;
|
|
198
|
+
endTs: bigint;
|
|
199
|
+
cliffAmount: bigint;
|
|
200
|
+
intervalSeconds: bigint;
|
|
201
|
+
revocable: boolean;
|
|
202
|
+
isActive: boolean;
|
|
203
|
+
scheduleId: bigint;
|
|
204
|
+
}
|
|
205
|
+
export interface ForcedTransferConfigData {
|
|
206
|
+
authority: PublicKey;
|
|
207
|
+
mint: PublicKey;
|
|
208
|
+
complianceOfficer: PublicKey;
|
|
209
|
+
thresholdAmount: bigint;
|
|
210
|
+
isActive: boolean;
|
|
211
|
+
totalForcedTransfers: bigint;
|
|
212
|
+
totalForcedAmount: bigint;
|
|
213
|
+
}
|
|
214
|
+
export interface ForcedTransferRecordData {
|
|
215
|
+
mint: PublicKey;
|
|
216
|
+
recordId: bigint;
|
|
217
|
+
fromWallet: PublicKey;
|
|
218
|
+
toWallet: PublicKey;
|
|
219
|
+
amount: bigint;
|
|
220
|
+
reason: string;
|
|
221
|
+
executedBy: PublicKey;
|
|
222
|
+
executedAt: bigint;
|
|
223
|
+
referenceId: string;
|
|
224
|
+
}
|
|
225
|
+
export interface RedemptionTrackerData {
|
|
226
|
+
authority: PublicKey;
|
|
227
|
+
mint: PublicKey;
|
|
228
|
+
nextPoolId: bigint;
|
|
229
|
+
totalPoolsCreated: number;
|
|
230
|
+
}
|
|
231
|
+
export interface RedemptionPoolData {
|
|
232
|
+
authority: PublicKey;
|
|
233
|
+
mint: PublicKey;
|
|
234
|
+
paymentMint: PublicKey;
|
|
235
|
+
poolId: bigint;
|
|
236
|
+
pricePerToken: bigint;
|
|
237
|
+
tokenDecimals: number;
|
|
238
|
+
paymentDecimals: number;
|
|
239
|
+
escrow: PublicKey;
|
|
240
|
+
totalDeposited: bigint;
|
|
241
|
+
totalRedeemedTokens: bigint;
|
|
242
|
+
totalPaidOut: bigint;
|
|
243
|
+
startTs: bigint;
|
|
244
|
+
endTs: bigint;
|
|
245
|
+
maxRedemptionPerWallet: bigint;
|
|
246
|
+
isActive: boolean;
|
|
247
|
+
}
|
|
248
|
+
export interface RedemptionRecordData {
|
|
249
|
+
redeemer: PublicKey;
|
|
250
|
+
tokensRedeemed: bigint;
|
|
251
|
+
paymentReceived: bigint;
|
|
252
|
+
redeemedAt: bigint;
|
|
253
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,12 @@ exports.PROGRAM_IDS = {
|
|
|
12
12
|
routerHook: new web3_js_1.PublicKey("HHnt7Hfnp2fDftFNCFPqEhebgXGizuqubXqhiEi8C1of"),
|
|
13
13
|
tokenFactory: new web3_js_1.PublicKey("VXQL8u4NVUYG1zaejujwh5gr21iinmk4yYCXn1g9TXr"),
|
|
14
14
|
maxBalanceHook: new web3_js_1.PublicKey("Ctx9ZtNzPFYyjqxdZSMYLgHdqNNpAS61G6ok1dYVBHWi"),
|
|
15
|
+
protocolFee: new web3_js_1.PublicKey("DFhGwMiWdAqZW1Pfr8hrnrSKuH91qzw9jkXm3aFUYSSi"),
|
|
16
|
+
distribution: new web3_js_1.PublicKey("968Gd9K5siYBqHVw7BYWPaMKxGfiaaaUbYrAWYJnYkFN"),
|
|
17
|
+
capTable: new web3_js_1.PublicKey("FAJyBPALnKamLHkiJWEM7GTGK1LSixvphjo3zPfXeTGh"),
|
|
18
|
+
vesting: new web3_js_1.PublicKey("2YuPxPyBVoYNda8ZEfWcW61A7BDpaL9ce9Y1M4fJwgb5"),
|
|
19
|
+
forcedTransfer: new web3_js_1.PublicKey("3RTBG7htQkP888AsvZTygbkp85xBHfXQHo2u32bsFfm3"),
|
|
20
|
+
redemption: new web3_js_1.PublicKey("HQF1SnVs6n3MjcHdqZ52qQB5WLEDiVR2XxMMUFhbQ6Ju"),
|
|
15
21
|
};
|
|
16
22
|
// ============================================================================
|
|
17
23
|
// PDA Seeds
|
|
@@ -27,4 +33,26 @@ exports.SEEDS = {
|
|
|
27
33
|
maxBalanceConfig: Buffer.from("max-balance-config"),
|
|
28
34
|
tokenRecord: Buffer.from("token-record"),
|
|
29
35
|
freezeAuthority: Buffer.from("freeze-authority"),
|
|
36
|
+
// Protocol Fee
|
|
37
|
+
protocolFeeConfig: Buffer.from("protocol-fee-config"),
|
|
38
|
+
// Distribution
|
|
39
|
+
distribution: Buffer.from("distribution"),
|
|
40
|
+
claimStatus: Buffer.from("claim-status"),
|
|
41
|
+
distributionTracker: Buffer.from("distribution-tracker"),
|
|
42
|
+
distributionEscrow: Buffer.from("escrow"),
|
|
43
|
+
// Cap Table
|
|
44
|
+
capTableConfig: Buffer.from("cap-table-config"),
|
|
45
|
+
holder: Buffer.from("holder"),
|
|
46
|
+
// Vesting
|
|
47
|
+
vesting: Buffer.from("vesting"),
|
|
48
|
+
vestingTracker: Buffer.from("vesting-tracker"),
|
|
49
|
+
vestingEscrow: Buffer.from("vesting-escrow"),
|
|
50
|
+
// Forced Transfer
|
|
51
|
+
forcedTransferConfig: Buffer.from("forced-transfer-config"),
|
|
52
|
+
ftRecord: Buffer.from("ft-record"),
|
|
53
|
+
// Redemption
|
|
54
|
+
redemptionPool: Buffer.from("redemption-pool"),
|
|
55
|
+
redemptionRecord: Buffer.from("redemption-record"),
|
|
56
|
+
redemptionTracker: Buffer.from("redemption-tracker"),
|
|
57
|
+
redemptionEscrow: Buffer.from("redemption-escrow"),
|
|
30
58
|
};
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sinai-standard/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Sinai Standard shared TypeScript types",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"files": [
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
8
10
|
"license": "ISC",
|
|
9
11
|
"scripts": {
|
|
10
12
|
"build": "tsc"
|