@cardano-sdk/ogmios 0.12.4 → 0.12.6
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/cjs/Provider/TxSubmitProvider/OgmiosTxSubmitProvider.d.ts +4 -3
- package/dist/cjs/Provider/TxSubmitProvider/OgmiosTxSubmitProvider.d.ts.map +1 -1
- package/dist/cjs/Provider/TxSubmitProvider/OgmiosTxSubmitProvider.js +23 -4
- package/dist/cjs/Provider/TxSubmitProvider/OgmiosTxSubmitProvider.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/Provider/TxSubmitProvider/OgmiosTxSubmitProvider.d.ts +4 -3
- package/dist/esm/Provider/TxSubmitProvider/OgmiosTxSubmitProvider.d.ts.map +1 -1
- package/dist/esm/Provider/TxSubmitProvider/OgmiosTxSubmitProvider.js +24 -5
- package/dist/esm/Provider/TxSubmitProvider/OgmiosTxSubmitProvider.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -6
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { HealthCheckResponse, ProviderDependencies, SubmitTxArgs, TxSubmitProvider } from '@cardano-sdk/core';
|
|
1
|
+
import { HandleProvider, HealthCheckResponse, ProviderDependencies, SubmitTxArgs, TxSubmitProvider } from '@cardano-sdk/core';
|
|
2
2
|
import { ConnectionConfig } from '@cardano-ogmios/client';
|
|
3
3
|
import { RunnableModule } from '@cardano-sdk/util';
|
|
4
4
|
export declare class OgmiosTxSubmitProvider extends RunnableModule implements TxSubmitProvider {
|
|
5
5
|
#private;
|
|
6
|
-
constructor(connectionConfig: ConnectionConfig, { logger }: ProviderDependencies);
|
|
6
|
+
constructor(connectionConfig: ConnectionConfig, { logger }: ProviderDependencies, handleProvider?: HandleProvider);
|
|
7
7
|
initializeImpl(): Promise<void>;
|
|
8
8
|
shutdownImpl(): Promise<void>;
|
|
9
|
-
submitTx({ signedTransaction }: SubmitTxArgs): Promise<void>;
|
|
9
|
+
submitTx({ signedTransaction, context }: SubmitTxArgs): Promise<void>;
|
|
10
10
|
healthCheck(): Promise<HealthCheckResponse>;
|
|
11
11
|
startImpl(): Promise<void>;
|
|
12
|
+
private throwIfHandleResolutionConflict;
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=OgmiosTxSubmitProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OgmiosTxSubmitProvider.d.ts","sourceRoot":"","sources":["../../../../src/Provider/TxSubmitProvider/OgmiosTxSubmitProvider.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"OgmiosTxSubmitProvider.d.ts","sourceRoot":"","sources":["../../../../src/Provider/TxSubmitProvider/OgmiosTxSubmitProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EAGpB,YAAY,EACZ,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,gBAAgB,EAIjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,cAAc,EAA2B,MAAM,mBAAmB,CAAC;AAS5E,qBAAa,sBAAuB,SAAQ,cAAe,YAAW,gBAAgB;;gBAWxE,gBAAgB,EAAE,gBAAgB,EAAE,EAAE,MAAM,EAAE,EAAE,oBAAoB,EAAE,cAAc,CAAC,EAAE,cAAc;IAOpG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAa/B,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAUpC,QAAQ,CAAC,EAAE,iBAAiB,EAAE,OAAO,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAerE,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAI3C,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;YAIlB,+BAA+B;CA0B9C"}
|
|
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
11
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
12
|
};
|
|
13
|
-
var _OgmiosTxSubmitProvider_txSubmissionClient, _OgmiosTxSubmitProvider_logger, _OgmiosTxSubmitProvider_connectionConfig;
|
|
13
|
+
var _OgmiosTxSubmitProvider_txSubmissionClient, _OgmiosTxSubmitProvider_logger, _OgmiosTxSubmitProvider_connectionConfig, _OgmiosTxSubmitProvider_handleProvider;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.OgmiosTxSubmitProvider = void 0;
|
|
16
16
|
const core_1 = require("@cardano-sdk/core");
|
|
@@ -19,13 +19,15 @@ const util_1 = require("@cardano-sdk/util");
|
|
|
19
19
|
const TxSubmissionClient_1 = require("../../Ogmios/TxSubmissionClient");
|
|
20
20
|
const util_2 = require("../../util");
|
|
21
21
|
class OgmiosTxSubmitProvider extends util_1.RunnableModule {
|
|
22
|
-
constructor(connectionConfig, { logger }) {
|
|
22
|
+
constructor(connectionConfig, { logger }, handleProvider) {
|
|
23
23
|
super('OgmiosTxSubmitProvider', logger);
|
|
24
24
|
_OgmiosTxSubmitProvider_txSubmissionClient.set(this, void 0);
|
|
25
25
|
_OgmiosTxSubmitProvider_logger.set(this, void 0);
|
|
26
26
|
_OgmiosTxSubmitProvider_connectionConfig.set(this, void 0);
|
|
27
|
+
_OgmiosTxSubmitProvider_handleProvider.set(this, void 0);
|
|
27
28
|
__classPrivateFieldSet(this, _OgmiosTxSubmitProvider_logger, (0, util_1.contextLogger)(logger, 'OgmiosTxSubmitProvider'), "f");
|
|
28
29
|
__classPrivateFieldSet(this, _OgmiosTxSubmitProvider_connectionConfig, connectionConfig, "f");
|
|
30
|
+
__classPrivateFieldSet(this, _OgmiosTxSubmitProvider_handleProvider, handleProvider, "f");
|
|
29
31
|
}
|
|
30
32
|
async initializeImpl() {
|
|
31
33
|
__classPrivateFieldGet(this, _OgmiosTxSubmitProvider_logger, "f").info('Initializing OgmiosTxSubmitProvider');
|
|
@@ -42,10 +44,11 @@ class OgmiosTxSubmitProvider extends util_1.RunnableModule {
|
|
|
42
44
|
await __classPrivateFieldGet(this, _OgmiosTxSubmitProvider_txSubmissionClient, "f").shutdown();
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
|
-
async submitTx({ signedTransaction }) {
|
|
47
|
+
async submitTx({ signedTransaction, context }) {
|
|
46
48
|
if (this.state !== 'running') {
|
|
47
49
|
throw new core_1.CardanoNodeErrors.NotInitializedError('submitTx', this.name);
|
|
48
50
|
}
|
|
51
|
+
await this.throwIfHandleResolutionConflict(context);
|
|
49
52
|
try {
|
|
50
53
|
const id = await __classPrivateFieldGet(this, _OgmiosTxSubmitProvider_txSubmissionClient, "f").submitTx(signedTransaction);
|
|
51
54
|
__classPrivateFieldGet(this, _OgmiosTxSubmitProvider_logger, "f").info(`Submitted ${id}`);
|
|
@@ -60,7 +63,23 @@ class OgmiosTxSubmitProvider extends util_1.RunnableModule {
|
|
|
60
63
|
async startImpl() {
|
|
61
64
|
return Promise.resolve();
|
|
62
65
|
}
|
|
66
|
+
async throwIfHandleResolutionConflict(context) {
|
|
67
|
+
if (context?.handles && context.handles.length > 0) {
|
|
68
|
+
if (!__classPrivateFieldGet(this, _OgmiosTxSubmitProvider_handleProvider, "f")) {
|
|
69
|
+
throw new core_1.ProviderError(core_1.ProviderFailure.NotImplemented, undefined, 'No HandleProvider was set during construction.');
|
|
70
|
+
}
|
|
71
|
+
const handleInfoList = await __classPrivateFieldGet(this, _OgmiosTxSubmitProvider_handleProvider, "f").resolveHandles({
|
|
72
|
+
handles: context.handles.map((handle) => handle.handle)
|
|
73
|
+
});
|
|
74
|
+
for (const [index, handleInfo] of handleInfoList.entries()) {
|
|
75
|
+
if (!handleInfo || handleInfo.cardanoAddress !== context.handles[index].cardanoAddress) {
|
|
76
|
+
const handleOwnerChangeError = new core_1.HandleOwnerChangeError(context.handles[index].handle, context.handles[index].cardanoAddress, handleInfo ? handleInfo.cardanoAddress : null);
|
|
77
|
+
throw new core_1.ProviderError(core_1.ProviderFailure.Conflict, handleOwnerChangeError);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
63
82
|
}
|
|
64
83
|
exports.OgmiosTxSubmitProvider = OgmiosTxSubmitProvider;
|
|
65
|
-
_OgmiosTxSubmitProvider_txSubmissionClient = new WeakMap(), _OgmiosTxSubmitProvider_logger = new WeakMap(), _OgmiosTxSubmitProvider_connectionConfig = new WeakMap();
|
|
84
|
+
_OgmiosTxSubmitProvider_txSubmissionClient = new WeakMap(), _OgmiosTxSubmitProvider_logger = new WeakMap(), _OgmiosTxSubmitProvider_connectionConfig = new WeakMap(), _OgmiosTxSubmitProvider_handleProvider = new WeakMap();
|
|
66
85
|
//# sourceMappingURL=OgmiosTxSubmitProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OgmiosTxSubmitProvider.js","sourceRoot":"","sources":["../../../../src/Provider/TxSubmitProvider/OgmiosTxSubmitProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"OgmiosTxSubmitProvider.js","sourceRoot":"","sources":["../../../../src/Provider/TxSubmitProvider/OgmiosTxSubmitProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,4CAW2B;AAQ3B,mDAAsD;AACtD,4CAA4E;AAC5E,wEAA+F;AAC/F,qCAAgE;AAOhE,MAAa,sBAAuB,SAAQ,qBAAc;IAWxD,YAAY,gBAAkC,EAAE,EAAE,MAAM,EAAwB,EAAE,cAA+B;QAC/G,KAAK,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;QAX1C,6DAAwC;QACxC,iDAAgB;QAChB,2DAAoC;QACpC,yDAAiC;QAS/B,uBAA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