@glamsystems/glam-sdk 1.0.14-alpha.5 → 1.1.0-alpha.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/index.cjs.js +33828 -21604
- package/index.esm.js +33802 -21604
- package/package.json +1 -1
- package/src/assets.d.ts +5 -6
- package/src/client/base.d.ts +10 -6
- package/src/client/bridge.d.ts +7 -9
- package/src/client/jupiter.d.ts +2 -2
- package/src/client/loopscale.d.ts +84 -0
- package/src/client/neutral.d.ts +109 -0
- package/src/client/price.d.ts +14 -4
- package/src/client.d.ts +6 -0
- package/src/constants.d.ts +2 -0
- package/src/deser/integrationPolicies.d.ts +14 -0
- package/src/glamExports.d.ts +1363 -1810
- package/src/globalConfig.d.ts +15 -10
- package/src/index.d.ts +2 -0
- package/src/utils/glamPDAs.d.ts +1 -0
- package/src/utils/pkmap.d.ts +23 -18
- package/target/idl/glam_mint-staging.json +1198 -72
- package/target/idl/glam_mint.json +13 -1
- package/target/idl/glam_protocol-staging.json +17 -2
- package/target/types/ext_loopscale.d.ts +3547 -0
- package/target/types/ext_neutral.d.ts +1670 -0
- package/target/types/glam_mint-staging.ts +1198 -72
- package/target/types/glam_mint.d.ts +13 -1
- package/target/types/glam_mint.ts +13 -1
- package/target/types/glam_protocol-staging.ts +17 -2
package/src/globalConfig.d.ts
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import { Connection, PublicKey } from "@solana/web3.js";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { Decodable } from "./deser/base";
|
|
3
|
+
import { PkMap } from "./utils";
|
|
4
|
+
type RawAssetMeta = {
|
|
4
5
|
asset: PublicKey;
|
|
5
6
|
decimals: number;
|
|
6
7
|
oracle: PublicKey;
|
|
7
|
-
|
|
8
|
+
oracleSourceOrdinal: number;
|
|
8
9
|
maxAgeSeconds: number;
|
|
9
10
|
priority: number;
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
padding: number[];
|
|
12
|
+
};
|
|
13
|
+
export declare function fetchGlobalConfig(connection: Connection, address?: PublicKey): Promise<GlobalConfig>;
|
|
14
|
+
export declare class GlobalConfig extends Decodable {
|
|
15
|
+
discriminator: number[];
|
|
12
16
|
admin: PublicKey;
|
|
13
17
|
feeAuthority: PublicKey;
|
|
14
18
|
referrer: PublicKey;
|
|
15
19
|
baseFeeBps: number;
|
|
16
20
|
flowFeeBps: number;
|
|
17
|
-
assetMetas:
|
|
21
|
+
assetMetas: RawAssetMeta[];
|
|
22
|
+
static _layout: any;
|
|
23
|
+
static encode(data: any): Buffer;
|
|
18
24
|
}
|
|
19
|
-
export declare function
|
|
20
|
-
export declare function
|
|
21
|
-
export
|
|
22
|
-
export declare function fetchOnchainAssetMetas(connection: Connection, address?: PublicKey): Promise<Map<string, OnchainAssetMeta>>;
|
|
25
|
+
export declare function getOracleName(ordinal: number): string;
|
|
26
|
+
export declare function fetchOnchainAssetMetas(connection: Connection, address?: PublicKey): Promise<PkMap<RawAssetMeta>>;
|
|
27
|
+
export {};
|
package/src/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export * from "./client/timelock";
|
|
|
7
7
|
export * from "./client/cctp";
|
|
8
8
|
export * from "./client/bridge";
|
|
9
9
|
export * from "./client/epi";
|
|
10
|
+
export * from "./client/loopscale";
|
|
11
|
+
export * from "./client/neutral";
|
|
10
12
|
export * from "./client/price";
|
|
11
13
|
export * from "./deser/integrationPolicies";
|
|
12
14
|
export * from "./deser/tokenAclLayouts";
|
package/src/utils/glamPDAs.d.ts
CHANGED
|
@@ -12,3 +12,4 @@ export declare function getTokenAclGateListConfigPda(authority: PublicKey, seed:
|
|
|
12
12
|
export declare function getTokenAclGateWalletEntryPda(listConfig: PublicKey, wallet: PublicKey): PublicKey;
|
|
13
13
|
export declare function getTokenAclGateExtraMetasPda(mint: PublicKey): PublicKey;
|
|
14
14
|
export declare function getGlobalConfigPda(): PublicKey;
|
|
15
|
+
export declare function getIntegrationAuthorityPda(integrationProgram: PublicKey): PublicKey;
|
package/src/utils/pkmap.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { PublicKey } from "@solana/web3.js";
|
|
2
|
+
type PkMapKey = PublicKey | string;
|
|
2
3
|
/**
|
|
3
|
-
* A Map implementation that uses PublicKey
|
|
4
|
+
* A Map implementation that uses PublicKey-compatible keys.
|
|
4
5
|
*
|
|
5
6
|
* This class extends the standard Map and allows using PublicKey objects
|
|
6
|
-
* as keys by converting them to base58 strings internally.
|
|
7
|
-
* problem of PublicKey object reference equality - two
|
|
8
|
-
* with the same address would normally be considered
|
|
7
|
+
* or base58 strings as keys by converting them to base58 strings internally.
|
|
8
|
+
* This solves the problem of PublicKey object reference equality - two
|
|
9
|
+
* PublicKey objects with the same address would normally be considered
|
|
10
|
+
* different keys in a Map.
|
|
9
11
|
*
|
|
10
12
|
* @example
|
|
11
13
|
* ```typescript
|
|
@@ -16,7 +18,7 @@ import { PublicKey } from "@solana/web3.js";
|
|
|
16
18
|
*
|
|
17
19
|
* // Create with initial entries
|
|
18
20
|
* const map2 = new PkMap<string>([
|
|
19
|
-
* [
|
|
21
|
+
* ["11111111111111111111111111111111", "value1"],
|
|
20
22
|
* [new PublicKey("22222222222222222222222222222222"), "value2"]
|
|
21
23
|
* ]);
|
|
22
24
|
*
|
|
@@ -29,34 +31,36 @@ export declare class PkMap<V> {
|
|
|
29
31
|
private readonly _map;
|
|
30
32
|
/**
|
|
31
33
|
* Creates a new PkMap instance.
|
|
32
|
-
* @param entries - Optional initial entries as [PublicKey, V] pairs
|
|
34
|
+
* @param entries - Optional initial entries as [PublicKey|string, V] pairs
|
|
33
35
|
*/
|
|
34
|
-
constructor(
|
|
36
|
+
constructor();
|
|
37
|
+
constructor(entries?: readonly (readonly [PkMapKey, V])[] | null);
|
|
38
|
+
constructor(entries?: Iterable<readonly [PkMapKey, V]> | null);
|
|
35
39
|
/**
|
|
36
40
|
* Associates the specified value with the specified PublicKey in this map.
|
|
37
|
-
* @param key - The PublicKey to use as the key
|
|
41
|
+
* @param key - The PublicKey or base58 string to use as the key
|
|
38
42
|
* @param value - The value to associate with the key
|
|
39
43
|
* @returns This PkMap instance for chaining
|
|
40
44
|
*/
|
|
41
|
-
set(key:
|
|
45
|
+
set(key: PkMapKey, value: V): this;
|
|
42
46
|
/**
|
|
43
|
-
* Returns the value associated with the specified
|
|
44
|
-
* @param key - The PublicKey whose associated value is to be returned
|
|
47
|
+
* Returns the value associated with the specified key, or undefined if not found.
|
|
48
|
+
* @param key - The PublicKey or base58 string whose associated value is to be returned
|
|
45
49
|
* @returns The value associated with the specified key, or undefined
|
|
46
50
|
*/
|
|
47
|
-
get(key:
|
|
51
|
+
get(key: PkMapKey): V | undefined;
|
|
48
52
|
/**
|
|
49
|
-
* Returns true if this map contains a mapping for the specified
|
|
50
|
-
* @param key - The PublicKey whose presence in this map is to be tested
|
|
53
|
+
* Returns true if this map contains a mapping for the specified key.
|
|
54
|
+
* @param key - The PublicKey or base58 string whose presence in this map is to be tested
|
|
51
55
|
* @returns true if this map contains a mapping for the specified key
|
|
52
56
|
*/
|
|
53
|
-
has(key:
|
|
57
|
+
has(key: PkMapKey): boolean;
|
|
54
58
|
/**
|
|
55
|
-
* Removes the mapping for the specified
|
|
56
|
-
* @param key - The PublicKey whose mapping is to be removed
|
|
59
|
+
* Removes the mapping for the specified key from this map if present.
|
|
60
|
+
* @param key - The PublicKey or base58 string whose mapping is to be removed
|
|
57
61
|
* @returns true if the element was removed, false otherwise
|
|
58
62
|
*/
|
|
59
|
-
delete(key:
|
|
63
|
+
delete(key: PkMapKey): boolean;
|
|
60
64
|
/**
|
|
61
65
|
* Returns an iterator of all PublicKey keys in this map.
|
|
62
66
|
* Note: This reconstructs PublicKey objects from the stored base58 strings.
|
|
@@ -80,3 +84,4 @@ export declare class PkMap<V> {
|
|
|
80
84
|
values(): IterableIterator<V>;
|
|
81
85
|
[Symbol.iterator](): IterableIterator<[PublicKey, V]>;
|
|
82
86
|
}
|
|
87
|
+
export {};
|