@splashprotocol/remote-builder 2.0.0-beta.44 → 2.0.0-beta.46
Sign up to get free protection for your applications and to get access to all the features.
- package/.turbo/turbo-build.log +10 -10
- package/dist/index.cjs +18 -8
- package/dist/index.d.cts +18 -10
- package/dist/index.d.ts +18 -10
- package/dist/index.js +18 -8
- package/package.json +2 -2
- package/src/builders/SplashRemoteBuilder.ts +8 -5
- package/src/core/models/RemoteTransaction/RemoteTransaction.ts +13 -4
- package/src/core/models/SignedRemoteTransaction/SignedRemoteTransaction.ts +12 -3
- package/src/core/types/RemoteBuilder.ts +5 -5
package/.turbo/turbo-build.log
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
[34mESM[39m Build start
|
11
11
|
[34mCJS[39m Build start
|
12
12
|
|
13
|
-
[90m[[
|
13
|
+
[90m[[90m4:48:23 PM[90m][39m [43m[30m WARN [39m[49m [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe condition "types" here will never be used as it comes after both "import" and "require"[0m [package.json]
|
14
14
|
|
15
15
|
package.json:16:6:
|
16
16
|
[37m 16 │ [32m"types"[37m: "./dist/index.d.ts"
|
@@ -31,7 +31,7 @@
|
|
31
31
|
|
32
32
|
|
33
33
|
|
34
|
-
[90m[[
|
34
|
+
[90m[[90m4:48:23 PM[90m][39m [43m[30m WARN [39m[49m [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe condition "types" here will never be used as it comes after both "import" and "require"[0m [package.json]
|
35
35
|
|
36
36
|
package.json:16:6:
|
37
37
|
[37m 16 │ [32m"types"[37m: "./dist/index.d.ts"
|
@@ -51,12 +51,12 @@
|
|
51
51
|
|
52
52
|
|
53
53
|
|
54
|
-
[32mESM[39m [1mdist/index.js [22m[
|
55
|
-
[32mESM[39m ⚡️ Build success in
|
56
|
-
[32mCJS[39m [1mdist/index.cjs [22m[
|
57
|
-
[32mCJS[39m ⚡️ Build success in
|
54
|
+
[32mESM[39m [1mdist/index.js [22m[32m2.31 KB[39m
|
55
|
+
[32mESM[39m ⚡️ Build success in 132ms
|
56
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m3.61 KB[39m
|
57
|
+
[32mCJS[39m ⚡️ Build success in 132ms
|
58
58
|
[34mDTS[39m Build start
|
59
|
-
[32mDTS[39m ⚡️ Build success in
|
60
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
61
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[
|
62
|
-
[2K[1G✨ Done in 1.
|
59
|
+
[32mDTS[39m ⚡️ Build success in 813ms
|
60
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m2.72 KB[39m
|
61
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m2.72 KB[39m
|
62
|
+
[2K[1G✨ Done in 1.66s.
|
package/dist/index.cjs
CHANGED
@@ -31,18 +31,23 @@ module.exports = __toCommonJS(src_exports);
|
|
31
31
|
|
32
32
|
// src/core/models/RemoteTransaction/RemoteTransaction.ts
|
33
33
|
var RemoteTransaction = class _RemoteTransaction {
|
34
|
-
constructor(serialization, builder) {
|
34
|
+
constructor(serialization, builder, additionalData) {
|
35
35
|
this.builder = builder;
|
36
36
|
this.serialization = serialization;
|
37
|
+
this.additionalData = additionalData;
|
37
38
|
}
|
38
|
-
static new(serialization, builder) {
|
39
|
-
return new _RemoteTransaction(serialization, builder);
|
39
|
+
static new(serialization, builder, additionalData) {
|
40
|
+
return new _RemoteTransaction(serialization, builder, additionalData);
|
40
41
|
}
|
41
42
|
/**
|
42
43
|
* Transaction serialization
|
43
44
|
* @type {S}
|
44
45
|
*/
|
45
46
|
serialization;
|
47
|
+
/**
|
48
|
+
* Transaction additional data
|
49
|
+
*/
|
50
|
+
additionalData;
|
46
51
|
sign() {
|
47
52
|
return this.builder.sign(this);
|
48
53
|
}
|
@@ -67,28 +72,33 @@ var SplashRemoteBuilder = class _SplashRemoteBuilder {
|
|
67
72
|
throw new Error("not implemented.");
|
68
73
|
}
|
69
74
|
trade() {
|
70
|
-
return Promise.resolve(RemoteTransaction.new("", this));
|
75
|
+
return Promise.resolve(RemoteTransaction.new("", this, void 0));
|
71
76
|
}
|
72
77
|
cancelOperation(outputReference) {
|
73
78
|
console.log(outputReference);
|
74
|
-
return Promise.resolve(RemoteTransaction.new("", this));
|
79
|
+
return Promise.resolve(RemoteTransaction.new("", this, void 0));
|
75
80
|
}
|
76
81
|
};
|
77
82
|
|
78
83
|
// src/core/models/SignedRemoteTransaction/SignedRemoteTransaction.ts
|
79
84
|
var SignedRemoteTransaction = class _SignedRemoteTransaction {
|
80
|
-
constructor(serialization, builder) {
|
85
|
+
constructor(serialization, builder, additionalData) {
|
81
86
|
this.builder = builder;
|
82
87
|
this.serialization = serialization;
|
88
|
+
this.additionalData = additionalData;
|
83
89
|
}
|
84
|
-
static new(serialization, builder) {
|
85
|
-
return new _SignedRemoteTransaction(serialization, builder);
|
90
|
+
static new(serialization, builder, additionalData) {
|
91
|
+
return new _SignedRemoteTransaction(serialization, builder, additionalData);
|
86
92
|
}
|
87
93
|
/**
|
88
94
|
* Transaction serialization
|
89
95
|
* @type {S}
|
90
96
|
*/
|
91
97
|
serialization;
|
98
|
+
/**
|
99
|
+
* Transaction additional data
|
100
|
+
*/
|
101
|
+
additionalData;
|
92
102
|
submit() {
|
93
103
|
return this.builder.submit(this);
|
94
104
|
}
|
package/dist/index.d.cts
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
import { Api, Backend, SplashBackend } from '@splashprotocol/api';
|
2
2
|
import { TransactionHash, CborHexString, OutputReference, OutputReferenceHash } from '@splashprotocol/core';
|
3
3
|
|
4
|
-
declare class SignedRemoteTransaction<S, RB extends RemoteBuilder<Api<Backend<{}>>, S
|
4
|
+
declare class SignedRemoteTransaction<S, RB extends RemoteBuilder<Api<Backend<{}>>, S>, AdditionalData> {
|
5
5
|
private builder;
|
6
|
-
static new<S, RB extends RemoteBuilder<Api<Backend<{}>>, S
|
6
|
+
static new<S, RB extends RemoteBuilder<Api<Backend<{}>>, S>, AdditionalData>(serialization: S, builder: RB, additionalData: AdditionalData): SignedRemoteTransaction<S, RB, AdditionalData>;
|
7
7
|
/**
|
8
8
|
* Transaction serialization
|
9
9
|
* @type {S}
|
10
10
|
*/
|
11
11
|
readonly serialization: S;
|
12
|
+
/**
|
13
|
+
* Transaction additional data
|
14
|
+
*/
|
15
|
+
readonly additionalData: AdditionalData;
|
12
16
|
private constructor();
|
13
17
|
submit(): Promise<TransactionHash>;
|
14
18
|
}
|
@@ -16,33 +20,37 @@ declare class SignedRemoteTransaction<S, RB extends RemoteBuilder<Api<Backend<{}
|
|
16
20
|
/**
|
17
21
|
* Remote transaction representation
|
18
22
|
*/
|
19
|
-
declare class RemoteTransaction<S, RB extends RemoteBuilder<Api<Backend<{}>>, S
|
23
|
+
declare class RemoteTransaction<S, RB extends RemoteBuilder<Api<Backend<{}>>, S>, AdditionalData> {
|
20
24
|
private builder;
|
21
|
-
static new<S, RB extends RemoteBuilder<Api<Backend<{}>>, S
|
25
|
+
static new<S, RB extends RemoteBuilder<Api<Backend<{}>>, S>, AdditionalData>(serialization: S, builder: RB, additionalData: AdditionalData): RemoteTransaction<S, RB, AdditionalData>;
|
22
26
|
/**
|
23
27
|
* Transaction serialization
|
24
28
|
* @type {S}
|
25
29
|
*/
|
26
30
|
readonly serialization: S;
|
31
|
+
/**
|
32
|
+
* Transaction additional data
|
33
|
+
*/
|
34
|
+
readonly additionalData: AdditionalData;
|
27
35
|
private constructor();
|
28
|
-
sign(): Promise<SignedRemoteTransaction<S, RB>>;
|
36
|
+
sign(): Promise<SignedRemoteTransaction<S, RB, AdditionalData>>;
|
29
37
|
signAndSubmit(): Promise<TransactionHash>;
|
30
38
|
}
|
31
39
|
|
32
40
|
interface RemoteBuilder<A extends Api<Backend<{}>>, S> {
|
33
41
|
readonly api: A;
|
34
|
-
sign(tx: RemoteTransaction<S, RemoteBuilder<A, S
|
35
|
-
submit(signedTx: SignedRemoteTransaction<S, RemoteBuilder<A, S
|
42
|
+
sign<AD>(tx: RemoteTransaction<S, RemoteBuilder<A, S>, AD>): Promise<SignedRemoteTransaction<S, RemoteBuilder<A, S>, AD>>;
|
43
|
+
submit<AD>(signedTx: SignedRemoteTransaction<S, RemoteBuilder<A, S>, AD>): Promise<TransactionHash>;
|
36
44
|
}
|
37
45
|
|
38
46
|
declare class SplashRemoteBuilder implements RemoteBuilder<Api<SplashBackend>, CborHexString> {
|
39
47
|
static new(api: Api<SplashBackend>): SplashRemoteBuilder;
|
40
48
|
readonly api: Api<SplashBackend>;
|
41
49
|
private constructor();
|
42
|
-
sign(): Promise<SignedRemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString
|
50
|
+
sign(): Promise<SignedRemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString>, any>>;
|
43
51
|
submit(): Promise<TransactionHash>;
|
44
|
-
trade(): Promise<RemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString
|
45
|
-
cancelOperation(outputReference: OutputReference | OutputReferenceHash): Promise<RemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString
|
52
|
+
trade(): Promise<RemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString>, any>>;
|
53
|
+
cancelOperation(outputReference: OutputReference | OutputReferenceHash): Promise<RemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString>, any>>;
|
46
54
|
}
|
47
55
|
|
48
56
|
declare class InsufficientCollateralError extends Error {
|
package/dist/index.d.ts
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
import { Api, Backend, SplashBackend } from '@splashprotocol/api';
|
2
2
|
import { TransactionHash, CborHexString, OutputReference, OutputReferenceHash } from '@splashprotocol/core';
|
3
3
|
|
4
|
-
declare class SignedRemoteTransaction<S, RB extends RemoteBuilder<Api<Backend<{}>>, S
|
4
|
+
declare class SignedRemoteTransaction<S, RB extends RemoteBuilder<Api<Backend<{}>>, S>, AdditionalData> {
|
5
5
|
private builder;
|
6
|
-
static new<S, RB extends RemoteBuilder<Api<Backend<{}>>, S
|
6
|
+
static new<S, RB extends RemoteBuilder<Api<Backend<{}>>, S>, AdditionalData>(serialization: S, builder: RB, additionalData: AdditionalData): SignedRemoteTransaction<S, RB, AdditionalData>;
|
7
7
|
/**
|
8
8
|
* Transaction serialization
|
9
9
|
* @type {S}
|
10
10
|
*/
|
11
11
|
readonly serialization: S;
|
12
|
+
/**
|
13
|
+
* Transaction additional data
|
14
|
+
*/
|
15
|
+
readonly additionalData: AdditionalData;
|
12
16
|
private constructor();
|
13
17
|
submit(): Promise<TransactionHash>;
|
14
18
|
}
|
@@ -16,33 +20,37 @@ declare class SignedRemoteTransaction<S, RB extends RemoteBuilder<Api<Backend<{}
|
|
16
20
|
/**
|
17
21
|
* Remote transaction representation
|
18
22
|
*/
|
19
|
-
declare class RemoteTransaction<S, RB extends RemoteBuilder<Api<Backend<{}>>, S
|
23
|
+
declare class RemoteTransaction<S, RB extends RemoteBuilder<Api<Backend<{}>>, S>, AdditionalData> {
|
20
24
|
private builder;
|
21
|
-
static new<S, RB extends RemoteBuilder<Api<Backend<{}>>, S
|
25
|
+
static new<S, RB extends RemoteBuilder<Api<Backend<{}>>, S>, AdditionalData>(serialization: S, builder: RB, additionalData: AdditionalData): RemoteTransaction<S, RB, AdditionalData>;
|
22
26
|
/**
|
23
27
|
* Transaction serialization
|
24
28
|
* @type {S}
|
25
29
|
*/
|
26
30
|
readonly serialization: S;
|
31
|
+
/**
|
32
|
+
* Transaction additional data
|
33
|
+
*/
|
34
|
+
readonly additionalData: AdditionalData;
|
27
35
|
private constructor();
|
28
|
-
sign(): Promise<SignedRemoteTransaction<S, RB>>;
|
36
|
+
sign(): Promise<SignedRemoteTransaction<S, RB, AdditionalData>>;
|
29
37
|
signAndSubmit(): Promise<TransactionHash>;
|
30
38
|
}
|
31
39
|
|
32
40
|
interface RemoteBuilder<A extends Api<Backend<{}>>, S> {
|
33
41
|
readonly api: A;
|
34
|
-
sign(tx: RemoteTransaction<S, RemoteBuilder<A, S
|
35
|
-
submit(signedTx: SignedRemoteTransaction<S, RemoteBuilder<A, S
|
42
|
+
sign<AD>(tx: RemoteTransaction<S, RemoteBuilder<A, S>, AD>): Promise<SignedRemoteTransaction<S, RemoteBuilder<A, S>, AD>>;
|
43
|
+
submit<AD>(signedTx: SignedRemoteTransaction<S, RemoteBuilder<A, S>, AD>): Promise<TransactionHash>;
|
36
44
|
}
|
37
45
|
|
38
46
|
declare class SplashRemoteBuilder implements RemoteBuilder<Api<SplashBackend>, CborHexString> {
|
39
47
|
static new(api: Api<SplashBackend>): SplashRemoteBuilder;
|
40
48
|
readonly api: Api<SplashBackend>;
|
41
49
|
private constructor();
|
42
|
-
sign(): Promise<SignedRemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString
|
50
|
+
sign(): Promise<SignedRemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString>, any>>;
|
43
51
|
submit(): Promise<TransactionHash>;
|
44
|
-
trade(): Promise<RemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString
|
45
|
-
cancelOperation(outputReference: OutputReference | OutputReferenceHash): Promise<RemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString
|
52
|
+
trade(): Promise<RemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString>, any>>;
|
53
|
+
cancelOperation(outputReference: OutputReference | OutputReferenceHash): Promise<RemoteTransaction<CborHexString, RemoteBuilder<Api<SplashBackend>, CborHexString>, any>>;
|
46
54
|
}
|
47
55
|
|
48
56
|
declare class InsufficientCollateralError extends Error {
|
package/dist/index.js
CHANGED
@@ -1,17 +1,22 @@
|
|
1
1
|
// src/core/models/RemoteTransaction/RemoteTransaction.ts
|
2
2
|
var RemoteTransaction = class _RemoteTransaction {
|
3
|
-
constructor(serialization, builder) {
|
3
|
+
constructor(serialization, builder, additionalData) {
|
4
4
|
this.builder = builder;
|
5
5
|
this.serialization = serialization;
|
6
|
+
this.additionalData = additionalData;
|
6
7
|
}
|
7
|
-
static new(serialization, builder) {
|
8
|
-
return new _RemoteTransaction(serialization, builder);
|
8
|
+
static new(serialization, builder, additionalData) {
|
9
|
+
return new _RemoteTransaction(serialization, builder, additionalData);
|
9
10
|
}
|
10
11
|
/**
|
11
12
|
* Transaction serialization
|
12
13
|
* @type {S}
|
13
14
|
*/
|
14
15
|
serialization;
|
16
|
+
/**
|
17
|
+
* Transaction additional data
|
18
|
+
*/
|
19
|
+
additionalData;
|
15
20
|
sign() {
|
16
21
|
return this.builder.sign(this);
|
17
22
|
}
|
@@ -36,28 +41,33 @@ var SplashRemoteBuilder = class _SplashRemoteBuilder {
|
|
36
41
|
throw new Error("not implemented.");
|
37
42
|
}
|
38
43
|
trade() {
|
39
|
-
return Promise.resolve(RemoteTransaction.new("", this));
|
44
|
+
return Promise.resolve(RemoteTransaction.new("", this, void 0));
|
40
45
|
}
|
41
46
|
cancelOperation(outputReference) {
|
42
47
|
console.log(outputReference);
|
43
|
-
return Promise.resolve(RemoteTransaction.new("", this));
|
48
|
+
return Promise.resolve(RemoteTransaction.new("", this, void 0));
|
44
49
|
}
|
45
50
|
};
|
46
51
|
|
47
52
|
// src/core/models/SignedRemoteTransaction/SignedRemoteTransaction.ts
|
48
53
|
var SignedRemoteTransaction = class _SignedRemoteTransaction {
|
49
|
-
constructor(serialization, builder) {
|
54
|
+
constructor(serialization, builder, additionalData) {
|
50
55
|
this.builder = builder;
|
51
56
|
this.serialization = serialization;
|
57
|
+
this.additionalData = additionalData;
|
52
58
|
}
|
53
|
-
static new(serialization, builder) {
|
54
|
-
return new _SignedRemoteTransaction(serialization, builder);
|
59
|
+
static new(serialization, builder, additionalData) {
|
60
|
+
return new _SignedRemoteTransaction(serialization, builder, additionalData);
|
55
61
|
}
|
56
62
|
/**
|
57
63
|
* Transaction serialization
|
58
64
|
* @type {S}
|
59
65
|
*/
|
60
66
|
serialization;
|
67
|
+
/**
|
68
|
+
* Transaction additional data
|
69
|
+
*/
|
70
|
+
additionalData;
|
61
71
|
submit() {
|
62
72
|
return this.builder.submit(this);
|
63
73
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@splashprotocol/remote-builder",
|
3
|
-
"version": "2.0.0-beta.
|
3
|
+
"version": "2.0.0-beta.46",
|
4
4
|
"type": "module",
|
5
5
|
"description": "Api client of splash protocol",
|
6
6
|
"scripts": {
|
@@ -33,7 +33,7 @@
|
|
33
33
|
]
|
34
34
|
},
|
35
35
|
"peerDependencies": {
|
36
|
-
"@splashprotocol/api": "2.0.0-beta.
|
36
|
+
"@splashprotocol/api": "2.0.0-beta.25",
|
37
37
|
"@splashprotocol/core": "2.0.0-beta.13"
|
38
38
|
}
|
39
39
|
}
|
@@ -25,7 +25,8 @@ export class SplashRemoteBuilder
|
|
25
25
|
sign(): Promise<
|
26
26
|
SignedRemoteTransaction<
|
27
27
|
CborHexString,
|
28
|
-
RemoteBuilder<Api<SplashBackend>, CborHexString
|
28
|
+
RemoteBuilder<Api<SplashBackend>, CborHexString>,
|
29
|
+
any
|
29
30
|
>
|
30
31
|
> {
|
31
32
|
throw new Error('not implemented.');
|
@@ -38,10 +39,11 @@ export class SplashRemoteBuilder
|
|
38
39
|
trade(): Promise<
|
39
40
|
RemoteTransaction<
|
40
41
|
CborHexString,
|
41
|
-
RemoteBuilder<Api<SplashBackend>, CborHexString
|
42
|
+
RemoteBuilder<Api<SplashBackend>, CborHexString>,
|
43
|
+
any
|
42
44
|
>
|
43
45
|
> {
|
44
|
-
return Promise.resolve(RemoteTransaction.new('', this));
|
46
|
+
return Promise.resolve(RemoteTransaction.new('', this, undefined));
|
45
47
|
}
|
46
48
|
|
47
49
|
cancelOperation(
|
@@ -49,10 +51,11 @@ export class SplashRemoteBuilder
|
|
49
51
|
): Promise<
|
50
52
|
RemoteTransaction<
|
51
53
|
CborHexString,
|
52
|
-
RemoteBuilder<Api<SplashBackend>, CborHexString
|
54
|
+
RemoteBuilder<Api<SplashBackend>, CborHexString>,
|
55
|
+
any
|
53
56
|
>
|
54
57
|
> {
|
55
58
|
console.log(outputReference);
|
56
|
-
return Promise.resolve(RemoteTransaction.new('', this));
|
59
|
+
return Promise.resolve(RemoteTransaction.new('', this, undefined));
|
57
60
|
}
|
58
61
|
}
|
@@ -9,12 +9,14 @@ import { TransactionHash } from '@splashprotocol/core';
|
|
9
9
|
export class RemoteTransaction<
|
10
10
|
S,
|
11
11
|
RB extends RemoteBuilder<Api<Backend<{}>>, S>,
|
12
|
+
AdditionalData,
|
12
13
|
> {
|
13
|
-
static new<S, RB extends RemoteBuilder<Api<Backend<{}>>, S
|
14
|
+
static new<S, RB extends RemoteBuilder<Api<Backend<{}>>, S>, AdditionalData>(
|
14
15
|
serialization: S,
|
15
16
|
builder: RB,
|
16
|
-
|
17
|
-
|
17
|
+
additionalData: AdditionalData,
|
18
|
+
): RemoteTransaction<S, RB, AdditionalData> {
|
19
|
+
return new RemoteTransaction(serialization, builder, additionalData);
|
18
20
|
}
|
19
21
|
|
20
22
|
/**
|
@@ -23,14 +25,21 @@ export class RemoteTransaction<
|
|
23
25
|
*/
|
24
26
|
readonly serialization: S;
|
25
27
|
|
28
|
+
/**
|
29
|
+
* Transaction additional data
|
30
|
+
*/
|
31
|
+
readonly additionalData: AdditionalData;
|
32
|
+
|
26
33
|
private constructor(
|
27
34
|
serialization: S,
|
28
35
|
private builder: RB,
|
36
|
+
additionalData: AdditionalData,
|
29
37
|
) {
|
30
38
|
this.serialization = serialization;
|
39
|
+
this.additionalData = additionalData;
|
31
40
|
}
|
32
41
|
|
33
|
-
sign(): Promise<SignedRemoteTransaction<S, RB>> {
|
42
|
+
sign(): Promise<SignedRemoteTransaction<S, RB, AdditionalData>> {
|
34
43
|
return this.builder.sign(this) as any;
|
35
44
|
}
|
36
45
|
|
@@ -5,12 +5,14 @@ import { TransactionHash } from '@splashprotocol/core';
|
|
5
5
|
export class SignedRemoteTransaction<
|
6
6
|
S,
|
7
7
|
RB extends RemoteBuilder<Api<Backend<{}>>, S>,
|
8
|
+
AdditionalData,
|
8
9
|
> {
|
9
|
-
static new<S, RB extends RemoteBuilder<Api<Backend<{}>>, S
|
10
|
+
static new<S, RB extends RemoteBuilder<Api<Backend<{}>>, S>, AdditionalData>(
|
10
11
|
serialization: S,
|
11
12
|
builder: RB,
|
12
|
-
|
13
|
-
|
13
|
+
additionalData: AdditionalData,
|
14
|
+
): SignedRemoteTransaction<S, RB, AdditionalData> {
|
15
|
+
return new SignedRemoteTransaction(serialization, builder, additionalData);
|
14
16
|
}
|
15
17
|
|
16
18
|
/**
|
@@ -19,11 +21,18 @@ export class SignedRemoteTransaction<
|
|
19
21
|
*/
|
20
22
|
readonly serialization: S;
|
21
23
|
|
24
|
+
/**
|
25
|
+
* Transaction additional data
|
26
|
+
*/
|
27
|
+
readonly additionalData: AdditionalData;
|
28
|
+
|
22
29
|
private constructor(
|
23
30
|
serialization: S,
|
24
31
|
private builder: RB,
|
32
|
+
additionalData: AdditionalData,
|
25
33
|
) {
|
26
34
|
this.serialization = serialization;
|
35
|
+
this.additionalData = additionalData;
|
27
36
|
}
|
28
37
|
|
29
38
|
submit(): Promise<TransactionHash> {
|
@@ -6,11 +6,11 @@ import { TransactionHash } from '@splashprotocol/core';
|
|
6
6
|
export interface RemoteBuilder<A extends Api<Backend<{}>>, S> {
|
7
7
|
readonly api: A;
|
8
8
|
|
9
|
-
sign(
|
10
|
-
tx: RemoteTransaction<S, RemoteBuilder<A, S
|
11
|
-
): Promise<SignedRemoteTransaction<S, RemoteBuilder<A, S
|
9
|
+
sign<AD>(
|
10
|
+
tx: RemoteTransaction<S, RemoteBuilder<A, S>, AD>,
|
11
|
+
): Promise<SignedRemoteTransaction<S, RemoteBuilder<A, S>, AD>>;
|
12
12
|
|
13
|
-
submit(
|
14
|
-
signedTx: SignedRemoteTransaction<S, RemoteBuilder<A, S
|
13
|
+
submit<AD>(
|
14
|
+
signedTx: SignedRemoteTransaction<S, RemoteBuilder<A, S>, AD>,
|
15
15
|
): Promise<TransactionHash>;
|
16
16
|
}
|