@bitgo/public-types 2.17.0 → 2.19.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/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/schema/transactions/sendTransactions.d.ts +2 -2
- package/dist/src/utils/arrayFromSingle.d.ts +3 -0
- package/dist/src/utils/arrayFromSingle.d.ts.map +1 -0
- package/dist/src/utils/arrayFromSingle.js +34 -0
- package/dist/src/utils/arrayFromSingle.js.map +1 -0
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +2 -0
- package/dist/src/utils/index.js.map +1 -1
- package/dist/src/utils/minMaxArray.d.ts +9 -0
- package/dist/src/utils/minMaxArray.d.ts.map +1 -0
- package/dist/src/utils/minMaxArray.js +30 -0
- package/dist/src/utils/minMaxArray.js.map +1 -0
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
package/dist/src/index.js
CHANGED
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
__exportStar(require("./schema"), exports);
|
18
|
+
__exportStar(require("./utils"), exports);
|
18
19
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,0CAAwB"}
|
@@ -193,7 +193,7 @@ export declare const txSendBody: {
|
|
193
193
|
amount: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
194
194
|
unit: t.UnionC<[t.Type<"baseUnit" | "cpu" | "ram", "baseUnit" | "cpu" | "ram", unknown>, t.UndefinedC]>;
|
195
195
|
formula: t.UnionC<[t.Type<"fixed" | "feeRate" | "perKB" | "custom", "fixed" | "feeRate" | "perKB" | "custom", unknown>, t.UndefinedC]>;
|
196
|
-
type: t.UnionC<[t.Type<"
|
196
|
+
type: t.UnionC<[t.Type<"max" | "base" | "tip", "max" | "base" | "tip", unknown>, t.UndefinedC]>;
|
197
197
|
}>]>;
|
198
198
|
timeBounds: t.UnionC<[t.Type<{
|
199
199
|
minTime?: string | number | undefined;
|
@@ -383,7 +383,7 @@ export declare const TxSendBody: t.ExactC<t.IntersectionC<[t.PartialC<{
|
|
383
383
|
amount: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
384
384
|
unit: t.UnionC<[t.Type<"baseUnit" | "cpu" | "ram", "baseUnit" | "cpu" | "ram", unknown>, t.UndefinedC]>;
|
385
385
|
formula: t.UnionC<[t.Type<"fixed" | "feeRate" | "perKB" | "custom", "fixed" | "feeRate" | "perKB" | "custom", unknown>, t.UndefinedC]>;
|
386
|
-
type: t.UnionC<[t.Type<"
|
386
|
+
type: t.UnionC<[t.Type<"max" | "base" | "tip", "max" | "base" | "tip", unknown>, t.UndefinedC]>;
|
387
387
|
}>]>;
|
388
388
|
timeBounds: t.UnionC<[t.Type<{
|
389
389
|
minTime?: string | number | undefined;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"arrayFromSingle.d.ts","sourceRoot":"","sources":["../../../src/utils/arrayFromSingle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAI3B,wBAAgB,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAC/C,KAAK,EAAE,CAAC,EACR,IAAI,GAAE,MAAyC,iDAYhD"}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
exports.arrayFromSingle = void 0;
|
27
|
+
const t = __importStar(require("io-ts"));
|
28
|
+
const function_1 = require("fp-ts/function");
|
29
|
+
const Either_1 = require("fp-ts/lib/Either");
|
30
|
+
function arrayFromSingle(codec, name = `ArrayFromSingle<${codec.name}>`) {
|
31
|
+
return new t.Type(name, t.array(codec).is, (u, c) => (0, function_1.pipe)(codec.validate(u, c), (0, Either_1.chain)((as) => t.array(codec).validate([as], c))), t.identity);
|
32
|
+
}
|
33
|
+
exports.arrayFromSingle = arrayFromSingle;
|
34
|
+
//# sourceMappingURL=arrayFromSingle.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"arrayFromSingle.js","sourceRoot":"","sources":["../../../src/utils/arrayFromSingle.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAAsC;AACtC,6CAAyC;AAEzC,SAAgB,eAAe,CAC7B,KAAQ,EACR,OAAe,mBAAmB,KAAK,CAAC,IAAI,GAAG;IAE/C,OAAO,IAAI,CAAC,CAAC,IAAI,CACf,IAAI,EACJ,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EACjB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACP,IAAA,eAAI,EACF,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,IAAA,cAAK,EAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAChD,EACH,CAAC,CAAC,QAAQ,CACX,CAAC;AACJ,CAAC;AAdD,0CAcC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC"}
|
package/dist/src/utils/index.js
CHANGED
@@ -16,4 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
__exportStar(require("./optional"), exports);
|
18
18
|
__exportStar(require("./primitives"), exports);
|
19
|
+
__exportStar(require("./arrayFromSingle"), exports);
|
20
|
+
__exportStar(require("./minMaxArray"), exports);
|
19
21
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,+CAA6B"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,+CAA6B;AAC7B,oDAAkC;AAClC,gDAA8B"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import * as t from "io-ts";
|
2
|
+
export interface IMinMaxArray<T> extends Array<T> {
|
3
|
+
readonly minMaxArray: unique symbol;
|
4
|
+
}
|
5
|
+
export declare const minMaxArray: <C extends t.Mixed>(codec: C, { min, max, }?: {
|
6
|
+
min?: number | undefined;
|
7
|
+
max?: number | undefined;
|
8
|
+
}) => t.BrandC<t.ArrayC<C>, IMinMaxArray<C>>;
|
9
|
+
//# sourceMappingURL=minMaxArray.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"minMaxArray.d.ts","sourceRoot":"","sources":["../../../src/utils/minMaxArray.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAE3B,MAAM,WAAW,YAAY,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IAC/C,QAAQ,CAAC,WAAW,EAAE,OAAO,MAAM,CAAC;CACrC;AAOD,eAAO,MAAM,WAAW;;;4CAerB,CAAC"}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
exports.minMaxArray = void 0;
|
27
|
+
const t = __importStar(require("io-ts"));
|
28
|
+
const minMaxArray = (codec, { min, max, } = {}) => t.brand(t.array(codec), (n) => (!min || min <= n.length) && (!max || n.length <= max), "minMaxArray");
|
29
|
+
exports.minMaxArray = minMaxArray;
|
30
|
+
//# sourceMappingURL=minMaxArray.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"minMaxArray.js","sourceRoot":"","sources":["../../../src/utils/minMaxArray.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAWpB,MAAM,WAAW,GAAG,CACzB,KAAQ,EACR,EACE,GAAG,EACH,GAAG,MAID,EAAE,EACN,EAAE,CACF,CAAC,CAAC,KAAK,CACL,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EACd,CAAC,CAAM,EAAwC,EAAE,CAC/C,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,MAAM,IAAI,GAAG,CAAC,EACxD,aAAa,CACd,CAAC;AAfS,QAAA,WAAW,eAepB"}
|