@splashprotocol/remote-builder 2.0.0-beta.43 → 2.0.0-beta.44
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 +22 -0
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +28 -5
- package/package.json +1 -1
- package/src/builders/SplashRemoteBuilder.ts +18 -1
- package/src/core/errors/InsufficientCollateralError.ts +1 -0
- package/src/core/errors/InsufficientFundsErrorForChange.ts +1 -0
- package/src/core/errors/NoCollateralError.ts +1 -0
- package/src/index.ts +3 -0
package/dist/index.cjs
CHANGED
@@ -20,6 +20,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
20
20
|
// src/index.ts
|
21
21
|
var src_exports = {};
|
22
22
|
__export(src_exports, {
|
23
|
+
InsufficientCollateralError: () => InsufficientCollateralError,
|
24
|
+
InsufficientFundsErrorForChange: () => InsufficientFundsErrorForChange,
|
25
|
+
NoCollateralError: () => NoCollateralError,
|
23
26
|
RemoteTransaction: () => RemoteTransaction,
|
24
27
|
SignedRemoteTransaction: () => SignedRemoteTransaction,
|
25
28
|
SplashRemoteBuilder: () => SplashRemoteBuilder
|
@@ -66,6 +69,10 @@ var SplashRemoteBuilder = class _SplashRemoteBuilder {
|
|
66
69
|
trade() {
|
67
70
|
return Promise.resolve(RemoteTransaction.new("", this));
|
68
71
|
}
|
72
|
+
cancelOperation(outputReference) {
|
73
|
+
console.log(outputReference);
|
74
|
+
return Promise.resolve(RemoteTransaction.new("", this));
|
75
|
+
}
|
69
76
|
};
|
70
77
|
|
71
78
|
// src/core/models/SignedRemoteTransaction/SignedRemoteTransaction.ts
|
@@ -86,8 +93,23 @@ var SignedRemoteTransaction = class _SignedRemoteTransaction {
|
|
86
93
|
return this.builder.submit(this);
|
87
94
|
}
|
88
95
|
};
|
96
|
+
|
97
|
+
// src/core/errors/InsufficientCollateralError.ts
|
98
|
+
var InsufficientCollateralError = class extends Error {
|
99
|
+
};
|
100
|
+
|
101
|
+
// src/core/errors/NoCollateralError.ts
|
102
|
+
var NoCollateralError = class extends Error {
|
103
|
+
};
|
104
|
+
|
105
|
+
// src/core/errors/InsufficientFundsErrorForChange.ts
|
106
|
+
var InsufficientFundsErrorForChange = class extends Error {
|
107
|
+
};
|
89
108
|
// Annotate the CommonJS export names for ESM import in node:
|
90
109
|
0 && (module.exports = {
|
110
|
+
InsufficientCollateralError,
|
111
|
+
InsufficientFundsErrorForChange,
|
112
|
+
NoCollateralError,
|
91
113
|
RemoteTransaction,
|
92
114
|
SignedRemoteTransaction,
|
93
115
|
SplashRemoteBuilder
|
package/dist/index.d.cts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Api, Backend, SplashBackend } from '@splashprotocol/api';
|
2
|
-
import { TransactionHash, CborHexString } from '@splashprotocol/core';
|
2
|
+
import { TransactionHash, CborHexString, OutputReference, OutputReferenceHash } from '@splashprotocol/core';
|
3
3
|
|
4
4
|
declare class SignedRemoteTransaction<S, RB extends RemoteBuilder<Api<Backend<{}>>, S>> {
|
5
5
|
private builder;
|
@@ -42,6 +42,16 @@ declare class SplashRemoteBuilder implements RemoteBuilder<Api<SplashBackend>, C
|
|
42
42
|
sign(): Promise<SignedRemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString>>>;
|
43
43
|
submit(): Promise<TransactionHash>;
|
44
44
|
trade(): Promise<RemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString>>>;
|
45
|
+
cancelOperation(outputReference: OutputReference | OutputReferenceHash): Promise<RemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString>>>;
|
45
46
|
}
|
46
47
|
|
47
|
-
|
48
|
+
declare class InsufficientCollateralError extends Error {
|
49
|
+
}
|
50
|
+
|
51
|
+
declare class NoCollateralError extends Error {
|
52
|
+
}
|
53
|
+
|
54
|
+
declare class InsufficientFundsErrorForChange extends Error {
|
55
|
+
}
|
56
|
+
|
57
|
+
export { InsufficientCollateralError, InsufficientFundsErrorForChange, NoCollateralError, type RemoteBuilder, RemoteTransaction, SignedRemoteTransaction, SplashRemoteBuilder };
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Api, Backend, SplashBackend } from '@splashprotocol/api';
|
2
|
-
import { TransactionHash, CborHexString } from '@splashprotocol/core';
|
2
|
+
import { TransactionHash, CborHexString, OutputReference, OutputReferenceHash } from '@splashprotocol/core';
|
3
3
|
|
4
4
|
declare class SignedRemoteTransaction<S, RB extends RemoteBuilder<Api<Backend<{}>>, S>> {
|
5
5
|
private builder;
|
@@ -42,6 +42,16 @@ declare class SplashRemoteBuilder implements RemoteBuilder<Api<SplashBackend>, C
|
|
42
42
|
sign(): Promise<SignedRemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString>>>;
|
43
43
|
submit(): Promise<TransactionHash>;
|
44
44
|
trade(): Promise<RemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString>>>;
|
45
|
+
cancelOperation(outputReference: OutputReference | OutputReferenceHash): Promise<RemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString>>>;
|
45
46
|
}
|
46
47
|
|
47
|
-
|
48
|
+
declare class InsufficientCollateralError extends Error {
|
49
|
+
}
|
50
|
+
|
51
|
+
declare class NoCollateralError extends Error {
|
52
|
+
}
|
53
|
+
|
54
|
+
declare class InsufficientFundsErrorForChange extends Error {
|
55
|
+
}
|
56
|
+
|
57
|
+
export { InsufficientCollateralError, InsufficientFundsErrorForChange, NoCollateralError, type RemoteBuilder, RemoteTransaction, SignedRemoteTransaction, SplashRemoteBuilder };
|
package/dist/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
// src/core/models/RemoteTransaction/RemoteTransaction.ts
|
2
2
|
var RemoteTransaction = class _RemoteTransaction {
|
3
3
|
constructor(serialization, builder) {
|
4
4
|
this.builder = builder;
|
@@ -30,13 +30,17 @@ var SplashRemoteBuilder = class _SplashRemoteBuilder {
|
|
30
30
|
this.api = api;
|
31
31
|
}
|
32
32
|
sign() {
|
33
|
-
throw new Error(
|
33
|
+
throw new Error("not implemented.");
|
34
34
|
}
|
35
35
|
submit() {
|
36
|
-
throw new Error(
|
36
|
+
throw new Error("not implemented.");
|
37
37
|
}
|
38
38
|
trade() {
|
39
|
-
return Promise.resolve(RemoteTransaction.new(
|
39
|
+
return Promise.resolve(RemoteTransaction.new("", this));
|
40
|
+
}
|
41
|
+
cancelOperation(outputReference) {
|
42
|
+
console.log(outputReference);
|
43
|
+
return Promise.resolve(RemoteTransaction.new("", this));
|
40
44
|
}
|
41
45
|
};
|
42
46
|
|
@@ -58,4 +62,23 @@ var SignedRemoteTransaction = class _SignedRemoteTransaction {
|
|
58
62
|
return this.builder.submit(this);
|
59
63
|
}
|
60
64
|
};
|
61
|
-
|
65
|
+
|
66
|
+
// src/core/errors/InsufficientCollateralError.ts
|
67
|
+
var InsufficientCollateralError = class extends Error {
|
68
|
+
};
|
69
|
+
|
70
|
+
// src/core/errors/NoCollateralError.ts
|
71
|
+
var NoCollateralError = class extends Error {
|
72
|
+
};
|
73
|
+
|
74
|
+
// src/core/errors/InsufficientFundsErrorForChange.ts
|
75
|
+
var InsufficientFundsErrorForChange = class extends Error {
|
76
|
+
};
|
77
|
+
export {
|
78
|
+
InsufficientCollateralError,
|
79
|
+
InsufficientFundsErrorForChange,
|
80
|
+
NoCollateralError,
|
81
|
+
RemoteTransaction,
|
82
|
+
SignedRemoteTransaction,
|
83
|
+
SplashRemoteBuilder
|
84
|
+
};
|
package/package.json
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
import { RemoteBuilder } from '../core/types/RemoteBuilder.ts';
|
2
2
|
import { Api, SplashBackend } from '@splashprotocol/api';
|
3
3
|
import { RemoteTransaction } from '../core/models/RemoteTransaction/RemoteTransaction.ts';
|
4
|
-
import {
|
4
|
+
import {
|
5
|
+
CborHexString,
|
6
|
+
OutputReference,
|
7
|
+
OutputReferenceHash,
|
8
|
+
TransactionHash,
|
9
|
+
} from '@splashprotocol/core';
|
5
10
|
import { SignedRemoteTransaction } from '../core/models/SignedRemoteTransaction/SignedRemoteTransaction.ts';
|
6
11
|
|
7
12
|
export class SplashRemoteBuilder
|
@@ -38,4 +43,16 @@ export class SplashRemoteBuilder
|
|
38
43
|
> {
|
39
44
|
return Promise.resolve(RemoteTransaction.new('', this));
|
40
45
|
}
|
46
|
+
|
47
|
+
cancelOperation(
|
48
|
+
outputReference: OutputReference | OutputReferenceHash,
|
49
|
+
): Promise<
|
50
|
+
RemoteTransaction<
|
51
|
+
CborHexString,
|
52
|
+
RemoteBuilder<Api<SplashBackend>, CborHexString>
|
53
|
+
>
|
54
|
+
> {
|
55
|
+
console.log(outputReference);
|
56
|
+
return Promise.resolve(RemoteTransaction.new('', this));
|
57
|
+
}
|
41
58
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export class InsufficientCollateralError extends Error {}
|
@@ -0,0 +1 @@
|
|
1
|
+
export class InsufficientFundsErrorForChange extends Error {}
|
@@ -0,0 +1 @@
|
|
1
|
+
export class NoCollateralError extends Error {}
|
package/src/index.ts
CHANGED
@@ -2,3 +2,6 @@ export * from './core/types/RemoteBuilder.ts';
|
|
2
2
|
export * from './builders/SplashRemoteBuilder.ts';
|
3
3
|
export * from './core/models/SignedRemoteTransaction/SignedRemoteTransaction.ts';
|
4
4
|
export * from './core/models/RemoteTransaction/RemoteTransaction.ts';
|
5
|
+
export * from './core/errors/InsufficientCollateralError.ts';
|
6
|
+
export * from './core/errors/NoCollateralError.ts';
|
7
|
+
export * from './core/errors/InsufficientFundsErrorForChange.ts';
|