@layerzerolabs/lz-config-types 3.0.46 → 3.0.47
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/CHANGELOG.md +9 -0
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +26 -4
- package/dist/index.d.ts +26 -4
- package/dist/index.mjs +7 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @layerzerolabs/lz-config-types
|
|
2
2
|
|
|
3
|
+
## 3.0.47
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 092a29c: endpoint configuration bera
|
|
8
|
+
- Updated dependencies [092a29c]
|
|
9
|
+
- @layerzerolabs/lz-core@3.0.47
|
|
10
|
+
- @layerzerolabs/lz-definitions@3.0.47
|
|
11
|
+
|
|
3
12
|
## 3.0.46
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -19,8 +19,15 @@ function isCombinedSquadsItemConfig(obj) {
|
|
|
19
19
|
}
|
|
20
20
|
return typeof obj === "object" && "multisigAddress" in obj;
|
|
21
21
|
}
|
|
22
|
+
function isCombinedRimosafeItemConfig(obj) {
|
|
23
|
+
if (obj === void 0 || obj === null) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return typeof obj === "object" && "multisigAddress" in obj;
|
|
27
|
+
}
|
|
22
28
|
|
|
23
29
|
exports.isCombinedGnosisItemConfig = isCombinedGnosisItemConfig;
|
|
30
|
+
exports.isCombinedRimosafeItemConfig = isCombinedRimosafeItemConfig;
|
|
24
31
|
exports.isCombinedSquadsItemConfig = isCombinedSquadsItemConfig;
|
|
25
32
|
exports.isGnosisItemConfig = isGnosisItemConfig;
|
|
26
33
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/signer.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../src/signer.ts"],"names":[],"mappings":";;;AAkKO,SAAS,mBAAmB,GAAuC,EAAA;AACtE,EAAI,IAAA,GAAA,KAAQ,KAAa,CAAA,IAAA,GAAA,KAAQ,IAAM,EAAA;AACnC,IAAO,OAAA,KAAA;AAAA;AAGX,EAAA,OAAO,OAAO,GAAA,KAAQ,QAAY,IAAA,SAAA,IAAa,OAAO,aAAiB,IAAA,GAAA;AAC3E;AAQO,SAAS,2BAA2B,GAA+C,EAAA;AACtF,EAAI,IAAA,GAAA,KAAQ,KAAa,CAAA,IAAA,GAAA,KAAQ,IAAM,EAAA;AACnC,IAAO,OAAA,KAAA;AAAA;AAGX,EAAO,OAAA,OAAO,QAAQ,QAAY,IAAA,SAAA,IAAa,OAAO,aAAiB,IAAA,GAAA,KAAQ,UAAc,IAAA,GAAA,IAAO,IAAQ,IAAA,GAAA,CAAA;AAChH;AAQO,SAAS,2BAA2B,GAA+C,EAAA;AACtF,EAAI,IAAA,GAAA,KAAQ,KAAa,CAAA,IAAA,GAAA,KAAQ,IAAM,EAAA;AACnC,IAAO,OAAA,KAAA;AAAA;AAGX,EAAO,OAAA,OAAO,GAAQ,KAAA,QAAA,IAAY,iBAAqB,IAAA,GAAA;AAC3D;AAEO,SAAS,6BAA6B,GAAiD,EAAA;AAC1F,EAAI,IAAA,GAAA,KAAQ,KAAa,CAAA,IAAA,GAAA,KAAQ,IAAM,EAAA;AACnC,IAAO,OAAA,KAAA;AAAA;AAGX,EAAO,OAAA,OAAO,GAAQ,KAAA,QAAA,IAAY,iBAAqB,IAAA,GAAA;AAC3D","file":"index.cjs","sourcesContent":["import { ContractNetworksConfig } from '@safe-global/protocol-kit'\ntype ContractNetworkConfig = ContractNetworksConfig[string]\n\n// ------------------ Account/Signer Config ------------------\n\nimport { Signer } from '@layerzerolabs/lz-core'\nimport { Chain, ChainType, Environment, Stage } from '@layerzerolabs/lz-definitions'\n\n/**\n * Interface representing the configuration for a signer item.\n */\nexport interface SignerItemConfig {\n /**\n * The mnemonic for the signer.\n */\n mnemonic?: string\n /**\n * The derivation path for the signer.\n */\n path?: string\n /**\n * The address of the signer.\n */\n address?: string\n /**\n * The private key of the signer.\n */\n pk?: string\n}\n\n/**\n * Interface representing the configuration for a Gnosis item.\n */\nexport interface GnosisItemConfig {\n /**\n * The URL of the Gnosis safe.\n */\n safeUrl: string\n /**\n * The address of the Gnosis safe.\n */\n safeAddress: string\n /**\n * The contract networks configuration for the Gnosis safe (optional).\n * @see {@link ContractNetworksConfig}\n */\n contractNetworks?: { [key: string]: Partial<ContractNetworkConfig> }\n}\n\n/**\n * Interface representing the configuration for a Squads item.\n */\nexport interface SquadsItemConfig {\n /**\n * The address of the multisig.\n */\n multisigAddress: string\n}\n/**\n * Interface representing the configuration for a Rimosafe item.\n */\nexport interface RimosafeItemConfig {\n /**\n * The address of the multisig.\n */\n multisigAddress: string\n}\n\n/**\n * Type representing the configuration for Gnosis by stage and chain.\n * @see {@link GnosisItemConfig}, {@link SquadsItemConfig}, {@link ChainType}, {@link Chain}\n */\nexport type GnosisStageConfig = {\n [chainOrType in ChainType | Chain]?: { [key: string]: GnosisItemConfig | SquadsItemConfig | RimosafeItemConfig }\n}\n\n/**\n * Type representing the configuration for Gnosis by stage.\n * This type maps stages to their corresponding Gnosis stage configurations.\n */\nexport type GnosisConfig = {\n /**\n * The stage of the configuration.\n * @see {@link Stage}, {@link GnosisStageConfig}\n */\n [stage in Stage]?: GnosisStageConfig\n}\n\n/**\n * Type representing the combined configuration for Gnosis and signer items.\n */\nexport type CombinedGnosisItemConfig = GnosisItemConfig & SignerItemConfig\n\n/**\n * Type representing the combined configuration for Squads and signer items.\n */\nexport type CombinedSquadsItemConfig = SquadsItemConfig & SignerItemConfig\n\n/**\n * Type representing the combined configuration for Rimosafe and signer items.\n */\nexport type CombinedRimosafeItemConfig = RimosafeItemConfig & SignerItemConfig\n/**\n * Type representing the configuration for signers by stage, chain, and key name.\n * @example\n * ```json\n * {\n * \"sandbox\": {\n * \"ethereum\": {\n * \"key1\": {\n * \"mnemonic\": \"xxx\",\n * \"path\": \"xxx\"\n * },\n * \"key2\": {\n * \"pk\": \"xxx\",\n * \"path\": \"xxx\"\n * safeUrl: \"xxx\",\n * safeAddress: \"xxx\"\n * }\n * }\n * }\n * }\n *\n * @see {@link SignerItemConfig}, {@link CombinedGnosisItemConfig}, {@link CombinedSquadsItemConfig} {@link CombinedRimosafeItemConfig }, {@link ChainType}, {@link Chain}\n * ```\n */\nexport type SignerConfig = {\n [stage in Stage]?: {\n [chainOrType in ChainType | Chain]?: {\n [key: string]:\n | SignerItemConfig\n | CombinedGnosisItemConfig\n | CombinedSquadsItemConfig\n | CombinedRimosafeItemConfig\n }\n }\n}\n\n/**\n * Interface representing a signer manager.\n * Provides methods to retrieve signers based on the specified chain, stage, environment, and key name.\n */\nexport interface SignerManager {\n /**\n * Retrieves a signer based on the specified chain, stage, environment, and key name.\n *\n * @param {Chain} chain - The chain for which to retrieve the signer.\n * @param {Stage} stage - The stage for which to retrieve the signer.\n * @param {Environment} env - The environment for which to retrieve the signer.\n * @param {string} keyName - The key name for which to retrieve the signer.\n * @returns {Promise<Signer>} A promise that resolves to the signer.\n */\n getSigner(chain: Chain, stage: Stage, env: Environment, keyName: string): Promise<Signer>\n}\n\n/**\n * Checks if the given object is a Gnosis item configuration.\n *\n * @param {unknown} obj - The object to check.\n * @returns {boolean} True if the object is a Gnosis item configuration, false otherwise.\n * @see {@link GnosisItemConfig}\n */\nexport function isGnosisItemConfig(obj: unknown): obj is GnosisItemConfig {\n if (obj === undefined || obj === null) {\n return false\n }\n\n return typeof obj === 'object' && 'safeUrl' in obj && 'safeAddress' in obj\n}\n\n/**\n * Checks if the given object is a combined Gnosis item configuration.\n *\n * @param {unknown} obj - The object to check.\n * @returns {boolean} True if the object is a combined Gnosis item configuration, false otherwise.\n */\nexport function isCombinedGnosisItemConfig(obj: unknown): obj is CombinedGnosisItemConfig {\n if (obj === undefined || obj === null) {\n return false\n }\n\n return typeof obj === 'object' && 'safeUrl' in obj && 'safeAddress' in obj && ('mnemonic' in obj || 'pk' in obj)\n}\n\n/**\n * Checks if the given object is a combined Squads item configuration.\n *\n * @param {unknown} obj - The object to check.\n * @returns {boolean} True if the object is a combined Squads item configuration, false otherwise.\n */\nexport function isCombinedSquadsItemConfig(obj: unknown): obj is CombinedSquadsItemConfig {\n if (obj === undefined || obj === null) {\n return false\n }\n\n return typeof obj === 'object' && 'multisigAddress' in obj\n}\n\nexport function isCombinedRimosafeItemConfig(obj: unknown): obj is CombinedRimosafeItemConfig {\n if (obj === undefined || obj === null) {\n return false\n }\n\n return typeof obj === 'object' && 'multisigAddress' in obj\n}\n"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -15,6 +15,14 @@ type ProviderSetting = {
|
|
|
15
15
|
* The API key for the provider (optional).
|
|
16
16
|
*/
|
|
17
17
|
apiKey?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The authentication field (optional). for example: 'Authorization'.
|
|
20
|
+
*/
|
|
21
|
+
authField?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The authentication value (optional). for example: 'Bearer <token>'.
|
|
24
|
+
*/
|
|
25
|
+
authValue?: string;
|
|
18
26
|
} | string;
|
|
19
27
|
/**
|
|
20
28
|
* Type representing the configuration for providers.
|
|
@@ -92,13 +100,22 @@ interface SquadsItemConfig {
|
|
|
92
100
|
*/
|
|
93
101
|
multisigAddress: string;
|
|
94
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Interface representing the configuration for a Rimosafe item.
|
|
105
|
+
*/
|
|
106
|
+
interface RimosafeItemConfig {
|
|
107
|
+
/**
|
|
108
|
+
* The address of the multisig.
|
|
109
|
+
*/
|
|
110
|
+
multisigAddress: string;
|
|
111
|
+
}
|
|
95
112
|
/**
|
|
96
113
|
* Type representing the configuration for Gnosis by stage and chain.
|
|
97
114
|
* @see {@link GnosisItemConfig}, {@link SquadsItemConfig}, {@link ChainType}, {@link Chain}
|
|
98
115
|
*/
|
|
99
116
|
type GnosisStageConfig = {
|
|
100
117
|
[chainOrType in ChainType | Chain]?: {
|
|
101
|
-
[key: string]: GnosisItemConfig | SquadsItemConfig;
|
|
118
|
+
[key: string]: GnosisItemConfig | SquadsItemConfig | RimosafeItemConfig;
|
|
102
119
|
};
|
|
103
120
|
};
|
|
104
121
|
/**
|
|
@@ -116,6 +133,10 @@ type CombinedGnosisItemConfig = GnosisItemConfig & SignerItemConfig;
|
|
|
116
133
|
* Type representing the combined configuration for Squads and signer items.
|
|
117
134
|
*/
|
|
118
135
|
type CombinedSquadsItemConfig = SquadsItemConfig & SignerItemConfig;
|
|
136
|
+
/**
|
|
137
|
+
* Type representing the combined configuration for Rimosafe and signer items.
|
|
138
|
+
*/
|
|
139
|
+
type CombinedRimosafeItemConfig = RimosafeItemConfig & SignerItemConfig;
|
|
119
140
|
/**
|
|
120
141
|
* Type representing the configuration for signers by stage, chain, and key name.
|
|
121
142
|
* @example
|
|
@@ -137,13 +158,13 @@ type CombinedSquadsItemConfig = SquadsItemConfig & SignerItemConfig;
|
|
|
137
158
|
* }
|
|
138
159
|
* }
|
|
139
160
|
*
|
|
140
|
-
* @see {@link SignerItemConfig}, {@link CombinedGnosisItemConfig}, {@link CombinedSquadsItemConfig}, {@link ChainType}, {@link Chain}
|
|
161
|
+
* @see {@link SignerItemConfig}, {@link CombinedGnosisItemConfig}, {@link CombinedSquadsItemConfig} {@link CombinedRimosafeItemConfig }, {@link ChainType}, {@link Chain}
|
|
141
162
|
* ```
|
|
142
163
|
*/
|
|
143
164
|
type SignerConfig = {
|
|
144
165
|
[stage in Stage]?: {
|
|
145
166
|
[chainOrType in ChainType | Chain]?: {
|
|
146
|
-
[key: string]: SignerItemConfig | CombinedGnosisItemConfig | CombinedSquadsItemConfig;
|
|
167
|
+
[key: string]: SignerItemConfig | CombinedGnosisItemConfig | CombinedSquadsItemConfig | CombinedRimosafeItemConfig;
|
|
147
168
|
};
|
|
148
169
|
};
|
|
149
170
|
};
|
|
@@ -185,5 +206,6 @@ declare function isCombinedGnosisItemConfig(obj: unknown): obj is CombinedGnosis
|
|
|
185
206
|
* @returns {boolean} True if the object is a combined Squads item configuration, false otherwise.
|
|
186
207
|
*/
|
|
187
208
|
declare function isCombinedSquadsItemConfig(obj: unknown): obj is CombinedSquadsItemConfig;
|
|
209
|
+
declare function isCombinedRimosafeItemConfig(obj: unknown): obj is CombinedRimosafeItemConfig;
|
|
188
210
|
|
|
189
|
-
export { type CombinedGnosisItemConfig, type CombinedSquadsItemConfig, type GnosisConfig, type GnosisItemConfig, type GnosisStageConfig, type ProviderConfig, type ProviderManager, type ProviderSetting, type SignerConfig, type SignerItemConfig, type SignerManager, type SquadsItemConfig, isCombinedGnosisItemConfig, isCombinedSquadsItemConfig, isGnosisItemConfig };
|
|
211
|
+
export { type CombinedGnosisItemConfig, type CombinedRimosafeItemConfig, type CombinedSquadsItemConfig, type GnosisConfig, type GnosisItemConfig, type GnosisStageConfig, type ProviderConfig, type ProviderManager, type ProviderSetting, type RimosafeItemConfig, type SignerConfig, type SignerItemConfig, type SignerManager, type SquadsItemConfig, isCombinedGnosisItemConfig, isCombinedRimosafeItemConfig, isCombinedSquadsItemConfig, isGnosisItemConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,14 @@ type ProviderSetting = {
|
|
|
15
15
|
* The API key for the provider (optional).
|
|
16
16
|
*/
|
|
17
17
|
apiKey?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The authentication field (optional). for example: 'Authorization'.
|
|
20
|
+
*/
|
|
21
|
+
authField?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The authentication value (optional). for example: 'Bearer <token>'.
|
|
24
|
+
*/
|
|
25
|
+
authValue?: string;
|
|
18
26
|
} | string;
|
|
19
27
|
/**
|
|
20
28
|
* Type representing the configuration for providers.
|
|
@@ -92,13 +100,22 @@ interface SquadsItemConfig {
|
|
|
92
100
|
*/
|
|
93
101
|
multisigAddress: string;
|
|
94
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Interface representing the configuration for a Rimosafe item.
|
|
105
|
+
*/
|
|
106
|
+
interface RimosafeItemConfig {
|
|
107
|
+
/**
|
|
108
|
+
* The address of the multisig.
|
|
109
|
+
*/
|
|
110
|
+
multisigAddress: string;
|
|
111
|
+
}
|
|
95
112
|
/**
|
|
96
113
|
* Type representing the configuration for Gnosis by stage and chain.
|
|
97
114
|
* @see {@link GnosisItemConfig}, {@link SquadsItemConfig}, {@link ChainType}, {@link Chain}
|
|
98
115
|
*/
|
|
99
116
|
type GnosisStageConfig = {
|
|
100
117
|
[chainOrType in ChainType | Chain]?: {
|
|
101
|
-
[key: string]: GnosisItemConfig | SquadsItemConfig;
|
|
118
|
+
[key: string]: GnosisItemConfig | SquadsItemConfig | RimosafeItemConfig;
|
|
102
119
|
};
|
|
103
120
|
};
|
|
104
121
|
/**
|
|
@@ -116,6 +133,10 @@ type CombinedGnosisItemConfig = GnosisItemConfig & SignerItemConfig;
|
|
|
116
133
|
* Type representing the combined configuration for Squads and signer items.
|
|
117
134
|
*/
|
|
118
135
|
type CombinedSquadsItemConfig = SquadsItemConfig & SignerItemConfig;
|
|
136
|
+
/**
|
|
137
|
+
* Type representing the combined configuration for Rimosafe and signer items.
|
|
138
|
+
*/
|
|
139
|
+
type CombinedRimosafeItemConfig = RimosafeItemConfig & SignerItemConfig;
|
|
119
140
|
/**
|
|
120
141
|
* Type representing the configuration for signers by stage, chain, and key name.
|
|
121
142
|
* @example
|
|
@@ -137,13 +158,13 @@ type CombinedSquadsItemConfig = SquadsItemConfig & SignerItemConfig;
|
|
|
137
158
|
* }
|
|
138
159
|
* }
|
|
139
160
|
*
|
|
140
|
-
* @see {@link SignerItemConfig}, {@link CombinedGnosisItemConfig}, {@link CombinedSquadsItemConfig}, {@link ChainType}, {@link Chain}
|
|
161
|
+
* @see {@link SignerItemConfig}, {@link CombinedGnosisItemConfig}, {@link CombinedSquadsItemConfig} {@link CombinedRimosafeItemConfig }, {@link ChainType}, {@link Chain}
|
|
141
162
|
* ```
|
|
142
163
|
*/
|
|
143
164
|
type SignerConfig = {
|
|
144
165
|
[stage in Stage]?: {
|
|
145
166
|
[chainOrType in ChainType | Chain]?: {
|
|
146
|
-
[key: string]: SignerItemConfig | CombinedGnosisItemConfig | CombinedSquadsItemConfig;
|
|
167
|
+
[key: string]: SignerItemConfig | CombinedGnosisItemConfig | CombinedSquadsItemConfig | CombinedRimosafeItemConfig;
|
|
147
168
|
};
|
|
148
169
|
};
|
|
149
170
|
};
|
|
@@ -185,5 +206,6 @@ declare function isCombinedGnosisItemConfig(obj: unknown): obj is CombinedGnosis
|
|
|
185
206
|
* @returns {boolean} True if the object is a combined Squads item configuration, false otherwise.
|
|
186
207
|
*/
|
|
187
208
|
declare function isCombinedSquadsItemConfig(obj: unknown): obj is CombinedSquadsItemConfig;
|
|
209
|
+
declare function isCombinedRimosafeItemConfig(obj: unknown): obj is CombinedRimosafeItemConfig;
|
|
188
210
|
|
|
189
|
-
export { type CombinedGnosisItemConfig, type CombinedSquadsItemConfig, type GnosisConfig, type GnosisItemConfig, type GnosisStageConfig, type ProviderConfig, type ProviderManager, type ProviderSetting, type SignerConfig, type SignerItemConfig, type SignerManager, type SquadsItemConfig, isCombinedGnosisItemConfig, isCombinedSquadsItemConfig, isGnosisItemConfig };
|
|
211
|
+
export { type CombinedGnosisItemConfig, type CombinedRimosafeItemConfig, type CombinedSquadsItemConfig, type GnosisConfig, type GnosisItemConfig, type GnosisStageConfig, type ProviderConfig, type ProviderManager, type ProviderSetting, type RimosafeItemConfig, type SignerConfig, type SignerItemConfig, type SignerManager, type SquadsItemConfig, isCombinedGnosisItemConfig, isCombinedRimosafeItemConfig, isCombinedSquadsItemConfig, isGnosisItemConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -17,7 +17,13 @@ function isCombinedSquadsItemConfig(obj) {
|
|
|
17
17
|
}
|
|
18
18
|
return typeof obj === "object" && "multisigAddress" in obj;
|
|
19
19
|
}
|
|
20
|
+
function isCombinedRimosafeItemConfig(obj) {
|
|
21
|
+
if (obj === void 0 || obj === null) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
return typeof obj === "object" && "multisigAddress" in obj;
|
|
25
|
+
}
|
|
20
26
|
|
|
21
|
-
export { isCombinedGnosisItemConfig, isCombinedSquadsItemConfig, isGnosisItemConfig };
|
|
27
|
+
export { isCombinedGnosisItemConfig, isCombinedRimosafeItemConfig, isCombinedSquadsItemConfig, isGnosisItemConfig };
|
|
22
28
|
//# sourceMappingURL=index.mjs.map
|
|
23
29
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/signer.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../src/signer.ts"],"names":[],"mappings":";AAkKO,SAAS,mBAAmB,GAAuC,EAAA;AACtE,EAAI,IAAA,GAAA,KAAQ,KAAa,CAAA,IAAA,GAAA,KAAQ,IAAM,EAAA;AACnC,IAAO,OAAA,KAAA;AAAA;AAGX,EAAA,OAAO,OAAO,GAAA,KAAQ,QAAY,IAAA,SAAA,IAAa,OAAO,aAAiB,IAAA,GAAA;AAC3E;AAQO,SAAS,2BAA2B,GAA+C,EAAA;AACtF,EAAI,IAAA,GAAA,KAAQ,KAAa,CAAA,IAAA,GAAA,KAAQ,IAAM,EAAA;AACnC,IAAO,OAAA,KAAA;AAAA;AAGX,EAAO,OAAA,OAAO,QAAQ,QAAY,IAAA,SAAA,IAAa,OAAO,aAAiB,IAAA,GAAA,KAAQ,UAAc,IAAA,GAAA,IAAO,IAAQ,IAAA,GAAA,CAAA;AAChH;AAQO,SAAS,2BAA2B,GAA+C,EAAA;AACtF,EAAI,IAAA,GAAA,KAAQ,KAAa,CAAA,IAAA,GAAA,KAAQ,IAAM,EAAA;AACnC,IAAO,OAAA,KAAA;AAAA;AAGX,EAAO,OAAA,OAAO,GAAQ,KAAA,QAAA,IAAY,iBAAqB,IAAA,GAAA;AAC3D;AAEO,SAAS,6BAA6B,GAAiD,EAAA;AAC1F,EAAI,IAAA,GAAA,KAAQ,KAAa,CAAA,IAAA,GAAA,KAAQ,IAAM,EAAA;AACnC,IAAO,OAAA,KAAA;AAAA;AAGX,EAAO,OAAA,OAAO,GAAQ,KAAA,QAAA,IAAY,iBAAqB,IAAA,GAAA;AAC3D","file":"index.mjs","sourcesContent":["import { ContractNetworksConfig } from '@safe-global/protocol-kit'\ntype ContractNetworkConfig = ContractNetworksConfig[string]\n\n// ------------------ Account/Signer Config ------------------\n\nimport { Signer } from '@layerzerolabs/lz-core'\nimport { Chain, ChainType, Environment, Stage } from '@layerzerolabs/lz-definitions'\n\n/**\n * Interface representing the configuration for a signer item.\n */\nexport interface SignerItemConfig {\n /**\n * The mnemonic for the signer.\n */\n mnemonic?: string\n /**\n * The derivation path for the signer.\n */\n path?: string\n /**\n * The address of the signer.\n */\n address?: string\n /**\n * The private key of the signer.\n */\n pk?: string\n}\n\n/**\n * Interface representing the configuration for a Gnosis item.\n */\nexport interface GnosisItemConfig {\n /**\n * The URL of the Gnosis safe.\n */\n safeUrl: string\n /**\n * The address of the Gnosis safe.\n */\n safeAddress: string\n /**\n * The contract networks configuration for the Gnosis safe (optional).\n * @see {@link ContractNetworksConfig}\n */\n contractNetworks?: { [key: string]: Partial<ContractNetworkConfig> }\n}\n\n/**\n * Interface representing the configuration for a Squads item.\n */\nexport interface SquadsItemConfig {\n /**\n * The address of the multisig.\n */\n multisigAddress: string\n}\n/**\n * Interface representing the configuration for a Rimosafe item.\n */\nexport interface RimosafeItemConfig {\n /**\n * The address of the multisig.\n */\n multisigAddress: string\n}\n\n/**\n * Type representing the configuration for Gnosis by stage and chain.\n * @see {@link GnosisItemConfig}, {@link SquadsItemConfig}, {@link ChainType}, {@link Chain}\n */\nexport type GnosisStageConfig = {\n [chainOrType in ChainType | Chain]?: { [key: string]: GnosisItemConfig | SquadsItemConfig | RimosafeItemConfig }\n}\n\n/**\n * Type representing the configuration for Gnosis by stage.\n * This type maps stages to their corresponding Gnosis stage configurations.\n */\nexport type GnosisConfig = {\n /**\n * The stage of the configuration.\n * @see {@link Stage}, {@link GnosisStageConfig}\n */\n [stage in Stage]?: GnosisStageConfig\n}\n\n/**\n * Type representing the combined configuration for Gnosis and signer items.\n */\nexport type CombinedGnosisItemConfig = GnosisItemConfig & SignerItemConfig\n\n/**\n * Type representing the combined configuration for Squads and signer items.\n */\nexport type CombinedSquadsItemConfig = SquadsItemConfig & SignerItemConfig\n\n/**\n * Type representing the combined configuration for Rimosafe and signer items.\n */\nexport type CombinedRimosafeItemConfig = RimosafeItemConfig & SignerItemConfig\n/**\n * Type representing the configuration for signers by stage, chain, and key name.\n * @example\n * ```json\n * {\n * \"sandbox\": {\n * \"ethereum\": {\n * \"key1\": {\n * \"mnemonic\": \"xxx\",\n * \"path\": \"xxx\"\n * },\n * \"key2\": {\n * \"pk\": \"xxx\",\n * \"path\": \"xxx\"\n * safeUrl: \"xxx\",\n * safeAddress: \"xxx\"\n * }\n * }\n * }\n * }\n *\n * @see {@link SignerItemConfig}, {@link CombinedGnosisItemConfig}, {@link CombinedSquadsItemConfig} {@link CombinedRimosafeItemConfig }, {@link ChainType}, {@link Chain}\n * ```\n */\nexport type SignerConfig = {\n [stage in Stage]?: {\n [chainOrType in ChainType | Chain]?: {\n [key: string]:\n | SignerItemConfig\n | CombinedGnosisItemConfig\n | CombinedSquadsItemConfig\n | CombinedRimosafeItemConfig\n }\n }\n}\n\n/**\n * Interface representing a signer manager.\n * Provides methods to retrieve signers based on the specified chain, stage, environment, and key name.\n */\nexport interface SignerManager {\n /**\n * Retrieves a signer based on the specified chain, stage, environment, and key name.\n *\n * @param {Chain} chain - The chain for which to retrieve the signer.\n * @param {Stage} stage - The stage for which to retrieve the signer.\n * @param {Environment} env - The environment for which to retrieve the signer.\n * @param {string} keyName - The key name for which to retrieve the signer.\n * @returns {Promise<Signer>} A promise that resolves to the signer.\n */\n getSigner(chain: Chain, stage: Stage, env: Environment, keyName: string): Promise<Signer>\n}\n\n/**\n * Checks if the given object is a Gnosis item configuration.\n *\n * @param {unknown} obj - The object to check.\n * @returns {boolean} True if the object is a Gnosis item configuration, false otherwise.\n * @see {@link GnosisItemConfig}\n */\nexport function isGnosisItemConfig(obj: unknown): obj is GnosisItemConfig {\n if (obj === undefined || obj === null) {\n return false\n }\n\n return typeof obj === 'object' && 'safeUrl' in obj && 'safeAddress' in obj\n}\n\n/**\n * Checks if the given object is a combined Gnosis item configuration.\n *\n * @param {unknown} obj - The object to check.\n * @returns {boolean} True if the object is a combined Gnosis item configuration, false otherwise.\n */\nexport function isCombinedGnosisItemConfig(obj: unknown): obj is CombinedGnosisItemConfig {\n if (obj === undefined || obj === null) {\n return false\n }\n\n return typeof obj === 'object' && 'safeUrl' in obj && 'safeAddress' in obj && ('mnemonic' in obj || 'pk' in obj)\n}\n\n/**\n * Checks if the given object is a combined Squads item configuration.\n *\n * @param {unknown} obj - The object to check.\n * @returns {boolean} True if the object is a combined Squads item configuration, false otherwise.\n */\nexport function isCombinedSquadsItemConfig(obj: unknown): obj is CombinedSquadsItemConfig {\n if (obj === undefined || obj === null) {\n return false\n }\n\n return typeof obj === 'object' && 'multisigAddress' in obj\n}\n\nexport function isCombinedRimosafeItemConfig(obj: unknown): obj is CombinedRimosafeItemConfig {\n if (obj === undefined || obj === null) {\n return false\n }\n\n return typeof obj === 'object' && 'multisigAddress' in obj\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerzerolabs/lz-config-types",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.47",
|
|
4
4
|
"description": "LayerZero Core Library",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"exports": {
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"clean-prebuild": "rimraf dist"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@layerzerolabs/lz-core": "^3.0.
|
|
27
|
-
"@layerzerolabs/lz-definitions": "^3.0.
|
|
26
|
+
"@layerzerolabs/lz-core": "^3.0.47",
|
|
27
|
+
"@layerzerolabs/lz-definitions": "^3.0.47",
|
|
28
28
|
"@safe-global/protocol-kit": "^1.3.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@jest/globals": "^29.7.0",
|
|
32
|
-
"@layerzerolabs/tsup-config-next": "^3.0.
|
|
33
|
-
"@layerzerolabs/typescript-config-next": "^3.0.
|
|
32
|
+
"@layerzerolabs/tsup-config-next": "^3.0.47",
|
|
33
|
+
"@layerzerolabs/typescript-config-next": "^3.0.47",
|
|
34
34
|
"@types/jest": "^29.5.10",
|
|
35
35
|
"jest": "^29.7.0",
|
|
36
36
|
"rimraf": "^5.0.5",
|