@bitgo-beta/sdk-coin-xtz 1.4.3-alpha.40 → 1.4.3-alpha.401

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