@lucid-evolution/provider 0.1.82 → 0.1.84
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/dist/index.cjs +612 -529
- package/dist/index.d.cts +67 -11
- package/dist/index.d.ts +67 -11
- package/dist/index.js +328 -248
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -27,14 +27,44 @@ declare class KupmiosError extends KupmiosError_base<{
|
|
|
27
27
|
}> {
|
|
28
28
|
get message(): string;
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Provides support for interacting with both Kupo and Ogmios APIs.
|
|
32
|
+
*
|
|
33
|
+
* @example Using Local URLs (No Authentication):
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const kupmios = new Kupmios(
|
|
36
|
+
* "http://localhost:1442", // Kupo API URL
|
|
37
|
+
* "http://localhost:1337" // Ogmios API URL
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example Using Authenticated URLs (No Custom Headers):
|
|
42
|
+
* ```typescript
|
|
43
|
+
* const kupmios = new Kupmios(
|
|
44
|
+
* "https://dmtr_kupoXXX.preprod-v2.kupo-m1.demeter.run", // Kupo Authenticated URL
|
|
45
|
+
* "https://dmtr_ogmiosXXX.preprod-v6.ogmios-m1.demeter.run" // Ogmios Authenticated URL
|
|
46
|
+
* );
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Using Public URLs with Custom Headers:
|
|
50
|
+
* ```typescript
|
|
51
|
+
* const kupmios = new Kupmios(
|
|
52
|
+
* "https://preprod-v2.kupo-m1.demeter.run", // Kupo API URL
|
|
53
|
+
* "https://preprod-v6.ogmios-m1.demeter.run", // Ogmios API URL
|
|
54
|
+
* {
|
|
55
|
+
* kupoHeader: { "dmtr-api-key": "dmtr_kupoXXX" }, // Custom header for Kupo
|
|
56
|
+
* ogmiosHeader: { "dmtr-api-key": "dmtr_ogmiosXXX" } // Custom header for Ogmios
|
|
57
|
+
* }
|
|
58
|
+
* );
|
|
59
|
+
*/
|
|
30
60
|
declare class Kupmios implements Provider {
|
|
31
|
-
kupoUrl
|
|
32
|
-
ogmiosUrl
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
61
|
+
private readonly kupoUrl;
|
|
62
|
+
private readonly ogmiosUrl;
|
|
63
|
+
private readonly headers?;
|
|
64
|
+
constructor(kupoUrl: string, ogmiosUrl: string, headers?: {
|
|
65
|
+
ogmiosHeader?: Record<string, string>;
|
|
66
|
+
kupoHeader?: Record<string, string>;
|
|
67
|
+
});
|
|
38
68
|
getProtocolParameters(): Promise<ProtocolParameters>;
|
|
39
69
|
getUtxos(addressOrCredential: Address | Credential): Promise<UTxO[]>;
|
|
40
70
|
getUtxosWithUnit(addressOrCredential: Address | Credential, unit: Unit): Promise<UTxO[]>;
|
|
@@ -56,7 +86,7 @@ type EmulatorAccount = {
|
|
|
56
86
|
outputData?: OutputData;
|
|
57
87
|
privateKey: string;
|
|
58
88
|
};
|
|
59
|
-
declare function
|
|
89
|
+
declare function generateEmulatorAccountFromPrivateKey(assets: Assets): Promise<EmulatorAccount>;
|
|
60
90
|
declare function generateEmulatorAccount(assets: Assets): EmulatorAccount;
|
|
61
91
|
declare class Emulator implements Provider {
|
|
62
92
|
ledger: Record<FlatOutRef, {
|
|
@@ -139,11 +169,37 @@ declare class KoiosError extends KoiosError_base<{
|
|
|
139
169
|
get message(): string;
|
|
140
170
|
}
|
|
141
171
|
/**
|
|
142
|
-
*
|
|
172
|
+
* Provides support for interacting with the Koios API
|
|
173
|
+
*
|
|
174
|
+
* @example Using the Preprod API URL:
|
|
175
|
+
* ```typescript
|
|
176
|
+
* const koios = new Koios(
|
|
177
|
+
* "https://preview.koios.rest/api/v1", // Preprod Preview Environment
|
|
178
|
+
* "optional-bearer-token" // Optional Bearer Token for authentication
|
|
179
|
+
* );
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
* @example Using the Preprod Stable API URL:
|
|
183
|
+
* ```typescript
|
|
184
|
+
* const koios = new Koios(
|
|
185
|
+
* "https://preprod.koios.rest/api/v1", // Preprod Stable Environment
|
|
186
|
+
* "optional-bearer-token" // Optional Bearer Token for authentication
|
|
187
|
+
* );
|
|
188
|
+
* ```
|
|
189
|
+
*
|
|
190
|
+
* @example Using the Mainnet API URL:
|
|
191
|
+
* ```typescript
|
|
192
|
+
* const koios = new Koios(
|
|
193
|
+
* "https://api.koios.rest/api/v1", // Mainnet Environment
|
|
194
|
+
* "optional-bearer-token" // Optional Bearer Token for authentication
|
|
195
|
+
* );
|
|
196
|
+
* ```
|
|
197
|
+
*
|
|
143
198
|
*/
|
|
144
199
|
declare class Koios implements Provider {
|
|
145
200
|
private readonly baseUrl;
|
|
146
|
-
|
|
201
|
+
private readonly token?;
|
|
202
|
+
constructor(baseUrl: string, token?: string);
|
|
147
203
|
getProtocolParameters(): Promise<ProtocolParameters>;
|
|
148
204
|
getUtxos(addressOrCredential: Address | Credential): Promise<UTxO[]>;
|
|
149
205
|
getUtxosWithUnit(addressOrCredential: Address | Credential, unit: Unit): Promise<UTxO[]>;
|
|
@@ -156,4 +212,4 @@ declare class Koios implements Provider {
|
|
|
156
212
|
evaluateTx(tx: Transaction, additionalUTxOs?: UTxO[]): Promise<EvalRedeemer[]>;
|
|
157
213
|
}
|
|
158
214
|
|
|
159
|
-
export { Blockfrost, Emulator, type EmulatorAccount, Koios, KoiosError, Kupmios, KupmiosError, Maestro, type MaestroConfig, type MaestroSupportedNetworks, generateEmulatorAccount,
|
|
215
|
+
export { Blockfrost, Emulator, type EmulatorAccount, Koios, KoiosError, Kupmios, KupmiosError, Maestro, type MaestroConfig, type MaestroSupportedNetworks, generateEmulatorAccount, generateEmulatorAccountFromPrivateKey };
|
package/dist/index.d.ts
CHANGED
|
@@ -27,14 +27,44 @@ declare class KupmiosError extends KupmiosError_base<{
|
|
|
27
27
|
}> {
|
|
28
28
|
get message(): string;
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Provides support for interacting with both Kupo and Ogmios APIs.
|
|
32
|
+
*
|
|
33
|
+
* @example Using Local URLs (No Authentication):
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const kupmios = new Kupmios(
|
|
36
|
+
* "http://localhost:1442", // Kupo API URL
|
|
37
|
+
* "http://localhost:1337" // Ogmios API URL
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example Using Authenticated URLs (No Custom Headers):
|
|
42
|
+
* ```typescript
|
|
43
|
+
* const kupmios = new Kupmios(
|
|
44
|
+
* "https://dmtr_kupoXXX.preprod-v2.kupo-m1.demeter.run", // Kupo Authenticated URL
|
|
45
|
+
* "https://dmtr_ogmiosXXX.preprod-v6.ogmios-m1.demeter.run" // Ogmios Authenticated URL
|
|
46
|
+
* );
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Using Public URLs with Custom Headers:
|
|
50
|
+
* ```typescript
|
|
51
|
+
* const kupmios = new Kupmios(
|
|
52
|
+
* "https://preprod-v2.kupo-m1.demeter.run", // Kupo API URL
|
|
53
|
+
* "https://preprod-v6.ogmios-m1.demeter.run", // Ogmios API URL
|
|
54
|
+
* {
|
|
55
|
+
* kupoHeader: { "dmtr-api-key": "dmtr_kupoXXX" }, // Custom header for Kupo
|
|
56
|
+
* ogmiosHeader: { "dmtr-api-key": "dmtr_ogmiosXXX" } // Custom header for Ogmios
|
|
57
|
+
* }
|
|
58
|
+
* );
|
|
59
|
+
*/
|
|
30
60
|
declare class Kupmios implements Provider {
|
|
31
|
-
kupoUrl
|
|
32
|
-
ogmiosUrl
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
61
|
+
private readonly kupoUrl;
|
|
62
|
+
private readonly ogmiosUrl;
|
|
63
|
+
private readonly headers?;
|
|
64
|
+
constructor(kupoUrl: string, ogmiosUrl: string, headers?: {
|
|
65
|
+
ogmiosHeader?: Record<string, string>;
|
|
66
|
+
kupoHeader?: Record<string, string>;
|
|
67
|
+
});
|
|
38
68
|
getProtocolParameters(): Promise<ProtocolParameters>;
|
|
39
69
|
getUtxos(addressOrCredential: Address | Credential): Promise<UTxO[]>;
|
|
40
70
|
getUtxosWithUnit(addressOrCredential: Address | Credential, unit: Unit): Promise<UTxO[]>;
|
|
@@ -56,7 +86,7 @@ type EmulatorAccount = {
|
|
|
56
86
|
outputData?: OutputData;
|
|
57
87
|
privateKey: string;
|
|
58
88
|
};
|
|
59
|
-
declare function
|
|
89
|
+
declare function generateEmulatorAccountFromPrivateKey(assets: Assets): Promise<EmulatorAccount>;
|
|
60
90
|
declare function generateEmulatorAccount(assets: Assets): EmulatorAccount;
|
|
61
91
|
declare class Emulator implements Provider {
|
|
62
92
|
ledger: Record<FlatOutRef, {
|
|
@@ -139,11 +169,37 @@ declare class KoiosError extends KoiosError_base<{
|
|
|
139
169
|
get message(): string;
|
|
140
170
|
}
|
|
141
171
|
/**
|
|
142
|
-
*
|
|
172
|
+
* Provides support for interacting with the Koios API
|
|
173
|
+
*
|
|
174
|
+
* @example Using the Preprod API URL:
|
|
175
|
+
* ```typescript
|
|
176
|
+
* const koios = new Koios(
|
|
177
|
+
* "https://preview.koios.rest/api/v1", // Preprod Preview Environment
|
|
178
|
+
* "optional-bearer-token" // Optional Bearer Token for authentication
|
|
179
|
+
* );
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
* @example Using the Preprod Stable API URL:
|
|
183
|
+
* ```typescript
|
|
184
|
+
* const koios = new Koios(
|
|
185
|
+
* "https://preprod.koios.rest/api/v1", // Preprod Stable Environment
|
|
186
|
+
* "optional-bearer-token" // Optional Bearer Token for authentication
|
|
187
|
+
* );
|
|
188
|
+
* ```
|
|
189
|
+
*
|
|
190
|
+
* @example Using the Mainnet API URL:
|
|
191
|
+
* ```typescript
|
|
192
|
+
* const koios = new Koios(
|
|
193
|
+
* "https://api.koios.rest/api/v1", // Mainnet Environment
|
|
194
|
+
* "optional-bearer-token" // Optional Bearer Token for authentication
|
|
195
|
+
* );
|
|
196
|
+
* ```
|
|
197
|
+
*
|
|
143
198
|
*/
|
|
144
199
|
declare class Koios implements Provider {
|
|
145
200
|
private readonly baseUrl;
|
|
146
|
-
|
|
201
|
+
private readonly token?;
|
|
202
|
+
constructor(baseUrl: string, token?: string);
|
|
147
203
|
getProtocolParameters(): Promise<ProtocolParameters>;
|
|
148
204
|
getUtxos(addressOrCredential: Address | Credential): Promise<UTxO[]>;
|
|
149
205
|
getUtxosWithUnit(addressOrCredential: Address | Credential, unit: Unit): Promise<UTxO[]>;
|
|
@@ -156,4 +212,4 @@ declare class Koios implements Provider {
|
|
|
156
212
|
evaluateTx(tx: Transaction, additionalUTxOs?: UTxO[]): Promise<EvalRedeemer[]>;
|
|
157
213
|
}
|
|
158
214
|
|
|
159
|
-
export { Blockfrost, Emulator, type EmulatorAccount, Koios, KoiosError, Kupmios, KupmiosError, Maestro, type MaestroConfig, type MaestroSupportedNetworks, generateEmulatorAccount,
|
|
215
|
+
export { Blockfrost, Emulator, type EmulatorAccount, Koios, KoiosError, Kupmios, KupmiosError, Maestro, type MaestroConfig, type MaestroSupportedNetworks, generateEmulatorAccount, generateEmulatorAccountFromPrivateKey };
|