@bitgo-beta/sdk-coin-xtz 1.4.3-alpha.397 → 1.4.3-alpha.399
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/CHANGELOG.md +6 -0
- package/package.json +8 -8
- package/dist/src/index.d.ts +0 -5
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -44
- package/dist/src/lib/address.d.ts +0 -8
- package/dist/src/lib/address.d.ts.map +0 -1
- package/dist/src/lib/address.js +0 -10
- package/dist/src/lib/iface.d.ts +0 -148
- package/dist/src/lib/iface.d.ts.map +0 -1
- package/dist/src/lib/iface.js +0 -3
- package/dist/src/lib/index.d.ts +0 -10
- package/dist/src/lib/index.d.ts.map +0 -1
- package/dist/src/lib/index.js +0 -51
- package/dist/src/lib/keyPair.d.ts +0 -40
- package/dist/src/lib/keyPair.d.ts.map +0 -1
- package/dist/src/lib/keyPair.js +0 -149
- package/dist/src/lib/multisigUtils.d.ts +0 -134
- package/dist/src/lib/multisigUtils.d.ts.map +0 -1
- package/dist/src/lib/multisigUtils.js +0 -1193
- package/dist/src/lib/transaction.d.ts +0 -119
- package/dist/src/lib/transaction.d.ts.map +0 -1
- package/dist/src/lib/transaction.js +0 -329
- package/dist/src/lib/transactionBuilder.d.ts +0 -171
- package/dist/src/lib/transactionBuilder.d.ts.map +0 -1
- package/dist/src/lib/transactionBuilder.js +0 -453
- package/dist/src/lib/transferBuilder.d.ts +0 -24
- package/dist/src/lib/transferBuilder.d.ts.map +0 -1
- package/dist/src/lib/transferBuilder.js +0 -64
- package/dist/src/lib/utils.d.ts +0 -280
- package/dist/src/lib/utils.d.ts.map +0 -1
- package/dist/src/lib/utils.js +0 -492
- package/dist/src/register.d.ts +0 -3
- package/dist/src/register.d.ts.map +0 -1
- package/dist/src/register.js +0 -11
- package/dist/src/txtz.d.ts +0 -13
- package/dist/src/txtz.d.ts.map +0 -1
- package/dist/src/txtz.js +0 -14
- package/dist/src/xtz.d.ts +0 -125
- package/dist/src/xtz.d.ts.map +0 -1
- package/dist/src/xtz.js +0 -409
package/dist/src/lib/utils.d.ts
DELETED
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
import { HashType, SignResponse } from './iface';
|
|
2
|
-
import { KeyPair } from './keyPair';
|
|
3
|
-
export declare const DEFAULT_WATERMARK: Uint8Array<ArrayBuffer>;
|
|
4
|
-
/**
|
|
5
|
-
* Encode the payload to base58 with a specific Tezos prefix.
|
|
6
|
-
*
|
|
7
|
-
* @param {Buffer} prefix to add to the encoded payload
|
|
8
|
-
* @param {Buffer} payload to encode
|
|
9
|
-
* @returns {any} base58 payload with a Tezos prefix
|
|
10
|
-
*/
|
|
11
|
-
export declare function base58encode(prefix: Buffer, payload: Buffer): string;
|
|
12
|
-
/**
|
|
13
|
-
* Calculate the transaction id for a for a signed transaction.
|
|
14
|
-
*
|
|
15
|
-
* @param {string} encodedTransaction Signed transaction in hexadecimal
|
|
16
|
-
* @returns {Promise<string>} The transaction id
|
|
17
|
-
*/
|
|
18
|
-
export declare function calculateTransactionId(encodedTransaction: string): Promise<string>;
|
|
19
|
-
/**
|
|
20
|
-
* Calculate the address of a new originated account.
|
|
21
|
-
*
|
|
22
|
-
* @param {string} transactionId The transaction id
|
|
23
|
-
* @param {number} index The index of the origination operation inside the transaction (starts at 0)
|
|
24
|
-
* @returns {Promise<string>} An originated address with the KT prefix
|
|
25
|
-
*/
|
|
26
|
-
export declare function calculateOriginatedAddress(transactionId: string, index: number): Promise<string>;
|
|
27
|
-
/**
|
|
28
|
-
* Generic data signing using Tezos library.
|
|
29
|
-
*
|
|
30
|
-
* @param {KeyPair} keyPair A Key Pair with a private key set
|
|
31
|
-
* @param {string} data The data in hexadecimal to sign
|
|
32
|
-
* @param {Uint8Array} watermark Magic byte: 1 for block, 2 for endorsement, 3 for generic
|
|
33
|
-
* @returns {Promise<SignResponse>}
|
|
34
|
-
*/
|
|
35
|
-
export declare function sign(keyPair: KeyPair, data: string, watermark?: Uint8Array): Promise<SignResponse>;
|
|
36
|
-
/**
|
|
37
|
-
* Verifies the signature produced for a given message belongs to a secp256k1 public key.
|
|
38
|
-
*
|
|
39
|
-
* @param {string} message Message in hex format to verify
|
|
40
|
-
* @param {string} publicKey secp256k1 public key with "sppk" prefix to verify the signature with
|
|
41
|
-
* @param {string} signature Tezos signature with "sig" prefix
|
|
42
|
-
* @param {Uint8Array} watermark Optional watermark used to generate the signature
|
|
43
|
-
* @returns {Promise<boolean>}
|
|
44
|
-
*/
|
|
45
|
-
export declare function verifySignature(message: string, publicKey: string, signature: string, watermark?: Uint8Array): Promise<boolean>;
|
|
46
|
-
/**
|
|
47
|
-
* Useful wrapper to create the generic multisig contract data to sign when moving funds.
|
|
48
|
-
*
|
|
49
|
-
* @param {string} contractAddress The wallet contract address with the funds to withdraw
|
|
50
|
-
* @param {string} destinationAddress The address to transfer the funds to
|
|
51
|
-
* @param {number} amount Number mutez to transfer
|
|
52
|
-
* @param {string} contractCounter Wallet counter to use in the transaction
|
|
53
|
-
* @returns {any} A JSON representation of the Michelson script to sign and approve a transfer
|
|
54
|
-
*/
|
|
55
|
-
export declare function generateDataToSign(contractAddress: string, destinationAddress: string, amount: string, contractCounter: string): any;
|
|
56
|
-
/**
|
|
57
|
-
* Returns whether or not the string is a valid Tezos hash of the given type
|
|
58
|
-
*
|
|
59
|
-
* @param {string} hash - the string to validate
|
|
60
|
-
* @param {HashType} hashType - the type of the provided hash
|
|
61
|
-
* @returns {boolean}
|
|
62
|
-
*/
|
|
63
|
-
export declare function isValidHash(hash: string, hashType: HashType): boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Returns whether or not the string is a valid Tezos address
|
|
66
|
-
*
|
|
67
|
-
* @param {string} hash - the address to validate
|
|
68
|
-
* @returns {boolean}
|
|
69
|
-
*/
|
|
70
|
-
export declare function isValidAddress(hash: string): boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Returns whether or not the string is a valid Tezos implicit account address
|
|
73
|
-
*
|
|
74
|
-
* @param {string} hash - the address to validate
|
|
75
|
-
* @returns {boolean}
|
|
76
|
-
*/
|
|
77
|
-
export declare function isValidImplicitAddress(hash: string): boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Returns whether or not the string is a valid Tezos originated account address
|
|
80
|
-
*
|
|
81
|
-
* @param {string} hash - the address to validate
|
|
82
|
-
* @returns {boolean}
|
|
83
|
-
*/
|
|
84
|
-
export declare function isValidOriginatedAddress(hash: string): boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Returns whether or not the string is a valid Tezos signature
|
|
87
|
-
*
|
|
88
|
-
* @param {string} hash - the signature to validate
|
|
89
|
-
* @returns {boolean}
|
|
90
|
-
*/
|
|
91
|
-
export declare function isValidSignature(hash: string): boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Returns whether or not the string is a valid Tezos public key
|
|
94
|
-
*
|
|
95
|
-
* @param {string} publicKey The public key to validate
|
|
96
|
-
* @returns {boolean}
|
|
97
|
-
*/
|
|
98
|
-
export declare function isValidPublicKey(publicKey: string): boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Returns whether or not the string is a valid Tezos private key
|
|
101
|
-
*
|
|
102
|
-
* @param {string} privateKey The private key to validate
|
|
103
|
-
* @returns {boolean}
|
|
104
|
-
*/
|
|
105
|
-
export declare function isValidPrivateKey(privateKey: string): boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Returns whether or not the string is a valid Tezos block hash
|
|
108
|
-
*
|
|
109
|
-
* @param {string} hash - the address to validate
|
|
110
|
-
* @returns {boolean}
|
|
111
|
-
*/
|
|
112
|
-
export declare function isValidBlockHash(hash: string): boolean;
|
|
113
|
-
/**
|
|
114
|
-
* Returns whether or not the string is a valid Tezos transaction hash
|
|
115
|
-
*
|
|
116
|
-
* @param {string} hash - the address to validate
|
|
117
|
-
* @returns {boolean}
|
|
118
|
-
*/
|
|
119
|
-
export declare function isValidTransactionHash(hash: string): boolean;
|
|
120
|
-
/**
|
|
121
|
-
* Returns whether or not the string is a valid Tezos key given a prefix
|
|
122
|
-
*
|
|
123
|
-
* @param {string} hash - the key to validate
|
|
124
|
-
* @param {HashType} hashType - the type of the provided hash
|
|
125
|
-
* @returns {boolean}
|
|
126
|
-
*/
|
|
127
|
-
export declare function isValidKey(hash: string, hashType: HashType): boolean;
|
|
128
|
-
/**
|
|
129
|
-
* Get the original key form the text without the given prefix.
|
|
130
|
-
*
|
|
131
|
-
* @param {string} hash - base58 encoded key with a Tezos prefix
|
|
132
|
-
* @param {HashType} hashType - the type of the provided hash
|
|
133
|
-
* @returns {Buffer} the original decoded key
|
|
134
|
-
*/
|
|
135
|
-
export declare function decodeKey(hash: string, hashType: HashType): Buffer;
|
|
136
|
-
/**
|
|
137
|
-
* Get the raw signature from a Tezos encoded one.
|
|
138
|
-
*
|
|
139
|
-
* @param {string} signature Tezos signatures prefixed with sig, edsig, p2sig or spsig
|
|
140
|
-
* @param {HashType} hashType The prefix of remove
|
|
141
|
-
* @returns {Buffer} The decoded signature without prefix
|
|
142
|
-
*/
|
|
143
|
-
export declare function decodeSignature(signature: string, hashType: HashType): Buffer;
|
|
144
|
-
export declare const hashTypes: {
|
|
145
|
-
tz1: {
|
|
146
|
-
prefix: Buffer<ArrayBuffer>;
|
|
147
|
-
byteLength: number;
|
|
148
|
-
};
|
|
149
|
-
tz2: {
|
|
150
|
-
prefix: Buffer<ArrayBuffer>;
|
|
151
|
-
byteLength: number;
|
|
152
|
-
};
|
|
153
|
-
tz3: {
|
|
154
|
-
prefix: Buffer<ArrayBuffer>;
|
|
155
|
-
byteLength: number;
|
|
156
|
-
};
|
|
157
|
-
KT: {
|
|
158
|
-
prefix: Buffer<ArrayBuffer>;
|
|
159
|
-
byteLength: number;
|
|
160
|
-
};
|
|
161
|
-
edpk: {
|
|
162
|
-
prefix: Buffer<ArrayBuffer>;
|
|
163
|
-
byteLength: number;
|
|
164
|
-
};
|
|
165
|
-
edsk2: {
|
|
166
|
-
prefix: Buffer<ArrayBuffer>;
|
|
167
|
-
byteLength: number;
|
|
168
|
-
};
|
|
169
|
-
spsk: {
|
|
170
|
-
prefix: Buffer<ArrayBuffer>;
|
|
171
|
-
byteLength: number;
|
|
172
|
-
};
|
|
173
|
-
p2sk: {
|
|
174
|
-
prefix: Buffer<ArrayBuffer>;
|
|
175
|
-
byteLength: number;
|
|
176
|
-
};
|
|
177
|
-
b: {
|
|
178
|
-
prefix: Buffer<ArrayBuffer>;
|
|
179
|
-
byteLength: number;
|
|
180
|
-
};
|
|
181
|
-
o: {
|
|
182
|
-
prefix: Buffer<ArrayBuffer>;
|
|
183
|
-
byteLength: number;
|
|
184
|
-
};
|
|
185
|
-
Lo: {
|
|
186
|
-
prefix: Buffer<ArrayBuffer>;
|
|
187
|
-
byteLength: number;
|
|
188
|
-
};
|
|
189
|
-
LLo: {
|
|
190
|
-
prefix: Buffer<ArrayBuffer>;
|
|
191
|
-
byteLength: number;
|
|
192
|
-
};
|
|
193
|
-
P: {
|
|
194
|
-
prefix: Buffer<ArrayBuffer>;
|
|
195
|
-
byteLength: number;
|
|
196
|
-
};
|
|
197
|
-
Co: {
|
|
198
|
-
prefix: Buffer<ArrayBuffer>;
|
|
199
|
-
byteLength: number;
|
|
200
|
-
};
|
|
201
|
-
sppk: {
|
|
202
|
-
prefix: Buffer<ArrayBuffer>;
|
|
203
|
-
byteLength: number;
|
|
204
|
-
};
|
|
205
|
-
p2pk: {
|
|
206
|
-
prefix: Buffer<ArrayBuffer>;
|
|
207
|
-
byteLength: number;
|
|
208
|
-
};
|
|
209
|
-
edesk: {
|
|
210
|
-
prefix: Buffer<ArrayBuffer>;
|
|
211
|
-
byteLength: number;
|
|
212
|
-
};
|
|
213
|
-
edsk: {
|
|
214
|
-
prefix: Buffer<ArrayBuffer>;
|
|
215
|
-
byteLength: number;
|
|
216
|
-
};
|
|
217
|
-
edsig: {
|
|
218
|
-
prefix: Buffer<ArrayBuffer>;
|
|
219
|
-
byteLength: number;
|
|
220
|
-
};
|
|
221
|
-
spsig1: {
|
|
222
|
-
prefix: Buffer<ArrayBuffer>;
|
|
223
|
-
byteLength: number;
|
|
224
|
-
};
|
|
225
|
-
p2sig: {
|
|
226
|
-
prefix: Buffer<ArrayBuffer>;
|
|
227
|
-
byteLength: number;
|
|
228
|
-
};
|
|
229
|
-
sig: {
|
|
230
|
-
prefix: Buffer<ArrayBuffer>;
|
|
231
|
-
byteLength: number;
|
|
232
|
-
};
|
|
233
|
-
Net: {
|
|
234
|
-
prefix: Buffer<ArrayBuffer>;
|
|
235
|
-
byteLength: number;
|
|
236
|
-
};
|
|
237
|
-
nce: {
|
|
238
|
-
prefix: Buffer<ArrayBuffer>;
|
|
239
|
-
byteLength: number;
|
|
240
|
-
};
|
|
241
|
-
id: {
|
|
242
|
-
prefix: Buffer<ArrayBuffer>;
|
|
243
|
-
byteLength: number;
|
|
244
|
-
};
|
|
245
|
-
};
|
|
246
|
-
export declare enum DEFAULT_GAS_LIMIT {
|
|
247
|
-
DELEGATION = 10600,
|
|
248
|
-
ORIGINATION = 10600,
|
|
249
|
-
TRANSFER = 10600,
|
|
250
|
-
REVEAL = 10600
|
|
251
|
-
}
|
|
252
|
-
export declare enum DEFAULT_FEE {
|
|
253
|
-
DELEGATION = 1257,
|
|
254
|
-
ORIGINATION = 10000,
|
|
255
|
-
TRANSFER = 10000,
|
|
256
|
-
REVEAL = 1420
|
|
257
|
-
}
|
|
258
|
-
export declare enum DEFAULT_STORAGE_LIMIT {
|
|
259
|
-
DELEGATION = 0,
|
|
260
|
-
ORIGINATION = 257,
|
|
261
|
-
TRANSFER = 257,
|
|
262
|
-
REVEAL = 0
|
|
263
|
-
}
|
|
264
|
-
export declare enum TRANSACTION_FEE {
|
|
265
|
-
ORIGINATION = 47640,
|
|
266
|
-
TRANSFER = 47640,
|
|
267
|
-
REVEAL = 1420
|
|
268
|
-
}
|
|
269
|
-
export declare enum TRANSACTION_STORAGE_LIMIT {
|
|
270
|
-
ORIGINATION = 3000,
|
|
271
|
-
TRANSFER = 300,
|
|
272
|
-
REVEAL = 5
|
|
273
|
-
}
|
|
274
|
-
export declare enum TRANSACTION_GAS_LIMIT {
|
|
275
|
-
ORIGINATION = 4600,
|
|
276
|
-
TRANSFER = 6000,
|
|
277
|
-
CONTRACT_TRANSFER = 20000,
|
|
278
|
-
REVEAL = 1500
|
|
279
|
-
}
|
|
280
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,iBAAiB,yBAAsB,CAAC;AAErD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAMpE;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAKxF;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBtG;AAED;;;;;;;GAOG;AACH,wBAAsB,IAAI,CACxB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,UAA8B,GACxC,OAAO,CAAC,YAAY,CAAC,CAMvB;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,GAAE,UAA8B,GACxC,OAAO,CAAC,OAAO,CAAC,CAelB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,MAAM,EACvB,kBAAkB,EAAE,MAAM,EAC1B,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