@keetanetwork/anchor 0.0.64 → 0.0.65
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/lib/anchor-external.d.ts +236 -0
- package/lib/anchor-external.d.ts.map +1 -0
- package/lib/anchor-external.generated.d.ts +3 -0
- package/lib/anchor-external.generated.d.ts.map +1 -0
- package/lib/anchor-external.generated.js +209 -0
- package/lib/anchor-external.generated.js.map +1 -0
- package/lib/anchor-external.js +506 -0
- package/lib/anchor-external.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/utils/buffer.d.ts +4 -0
- package/lib/utils/buffer.d.ts.map +1 -1
- package/lib/utils/buffer.js +17 -0
- package/lib/utils/buffer.js.map +1 -1
- package/lib/utils/signing.d.ts +5 -0
- package/lib/utils/signing.d.ts.map +1 -1
- package/lib/utils/signing.js +1 -1
- package/lib/utils/signing.js.map +1 -1
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -1
- package/services/asset-movement/common.js +1 -1
- package/services/asset-movement/common.js.map +1 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import type { lib as KeetaNetLib } from '@keetanetwork/keetanet-client';
|
|
2
|
+
import { KeetaAnchorUserError } from './error.js';
|
|
3
|
+
type Account = InstanceType<typeof KeetaNetLib.Account>;
|
|
4
|
+
/**
|
|
5
|
+
* Current envelope format version.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ANCHOR_EXTERNAL_VERSION = 1;
|
|
8
|
+
/**
|
|
9
|
+
* Per-anchor entry.
|
|
10
|
+
*/
|
|
11
|
+
export type AnchorExternalEntry = {
|
|
12
|
+
/**
|
|
13
|
+
* Transaction id at the anchor.
|
|
14
|
+
*/
|
|
15
|
+
transactionId: string;
|
|
16
|
+
} | {
|
|
17
|
+
/**
|
|
18
|
+
* Persistent forwarding id at the anchor.
|
|
19
|
+
*/
|
|
20
|
+
persistentForwardingId: string;
|
|
21
|
+
} | {
|
|
22
|
+
/**
|
|
23
|
+
* Opaque destination data interpreted by the anchor (e.g. an EVM
|
|
24
|
+
* address for an EVM anchor).
|
|
25
|
+
*/
|
|
26
|
+
destination: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Replay-protection binding for a signed envelope.
|
|
30
|
+
*
|
|
31
|
+
* Pins the signature to a specific position on the signer's account
|
|
32
|
+
* chain so the same signed envelope cannot be reused on a different
|
|
33
|
+
* operation or block.
|
|
34
|
+
*/
|
|
35
|
+
export type AnchorExternalBinding = {
|
|
36
|
+
/**
|
|
37
|
+
* Block hash that the signer's account had as its head when the
|
|
38
|
+
* SEND carrying this envelope was constructed.
|
|
39
|
+
*/
|
|
40
|
+
previousBlockHash: string;
|
|
41
|
+
/**
|
|
42
|
+
* Index of the SEND operation within its block.
|
|
43
|
+
*/
|
|
44
|
+
operationIndex: number;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Decoded anchor-external envelope as exposed to callers.
|
|
48
|
+
*/
|
|
49
|
+
export type AnchorExternalEnvelope = {
|
|
50
|
+
/**
|
|
51
|
+
* Envelope format version.
|
|
52
|
+
*/
|
|
53
|
+
version: typeof ANCHOR_EXTERNAL_VERSION;
|
|
54
|
+
/**
|
|
55
|
+
* Per-anchor entries keyed by `Account.publicKeyString.get()`.
|
|
56
|
+
*/
|
|
57
|
+
anchors: {
|
|
58
|
+
[anchorPublicKey: string]: AnchorExternalEntry;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Signature binding. Present if the envelope is signed.
|
|
62
|
+
*/
|
|
63
|
+
binding?: AnchorExternalBinding;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Authenticity record attached to a verified signed envelope. Present only
|
|
67
|
+
* when the signature was verified and the signer appears in
|
|
68
|
+
* {@link AnchorExternalEnvelope.anchors}.
|
|
69
|
+
*/
|
|
70
|
+
export type AnchorExternalSigned = {
|
|
71
|
+
signer: Account;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Shape inspection result from {@link AnchorExternal.peek}.
|
|
75
|
+
*/
|
|
76
|
+
export type AnchorExternalPeekResult = {
|
|
77
|
+
encrypted: boolean;
|
|
78
|
+
signed: boolean;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Per-anchor entry as it appears in the encoded envelope.
|
|
82
|
+
*
|
|
83
|
+
* `t` = transaction id, `p` = persistent forwarding id, `d` = destination.
|
|
84
|
+
*
|
|
85
|
+
* Note: Single-letter keys keep the envelope smaller.
|
|
86
|
+
*/
|
|
87
|
+
export type EncodedAnchorExternalEntryV1 = {
|
|
88
|
+
t: string;
|
|
89
|
+
} | {
|
|
90
|
+
p: string;
|
|
91
|
+
} | {
|
|
92
|
+
d: string;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Replay-protection binding as it appears in the encoded envelope.
|
|
96
|
+
*
|
|
97
|
+
* `p` = previous block hash, `o` = operation index.
|
|
98
|
+
*/
|
|
99
|
+
export type EncodedAnchorExternalBindingV1 = {
|
|
100
|
+
p: string;
|
|
101
|
+
o: number;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Anchor-external envelope as it appears inside the encoded blob.
|
|
105
|
+
*
|
|
106
|
+
* `v` = envelope version, `a` = anchors, `b` = binding.
|
|
107
|
+
*/
|
|
108
|
+
export type EncodedAnchorExternalEnvelopeV1 = {
|
|
109
|
+
v: typeof ANCHOR_EXTERNAL_VERSION;
|
|
110
|
+
a: {
|
|
111
|
+
[anchorPublicKey: string]: EncodedAnchorExternalEntryV1;
|
|
112
|
+
};
|
|
113
|
+
b?: EncodedAnchorExternalBindingV1;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Error codes for anchor-external envelope operations.
|
|
117
|
+
*/
|
|
118
|
+
export declare const AnchorExternalErrorCodes: readonly ["BAD_BASE64", "NOT_AN_ENVELOPE", "UNSUPPORTED_VERSION", "NON_CANONICAL", "PLAINTEXT_TOO_LARGE", "BAD_SIGNATURE", "SIGNER_NOT_LISTED", "MISSING_BINDING", "UNEXPECTED_BINDING", "EXPECTED_PLAIN", "EXPECTED_ENCRYPTED", "OUTPUT_TOO_LARGE"];
|
|
119
|
+
export type AnchorExternalErrorCode = typeof AnchorExternalErrorCodes[number];
|
|
120
|
+
/**
|
|
121
|
+
* Error raised by anchor-external decode failures.
|
|
122
|
+
*/
|
|
123
|
+
export declare class AnchorExternalError extends KeetaAnchorUserError {
|
|
124
|
+
static readonly name: string;
|
|
125
|
+
private readonly anchorExternalErrorObjectTypeID;
|
|
126
|
+
private static readonly anchorExternalErrorObjectTypeID;
|
|
127
|
+
readonly code: AnchorExternalErrorCode;
|
|
128
|
+
/**
|
|
129
|
+
* Type-narrow an arbitrary string to {@link AnchorExternalErrorCode}.
|
|
130
|
+
*/
|
|
131
|
+
static isValidCode(code: string): code is AnchorExternalErrorCode;
|
|
132
|
+
constructor(code: AnchorExternalErrorCode, message: string);
|
|
133
|
+
static isInstance(input: unknown): input is AnchorExternalError;
|
|
134
|
+
toJSON(): ReturnType<KeetaAnchorUserError['toJSON']> & {
|
|
135
|
+
code: AnchorExternalErrorCode;
|
|
136
|
+
};
|
|
137
|
+
static fromJSON(input: unknown): Promise<AnchorExternalError>;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Fluent builder for constructing an anchor-external envelope and producing
|
|
141
|
+
* its encoded SEND.external string.
|
|
142
|
+
*/
|
|
143
|
+
export declare class AnchorExternalBuilder {
|
|
144
|
+
#private;
|
|
145
|
+
/**
|
|
146
|
+
* Set the entry for a given anchor, replacing any prior entry
|
|
147
|
+
* for the same anchor.
|
|
148
|
+
*/
|
|
149
|
+
setAnchor(anchor: Account, entry: AnchorExternalEntry): this;
|
|
150
|
+
/**
|
|
151
|
+
* Sign the produced envelope with the given account.
|
|
152
|
+
*/
|
|
153
|
+
withSigner(signer: Account): this;
|
|
154
|
+
/**
|
|
155
|
+
* Encrypt the produced envelope so each listed principal can decrypt
|
|
156
|
+
* it. Omit to leave the envelope as plaintext.
|
|
157
|
+
*/
|
|
158
|
+
withPrincipals(principals: Account[]): this;
|
|
159
|
+
/**
|
|
160
|
+
* Bind the produced signature to a position on the signer's
|
|
161
|
+
* account chain. Required whenever {@link withSigner} is used.
|
|
162
|
+
*
|
|
163
|
+
* @param previousBlockHash Block hash of the signer's current head.
|
|
164
|
+
* @param operationIndex Index of the SEND operation within its block.
|
|
165
|
+
*/
|
|
166
|
+
withBinding(previousBlockHash: string, operationIndex: number): this;
|
|
167
|
+
/**
|
|
168
|
+
* Set an upper bound on the encoded output length. {@link build}
|
|
169
|
+
* throws if the produced string would exceed this length.
|
|
170
|
+
*/
|
|
171
|
+
withMaxLength(maxLength: number): this;
|
|
172
|
+
/**
|
|
173
|
+
* Snapshot of the envelope as it would be encoded right now.
|
|
174
|
+
*/
|
|
175
|
+
toEnvelope(): AnchorExternalEnvelope;
|
|
176
|
+
/**
|
|
177
|
+
* Produce the encoded SEND.external string.
|
|
178
|
+
*
|
|
179
|
+
* @throws {@link KeetaAnchorError} on caller misuse.
|
|
180
|
+
*/
|
|
181
|
+
build(): Promise<string>;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Immutable, verified view of a parsed SEND.external envelope.
|
|
185
|
+
*/
|
|
186
|
+
export declare class AnchorExternal {
|
|
187
|
+
#private;
|
|
188
|
+
static readonly Builder: typeof AnchorExternalBuilder;
|
|
189
|
+
private constructor();
|
|
190
|
+
/**
|
|
191
|
+
* Decoded envelope.
|
|
192
|
+
*/
|
|
193
|
+
get envelope(): AnchorExternalEnvelope;
|
|
194
|
+
/**
|
|
195
|
+
* `true` if the source blob was encrypted.
|
|
196
|
+
*/
|
|
197
|
+
get encrypted(): boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Authenticity record for a verified signed envelope, or `undefined`
|
|
200
|
+
* if the envelope was not signed.
|
|
201
|
+
*/
|
|
202
|
+
get signed(): AnchorExternalSigned | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* Decode an external string asserted to be plaintext.
|
|
205
|
+
*
|
|
206
|
+
* @throws {@link AnchorExternalError} `EXPECTED_PLAIN` if the source blob is encrypted.
|
|
207
|
+
*/
|
|
208
|
+
static fromPlainExternal(external: string): Promise<AnchorExternal>;
|
|
209
|
+
/**
|
|
210
|
+
* Decode an external string asserted to be encrypted under one of the
|
|
211
|
+
* supplied principals.
|
|
212
|
+
*
|
|
213
|
+
* @throws {@link AnchorExternalError} `EXPECTED_ENCRYPTED` if the source blob is plaintext.
|
|
214
|
+
* @throws {@link KeetaAnchorError} if `principals` is empty.
|
|
215
|
+
*/
|
|
216
|
+
static fromEncryptedExternal(external: string, principals: Account[]): Promise<AnchorExternal>;
|
|
217
|
+
/**
|
|
218
|
+
* Inspect encrypted/signed flags of a candidate external string
|
|
219
|
+
* without reading plaintext or requiring a decryption key.
|
|
220
|
+
*/
|
|
221
|
+
static peek(external: string): Promise<AnchorExternalPeekResult>;
|
|
222
|
+
/**
|
|
223
|
+
* Create an {@link AnchorExternal} from a container.
|
|
224
|
+
*/
|
|
225
|
+
private static fromContainer;
|
|
226
|
+
/**
|
|
227
|
+
* Read the envelope from a container.
|
|
228
|
+
*/
|
|
229
|
+
private static readEnvelope;
|
|
230
|
+
/**
|
|
231
|
+
* Read the signed record from a container.
|
|
232
|
+
*/
|
|
233
|
+
private static readSigned;
|
|
234
|
+
}
|
|
235
|
+
export {};
|
|
236
|
+
//# sourceMappingURL=anchor-external.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchor-external.d.ts","sourceRoot":"","sources":["../../src/lib/anchor-external.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,IAAI,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAIxE,OAAO,EAAoB,oBAAoB,EAAkC,MAAM,YAAY,CAAC;AAIpG,KAAK,OAAO,GAAG,YAAY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,WAAW,CAAC,iBAAiB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI;IAWpE;;;OAGG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAStC;;OAEG;IACH,UAAU,IAAI,sBAAsB;IAapC;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;CAiC9B;AAMD;;GAEG;AACH,qBAAa,cAAc;;IAC1B,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,qBAAqB,CAAyB;IAM9E,OAAO;IAMP;;OAEG;IACH,IAAI,QAAQ,IAAI,sBAAsB,CAErC;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;;OAGG;IACH,IAAI,MAAM,IAAI,oBAAoB,GAAG,SAAS,CAE7C;IAED;;;;OAIG;WACU,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAwBzE;;;;;;OAMG;WACU,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC;IA6BpG;;;OAGG;WACU,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAmBtE;;OAEG;mBACkB,aAAa;IAOlC;;OAEG;mBACkB,YAAY;IAyCjC;;OAEG;mBACkB,UAAU;CAuC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchor-external.generated.d.ts","sourceRoot":"","sources":["../../src/lib/anchor-external.generated.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AAE5E,eAAO,MAAM,qCAAqC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,+BAAuF,CAAC"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import * as __typia_transform__accessExpressionAsString from "typia/lib/internal/_accessExpressionAsString.js";
|
|
2
|
+
import * as __typia_transform__assertGuard from "typia/lib/internal/_assertGuard.js";
|
|
3
|
+
import { createAssertEquals } from 'typia';
|
|
4
|
+
export const assertEncodedAnchorExternalEnvelopeV1 = (() => { const _io0 = (input, _exceptionable = true) => 1 === input.v && ("object" === typeof input.a && null !== input.a && false === Array.isArray(input.a) && _io1(input.a, true && _exceptionable)) && (undefined === input.b || "object" === typeof input.b && null !== input.b && _io5(input.b, true && _exceptionable)) && (2 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
5
|
+
if (["v", "a", "b"].some(prop => key === prop))
|
|
6
|
+
return true;
|
|
7
|
+
const value = input[key];
|
|
8
|
+
if (undefined === value)
|
|
9
|
+
return true;
|
|
10
|
+
return false;
|
|
11
|
+
})); const _io1 = (input, _exceptionable = true) => Object.keys(input).every(key => {
|
|
12
|
+
const value = input[key];
|
|
13
|
+
if (undefined === value)
|
|
14
|
+
return true;
|
|
15
|
+
return "object" === typeof value && null !== value && _iu0(value, true && _exceptionable);
|
|
16
|
+
}); const _io2 = (input, _exceptionable = true) => "string" === typeof input.t && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
17
|
+
if (["t"].some(prop => key === prop))
|
|
18
|
+
return true;
|
|
19
|
+
const value = input[key];
|
|
20
|
+
if (undefined === value)
|
|
21
|
+
return true;
|
|
22
|
+
return false;
|
|
23
|
+
})); const _io3 = (input, _exceptionable = true) => "string" === typeof input.p && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
24
|
+
if (["p"].some(prop => key === prop))
|
|
25
|
+
return true;
|
|
26
|
+
const value = input[key];
|
|
27
|
+
if (undefined === value)
|
|
28
|
+
return true;
|
|
29
|
+
return false;
|
|
30
|
+
})); const _io4 = (input, _exceptionable = true) => "string" === typeof input.d && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
31
|
+
if (["d"].some(prop => key === prop))
|
|
32
|
+
return true;
|
|
33
|
+
const value = input[key];
|
|
34
|
+
if (undefined === value)
|
|
35
|
+
return true;
|
|
36
|
+
return false;
|
|
37
|
+
})); const _io5 = (input, _exceptionable = true) => "string" === typeof input.p && "number" === typeof input.o && (2 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
38
|
+
if (["p", "o"].some(prop => key === prop))
|
|
39
|
+
return true;
|
|
40
|
+
const value = input[key];
|
|
41
|
+
if (undefined === value)
|
|
42
|
+
return true;
|
|
43
|
+
return false;
|
|
44
|
+
})); const _iu0 = (input, _exceptionable = true) => (() => {
|
|
45
|
+
if (undefined !== input.t)
|
|
46
|
+
return _io2(input, true && _exceptionable);
|
|
47
|
+
else if (undefined !== input.p)
|
|
48
|
+
return _io3(input, true && _exceptionable);
|
|
49
|
+
else if (undefined !== input.d)
|
|
50
|
+
return _io4(input, true && _exceptionable);
|
|
51
|
+
else
|
|
52
|
+
return false;
|
|
53
|
+
})(); const _ao0 = (input, _path, _exceptionable = true) => (1 === input.v || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
54
|
+
method: "createAssertEquals",
|
|
55
|
+
path: _path + ".v",
|
|
56
|
+
expected: "1",
|
|
57
|
+
value: input.v
|
|
58
|
+
}, _errorFactory)) && (("object" === typeof input.a && null !== input.a && false === Array.isArray(input.a) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
59
|
+
method: "createAssertEquals",
|
|
60
|
+
path: _path + ".a",
|
|
61
|
+
expected: "__type",
|
|
62
|
+
value: input.a
|
|
63
|
+
}, _errorFactory)) && _ao1(input.a, _path + ".a", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
64
|
+
method: "createAssertEquals",
|
|
65
|
+
path: _path + ".a",
|
|
66
|
+
expected: "__type",
|
|
67
|
+
value: input.a
|
|
68
|
+
}, _errorFactory)) && (undefined === input.b || ("object" === typeof input.b && null !== input.b || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
69
|
+
method: "createAssertEquals",
|
|
70
|
+
path: _path + ".b",
|
|
71
|
+
expected: "(EncodedAnchorExternalBindingV1 | undefined)",
|
|
72
|
+
value: input.b
|
|
73
|
+
}, _errorFactory)) && _ao5(input.b, _path + ".b", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
74
|
+
method: "createAssertEquals",
|
|
75
|
+
path: _path + ".b",
|
|
76
|
+
expected: "(EncodedAnchorExternalBindingV1 | undefined)",
|
|
77
|
+
value: input.b
|
|
78
|
+
}, _errorFactory)) && (2 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).every(key => {
|
|
79
|
+
if (["v", "a", "b"].some(prop => key === prop))
|
|
80
|
+
return true;
|
|
81
|
+
const value = input[key];
|
|
82
|
+
if (undefined === value)
|
|
83
|
+
return true;
|
|
84
|
+
return __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
85
|
+
method: "createAssertEquals",
|
|
86
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
87
|
+
expected: "undefined",
|
|
88
|
+
value: value
|
|
89
|
+
}, _errorFactory);
|
|
90
|
+
}))); const _ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
91
|
+
const value = input[key];
|
|
92
|
+
if (undefined === value)
|
|
93
|
+
return true;
|
|
94
|
+
return ("object" === typeof value && null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
95
|
+
method: "createAssertEquals",
|
|
96
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
97
|
+
expected: "(__type.o1 | __type.o2 | __type.o3)",
|
|
98
|
+
value: value
|
|
99
|
+
}, _errorFactory)) && _au0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
100
|
+
method: "createAssertEquals",
|
|
101
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
102
|
+
expected: "(__type.o1 | __type.o2 | __type.o3)",
|
|
103
|
+
value: value
|
|
104
|
+
}, _errorFactory);
|
|
105
|
+
}); const _ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.t || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
106
|
+
method: "createAssertEquals",
|
|
107
|
+
path: _path + ".t",
|
|
108
|
+
expected: "string",
|
|
109
|
+
value: input.t
|
|
110
|
+
}, _errorFactory)) && (1 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).every(key => {
|
|
111
|
+
if (["t"].some(prop => key === prop))
|
|
112
|
+
return true;
|
|
113
|
+
const value = input[key];
|
|
114
|
+
if (undefined === value)
|
|
115
|
+
return true;
|
|
116
|
+
return __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
117
|
+
method: "createAssertEquals",
|
|
118
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
119
|
+
expected: "undefined",
|
|
120
|
+
value: value
|
|
121
|
+
}, _errorFactory);
|
|
122
|
+
}))); const _ao3 = (input, _path, _exceptionable = true) => ("string" === typeof input.p || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
123
|
+
method: "createAssertEquals",
|
|
124
|
+
path: _path + ".p",
|
|
125
|
+
expected: "string",
|
|
126
|
+
value: input.p
|
|
127
|
+
}, _errorFactory)) && (1 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).every(key => {
|
|
128
|
+
if (["p"].some(prop => key === prop))
|
|
129
|
+
return true;
|
|
130
|
+
const value = input[key];
|
|
131
|
+
if (undefined === value)
|
|
132
|
+
return true;
|
|
133
|
+
return __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
134
|
+
method: "createAssertEquals",
|
|
135
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
136
|
+
expected: "undefined",
|
|
137
|
+
value: value
|
|
138
|
+
}, _errorFactory);
|
|
139
|
+
}))); const _ao4 = (input, _path, _exceptionable = true) => ("string" === typeof input.d || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
140
|
+
method: "createAssertEquals",
|
|
141
|
+
path: _path + ".d",
|
|
142
|
+
expected: "string",
|
|
143
|
+
value: input.d
|
|
144
|
+
}, _errorFactory)) && (1 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).every(key => {
|
|
145
|
+
if (["d"].some(prop => key === prop))
|
|
146
|
+
return true;
|
|
147
|
+
const value = input[key];
|
|
148
|
+
if (undefined === value)
|
|
149
|
+
return true;
|
|
150
|
+
return __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
151
|
+
method: "createAssertEquals",
|
|
152
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
153
|
+
expected: "undefined",
|
|
154
|
+
value: value
|
|
155
|
+
}, _errorFactory);
|
|
156
|
+
}))); const _ao5 = (input, _path, _exceptionable = true) => ("string" === typeof input.p || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
157
|
+
method: "createAssertEquals",
|
|
158
|
+
path: _path + ".p",
|
|
159
|
+
expected: "string",
|
|
160
|
+
value: input.p
|
|
161
|
+
}, _errorFactory)) && ("number" === typeof input.o || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
162
|
+
method: "createAssertEquals",
|
|
163
|
+
path: _path + ".o",
|
|
164
|
+
expected: "number",
|
|
165
|
+
value: input.o
|
|
166
|
+
}, _errorFactory)) && (2 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).every(key => {
|
|
167
|
+
if (["p", "o"].some(prop => key === prop))
|
|
168
|
+
return true;
|
|
169
|
+
const value = input[key];
|
|
170
|
+
if (undefined === value)
|
|
171
|
+
return true;
|
|
172
|
+
return __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
173
|
+
method: "createAssertEquals",
|
|
174
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
175
|
+
expected: "undefined",
|
|
176
|
+
value: value
|
|
177
|
+
}, _errorFactory);
|
|
178
|
+
}))); const _au0 = (input, _path, _exceptionable = true) => (() => {
|
|
179
|
+
if (undefined !== input.t)
|
|
180
|
+
return _ao2(input, _path, true && _exceptionable);
|
|
181
|
+
else if (undefined !== input.p)
|
|
182
|
+
return _ao3(input, _path, true && _exceptionable);
|
|
183
|
+
else if (undefined !== input.d)
|
|
184
|
+
return _ao4(input, _path, true && _exceptionable);
|
|
185
|
+
else
|
|
186
|
+
return __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
187
|
+
method: "createAssertEquals",
|
|
188
|
+
path: _path,
|
|
189
|
+
expected: "(__type.o1 | __type.o2 | __type.o3)",
|
|
190
|
+
value: input
|
|
191
|
+
}, _errorFactory);
|
|
192
|
+
})(); const __is = (input, _exceptionable = true) => "object" === typeof input && null !== input && _io0(input, true); let _errorFactory; return (input, errorFactory) => {
|
|
193
|
+
if (false === __is(input)) {
|
|
194
|
+
_errorFactory = errorFactory;
|
|
195
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || __typia_transform__assertGuard._assertGuard(true, {
|
|
196
|
+
method: "createAssertEquals",
|
|
197
|
+
path: _path + "",
|
|
198
|
+
expected: "EncodedAnchorExternalEnvelopeV1",
|
|
199
|
+
value: input
|
|
200
|
+
}, _errorFactory)) && _ao0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
201
|
+
method: "createAssertEquals",
|
|
202
|
+
path: _path + "",
|
|
203
|
+
expected: "EncodedAnchorExternalEnvelopeV1",
|
|
204
|
+
value: input
|
|
205
|
+
}, _errorFactory))(input, "$input", true);
|
|
206
|
+
}
|
|
207
|
+
return input;
|
|
208
|
+
}; })();
|
|
209
|
+
//# sourceMappingURL=anchor-external.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchor-external.generated.js","sourceRoot":"","sources":["../../src/lib/anchor-external.generated.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAG3C,MAAM,CAAC,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAA6G,CAAC","sourcesContent":["import { createAssertEquals } from 'typia';\nimport type { EncodedAnchorExternalEnvelopeV1 } from './anchor-external.js';\n\nexport const assertEncodedAnchorExternalEnvelopeV1: (input: unknown) => EncodedAnchorExternalEnvelopeV1 = createAssertEquals<EncodedAnchorExternalEnvelopeV1>();\n"]}
|