@bitgo-beta/sdk-coin-hbar 2.0.73-alpha.106 → 2.0.73-alpha.107

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 (59) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/package.json +7 -7
  3. package/dist/src/hbar.d.ts +0 -168
  4. package/dist/src/hbar.d.ts.map +0 -1
  5. package/dist/src/hbar.js +0 -497
  6. package/dist/src/hbarToken.d.ts +0 -21
  7. package/dist/src/hbarToken.d.ts.map +0 -1
  8. package/dist/src/hbarToken.js +0 -58
  9. package/dist/src/index.d.ts +0 -6
  10. package/dist/src/index.d.ts.map +0 -1
  11. package/dist/src/index.js +0 -22
  12. package/dist/src/lib/coinTransferBuilder.d.ts +0 -47
  13. package/dist/src/lib/coinTransferBuilder.d.ts.map +0 -1
  14. package/dist/src/lib/coinTransferBuilder.js +0 -159
  15. package/dist/src/lib/constants.d.ts +0 -8
  16. package/dist/src/lib/constants.d.ts.map +0 -1
  17. package/dist/src/lib/constants.js +0 -12
  18. package/dist/src/lib/iface.d.ts +0 -50
  19. package/dist/src/lib/iface.d.ts.map +0 -1
  20. package/dist/src/lib/iface.js +0 -3
  21. package/dist/src/lib/index.d.ts +0 -10
  22. package/dist/src/lib/index.d.ts.map +0 -1
  23. package/dist/src/lib/index.js +0 -53
  24. package/dist/src/lib/keyPair.d.ts +0 -24
  25. package/dist/src/lib/keyPair.d.ts.map +0 -1
  26. package/dist/src/lib/keyPair.js +0 -70
  27. package/dist/src/lib/tokenAssociateBuilder.d.ts +0 -38
  28. package/dist/src/lib/tokenAssociateBuilder.d.ts.map +0 -1
  29. package/dist/src/lib/tokenAssociateBuilder.js +0 -107
  30. package/dist/src/lib/tokenTransferBuilder.d.ts +0 -25
  31. package/dist/src/lib/tokenTransferBuilder.d.ts.map +0 -1
  32. package/dist/src/lib/tokenTransferBuilder.js +0 -130
  33. package/dist/src/lib/transaction.d.ts +0 -106
  34. package/dist/src/lib/transaction.d.ts.map +0 -1
  35. package/dist/src/lib/transaction.js +0 -330
  36. package/dist/src/lib/transactionBuilder.d.ts +0 -111
  37. package/dist/src/lib/transactionBuilder.d.ts.map +0 -1
  38. package/dist/src/lib/transactionBuilder.js +0 -284
  39. package/dist/src/lib/transactionBuilderFactory.d.ts +0 -47
  40. package/dist/src/lib/transactionBuilderFactory.d.ts.map +0 -1
  41. package/dist/src/lib/transactionBuilderFactory.js +0 -88
  42. package/dist/src/lib/transferBuilder.d.ts +0 -24
  43. package/dist/src/lib/transferBuilder.d.ts.map +0 -1
  44. package/dist/src/lib/transferBuilder.js +0 -55
  45. package/dist/src/lib/utils.d.ts +0 -210
  46. package/dist/src/lib/utils.d.ts.map +0 -1
  47. package/dist/src/lib/utils.js +0 -481
  48. package/dist/src/lib/walletInitializationBuilder.d.ts +0 -28
  49. package/dist/src/lib/walletInitializationBuilder.d.ts.map +0 -1
  50. package/dist/src/lib/walletInitializationBuilder.js +0 -124
  51. package/dist/src/register.d.ts +0 -3
  52. package/dist/src/register.d.ts.map +0 -1
  53. package/dist/src/register.js +0 -15
  54. package/dist/src/seedValidator.d.ts +0 -31
  55. package/dist/src/seedValidator.d.ts.map +0 -1
  56. package/dist/src/seedValidator.js +0 -103
  57. package/dist/src/thbar.d.ts +0 -14
  58. package/dist/src/thbar.d.ts.map +0 -1
  59. package/dist/src/thbar.js +0 -17
