@sorandomains/holder 0.4.0 → 0.5.1
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/README.md +14 -7
- package/dist/index.d.ts +37 -2
- package/dist/index.js +48 -3
- package/dist/native-allowlist.d.ts +21 -0
- package/dist/native-allowlist.js +34 -0
- package/dist/native-approver.d.ts +21 -0
- package/dist/native-approver.js +36 -0
- package/dist/native-auth.d.ts +31 -0
- package/dist/native-auth.js +85 -0
- package/dist/native-codec.d.ts +38 -0
- package/dist/native-codec.js +95 -0
- package/dist/native-holder.d.ts +42 -0
- package/dist/native-holder.js +252 -0
- package/dist/native-transport.d.ts +73 -0
- package/dist/native-transport.js +174 -0
- package/dist/native-types.d.ts +166 -0
- package/dist/native-types.js +98 -0
- package/package.json +2 -2
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { xdr } from "@stellar/stellar-sdk";
|
|
2
|
+
import { type PaymentDestination } from "./payment.js";
|
|
3
|
+
export type ClaimAdmission = {
|
|
4
|
+
type: "open";
|
|
5
|
+
} | {
|
|
6
|
+
type: "allowlist";
|
|
7
|
+
root: string;
|
|
8
|
+
} | {
|
|
9
|
+
type: "approval";
|
|
10
|
+
account: string;
|
|
11
|
+
};
|
|
12
|
+
export type ClaimSettings = {
|
|
13
|
+
mode: "manual" | "public";
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
admission: ClaimAdmission;
|
|
16
|
+
feeToken: string;
|
|
17
|
+
feeAmount: bigint;
|
|
18
|
+
feeRecipient: string;
|
|
19
|
+
walletLimit: bigint;
|
|
20
|
+
approvalAllowance: bigint;
|
|
21
|
+
approvalRateLimit: bigint;
|
|
22
|
+
approvalWindowSecs: bigint;
|
|
23
|
+
approvalTtlSecs: bigint;
|
|
24
|
+
};
|
|
25
|
+
export type ClaimConfig = {
|
|
26
|
+
settings: ClaimSettings;
|
|
27
|
+
ownerEpoch: bigint;
|
|
28
|
+
policyVersion: bigint;
|
|
29
|
+
grantEpoch: bigint;
|
|
30
|
+
};
|
|
31
|
+
export type RequestContext = {
|
|
32
|
+
network: string;
|
|
33
|
+
registry: string;
|
|
34
|
+
registrar: string;
|
|
35
|
+
namespace: string;
|
|
36
|
+
requestId: string;
|
|
37
|
+
validAfter: bigint;
|
|
38
|
+
deadline: bigint;
|
|
39
|
+
};
|
|
40
|
+
export type ClaimIntent = {
|
|
41
|
+
context: RequestContext;
|
|
42
|
+
label: string;
|
|
43
|
+
claimant: string;
|
|
44
|
+
destination: PaymentDestination;
|
|
45
|
+
resolver: string;
|
|
46
|
+
expectedGeneration: bigint | null;
|
|
47
|
+
expectedExpiry: bigint | null;
|
|
48
|
+
termSecs: bigint;
|
|
49
|
+
ownerEpoch: bigint;
|
|
50
|
+
policyVersion: bigint;
|
|
51
|
+
grantEpoch: bigint;
|
|
52
|
+
feeToken: string;
|
|
53
|
+
feeAmount: bigint;
|
|
54
|
+
feeRecipient: string;
|
|
55
|
+
};
|
|
56
|
+
export type ReservedIntent = {
|
|
57
|
+
context: RequestContext;
|
|
58
|
+
label: string;
|
|
59
|
+
holder: string;
|
|
60
|
+
destination: PaymentDestination;
|
|
61
|
+
resolver: string;
|
|
62
|
+
expectedGeneration: bigint | null;
|
|
63
|
+
expectedExpiry: bigint | null;
|
|
64
|
+
termSecs: bigint;
|
|
65
|
+
ownerEpoch: bigint;
|
|
66
|
+
policyVersion: bigint;
|
|
67
|
+
};
|
|
68
|
+
export type TransferIntent = {
|
|
69
|
+
context: RequestContext;
|
|
70
|
+
label: string;
|
|
71
|
+
from: string;
|
|
72
|
+
to: string;
|
|
73
|
+
expectedGeneration: bigint;
|
|
74
|
+
expectedExpiry: bigint;
|
|
75
|
+
proposalExpires: bigint;
|
|
76
|
+
destination: PaymentDestination;
|
|
77
|
+
resolver: string;
|
|
78
|
+
};
|
|
79
|
+
export type RenewIntent = {
|
|
80
|
+
context: RequestContext;
|
|
81
|
+
label: string;
|
|
82
|
+
holder: string;
|
|
83
|
+
expectedGeneration: bigint;
|
|
84
|
+
expectedExpiry: bigint;
|
|
85
|
+
termSecs: bigint;
|
|
86
|
+
minNewExpiry: bigint;
|
|
87
|
+
maxNewExpiry: bigint;
|
|
88
|
+
};
|
|
89
|
+
export type ClaimReceipt = {
|
|
90
|
+
operation: "claim" | "reserved" | "transfer" | "renew";
|
|
91
|
+
intentHash: string;
|
|
92
|
+
node: string;
|
|
93
|
+
holder: string;
|
|
94
|
+
generation: bigint;
|
|
95
|
+
expiresAt: bigint;
|
|
96
|
+
feeAmount: bigint;
|
|
97
|
+
feeToken: string;
|
|
98
|
+
feeRecipient: string | null;
|
|
99
|
+
ledger: number;
|
|
100
|
+
timestamp: bigint;
|
|
101
|
+
};
|
|
102
|
+
export type ClaimResult = {
|
|
103
|
+
status: "fresh" | "replayed";
|
|
104
|
+
receipt: ClaimReceipt;
|
|
105
|
+
};
|
|
106
|
+
export type ClaimUsage = {
|
|
107
|
+
publicClaims: bigint;
|
|
108
|
+
reservedIssues: bigint;
|
|
109
|
+
};
|
|
110
|
+
export type ApprovalUsage = {
|
|
111
|
+
total: bigint;
|
|
112
|
+
windowUsed: bigint;
|
|
113
|
+
windowEnds: bigint;
|
|
114
|
+
};
|
|
115
|
+
export type ClaimQuote = {
|
|
116
|
+
network: string;
|
|
117
|
+
registry: string;
|
|
118
|
+
registrar: string;
|
|
119
|
+
namespace: string;
|
|
120
|
+
resolver: string;
|
|
121
|
+
label: string;
|
|
122
|
+
node: string;
|
|
123
|
+
claimant: string;
|
|
124
|
+
config: ClaimConfig | null;
|
|
125
|
+
ownerEpoch: bigint;
|
|
126
|
+
policyVersion: bigint;
|
|
127
|
+
available: boolean;
|
|
128
|
+
reserved: boolean;
|
|
129
|
+
generation: bigint | null;
|
|
130
|
+
expiresAt: bigint | null;
|
|
131
|
+
termSecs: bigint;
|
|
132
|
+
now: bigint;
|
|
133
|
+
usage: ClaimUsage;
|
|
134
|
+
approvalUsage: ApprovalUsage;
|
|
135
|
+
};
|
|
136
|
+
export type DestinationPreview = {
|
|
137
|
+
node: string;
|
|
138
|
+
holder: string;
|
|
139
|
+
generation: bigint;
|
|
140
|
+
expiresAt: bigint;
|
|
141
|
+
active: boolean;
|
|
142
|
+
destination: PaymentDestination;
|
|
143
|
+
};
|
|
144
|
+
export declare function claimSettingsToScVal(value: ClaimSettings): xdr.ScVal;
|
|
145
|
+
export declare const claimPolicyInputToScVal: typeof claimSettingsToScVal;
|
|
146
|
+
export declare const claimLabelToScVal: (value: string) => xdr.ScVal;
|
|
147
|
+
export declare const claimConfigFromNative: (value: unknown) => ClaimConfig;
|
|
148
|
+
export declare const claimQuoteFromNative: (value: unknown) => ClaimQuote;
|
|
149
|
+
export declare const claimUsageFromNative: (value: unknown) => ClaimUsage;
|
|
150
|
+
export declare const approvalUsageFromNative: (value: unknown) => ApprovalUsage;
|
|
151
|
+
export declare const destinationPreviewFromNative: (value: unknown) => DestinationPreview;
|
|
152
|
+
export declare const claimReceiptFromNative: (value: unknown) => ClaimReceipt;
|
|
153
|
+
export declare function claimIntentToScVal(value: ClaimIntent): xdr.ScVal;
|
|
154
|
+
export declare function reservedIntentToScVal(value: ReservedIntent): xdr.ScVal;
|
|
155
|
+
export declare function transferIntentToScVal(value: TransferIntent): xdr.ScVal;
|
|
156
|
+
export declare function renewIntentToScVal(value: RenewIntent): xdr.ScVal;
|
|
157
|
+
export declare const claimIntentFromNative: (value: unknown) => ClaimIntent;
|
|
158
|
+
export declare const transferIntentFromNative: (value: unknown) => TransferIntent;
|
|
159
|
+
export declare const renewIntentFromNative: (value: unknown) => RenewIntent;
|
|
160
|
+
export declare function claimResultFromNative(value: unknown): ClaimResult;
|
|
161
|
+
export declare function nativeIntentHash(method: "claim" | "issue_reserved_with_destination" | "accept_transfer_with_destination" | "renew_holder", value: xdr.ScVal): string;
|
|
162
|
+
/** Lossless public recovery JSON; only declared bigint fields receive the tagged encoding. */
|
|
163
|
+
export declare function stringifyNativeIntent(value: ClaimIntent | TransferIntent | RenewIntent | ReservedIntent): string;
|
|
164
|
+
export declare function parseNativeClaimIntent(json: string): ClaimIntent;
|
|
165
|
+
export declare function parseNativeTransferIntent(json: string): TransferIntent;
|
|
166
|
+
export declare function parseNativeRenewIntent(json: string): RenewIntent;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { hash, scValToNative, xdr } from "@stellar/stellar-sdk";
|
|
2
|
+
import { destinationFromNative } from "./payment.js";
|
|
3
|
+
import { NativeClaimError, address, amount, bool, bytes32, exactObject, hex, hex32, label, paymentDestinationToScVal, sc, struct, u32, u64, unhex, utf8 } from "./native-codec.js";
|
|
4
|
+
const primitive = (validate, encode) => ({ encode: v => encode(validate(v)), decode: validate });
|
|
5
|
+
const U64 = primitive(v => u64(v, "u64 field"), sc.u64), U32 = primitive(v => u32(v, "u32 field"), sc.u32), AMOUNT = primitive(v => amount(v, "fee amount"), sc.i128), BOOL = primitive(v => bool(v, "boolean field"), sc.bool);
|
|
6
|
+
const ACCOUNT = primitive(v => address(v, "account", "account"), sc.address), CONTRACT = primitive(v => address(v, "contract", "contract"), sc.address), IDENTITY = primitive(v => address(v, "identity", "identity"), sc.address);
|
|
7
|
+
const HEX = { encode: v => sc.bytes(unhex(hex32(v, "bytes32 field"))), decode: v => hex(bytes32(v, "bytes32 field")) };
|
|
8
|
+
const LABEL = { encode: v => sc.bytes(utf8(label(v))), decode: v => { if (!(v instanceof Uint8Array))
|
|
9
|
+
throw new NativeClaimError("label must be on-chain Bytes"); return label(new TextDecoder("utf-8", { fatal: true }).decode(v)); } };
|
|
10
|
+
const DESTINATION = { encode: v => paymentDestinationToScVal(v), decode: destinationFromNative };
|
|
11
|
+
const optional = (inner) => ({ encode: v => v === null ? sc.option(null) : inner.encode(v), decode: v => v === null || v === undefined ? null : inner.decode(v) });
|
|
12
|
+
const enumeration = (mapping) => ({ encode: v => { if (typeof v !== "string" || !Object.hasOwn(mapping, v))
|
|
13
|
+
throw new NativeClaimError("unsupported enum value"); return xdr.ScVal.scvVec([sc.symbol(mapping[v])]); }, decode: v => { if (!Array.isArray(v) || v.length !== 1)
|
|
14
|
+
throw new NativeClaimError("invalid enum result"); const entry = Object.entries(mapping).find(([, tag]) => tag === v[0]); if (!entry)
|
|
15
|
+
throw new NativeClaimError("unknown enum tag"); return entry[0]; } });
|
|
16
|
+
const ADMISSION = { encode: v => { if (!v || typeof v !== "object")
|
|
17
|
+
throw new NativeClaimError("invalid admission"); const a = v; if (a.type === "open") {
|
|
18
|
+
exactObject(a, ["type"], "open admission");
|
|
19
|
+
return xdr.ScVal.scvVec([sc.symbol("Open")]);
|
|
20
|
+
} if (a.type === "allowlist") {
|
|
21
|
+
exactObject(a, ["type", "root"], "allowlist admission");
|
|
22
|
+
return xdr.ScVal.scvVec([sc.symbol("Allowlist"), HEX.encode(a.root)]);
|
|
23
|
+
} if (a.type === "approval") {
|
|
24
|
+
exactObject(a, ["type", "account"], "approval admission");
|
|
25
|
+
return xdr.ScVal.scvVec([sc.symbol("Approval"), ACCOUNT.encode(a.account)]);
|
|
26
|
+
} throw new NativeClaimError("unsupported admission"); }, decode: v => { if (!Array.isArray(v))
|
|
27
|
+
throw new NativeClaimError("invalid admission enum"); if (v.length === 1 && v[0] === "Open")
|
|
28
|
+
return { type: "open" }; if (v.length === 2 && v[0] === "Allowlist")
|
|
29
|
+
return { type: "allowlist", root: HEX.decode(v[1]) }; if (v.length === 2 && v[0] === "Approval")
|
|
30
|
+
return { type: "approval", account: ACCOUNT.decode(v[1]) }; throw new NativeClaimError("unknown admission enum"); } };
|
|
31
|
+
const snake = (s) => s.replace(/[A-Z]/g, c => "_" + c.toLowerCase());
|
|
32
|
+
function model(fields) { return { encode: v => { const value = exactObject(v, Object.keys(fields), "native input"); return struct(Object.fromEntries(Object.entries(fields).map(([name, codec]) => [snake(name), codec.encode(value[name])]))); }, decode: v => { const value = exactObject(v, Object.keys(fields).map(snake), "native result"); return Object.fromEntries(Object.entries(fields).map(([name, codec]) => [name, codec.decode(value[snake(name)])])); } }; }
|
|
33
|
+
const SETTINGS = model({ mode: enumeration({ manual: "Manual", public: "Public" }), enabled: BOOL, admission: ADMISSION, feeToken: CONTRACT, feeAmount: AMOUNT, feeRecipient: ACCOUNT, walletLimit: U64, approvalAllowance: U64, approvalRateLimit: U64, approvalWindowSecs: U64, approvalTtlSecs: U64 });
|
|
34
|
+
const CONFIG = model({ settings: SETTINGS, ownerEpoch: U64, policyVersion: U64, grantEpoch: U64 });
|
|
35
|
+
const CONTEXT = model({ network: HEX, registry: CONTRACT, registrar: CONTRACT, namespace: HEX, requestId: HEX, validAfter: U64, deadline: U64 });
|
|
36
|
+
const CLAIM = model({ context: CONTEXT, label: LABEL, claimant: ACCOUNT, destination: DESTINATION, resolver: CONTRACT, expectedGeneration: optional(U64), expectedExpiry: optional(U64), termSecs: U64, ownerEpoch: U64, policyVersion: U64, grantEpoch: U64, feeToken: CONTRACT, feeAmount: AMOUNT, feeRecipient: ACCOUNT });
|
|
37
|
+
const RESERVED = model({ context: CONTEXT, label: LABEL, holder: ACCOUNT, destination: DESTINATION, resolver: CONTRACT, expectedGeneration: optional(U64), expectedExpiry: optional(U64), termSecs: U64, ownerEpoch: U64, policyVersion: U64 });
|
|
38
|
+
const TRANSFER = model({ context: CONTEXT, label: LABEL, from: IDENTITY, to: ACCOUNT, expectedGeneration: U64, expectedExpiry: U64, proposalExpires: U64, destination: DESTINATION, resolver: CONTRACT });
|
|
39
|
+
const RENEW = model({ context: CONTEXT, label: LABEL, holder: ACCOUNT, expectedGeneration: U64, expectedExpiry: U64, termSecs: U64, minNewExpiry: U64, maxNewExpiry: U64 });
|
|
40
|
+
const USAGE = model({ publicClaims: U64, reservedIssues: U64 }), APPROVAL_USAGE = model({ total: U64, windowUsed: U64, windowEnds: U64 });
|
|
41
|
+
const CONFIG_STATE = { encode: v => v === null ? xdr.ScVal.scvVec([sc.symbol("Unconfigured")]) : xdr.ScVal.scvVec([sc.symbol("Configured"), CONFIG.encode(v)]), decode: v => { if (!Array.isArray(v))
|
|
42
|
+
throw new NativeClaimError("invalid claim config state"); if (v.length === 1 && v[0] === "Unconfigured")
|
|
43
|
+
return null; if (v.length === 2 && v[0] === "Configured")
|
|
44
|
+
return CONFIG.decode(v[1]); throw new NativeClaimError("invalid claim config state"); } };
|
|
45
|
+
const QUOTE = model({ network: HEX, registry: CONTRACT, registrar: CONTRACT, namespace: HEX, resolver: CONTRACT, label: LABEL, node: HEX, claimant: ACCOUNT, config: CONFIG_STATE, ownerEpoch: U64, policyVersion: U64, available: BOOL, reserved: BOOL, generation: optional(U64), expiresAt: optional(U64), termSecs: U64, now: U64, usage: USAGE, approvalUsage: APPROVAL_USAGE });
|
|
46
|
+
const RECEIPT = model({ operation: enumeration({ claim: "Claim", reserved: "Reserved", transfer: "Transfer", renew: "Renew" }), intentHash: HEX, node: HEX, holder: IDENTITY, generation: U64, expiresAt: U64, feeAmount: AMOUNT, feeToken: CONTRACT, feeRecipient: optional(ACCOUNT), ledger: U32, timestamp: U64 });
|
|
47
|
+
const PREVIEW = model({ node: HEX, holder: IDENTITY, generation: U64, expiresAt: U64, active: BOOL, destination: DESTINATION });
|
|
48
|
+
export function claimSettingsToScVal(value) {
|
|
49
|
+
const encoded = SETTINGS.encode(value);
|
|
50
|
+
if (value.admission.type === "approval") {
|
|
51
|
+
if (value.approvalAllowance === 0n || value.approvalRateLimit === 0n || value.approvalWindowSecs === 0n || value.approvalWindowSecs > 31536000n || value.approvalTtlSecs === 0n || value.approvalTtlSecs > 3600n)
|
|
52
|
+
throw new NativeClaimError("approval mode requires explicit bounded admission budgets, window and lifetime");
|
|
53
|
+
if (value.admission.account === value.feeRecipient)
|
|
54
|
+
throw new NativeClaimError("eligibility account must differ from fee treasury");
|
|
55
|
+
}
|
|
56
|
+
else if (value.approvalAllowance !== 0n || value.approvalRateLimit !== 0n || value.approvalWindowSecs !== 0n || value.approvalTtlSecs !== 0n)
|
|
57
|
+
throw new NativeClaimError("approval settings must be zero outside approval mode");
|
|
58
|
+
return encoded;
|
|
59
|
+
}
|
|
60
|
+
export const claimPolicyInputToScVal = claimSettingsToScVal;
|
|
61
|
+
export const claimLabelToScVal = (value) => LABEL.encode(value);
|
|
62
|
+
export const claimConfigFromNative = (value) => CONFIG.decode(value);
|
|
63
|
+
export const claimQuoteFromNative = (value) => QUOTE.decode(value);
|
|
64
|
+
export const claimUsageFromNative = (value) => USAGE.decode(value);
|
|
65
|
+
export const approvalUsageFromNative = (value) => APPROVAL_USAGE.decode(value);
|
|
66
|
+
export const destinationPreviewFromNative = (value) => PREVIEW.decode(value);
|
|
67
|
+
export const claimReceiptFromNative = (value) => RECEIPT.decode(value);
|
|
68
|
+
function validContext(c) { if (c.deadline <= c.validAfter || c.deadline - c.validAfter > 3600n)
|
|
69
|
+
throw new NativeClaimError("business intent lifetime must be positive and at most 3600 seconds"); }
|
|
70
|
+
export function claimIntentToScVal(value) { const result = CLAIM.encode(value); validContext(value.context); if ((value.expectedGeneration === null) !== (value.expectedExpiry === null))
|
|
71
|
+
throw new NativeClaimError("generation and expiry expectations must both be present or absent"); return result; }
|
|
72
|
+
export function reservedIntentToScVal(value) { const result = RESERVED.encode(value); validContext(value.context); if ((value.expectedGeneration === null) !== (value.expectedExpiry === null))
|
|
73
|
+
throw new NativeClaimError("generation and expiry expectations must both be present or absent"); return result; }
|
|
74
|
+
export function transferIntentToScVal(value) { const result = TRANSFER.encode(value); validContext(value.context); return result; }
|
|
75
|
+
export function renewIntentToScVal(value) { const result = RENEW.encode(value); validContext(value.context); if (value.termSecs === 0n || value.maxNewExpiry < value.minNewExpiry)
|
|
76
|
+
throw new NativeClaimError("invalid renewal bounds"); return result; }
|
|
77
|
+
export const claimIntentFromNative = (value) => CLAIM.decode(value);
|
|
78
|
+
export const transferIntentFromNative = (value) => TRANSFER.decode(value);
|
|
79
|
+
export const renewIntentFromNative = (value) => RENEW.decode(value);
|
|
80
|
+
export function claimResultFromNative(value) { if (!Array.isArray(value) || value.length !== 2 || !["Fresh", "Replayed"].includes(value[0]))
|
|
81
|
+
throw new NativeClaimError("invalid claim result"); return { status: value[0] === "Fresh" ? "fresh" : "replayed", receipt: claimReceiptFromNative(value[1]) }; }
|
|
82
|
+
export function nativeIntentHash(method, value) { return hex(hash(xdr.ScVal.scvVec([sc.symbol(method), value]).toXDR())); }
|
|
83
|
+
/** Lossless public recovery JSON; only declared bigint fields receive the tagged encoding. */
|
|
84
|
+
export function stringifyNativeIntent(value) { return JSON.stringify(value, (_key, v) => typeof v === "bigint" ? { $u64: v.toString() } : v); }
|
|
85
|
+
export function parseNativeClaimIntent(json) { if (json.length > 16384)
|
|
86
|
+
throw new NativeClaimError("claim recovery reference is too large"); const raw = JSON.parse(json, (_key, v) => { if (v && typeof v === "object" && !Array.isArray(v) && Object.keys(v).join(",") === "$u64") {
|
|
87
|
+
if (typeof v.$u64 !== "string" || !/^(0|[1-9][0-9]*)$/.test(v.$u64))
|
|
88
|
+
throw new NativeClaimError("invalid recovery integer");
|
|
89
|
+
return BigInt(v.$u64);
|
|
90
|
+
} return v; }); return claimIntentFromNative(scValToNative(claimIntentToScVal(raw))); }
|
|
91
|
+
export function parseNativeTransferIntent(json) { return parseLifecycleIntent(json, TRANSFER, transferIntentToScVal); }
|
|
92
|
+
export function parseNativeRenewIntent(json) { return parseLifecycleIntent(json, RENEW, renewIntentToScVal); }
|
|
93
|
+
function parseLifecycleIntent(json, codec, encode) { if (json.length > 16384)
|
|
94
|
+
throw new NativeClaimError("lifecycle intent is too large"); const raw = JSON.parse(json, (_key, v) => { if (v && typeof v === "object" && !Array.isArray(v) && Object.keys(v).join(",") === "$u64") {
|
|
95
|
+
if (typeof v.$u64 !== "string" || !/^(0|[1-9][0-9]*)$/.test(v.$u64))
|
|
96
|
+
throw new NativeClaimError("invalid recovery integer");
|
|
97
|
+
return BigInt(v.$u64);
|
|
98
|
+
} return v; }); return codec.decode(scValToNative(encode(raw))); }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sorandomains/holder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Manage your own Soran name on Stellar \u2014 records, profile, reverse, primary, and transfers, signed by your key.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"typecheck": "tsc --noEmit",
|
|
20
20
|
"prepublishOnly": "tsc",
|
|
21
21
|
"check:browser": "esbuild dist/index.js --bundle --platform=browser --external:@stellar/stellar-sdk --outfile=browser-check.js --legal-comments=none --log-level=error && node -e \"const fs=require('fs');const s=fs.readFileSync('browser-check.js','utf8');fs.unlinkSync('browser-check.js');if(/\\bBuffer\\b/.test(s)){console.error('FAIL: bare Buffer reference in browser bundle');process.exit(1)}console.log('browser bundle clean')\"",
|
|
22
|
-
"test": "node --import tsx test/decode-failure.test.mts && node --import tsx --test test/
|
|
22
|
+
"test": "node --import tsx test/decode-failure.test.mts && node --import tsx --test test/integration.test.mts test/payment.test.mts test/muxed.test.mts test/native-*.test.mts"
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"repository": {
|