@kimafinance/kima-transaction-api 1.4.1 → 1.4.2

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.
Files changed (82) hide show
  1. package/build/index.d.ts +50 -3
  2. package/build/index.js +121 -17
  3. package/build/kima/common.d.ts +1 -4
  4. package/build/kima/common.js +9 -12
  5. package/build/kima/tx.d.ts +674 -0
  6. package/build/kima/tx.js +2170 -0
  7. package/package.json +10 -10
  8. package/src/index.ts +206 -3
  9. package/src/kima/common.ts +12 -5
  10. package/src/kima/tx.ts +2945 -0
  11. package/build/api/htlc-lock.d.ts +0 -23
  12. package/build/api/htlc-lock.js +0 -37
  13. package/build/api/htlc-reclaim.d.ts +0 -14
  14. package/build/api/htlc-reclaim.js +0 -28
  15. package/build/api/submit.d.ts +0 -54
  16. package/build/api/submit.js +0 -94
  17. package/build/config/global-this.config.d.ts +0 -2
  18. package/build/config/global-this.config.js +0 -18
  19. package/build/config/probuff.config.d.ts +0 -2
  20. package/build/config/probuff.config.js +0 -12
  21. package/build/kima/tx/cancel.d.ts +0 -35
  22. package/build/kima/tx/cancel.js +0 -115
  23. package/build/kima/tx/drain-finalize.d.ts +0 -47
  24. package/build/kima/tx/drain-finalize.js +0 -155
  25. package/build/kima/tx/drain.d.ts +0 -50
  26. package/build/kima/tx/drain.js +0 -164
  27. package/build/kima/tx/finalize.d.ts +0 -47
  28. package/build/kima/tx/finalize.js +0 -155
  29. package/build/kima/tx/htlc-lock.d.ts +0 -42
  30. package/build/kima/tx/htlc-lock.js +0 -152
  31. package/build/kima/tx/htlc-reclaim.d.ts +0 -30
  32. package/build/kima/tx/htlc-reclaim.js +0 -105
  33. package/build/kima/tx/index.d.ts +0 -1
  34. package/build/kima/tx/index.js +0 -4
  35. package/build/kima/tx/liquidity-provision.d.ts +0 -30
  36. package/build/kima/tx/liquidity-provision.js +0 -102
  37. package/build/kima/tx/message-service.d.ts +0 -54
  38. package/build/kima/tx/message-service.js +0 -117
  39. package/build/kima/tx/provision-finalize.d.ts +0 -47
  40. package/build/kima/tx/provision-finalize.js +0 -155
  41. package/build/kima/tx/provision.d.ts +0 -70
  42. package/build/kima/tx/provision.js +0 -230
  43. package/build/kima/tx/request.d.ts +0 -63
  44. package/build/kima/tx/request.js +0 -222
  45. package/build/kima/tx/response.d.ts +0 -21
  46. package/build/kima/tx/response.js +0 -69
  47. package/build/kima/tx/rpc.d.ts +0 -0
  48. package/build/kima/tx/rpc.js +0 -1
  49. package/build/kima/tx/set-hash.d.ts +0 -42
  50. package/build/kima/tx/set-hash.js +0 -130
  51. package/build/kima/tx/set-process.d.ts +0 -37
  52. package/build/kima/tx/set-process.js +0 -121
  53. package/build/kima/tx/transfer-limit.d.ts +0 -30
  54. package/build/kima/tx/transfer-limit.js +0 -102
  55. package/build/kima/tx/withdraw.d.ts +0 -47
  56. package/build/kima/tx/withdraw.js +0 -155
  57. package/build/utils.d.ts +0 -17
  58. package/build/utils.js +0 -49
  59. package/src/api/htlc-lock.ts +0 -57
  60. package/src/api/htlc-reclaim.ts +0 -39
  61. package/src/api/submit.ts +0 -132
  62. package/src/config/global-this.config.ts +0 -20
  63. package/src/config/probuff.config.ts +0 -9
  64. package/src/kima/tx/cancel.ts +0 -147
  65. package/src/kima/tx/drain-finalize.ts +0 -191
  66. package/src/kima/tx/drain.ts +0 -201
  67. package/src/kima/tx/finalize.ts +0 -191
  68. package/src/kima/tx/htlc-lock.ts +0 -183
  69. package/src/kima/tx/htlc-reclaim.ts +0 -132
  70. package/src/kima/tx/index.ts +0 -1
  71. package/src/kima/tx/liquidity-provision.ts +0 -132
  72. package/src/kima/tx/message-service.ts +0 -278
  73. package/src/kima/tx/provision-finalize.ts +0 -191
  74. package/src/kima/tx/provision.ts +0 -279
  75. package/src/kima/tx/request.ts +0 -256
  76. package/src/kima/tx/response.ts +0 -83
  77. package/src/kima/tx/rpc.ts +0 -0
  78. package/src/kima/tx/set-hash.ts +0 -162
  79. package/src/kima/tx/set-process.ts +0 -151
  80. package/src/kima/tx/transfer-limit.ts +0 -132
  81. package/src/kima/tx/withdraw.ts +0 -191
  82. package/src/utils.ts +0 -67
