@percolatorct/sdk 1.0.0-beta.9 → 2.0.1
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 +24 -4
- package/dist/abi/accounts.d.ts +129 -25
- package/dist/abi/errors.d.ts +0 -11
- package/dist/abi/index.d.ts +1 -0
- package/dist/abi/instructions.d.ts +429 -150
- package/dist/abi/nft.d.ts +136 -0
- package/dist/config/program-ids.d.ts +1 -1
- package/dist/index.js +1922 -688
- package/dist/index.js.map +1 -1
- package/dist/math/trading.d.ts +1 -116
- package/dist/math/warmup.d.ts +0 -50
- package/dist/runtime/lighthouse.d.ts +1 -1
- package/dist/solana/discovery.d.ts +2 -13
- package/dist/solana/oracle.d.ts +2 -10
- package/dist/solana/pda.d.ts +6 -5
- package/dist/solana/slab.d.ts +133 -9
- package/dist/solana/stake.d.ts +51 -9
- package/dist/validation.d.ts +1 -26
- package/package.json +5 -2
package/dist/validation.d.ts
CHANGED
|
@@ -9,34 +9,14 @@ export declare class ValidationError extends Error {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Validate a public key string.
|
|
12
|
-
*
|
|
13
|
-
* @param value - Base58-encoded public key string.
|
|
14
|
-
* @param field - Field name for error messages.
|
|
15
|
-
* @returns Parsed `PublicKey` instance.
|
|
16
|
-
* @throws {@link ValidationError} if the string is not a valid base58 public key.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* const key = validatePublicKey("11111111111111111111111111111111", "slab");
|
|
21
|
-
* ```
|
|
22
12
|
*/
|
|
23
13
|
export declare function validatePublicKey(value: string, field: string): PublicKey;
|
|
24
14
|
/**
|
|
25
15
|
* Validate a non-negative integer index (u16 range for accounts).
|
|
26
|
-
*
|
|
27
|
-
* @param value - Decimal string representing the index.
|
|
28
|
-
* @param field - Field name for error messages.
|
|
29
|
-
* @returns Parsed integer in `[0, 65535]`.
|
|
30
|
-
* @throws {@link ValidationError} if the value is not a valid u16 integer.
|
|
31
16
|
*/
|
|
32
17
|
export declare function validateIndex(value: string, field: string): number;
|
|
33
18
|
/**
|
|
34
19
|
* Validate a non-negative amount (u64 range).
|
|
35
|
-
*
|
|
36
|
-
* @param value - Decimal string representing the amount.
|
|
37
|
-
* @param field - Field name for error messages.
|
|
38
|
-
* @returns Parsed `bigint` in `[0, 2^64 - 1]`.
|
|
39
|
-
* @throws {@link ValidationError} if the value is negative or exceeds u64 max.
|
|
40
20
|
*/
|
|
41
21
|
export declare function validateAmount(value: string, field: string): bigint;
|
|
42
22
|
/**
|
|
@@ -52,12 +32,7 @@ export declare function validateI64(value: string, field: string): bigint;
|
|
|
52
32
|
*/
|
|
53
33
|
export declare function validateI128(value: string, field: string): bigint;
|
|
54
34
|
/**
|
|
55
|
-
* Validate a basis points value (0
|
|
56
|
-
*
|
|
57
|
-
* @param value - Decimal string representing basis points.
|
|
58
|
-
* @param field - Field name for error messages.
|
|
59
|
-
* @returns Parsed integer in `[0, 10000]`.
|
|
60
|
-
* @throws {@link ValidationError} if the value exceeds 10000.
|
|
35
|
+
* Validate a basis points value (0-10000).
|
|
61
36
|
*/
|
|
62
37
|
export declare function validateBps(value: string, field: string): number;
|
|
63
38
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percolatorct/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"build": "tsup && tsc --emitDeclarationOnly --declaration --outDir dist",
|
|
24
24
|
"test": "tsx test/abi.test.ts && tsx test/slab.test.ts && tsx test/validation.test.ts && tsx test/dex-oracle.test.ts && tsx test/trading.test.ts && tsx test/warmup-leverage-cap.test.ts && tsx test/dynamic-fees.test.ts && tsx test/oracle.test.ts && vitest run",
|
|
25
25
|
"lint": "tsc --noEmit",
|
|
26
|
-
"verify-layout": "tsx scripts/verify-layout.ts"
|
|
26
|
+
"verify-layout": "tsx scripts/verify-layout.ts",
|
|
27
|
+
"update-parity-fixtures": "node scripts/update-parity-fixtures.mjs",
|
|
28
|
+
"parity:check": "node scripts/check-parity-fixtures.mjs"
|
|
27
29
|
},
|
|
28
30
|
"dependencies": {
|
|
29
31
|
"@solana/spl-token": "^0.4.14",
|
|
@@ -31,6 +33,7 @@
|
|
|
31
33
|
},
|
|
32
34
|
"devDependencies": {
|
|
33
35
|
"@types/node": "^20.17.10",
|
|
36
|
+
"dotenv": "^17.4.1",
|
|
34
37
|
"tsup": "^8.3.5",
|
|
35
38
|
"tsx": "^4.21.0",
|
|
36
39
|
"typescript": "^5.7.2",
|