@@ -1,210 +0,0 @@
1
- import { PrivateKey } from '@hashgraph/sdk';
2
- import { proto } from '@hashgraph/proto';
3
- import { AddressDetails } from './iface';
4
- import { toHex, toUint8Array } from '@bitgo-beta/sdk-core';
5
- import { BaseCoin } from '@bitgo-beta/statics';
6
- export { toHex, toUint8Array };
7
- /**
8
- * Returns whether the string is a valid Hedera account address
9
- *
10
- * In any form, `shard` and `realm` are assumed to be 0 if not provided.
11
- *
12
- * @param {string} address - The address to be validated
13
- * @returns {boolean} - The validation result
14
- */
15
- export declare function isValidAddress(address: string): boolean;
16
- /**
17
- * Returns whether the string is a valid Hedera transaction id
18
- *
19
- * @param {string} txId - The transaction id to be validated
20
- * @returns {boolean} - The validation result
21
- */
22
- export declare function isValidTransactionId(txId: string): boolean;
23
- /**
24
- Returns whether the string is a valid Hedera public key
25
- *
26
- * @param {string} key - The public key to be validated
27
- * @returns {boolean} - The validation result
28
- */
29
- export declare function isValidPublicKey(key: string): boolean;
30
- /**
31
- * Checks whether nodeJS.process exist and if a node version is defined to determine if this is an nodeJS environment
32
- *
33
- * @returns {boolean} - The validation result
34
- */
35
- export declare function isNodeEnvironment(): boolean;
36
- /**
37
- * Calculate the current time with nanoseconds precision
38
- *
39
- * @returns {string} - The current time in seconds
40
- */
41
- export declare function getCurrentTime(): string;
42
- /**
43
- * Returns whether the string is a valid timestamp
44
- *
45
- * Nanoseconds are optional and can be passed after a dot, for example: 1595374723.356981689
46
- *
47
- * @param {string} time - The timestamp to be validated
48
- * @returns {boolean} - The validation result
49
- */
50
- export declare function isValidTimeString(time: string): boolean;
51
- /**
52
- * Returns whether the string is a valid amount number
53
- *
54
- * @param {string} amount - The string to validate
55
- * @returns {boolean} - The validation result
56
- */
57
- export declare function isValidAmount(amount: string): boolean;
58
- /**
59
- * Returns whether the provided raw transaction accommodates to bitgo's preferred format
60
- *
61
- * @param {any} rawTransaction - The raw transaction to be checked
62
- * @returns {boolean} - The validation result
63
- */
64
- export declare function isValidRawTransactionFormat(rawTransaction: any): boolean;
65
- /**
66
- * Returns a string representation of an {proto.IAccountID} object
67
- *
68
- * @param {proto.IAccountID} accountId - Account id to be cast to string
69
- * @returns {string} - The string representation of the {proto.IAccountID}
70
- */
71
- export declare function stringifyAccountId({ shardNum, realmNum, accountNum }: proto.IAccountID): string;
72
- /**
73
- * Returns a string representation of an {proto.ITokenID} object
74
- *
75
- * @param {proto.ITokenID} - token id to be cast to string
76
- * @returns {string} - the string representation of the {proto.ITokenID}
77
- */
78
- export declare function stringifyTokenId({ shardNum, realmNum, tokenNum }: proto.ITokenID): string;
79
- /**
80
- * Returns a string representation of an {proto.ITimestamp} object
81
- *
82
- * @param {proto.ITimestamp} timestamp - Timestamp to be cast to string
83
- * @returns {string} - The string representation of the {proto.ITimestamp}
84
- */
85
- export declare function stringifyTxTime({ seconds, nanos }: proto.ITimestamp): string;
86
- /**
87
- * Remove the specified prefix from a string only if it starts with that prefix
88
- *
89
- * @param {string} prefix - The prefix to be removed
90
- * @param {string} key - The original string, usually a private or public key
91
- * @returns {string} - The string without prefix
92
- */
93
- export declare function removePrefix(prefix: string, key: string): string;
94
- /**
95
- * Check if this is a valid memo
96
- *
97
- * @param {string} memo
98
- * @returns {boolean}
99
- */
100
- export declare function isValidMemo(memo: string): boolean;
101
- /**
102
- * Uses the native hashgraph SDK function to get a raw key.
103
- *
104
- * @param {string} prv - Private key
105
- * @returns {PrivateKey}
106
- */
107
- export declare function createRawKey(prv: string): PrivateKey;
108
- /**
109
- * Converts a stellar public key to ed25519 hex format
110
- *
111
- * @param {string} stellarPub
112
- * @returns {string}
113
- */
114
- export declare function convertFromStellarPub(stellarPub: string): string;
115
- /**
116
- * Checks if two addresses have the same base address
117
- *
118
- * @param {String} address
119
- * @param {String} baseAddress
120
- * @returns {boolean}
121
- */
122
- export declare function isSameBaseAddress(address: string, baseAddress: string): boolean;
123
- /**
124
- * Returns the base address portion of an address
125
- *
126
- * @param {String} address
127
- * @returns {String} - the base address
128
- */
129
- export declare function getBaseAddress(address: string): string;
130
- /**
131
- * Process address into address and memo id
132
- *
133
- * @param {string} rawAddress
134
- * @returns {AddressDetails} - object containing address and memo id
135
- */
136
- export declare function getAddressDetails(rawAddress: string): AddressDetails;
137
- /**
138
- * Validate and return address with appended memo id
139
- *
140
- * @param {AddressDetails} addressDetails - Address which to append memo id
141
- * @returns {string} - Address with appended memo id
142
- */
143
- export declare function normalizeAddress({ address, memoId }: AddressDetails): string;
144
- /**
145
- * Return boolean indicating whether input is a valid address with memo id
146
- *
147
- * @param {string} address - Address in the form <address>?memoId=<memoId>
148
- * @returns {boolean} - True if input is a valid address
149
- */
150
- export declare function isValidAddressWithPaymentId(address: string): boolean;
151
- /**
152
- * Build hedera {proto.TokenID} object from token ID string
153
- *
154
- * @param {string} tokenID - The token ID to build
155
- * @returns {proto.TokenID} - The resulting proto TokenID object
156
- */
157
- export declare function buildHederaTokenID(tokenID: string): proto.TokenID;
158
- /**
159
- * Build hedera {proto.AccountID} object from account ID string
160
- *
161
- * @param {string} accountID - The account ID to build
162
- * @returns {proto} - The resulting proto AccountID object
163
- */
164
- export declare function buildHederaAccountID(accountID: string): proto.AccountID;
165
- /**
166
- * Check if Hedera token ID is valid and supported
167
- *
168
- * @param {string} tokenId - The token ID to validate
169
- * @returns {boolean} - True if tokenId is valid and supported
170
- */
171
- export declare function isValidHederaTokenID(tokenId: string): boolean;
172
- /**
173
- * Get the associated hedera token ID from token name, if supported
174
- *
175
- * @param {string} tokenName - The hedera token name
176
- * @returns {boolean} - The associated token ID or undefined if not supported
177
- */
178
- export declare function getHederaTokenIdFromName(tokenName: string): string | undefined;
179
- /**
180
- * Get the associated hedera token from token ID, if supported
181
- *
182
- * @param tokenId - The token address
183
- * @returns {BaseCoin} - BaseCoin object for the matching token
184
- */
185
- export declare function getHederaTokenNameFromId(tokenId: string): Readonly<BaseCoin> | undefined;
186
- /**
187
- * Return boolean indicating whether input is a valid token transfer transaction
188
- *
189
- * @param {proto.ICryptoTransferTransactionBody | null} transferTxBody is a transfer transaction body
190
- * @returns {boolean} true is input is a valid token transfer transaction
191
- */
192
- export declare function isTokenTransfer(transferTxBody: proto.ICryptoTransferTransactionBody | null): boolean;
193
- /** validates a startTime string to be a valid timestamp and in the future
194
- * @param {string} startTime - The startTime to be validated
195
- * @throws {Error} - if startTime is not a valid timestamp or is in the past
196
- * @returns {void}
197
- * */
198
- export declare function validateStartTime(startTime: string): void;
199
- export declare function normalizeStarttime(startTime: string): string;
200
- /**
201
- * Await for a given amount of time in milliseconds
202
- * @param ms - The amount of time to wait in milliseconds
203
- * @returns {Promise<void>} - A promise that resolves after the given amount of time
204
- */
205
- export declare function sleep(ms: number): Promise<void>;
206
- /**
207
- * Check if the startTime is within the broadcast window (5 seconds after and 175 seconds after the startTime)
208
- */
209
- export declare function shouldBroadcastNow(startTime: string): boolean;
210
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAqC,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAc,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAsB,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;AAI/B;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAkBvD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAa1D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAUrD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAQvC;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAOrD;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,cAAc,EAAE,GAAG,GAAG,OAAO,CAKxE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,QA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