@ar.io/sdk 3.14.0-alpha.6 → 3.14.0-alpha.7

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.
@@ -46,7 +46,19 @@ exports.sortANTRecords = sortANTRecords;
46
46
  *
47
47
  * @param state - The HyperBeam serialized ANT state.
48
48
  */
49
- const convertHyperBeamStateToAoANTState = (state) => {
49
+ const convertHyperBeamStateToAoANTState = (initialState) => {
50
+ function lowerCaseKeys(obj) {
51
+ return Object.fromEntries(Object.entries(obj).map(([key, value]) => {
52
+ if (typeof value === 'object' &&
53
+ !Array.isArray(value) &&
54
+ value !== null) {
55
+ return [key.toLowerCase(), lowerCaseKeys(value)];
56
+ }
57
+ return [key.toLowerCase(), value];
58
+ }));
59
+ }
60
+ // we need to ensure keys are lower cased because hyperbeam json serializes keys to lowercase inconsistently
61
+ const state = lowerCaseKeys(initialState);
50
62
  return {
51
63
  Name: state.name,
52
64
  Ticker: state.ticker,
@@ -17,4 +17,4 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.version = void 0;
19
19
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
20
- exports.version = '3.14.0-alpha.6';
20
+ exports.version = '3.14.0-alpha.7';
@@ -42,7 +42,19 @@ export const sortANTRecords = (antRecords) => {
42
42
  *
43
43
  * @param state - The HyperBeam serialized ANT state.
44
44
  */
45
- export const convertHyperBeamStateToAoANTState = (state) => {
45
+ export const convertHyperBeamStateToAoANTState = (initialState) => {
46
+ function lowerCaseKeys(obj) {
47
+ return Object.fromEntries(Object.entries(obj).map(([key, value]) => {
48
+ if (typeof value === 'object' &&
49
+ !Array.isArray(value) &&
50
+ value !== null) {
51
+ return [key.toLowerCase(), lowerCaseKeys(value)];
52
+ }
53
+ return [key.toLowerCase(), value];
54
+ }));
55
+ }
56
+ // we need to ensure keys are lower cased because hyperbeam json serializes keys to lowercase inconsistently
57
+ const state = lowerCaseKeys(initialState);
46
58
  return {
47
59
  Name: state.name,
48
60
  Ticker: state.ticker,
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
17
- export const version = '3.14.0-alpha.6';
17
+ export const version = '3.14.0-alpha.7';
@@ -29,4 +29,4 @@ export declare const sortANTRecords: (antRecords: ANTRecords) => SortedANTRecord
29
29
  *
30
30
  * @param state - The HyperBeam serialized ANT state.
31
31
  */
32
- export declare const convertHyperBeamStateToAoANTState: (state: HyperBeamANTState) => AoANTState;
32
+ export declare const convertHyperBeamStateToAoANTState: (initialState: HyperBeamANTState) => AoANTState;
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const version = "3.14.0-alpha.5";
16
+ export declare const version = "3.14.0-alpha.6";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "3.14.0-alpha.6",
3
+ "version": "3.14.0-alpha.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"