@bitgo/sdk-coin-islm 1.1.0
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/.eslintignore +5 -0
- package/.mocharc.yml +8 -0
- package/CHANGELOG.md +10 -0
- package/LICENSE +191 -0
- package/README.md +30 -0
- package/dist/resources/types/ethSecp256k1.d.ts +63 -0
- package/dist/resources/types/ethSecp256k1.d.ts.map +1 -0
- package/dist/resources/types/ethSecp256k1.js +156 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +17 -0
- package/dist/src/islm.d.ts +32 -0
- package/dist/src/islm.d.ts.map +1 -0
- package/dist/src/islm.js +73 -0
- package/dist/src/lib/constants.d.ts +7 -0
- package/dist/src/lib/constants.d.ts.map +1 -0
- package/dist/src/lib/constants.js +10 -0
- package/dist/src/lib/index.d.ts +7 -0
- package/dist/src/lib/index.d.ts.map +1 -0
- package/dist/src/lib/index.js +34 -0
- package/dist/src/lib/keyPair.d.ts +11 -0
- package/dist/src/lib/keyPair.d.ts.map +1 -0
- package/dist/src/lib/keyPair.js +21 -0
- package/dist/src/lib/transactionBuilderFactory.d.ts +27 -0
- package/dist/src/lib/transactionBuilderFactory.d.ts.map +1 -0
- package/dist/src/lib/transactionBuilderFactory.js +71 -0
- package/dist/src/lib/utils.d.ts +44 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/lib/utils.js +116 -0
- package/dist/src/register.d.ts +3 -0
- package/dist/src/register.d.ts.map +1 -0
- package/dist/src/register.js +11 -0
- package/dist/src/tislm.d.ts +14 -0
- package/dist/src/tislm.d.ts.map +1 -0
- package/dist/src/tislm.js +18 -0
- package/package.json +61 -0
- package/resources/README.md +15 -0
- package/resources/proto/ethermint/crypto/v1/ethsecp256k1/ethSecp256k1.proto +23 -0
- package/resources/proto/gogoproto/gogo.proto +145 -0
- package/resources/types/ethSecp256k1.ts +183 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// Protocol Buffers for Go with Gadgets
|
|
2
|
+
//
|
|
3
|
+
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
|
|
4
|
+
// http://github.com/cosmos/gogoproto
|
|
5
|
+
//
|
|
6
|
+
// Redistribution and use in source and binary forms, with or without
|
|
7
|
+
// modification, are permitted provided that the following conditions are
|
|
8
|
+
// met:
|
|
9
|
+
//
|
|
10
|
+
// * Redistributions of source code must retain the above copyright
|
|
11
|
+
// notice, this list of conditions and the following disclaimer.
|
|
12
|
+
// * Redistributions in binary form must reproduce the above
|
|
13
|
+
// copyright notice, this list of conditions and the following disclaimer
|
|
14
|
+
// in the documentation and/or other materials provided with the
|
|
15
|
+
// distribution.
|
|
16
|
+
//
|
|
17
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
18
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
19
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
20
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
21
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
22
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
23
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
24
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
25
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
|
|
29
|
+
syntax = "proto2";
|
|
30
|
+
package gogoproto;
|
|
31
|
+
|
|
32
|
+
import "google/protobuf/descriptor.proto";
|
|
33
|
+
|
|
34
|
+
option java_package = "com.google.protobuf";
|
|
35
|
+
option java_outer_classname = "GoGoProtos";
|
|
36
|
+
option go_package = "github.com/cosmos/gogoproto/gogoproto";
|
|
37
|
+
|
|
38
|
+
extend google.protobuf.EnumOptions {
|
|
39
|
+
optional bool goproto_enum_prefix = 62001;
|
|
40
|
+
optional bool goproto_enum_stringer = 62021;
|
|
41
|
+
optional bool enum_stringer = 62022;
|
|
42
|
+
optional string enum_customname = 62023;
|
|
43
|
+
optional bool enumdecl = 62024;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
extend google.protobuf.EnumValueOptions {
|
|
47
|
+
optional string enumvalue_customname = 66001;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
extend google.protobuf.FileOptions {
|
|
51
|
+
optional bool goproto_getters_all = 63001;
|
|
52
|
+
optional bool goproto_enum_prefix_all = 63002;
|
|
53
|
+
optional bool goproto_stringer_all = 63003;
|
|
54
|
+
optional bool verbose_equal_all = 63004;
|
|
55
|
+
optional bool face_all = 63005;
|
|
56
|
+
optional bool gostring_all = 63006;
|
|
57
|
+
optional bool populate_all = 63007;
|
|
58
|
+
optional bool stringer_all = 63008;
|
|
59
|
+
optional bool onlyone_all = 63009;
|
|
60
|
+
|
|
61
|
+
optional bool equal_all = 63013;
|
|
62
|
+
optional bool description_all = 63014;
|
|
63
|
+
optional bool testgen_all = 63015;
|
|
64
|
+
optional bool benchgen_all = 63016;
|
|
65
|
+
optional bool marshaler_all = 63017;
|
|
66
|
+
optional bool unmarshaler_all = 63018;
|
|
67
|
+
optional bool stable_marshaler_all = 63019;
|
|
68
|
+
|
|
69
|
+
optional bool sizer_all = 63020;
|
|
70
|
+
|
|
71
|
+
optional bool goproto_enum_stringer_all = 63021;
|
|
72
|
+
optional bool enum_stringer_all = 63022;
|
|
73
|
+
|
|
74
|
+
optional bool unsafe_marshaler_all = 63023;
|
|
75
|
+
optional bool unsafe_unmarshaler_all = 63024;
|
|
76
|
+
|
|
77
|
+
optional bool goproto_extensions_map_all = 63025;
|
|
78
|
+
optional bool goproto_unrecognized_all = 63026;
|
|
79
|
+
optional bool gogoproto_import = 63027;
|
|
80
|
+
optional bool protosizer_all = 63028;
|
|
81
|
+
optional bool compare_all = 63029;
|
|
82
|
+
optional bool typedecl_all = 63030;
|
|
83
|
+
optional bool enumdecl_all = 63031;
|
|
84
|
+
|
|
85
|
+
optional bool goproto_registration = 63032;
|
|
86
|
+
optional bool messagename_all = 63033;
|
|
87
|
+
|
|
88
|
+
optional bool goproto_sizecache_all = 63034;
|
|
89
|
+
optional bool goproto_unkeyed_all = 63035;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
extend google.protobuf.MessageOptions {
|
|
93
|
+
optional bool goproto_getters = 64001;
|
|
94
|
+
optional bool goproto_stringer = 64003;
|
|
95
|
+
optional bool verbose_equal = 64004;
|
|
96
|
+
optional bool face = 64005;
|
|
97
|
+
optional bool gostring = 64006;
|
|
98
|
+
optional bool populate = 64007;
|
|
99
|
+
optional bool stringer = 67008;
|
|
100
|
+
optional bool onlyone = 64009;
|
|
101
|
+
|
|
102
|
+
optional bool equal = 64013;
|
|
103
|
+
optional bool description = 64014;
|
|
104
|
+
optional bool testgen = 64015;
|
|
105
|
+
optional bool benchgen = 64016;
|
|
106
|
+
optional bool marshaler = 64017;
|
|
107
|
+
optional bool unmarshaler = 64018;
|
|
108
|
+
optional bool stable_marshaler = 64019;
|
|
109
|
+
|
|
110
|
+
optional bool sizer = 64020;
|
|
111
|
+
|
|
112
|
+
optional bool unsafe_marshaler = 64023;
|
|
113
|
+
optional bool unsafe_unmarshaler = 64024;
|
|
114
|
+
|
|
115
|
+
optional bool goproto_extensions_map = 64025;
|
|
116
|
+
optional bool goproto_unrecognized = 64026;
|
|
117
|
+
|
|
118
|
+
optional bool protosizer = 64028;
|
|
119
|
+
optional bool compare = 64029;
|
|
120
|
+
|
|
121
|
+
optional bool typedecl = 64030;
|
|
122
|
+
|
|
123
|
+
optional bool messagename = 64033;
|
|
124
|
+
|
|
125
|
+
optional bool goproto_sizecache = 64034;
|
|
126
|
+
optional bool goproto_unkeyed = 64035;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
extend google.protobuf.FieldOptions {
|
|
130
|
+
optional bool nullable = 65001;
|
|
131
|
+
optional bool embed = 65002;
|
|
132
|
+
optional string customtype = 65003;
|
|
133
|
+
optional string customname = 65004;
|
|
134
|
+
optional string jsontag = 65005;
|
|
135
|
+
optional string moretags = 65006;
|
|
136
|
+
optional string casttype = 65007;
|
|
137
|
+
optional string castkey = 65008;
|
|
138
|
+
optional string castvalue = 65009;
|
|
139
|
+
|
|
140
|
+
optional bool stdtime = 65010;
|
|
141
|
+
optional bool stdduration = 65011;
|
|
142
|
+
optional bool wktpointer = 65012;
|
|
143
|
+
|
|
144
|
+
optional string castrepeated = 65013;
|
|
145
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import * as _m0 from 'protobufjs/minimal';
|
|
3
|
+
|
|
4
|
+
export const protobufPackage = 'ethermint.crypto.v1.ethsecp256k1';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* PubKey defines a type alias for an ecdsa.PublicKey that implements
|
|
8
|
+
* Tendermint's PubKey interface. It represents the 33-byte compressed public
|
|
9
|
+
* key format.
|
|
10
|
+
*/
|
|
11
|
+
export interface PubKey {
|
|
12
|
+
/** key is the public key in byte form */
|
|
13
|
+
key: Uint8Array;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* PrivKey defines a type alias for an ecdsa.PrivateKey that implements
|
|
18
|
+
* Tendermint's PrivateKey interface.
|
|
19
|
+
*/
|
|
20
|
+
export interface PrivKey {
|
|
21
|
+
/** key is the private key in byte form */
|
|
22
|
+
key: Uint8Array;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function createBasePubKey(): PubKey {
|
|
26
|
+
return { key: new Uint8Array(0) };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const PubKey = {
|
|
30
|
+
encode(message: PubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
31
|
+
if (message.key.length !== 0) {
|
|
32
|
+
writer.uint32(10).bytes(message.key);
|
|
33
|
+
}
|
|
34
|
+
return writer;
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): PubKey {
|
|
38
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
39
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
40
|
+
const message = createBasePubKey();
|
|
41
|
+
while (reader.pos < end) {
|
|
42
|
+
const tag = reader.uint32();
|
|
43
|
+
switch (tag >>> 3) {
|
|
44
|
+
case 1:
|
|
45
|
+
if (tag !== 10) {
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message.key = reader.bytes();
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
reader.skipType(tag & 7);
|
|
56
|
+
}
|
|
57
|
+
return message;
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
fromJSON(object: any): PubKey {
|
|
61
|
+
return { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(0) };
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
toJSON(message: PubKey): unknown {
|
|
65
|
+
const obj: any = {};
|
|
66
|
+
if (message.key.length !== 0) {
|
|
67
|
+
obj.key = base64FromBytes(message.key);
|
|
68
|
+
}
|
|
69
|
+
return obj;
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
create<I extends Exact<DeepPartial<PubKey>, I>>(base?: I): PubKey {
|
|
73
|
+
return PubKey.fromPartial(base ?? ({} as any));
|
|
74
|
+
},
|
|
75
|
+
fromPartial<I extends Exact<DeepPartial<PubKey>, I>>(object: I): PubKey {
|
|
76
|
+
const message = createBasePubKey();
|
|
77
|
+
message.key = object.key ?? new Uint8Array(0);
|
|
78
|
+
return message;
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
function createBasePrivKey(): PrivKey {
|
|
83
|
+
return { key: new Uint8Array(0) };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const PrivKey = {
|
|
87
|
+
encode(message: PrivKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
88
|
+
if (message.key.length !== 0) {
|
|
89
|
+
writer.uint32(10).bytes(message.key);
|
|
90
|
+
}
|
|
91
|
+
return writer;
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey {
|
|
95
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
96
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
97
|
+
const message = createBasePrivKey();
|
|
98
|
+
while (reader.pos < end) {
|
|
99
|
+
const tag = reader.uint32();
|
|
100
|
+
switch (tag >>> 3) {
|
|
101
|
+
case 1:
|
|
102
|
+
if (tag !== 10) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
message.key = reader.bytes();
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
reader.skipType(tag & 7);
|
|
113
|
+
}
|
|
114
|
+
return message;
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
fromJSON(object: any): PrivKey {
|
|
118
|
+
return { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(0) };
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
toJSON(message: PrivKey): unknown {
|
|
122
|
+
const obj: any = {};
|
|
123
|
+
if (message.key.length !== 0) {
|
|
124
|
+
obj.key = base64FromBytes(message.key);
|
|
125
|
+
}
|
|
126
|
+
return obj;
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
create<I extends Exact<DeepPartial<PrivKey>, I>>(base?: I): PrivKey {
|
|
130
|
+
return PrivKey.fromPartial(base ?? ({} as any));
|
|
131
|
+
},
|
|
132
|
+
fromPartial<I extends Exact<DeepPartial<PrivKey>, I>>(object: I): PrivKey {
|
|
133
|
+
const message = createBasePrivKey();
|
|
134
|
+
message.key = object.key ?? new Uint8Array(0);
|
|
135
|
+
return message;
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
function bytesFromBase64(b64: string): Uint8Array {
|
|
140
|
+
if (globalThis.Buffer) {
|
|
141
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, 'base64'));
|
|
142
|
+
} else {
|
|
143
|
+
const bin = globalThis.atob(b64);
|
|
144
|
+
const arr = new Uint8Array(bin.length);
|
|
145
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
146
|
+
arr[i] = bin.charCodeAt(i);
|
|
147
|
+
}
|
|
148
|
+
return arr;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function base64FromBytes(arr: Uint8Array): string {
|
|
153
|
+
if (globalThis.Buffer) {
|
|
154
|
+
return globalThis.Buffer.from(arr).toString('base64');
|
|
155
|
+
} else {
|
|
156
|
+
const bin: string[] = [];
|
|
157
|
+
arr.forEach((byte) => {
|
|
158
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
159
|
+
});
|
|
160
|
+
return globalThis.btoa(bin.join(''));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
165
|
+
|
|
166
|
+
export type DeepPartial<T> = T extends Builtin
|
|
167
|
+
? T
|
|
168
|
+
: T extends globalThis.Array<infer U>
|
|
169
|
+
? globalThis.Array<DeepPartial<U>>
|
|
170
|
+
: T extends ReadonlyArray<infer U>
|
|
171
|
+
? ReadonlyArray<DeepPartial<U>>
|
|
172
|
+
: T extends {}
|
|
173
|
+
? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
174
|
+
: Partial<T>;
|
|
175
|
+
|
|
176
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
177
|
+
export type Exact<P, I extends P> = P extends Builtin
|
|
178
|
+
? P
|
|
179
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
180
|
+
|
|
181
|
+
function isSet(value: any): boolean {
|
|
182
|
+
return value !== null && value !== undefined;
|
|
183
|
+
}
|