@@ -1,70 +0,0 @@
1
- import _m0 from "../../config/probuff.config";
2
- export interface MsgRequestProvisionTransaction {
3
- creator: string;
4
- chain: string;
5
- fromAddress: string;
6
- symbol: string;
7
- amount: string;
8
- options: string;
9
- /** BTC transaction */
10
- htlcExpirationTimestamp: string;
11
- /** the txhash locking the funds in the HTLC */
12
- htlcCreationHash: string;
13
- /** the output index of the locked funds in the HTLC creation transaction */
14
- htlcCreationVout: number;
15
- /** a version denoting which HTLC script version is being using for the HTLC transaction */
16
- htlcVersion: string;
17
- /** the (compressed) public key of the sender */
18
- senderPubKey: Uint8Array;
19
- }
20
- export interface MsgRequestProvisionTransactionResponse {
21
- code: string;
22
- msg: string;
23
- txId: number;
24
- }
25
- export declare const MsgRequestProvisionTransaction: {
26
- encode(message: MsgRequestProvisionTransaction, writer?: _m0.Writer): _m0.Writer;
27
- decode(input: _m0.Reader | Uint8Array, length?: number): MsgRequestProvisionTransaction;
28
- fromJSON(object: any): MsgRequestProvisionTransaction;
29
- toJSON(message: MsgRequestProvisionTransaction): unknown;
30
- fromPartial<I extends {
31
- creator?: string | undefined;
32
- chain?: string | undefined;
33
- fromAddress?: string | undefined;
34
- symbol?: string | undefined;
35
- amount?: string | undefined;
36
- options?: string | undefined;
37
- htlcExpirationTimestamp?: string | undefined;
38
- htlcCreationHash?: string | undefined;
39
- htlcCreationVout?: number | undefined;
40
- htlcVersion?: string | undefined;
41
- senderPubKey?: Uint8Array | undefined;
42
- } & {
43
- creator?: string | undefined;
44
- chain?: string | undefined;
45
- fromAddress?: string | undefined;
46
- symbol?: string | undefined;
47
- amount?: string | undefined;
48
- options?: string | undefined;
49
- htlcExpirationTimestamp?: string | undefined;
50
- htlcCreationHash?: string | undefined;
51
- htlcCreationVout?: number | undefined;
52
- htlcVersion?: string | undefined;
53
- senderPubKey?: Uint8Array | undefined;
54
- } & { [K in Exclude<keyof I, keyof MsgRequestProvisionTransaction>]: never; }>(object: I): MsgRequestProvisionTransaction;
55
- };
56
- export declare const MsgRequestProvisionTransactionResponse: {
57
- encode(message: MsgRequestProvisionTransactionResponse, writer?: _m0.Writer): _m0.Writer;
58
- decode(input: _m0.Reader | Uint8Array, length?: number): MsgRequestProvisionTransactionResponse;
59
- fromJSON(object: any): MsgRequestProvisionTransactionResponse;
60
- toJSON(message: MsgRequestProvisionTransactionResponse): unknown;
61
- fromPartial<I extends {
62
- code?: string | undefined;
63
- msg?: string | undefined;
64
- txId?: number | undefined;
65
- } & {
66
- code?: string | undefined;
67
- msg?: string | undefined;
68
- txId?: number | undefined;
69
- } & { [K in Exclude<keyof I, keyof MsgRequestProvisionTransactionResponse>]: never; }>(object: I): MsgRequestProvisionTransactionResponse;
70
- };
@@ -1,230 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.MsgRequestProvisionTransactionResponse = exports.MsgRequestProvisionTransaction = void 0;
7
- const probuff_config_1 = __importDefault(require("../../config/probuff.config"));
8
- const utils_1 = require("../../utils");
9
- function createBaseMsgRequestProvisionTransaction() {
10
- return {
11
- creator: "",
12
- chain: "",
13
- fromAddress: "",
14
- symbol: "",
15
- amount: "",
16
- options: "",
17
- htlcExpirationTimestamp: "",
18
- htlcCreationHash: "",
19
- htlcCreationVout: 0,
20
- htlcVersion: "",
21
- senderPubKey: new Uint8Array(),
22
- };
23
- }
24
- exports.MsgRequestProvisionTransaction = {
25
- encode(message, writer = probuff_config_1.default.Writer.create()) {
26
- if (message.creator !== "") {
27
- writer.uint32(10).string(message.creator);
28
- }
29
- if (message.chain !== "") {
30
- writer.uint32(18).string(message.chain);
31
- }
32
- if (message.fromAddress !== "") {
33
- writer.uint32(26).string(message.fromAddress);
34
- }
35
- if (message.symbol !== "") {
36
- writer.uint32(34).string(message.symbol);
37
- }
38
- if (message.amount !== "") {
39
- writer.uint32(42).string(message.amount);
40
- }
41
- if (message.options !== "") {
42
- writer.uint32(50).string(message.options);
43
- }
44
- if (message.htlcExpirationTimestamp !== "") {
45
- writer.uint32(58).string(message.htlcExpirationTimestamp);
46
- }
47
- if (message.htlcCreationHash !== "") {
48
- writer.uint32(66).string(message.htlcCreationHash);
49
- }
50
- if (message.htlcCreationVout !== 0) {
51
- writer.uint32(72).uint32(message.htlcCreationVout);
52
- }
53
- if (message.htlcVersion !== "") {
54
- writer.uint32(82).string(message.htlcVersion);
55
- }
56
- if (message.senderPubKey.length !== 0) {
57
- writer.uint32(90).bytes(message.senderPubKey);
58
- }
59
- return writer;
60
- },
61
- decode(input, length) {
62
- const reader = input instanceof probuff_config_1.default.Reader ? input : new probuff_config_1.default.Reader(input);
63
- let end = length === undefined ? reader.len : reader.pos + length;
64
- const message = createBaseMsgRequestProvisionTransaction();
65
- while (reader.pos < end) {
66
- const tag = reader.uint32();
67
- switch (tag >>> 3) {
68
- case 1:
69
- message.creator = reader.string();
70
- break;
71
- case 2:
72
- message.chain = reader.string();
73
- break;
74
- case 3:
75
- message.fromAddress = reader.string();
76
- break;
77
- case 4:
78
- message.symbol = reader.string();
79
- break;
80
- case 5:
81
- message.amount = reader.string();
82
- break;
83
- case 6:
84
- message.options = reader.string();
85
- break;
86
- case 7:
87
- message.htlcExpirationTimestamp = reader.string();
88
- break;
89
- case 8:
90
- message.htlcCreationHash = reader.string();
91
- break;
92
- case 9:
93
- message.htlcCreationVout = reader.uint32();
94
- break;
95
- case 10:
96
- message.htlcVersion = reader.string();
97
- break;
98
- case 11:
99
- message.senderPubKey = reader.bytes();
100
- break;
101
- default:
102
- reader.skipType(tag & 7);
103
- break;
104
- }
105
- }
106
- return message;
107
- },
108
- fromJSON(object) {
109
- return {
110
- creator: (0, utils_1.isSet)(object.creator) ? String(object.creator) : "",
111
- chain: (0, utils_1.isSet)(object.chain) ? String(object.chain) : "",
112
- fromAddress: (0, utils_1.isSet)(object.fromAddress) ? String(object.fromAddress) : "",
113
- symbol: (0, utils_1.isSet)(object.symbol) ? String(object.symbol) : "",
114
- amount: (0, utils_1.isSet)(object.amount) ? String(object.amount) : "",
115
- options: (0, utils_1.isSet)(object.options) ? String(object.options) : "",
116
- htlcExpirationTimestamp: (0, utils_1.isSet)(object.htlcExpirationTimestamp)
117
- ? String(object.htlcExpirationTimestamp)
118
- : "",
119
- htlcCreationHash: (0, utils_1.isSet)(object.htlcCreationHash)
120
- ? String(object.htlcCreationHash)
121
- : "",
122
- htlcCreationVout: (0, utils_1.isSet)(object.htlcCreationVout)
123
- ? Number(object.htlcCreationVout)
124
- : 0,
125
- htlcVersion: (0, utils_1.isSet)(object.htlcVersion) ? String(object.htlcVersion) : "",
126
- senderPubKey: (0, utils_1.isSet)(object.senderPubKey)
127
- ? (0, utils_1.bytesFromBase64)(object.senderPubKey)
128
- : new Uint8Array(),
129
- };
130
- },
131
- toJSON(message) {
132
- const obj = {};
133
- message.creator !== undefined && (obj.creator = message.creator);
134
- message.chain !== undefined && (obj.chain = message.chain);
135
- message.fromAddress !== undefined &&
136
- (obj.fromAddress = message.fromAddress);
137
- message.symbol !== undefined && (obj.symbol = message.symbol);
138
- message.amount !== undefined && (obj.amount = message.amount);
139
- message.options !== undefined && (obj.options = message.options);
140
- message.htlcExpirationTimestamp !== undefined &&
141
- (obj.htlcExpirationTimestamp = message.htlcExpirationTimestamp);
142
- message.htlcCreationHash !== undefined &&
143
- (obj.htlcCreationHash = message.htlcCreationHash);
144
- message.htlcCreationVout !== undefined &&
145
- (obj.htlcCreationVout = Math.round(message.htlcCreationVout));
146
- message.htlcVersion !== undefined &&
147
- (obj.htlcVersion = message.htlcVersion);
148
- message.senderPubKey !== undefined &&
149
- (obj.senderPubKey = (0, utils_1.base64FromBytes)(message.senderPubKey !== undefined
150
- ? message.senderPubKey
151
- : new Uint8Array()));
152
- return obj;
153
- },
154
- fromPartial(object) {
155
- const message = createBaseMsgRequestProvisionTransaction();
156
- message.creator = object.creator ?? "";
157
- message.chain = object.chain ?? "";
158
- message.fromAddress = object.fromAddress ?? "";
159
- message.symbol = object.symbol ?? "";
160
- message.amount = object.amount ?? "";
161
- message.options = object.options ?? "";
162
- message.htlcExpirationTimestamp = object.htlcExpirationTimestamp ?? "";
163
- message.htlcCreationHash = object.htlcCreationHash ?? "";
164
- message.htlcCreationVout = object.htlcCreationVout ?? 0;
165
- message.htlcVersion = object.htlcVersion ?? "";
166
- message.senderPubKey = object.senderPubKey ?? new Uint8Array();
167
- return message;
168
- },
169
- };
170
- function createBaseMsgRequestProvisionTransactionResponse() {
171
- return { code: "", msg: "", txId: 0 };
172
- }
173
- exports.MsgRequestProvisionTransactionResponse = {
174
- encode(message, writer = probuff_config_1.default.Writer.create()) {
175
- if (message.code !== "") {
176
- writer.uint32(10).string(message.code);
177
- }
178
- if (message.msg !== "") {
179
- writer.uint32(18).string(message.msg);
180
- }
181
- if (message.txId !== 0) {
182
- writer.uint32(24).uint64(message.txId);
183
- }
184
- return writer;
185
- },
186
- decode(input, length) {
187
- const reader = input instanceof probuff_config_1.default.Reader ? input : new probuff_config_1.default.Reader(input);
188
- let end = length === undefined ? reader.len : reader.pos + length;
189
- const message = createBaseMsgRequestProvisionTransactionResponse();
190
- while (reader.pos < end) {
191
- const tag = reader.uint32();
192
- switch (tag >>> 3) {
193
- case 1:
194
- message.code = reader.string();
195
- break;
196
- case 2:
197
- message.msg = reader.string();
198
- break;
199
- case 3:
200
- message.txId = (0, utils_1.longToNumber)(reader.uint64());
201
- break;
202
- default:
203
- reader.skipType(tag & 7);
204
- break;
205
- }
206
- }
207
- return message;
208
- },
209
- fromJSON(object) {
210
- return {
211
- code: (0, utils_1.isSet)(object.code) ? String(object.code) : "",
212
- msg: (0, utils_1.isSet)(object.msg) ? String(object.msg) : "",
213
- txId: (0, utils_1.isSet)(object.txId) ? Number(object.txId) : 0,
214
- };
215
- },
216
- toJSON(message) {
217
- const obj = {};
218
- message.code !== undefined && (obj.code = message.code);
219
- message.msg !== undefined && (obj.msg = message.msg);
220
- message.txId !== undefined && (obj.txId = Math.round(message.txId));
221
- return obj;
222
- },
223
- fromPartial(object) {
224
- const message = createBaseMsgRequestProvisionTransactionResponse();
225
- message.code = object.code ?? "";
226
- message.msg = object.msg ?? "";
227
- message.txId = object.txId ?? 0;
228
- return message;
229
- },
230
- };
@@ -1,63 +0,0 @@
1
- import _m0 from "../../config/probuff.config";
2
- export interface MsgRequestTransaction {
3
- creator: string;
4
- originChain: string;
5
- originAddress: string;
6
- targetChain: string;
7
- targetAddress: string;
8
- originSymbol: string;
9
- targetSymbol: string;
10
- amount: string;
11
- fee: string;
12
- /** the timestamp when the HTLC contract expires and the user can reclaim the funds locked there */
13
- htlcExpirationTimestamp: string;
14
- /** the txhash locking the funds in the HTLC */
15
- htlcCreationHash: string;
16
- /** the output index of the locked funds in the HTLC creation transaction */
17
- htlcCreationVout: number;
18
- /** a version denoting which HTLC script version is being using for the HTLC transaction */
19
- htlcVersion: string;
20
- /** for bitcoin transaction this is the public key of the sender */
21
- senderPubKey: Uint8Array;
22
- /** additional data JSON object */
23
- options: string;
24
- }
25
- export declare const MsgRequestTransaction: {
26
- encode(message: MsgRequestTransaction, writer?: _m0.Writer): _m0.Writer;
27
- decode(input: _m0.Reader | Uint8Array, length?: number): MsgRequestTransaction;
28
- fromJSON(object: any): MsgRequestTransaction;
29
- toJSON(message: MsgRequestTransaction): unknown;
30
- fromPartial<I extends {
31
- creator?: string | undefined;
32
- originChain?: string | undefined;
33
- originAddress?: string | undefined;
34
- targetChain?: string | undefined;
35
- targetAddress?: string | undefined;
36
- originSymbol?: string | undefined;
37
- targetSymbol?: string | undefined;
38
- amount?: string | undefined;
39
- fee?: string | undefined;
40
- htlcExpirationTimestamp?: string | undefined;
41
- htlcCreationHash?: string | undefined;
42
- htlcCreationVout?: number | undefined;
43
- htlcVersion?: string | undefined;
44
- senderPubKey?: Uint8Array | undefined;
45
- options?: string | undefined;
46
- } & {
47
- creator?: string | undefined;
48
- originChain?: string | undefined;
49
- originAddress?: string | undefined;
50
- targetChain?: string | undefined;
51
- targetAddress?: string | undefined;
52
- originSymbol?: string | undefined;
53
- targetSymbol?: string | undefined;
54
- amount?: string | undefined;
55
- fee?: string | undefined;
56
- htlcExpirationTimestamp?: string | undefined;
57
- htlcCreationHash?: string | undefined;
58
- htlcCreationVout?: number | undefined;
59
- htlcVersion?: string | undefined;
60
- senderPubKey?: Uint8Array | undefined;
61
- options?: string | undefined;
62
- } & { [K in Exclude<keyof I, keyof MsgRequestTransaction>]: never; }>(object: I): MsgRequestTransaction;
63
- };
@@ -1,222 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.MsgRequestTransaction = void 0;
7
- const probuff_config_1 = __importDefault(require("../../config/probuff.config"));
8
- const utils_1 = require("../../utils");
9
- function createBaseMsgRequestTransaction() {
10
- return {
11
- creator: "",
12
- originChain: "",
13
- originAddress: "",
14
- targetChain: "",
15
- targetAddress: "",
16
- originSymbol: "",
17
- targetSymbol: "",
18
- amount: "",
19
- fee: "",
20
- htlcExpirationTimestamp: "",
21
- htlcCreationHash: "",
22
- htlcCreationVout: 0,
23
- htlcVersion: "",
24
- senderPubKey: new Uint8Array(),
25
- options: "",
26
- };
27
- }
28
- exports.MsgRequestTransaction = {
29
- encode(message, writer = probuff_config_1.default.Writer.create()) {
30
- if (message.creator !== "") {
31
- writer.uint32(10).string(message.creator);
32
- }
33
- if (message.originChain !== "") {
34
- writer.uint32(18).string(message.originChain);
35
- }
36
- if (message.originAddress !== "") {
37
- writer.uint32(26).string(message.originAddress);
38
- }
39
- if (message.targetChain !== "") {
40
- writer.uint32(34).string(message.targetChain);
41
- }
42
- if (message.targetAddress !== "") {
43
- writer.uint32(42).string(message.targetAddress);
44
- }
45
- if (message.originSymbol !== "") {
46
- writer.uint32(50).string(message.originSymbol);
47
- }
48
- if (message.targetSymbol !== "") {
49
- writer.uint32(58).string(message.targetSymbol);
50
- }
51
- if (message.amount !== "") {
52
- writer.uint32(66).string(message.amount);
53
- }
54
- if (message.fee !== "") {
55
- writer.uint32(74).string(message.fee);
56
- }
57
- if (message.htlcExpirationTimestamp !== "") {
58
- writer.uint32(82).string(message.htlcExpirationTimestamp);
59
- }
60
- if (message.htlcCreationHash !== "") {
61
- writer.uint32(90).string(message.htlcCreationHash);
62
- }
63
- if (message.htlcCreationVout !== 0) {
64
- writer.uint32(96).uint32(message.htlcCreationVout);
65
- }
66
- if (message.htlcVersion !== "") {
67
- writer.uint32(106).string(message.htlcVersion);
68
- }
69
- if (message.senderPubKey.length !== 0) {
70
- writer.uint32(114).bytes(message.senderPubKey);
71
- }
72
- if (message.options !== "") {
73
- writer.uint32(122).string(message.options);
74
- }
75
- return writer;
76
- },
77
- decode(input, length) {
78
- const reader = input instanceof probuff_config_1.default.Reader ? input : new probuff_config_1.default.Reader(input);
79
- let end = length === undefined ? reader.len : reader.pos + length;
80
- const message = createBaseMsgRequestTransaction();
81
- while (reader.pos < end) {
82
- const tag = reader.uint32();
83
- switch (tag >>> 3) {
84
- case 1:
85
- message.creator = reader.string();
86
- break;
87
- case 2:
88
- message.originChain = reader.string();
89
- break;
90
- case 3:
91
- message.originAddress = reader.string();
92
- break;
93
- case 4:
94
- message.targetChain = reader.string();
95
- break;
96
- case 5:
97
- message.targetAddress = reader.string();
98
- break;
99
- case 6:
100
- message.originSymbol = reader.string();
101
- break;
102
- case 7:
103
- message.targetSymbol = reader.string();
104
- break;
105
- case 8:
106
- message.amount = reader.string();
107
- break;
108
- case 9:
109
- message.fee = reader.string();
110
- break;
111
- case 10:
112
- message.htlcExpirationTimestamp = reader.string();
113
- break;
114
- case 11:
115
- message.htlcCreationHash = reader.string();
116
- break;
117
- case 12:
118
- message.htlcCreationVout = reader.uint32();
119
- break;
120
- case 13:
121
- message.htlcVersion = reader.string();
122
- break;
123
- case 14:
124
- message.senderPubKey = reader.bytes();
125
- break;
126
- case 15:
127
- message.options = reader.string();
128
- break;
129
- default:
130
- reader.skipType(tag & 7);
131
- break;
132
- }
133
- }
134
- return message;
135
- },
136
- fromJSON(object) {
137
- return {
138
- creator: (0, utils_1.isSet)(object.creator) ? String(object.creator) : "",
139
- originChain: (0, utils_1.isSet)(object.originChain) ? String(object.originChain) : "",
140
- originAddress: (0, utils_1.isSet)(object.originAddress)
141
- ? String(object.originAddress)
142
- : "",
143
- targetChain: (0, utils_1.isSet)(object.targetChain) ? String(object.targetChain) : "",
144
- targetAddress: (0, utils_1.isSet)(object.targetAddress)
145
- ? String(object.targetAddress)
146
- : "",
147
- originSymbol: (0, utils_1.isSet)(object.originSymbol)
148
- ? String(object.originSymbol)
149
- : "",
150
- targetSymbol: (0, utils_1.isSet)(object.targetSymbol)
151
- ? String(object.targetSymbol)
152
- : "",
153
- amount: (0, utils_1.isSet)(object.amount) ? String(object.amount) : "",
154
- fee: (0, utils_1.isSet)(object.fee) ? String(object.fee) : "",
155
- htlcExpirationTimestamp: (0, utils_1.isSet)(object.htlcExpirationTimestamp)
156
- ? String(object.htlcExpirationTimestamp)
157
- : "",
158
- htlcCreationHash: (0, utils_1.isSet)(object.htlcCreationHash)
159
- ? String(object.htlcCreationHash)
160
- : "",
161
- htlcCreationVout: (0, utils_1.isSet)(object.htlcCreationVout)
162
- ? Number(object.htlcCreationVout)
163
- : 0,
164
- htlcVersion: (0, utils_1.isSet)(object.htlcVersion) ? String(object.htlcVersion) : "",
165
- senderPubKey: (0, utils_1.isSet)(object.senderPubKey)
166
- ? (0, utils_1.bytesFromBase64)(object.senderPubKey)
167
- : new Uint8Array(),
168
- options: (0, utils_1.isSet)(object.options) ? String(object.options) : "",
169
- };
170
- },
171
- toJSON(message) {
172
- const obj = {};
173
- message.creator !== undefined && (obj.creator = message.creator);
174
- message.originChain !== undefined &&
175
- (obj.originChain = message.originChain);
176
- message.originAddress !== undefined &&
177
- (obj.originAddress = message.originAddress);
178
- message.targetChain !== undefined &&
179
- (obj.targetChain = message.targetChain);
180
- message.targetAddress !== undefined &&
181
- (obj.targetAddress = message.targetAddress);
182
- message.originSymbol !== undefined &&
183
- (obj.originSymbol = message.originSymbol);
184
- message.targetSymbol !== undefined &&
185
- (obj.targetSymbol = message.targetSymbol);
186
- message.amount !== undefined && (obj.amount = message.amount);
187
- message.fee !== undefined && (obj.fee = message.fee);
188
- message.htlcExpirationTimestamp !== undefined &&
189
- (obj.htlcExpirationTimestamp = message.htlcExpirationTimestamp);
190
- message.htlcCreationHash !== undefined &&
191
- (obj.htlcCreationHash = message.htlcCreationHash);
192
- message.htlcCreationVout !== undefined &&
193
- (obj.htlcCreationVout = Math.round(message.htlcCreationVout));
194
- message.htlcVersion !== undefined &&
195
- (obj.htlcVersion = message.htlcVersion);
196
- message.senderPubKey !== undefined &&
197
- (obj.senderPubKey = (0, utils_1.base64FromBytes)(message.senderPubKey !== undefined
198
- ? message.senderPubKey
199
- : new Uint8Array()));
200
- message.options !== undefined && (obj.options = message.options);
201
- return obj;
202
- },
203
- fromPartial(object) {
204
- const message = createBaseMsgRequestTransaction();
205
- message.creator = object.creator ?? "";
206
- message.originChain = object.originChain ?? "";
207
- message.originAddress = object.originAddress ?? "";
208
- message.targetChain = object.targetChain ?? "";
209
- message.targetAddress = object.targetAddress ?? "";
210
- message.originSymbol = object.originSymbol ?? "";
211
- message.targetSymbol = object.targetSymbol ?? "";
212
- message.amount = object.amount ?? "";
213
- message.fee = object.fee ?? "";
214
- message.htlcExpirationTimestamp = object.htlcExpirationTimestamp ?? "";
215
- message.htlcCreationHash = object.htlcCreationHash ?? "";
216
- message.htlcCreationVout = object.htlcCreationVout ?? 0;
217
- message.htlcVersion = object.htlcVersion ?? "";
218
- message.senderPubKey = object.senderPubKey ?? new Uint8Array();
219
- message.options = object.options ?? "";
220
- return message;
221
- },
222
- };
@@ -1,21 +0,0 @@
1
- import _m0 from "../../config/probuff.config";
2
- export interface MsgRequestTransactionResponse {
3
- code: string;
4
- msg: string;
5
- txId: number;
6
- }
7
- export declare const MsgRequestTransactionResponse: {
8
- encode(message: MsgRequestTransactionResponse, writer?: _m0.Writer): _m0.Writer;
9
- decode(input: _m0.Reader | Uint8Array, length?: number): MsgRequestTransactionResponse;
10
- fromJSON(object: any): MsgRequestTransactionResponse;
11
- toJSON(message: MsgRequestTransactionResponse): unknown;
12
- fromPartial<I extends {
13
- code?: string | undefined;
14
- msg?: string | undefined;
15
- txId?: number | undefined;
16
- } & {
17
- code?: string | undefined;
18
- msg?: string | undefined;
19
- txId?: number | undefined;
20
- } & { [K in Exclude<keyof I, keyof MsgRequestTransactionResponse>]: never; }>(object: I): MsgRequestTransactionResponse;
21
- };
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.MsgRequestTransactionResponse = void 0;
7
- const probuff_config_1 = __importDefault(require("../../config/probuff.config"));
8
- const utils_1 = require("../../utils");
9
- function createBaseMsgRequestTransactionResponse() {
10
- return { code: "", msg: "", txId: 0 };
11
- }
12
- exports.MsgRequestTransactionResponse = {
13
- encode(message, writer = probuff_config_1.default.Writer.create()) {
14
- if (message.code !== "") {
15
- writer.uint32(10).string(message.code);
16
- }
17
- if (message.msg !== "") {
18
- writer.uint32(18).string(message.msg);
19
- }
20
- if (message.txId !== 0) {
21
- writer.uint32(24).uint64(message.txId);
22
- }
23
- return writer;
24
- },
25
- decode(input, length) {
26
- const reader = input instanceof probuff_config_1.default.Reader ? input : new probuff_config_1.default.Reader(input);
27
- let end = length === undefined ? reader.len : reader.pos + length;
28
- const message = createBaseMsgRequestTransactionResponse();
29
- while (reader.pos < end) {
30
- const tag = reader.uint32();
31
- switch (tag >>> 3) {
32
- case 1:
33
- message.code = reader.string();
34
- break;
35
- case 2:
36
- message.msg = reader.string();
37
- break;
38
- case 3:
39
- message.txId = (0, utils_1.longToNumber)(reader.uint64());
40
- break;
41
- default:
42
- reader.skipType(tag & 7);
43
- break;
44
- }
45
- }
46
- return message;
47
- },
48
- fromJSON(object) {
49
- return {
50
- code: (0, utils_1.isSet)(object.code) ? String(object.code) : "",
51
- msg: (0, utils_1.isSet)(object.msg) ? String(object.msg) : "",
52
- txId: (0, utils_1.isSet)(object.txId) ? Number(object.txId) : 0,
53
- };
54
- },
55
- toJSON(message) {
56
- const obj = {};
57
- message.code !== undefined && (obj.code = message.code);
58
- message.msg !== undefined && (obj.msg = message.msg);
59
- message.txId !== undefined && (obj.txId = Math.round(message.txId));
60
- return obj;
61
- },
62
- fromPartial(object) {
63
- const message = createBaseMsgRequestTransactionResponse();
64
- message.code = object.code ?? "";
65
- message.msg = object.msg ?? "";
66
- message.txId = object.txId ?? 0;
67
- return message;
68
- },
69
- };
File without changes
@@ -1 +0,0 @@
1
- "use strict";