@settlemint/dalp-cli 2.1.7-main.23296648230 → 2.1.7-main.23299652388

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 (2) hide show
  1. package/dist/dalp.js +111 -28
  2. package/package.json +1 -1
package/dist/dalp.js CHANGED
@@ -54935,6 +54935,7 @@ init_zod();
54935
54935
  init_zod();
54936
54936
  init_zod();
54937
54937
  init_zod();
54938
+ init_zod();
54938
54939
 
54939
54940
  // ../../node_modules/.bun/iso-3166@4.4.0/node_modules/iso-3166/1.js
54940
54941
  var iso31661 = [
@@ -59697,7 +59698,8 @@ var accountSearchContract = v1Contract.route({
59697
59698
  successDescription: "List of accounts matching the search criteria",
59698
59699
  tags: ["account"]
59699
59700
  }).input(AccountSearchInputSchema).output(AccountSearchResultSchema.array());
59700
- var TimestampSchema = exports_external.preprocess((value22) => {
59701
+ var TimestampInputSchema = exports_external.union([exports_external.string(), exports_external.number(), exports_external.date()]);
59702
+ var TimestampSchema = TimestampInputSchema.pipe(exports_external.preprocess((value22) => {
59701
59703
  if (value22 instanceof Date) {
59702
59704
  return value22;
59703
59705
  }
@@ -59720,14 +59722,11 @@ var TimestampSchema = exports_external.preprocess((value22) => {
59720
59722
  }
59721
59723
  if (typeof value22 === "string") {
59722
59724
  const date6 = new Date(value22);
59723
- if (Number.isNaN(date6.getTime())) {
59724
- throw new TypeError("Invalid date string format");
59725
- }
59726
- return date6;
59725
+ return Number.isNaN(date6.getTime()) ? value22 : date6;
59727
59726
  }
59728
59727
  if (typeof value22 === "number") {
59729
59728
  if (value22 < 0) {
59730
- throw new Error("Timestamp cannot be negative");
59729
+ return value22;
59731
59730
  }
59732
59731
  if (value22 < 10000000000) {
59733
59732
  return new Date(value22 * 1000);
@@ -59738,7 +59737,7 @@ var TimestampSchema = exports_external.preprocess((value22) => {
59738
59737
  return new Date(value22);
59739
59738
  }
59740
59739
  return value22;
59741
- }, exports_external.date()).meta({
59740
+ }, exports_external.date())).meta({
59742
59741
  description: "A timestamp in various formats",
59743
59742
  examples: ["2023-04-01T12:00:00Z", 1680354000, "1680354000000"]
59744
59743
  });
@@ -59828,11 +59827,18 @@ var fixedYieldScheduleClaimContract = v1Contract.route({
59828
59827
  var BasisPointsSchema = exports_external.int("Basis points must be an integer").min(0, "Basis points cannot be negative").max(20000, "Basis points cannot exceed 20000 (200%)").meta({ description: "Basis points value between 0 and 20000 (0% to 200%)", examples: [100, 250, 500, 1000] });
59829
59828
  var basisPoints = () => BasisPointsSchema;
59830
59829
  var blocktime = (options = {}) => {
59831
- const base = timestamp().refine((date6) => {
59830
+ const base = exports_external.unknown().superRefine((value22, ctx) => {
59831
+ if (typeof value22 === "number" && value22 < 0) {
59832
+ ctx.addIssue({
59833
+ code: exports_external.ZodIssueCode.custom,
59834
+ message: "Timestamp cannot be negative"
59835
+ });
59836
+ }
59837
+ }).pipe(timestamp()).refine((date6) => {
59832
59838
  const time3 = getUnixTime(date6);
59833
59839
  return time3 >= 0;
59834
59840
  }, {
59835
- message: "Blocktime is out of valid range (must be >= Jan 1, 1970)"
59841
+ message: "Timestamp cannot be negative"
59836
59842
  }).transform((date6) => getUnixTime(date6).toString()).meta({
59837
59843
  description: "Unix timestamp in seconds for blockchain operations",
59838
59844
  examples: ["1704067200", "1735689600"]
@@ -71739,17 +71745,34 @@ var TokenApproveTransferInputSchema = TokenMutationInputSchema.extend({
71739
71745
  description: "Wallet address of the token recipient whose identity will be the toIdentity",
71740
71746
  examples: ["0x71C7656EC7ab88b098defB751B7401B5f6d8976F"]
71741
71747
  }),
71742
- amount: exports_external.string().refine((v) => /^\d+$/.test(v), "Amount must be a decimal digit string with no leading zeros, signs, spaces, or hex prefix").refine((v) => {
71743
- try {
71744
- return BigInt(v) > 0n;
71745
- } catch {
71746
- return false;
71747
- }
71748
- }, "Amount must be greater than zero").meta({
71748
+ fromIdentityAddress: ethereumAddress.optional().meta({
71749
+ description: "Identity contract address of the sender (overrides wallet→identity lookup)",
71750
+ examples: ["0x71C7656EC7ab88b098defB751B7401B5f6d8976F"]
71751
+ }),
71752
+ toIdentityAddress: ethereumAddress.optional().meta({
71753
+ description: "Identity contract address of the recipient (overrides wallet→identity lookup)",
71754
+ examples: ["0x71C7656EC7ab88b098defB751B7401B5f6d8976F"]
71755
+ }),
71756
+ amount: assetAmount.refine((v) => v > 0n, "Amount must be greater than zero").meta({
71749
71757
  description: "The exact token amount in base units as a decimal string (must be greater than zero)",
71750
71758
  examples: ["1000000000000000000"]
71751
71759
  })
71752
71760
  });
71761
+ function identityAddressPairRefinement(data2, ctx) {
71762
+ const hasFrom = data2.fromIdentityAddress !== undefined;
71763
+ const hasTo = data2.toIdentityAddress !== undefined;
71764
+ if (hasFrom !== hasTo) {
71765
+ ctx.addIssue({
71766
+ code: exports_external.ZodIssueCode.custom,
71767
+ message: "fromIdentityAddress and toIdentityAddress must both be provided or both omitted — partial overrides are not supported.",
71768
+ path: hasFrom ? ["toIdentityAddress"] : ["fromIdentityAddress"]
71769
+ });
71770
+ }
71771
+ }
71772
+ var TokenApproveTransferInputValidatedSchema = TokenApproveTransferInputSchema.superRefine(identityAddressPairRefinement);
71773
+ var TokenApproveTransferBodySchema = TokenApproveTransferInputSchema.omit({
71774
+ tokenAddress: true
71775
+ }).superRefine(identityAddressPairRefinement);
71753
71776
  var TokenRevokeTransferApprovalInputSchema = TokenMutationInputSchema.extend({
71754
71777
  fromWallet: ethereumAddress.meta({
71755
71778
  description: "Wallet address of the token sender whose identity will be the fromIdentity",
@@ -71759,17 +71782,23 @@ var TokenRevokeTransferApprovalInputSchema = TokenMutationInputSchema.extend({
71759
71782
  description: "Wallet address of the token recipient whose identity will be the toIdentity",
71760
71783
  examples: ["0x71C7656EC7ab88b098defB751B7401B5f6d8976F"]
71761
71784
  }),
71762
- amount: exports_external.string().refine((v) => /^\d+$/.test(v), "Amount must be a decimal digit string with no leading zeros, signs, spaces, or hex prefix").refine((v) => {
71763
- try {
71764
- return BigInt(v) > 0n;
71765
- } catch {
71766
- return false;
71767
- }
71768
- }, "Amount must be greater than zero").meta({
71785
+ fromIdentityAddress: ethereumAddress.optional().meta({
71786
+ description: "Identity contract address of the sender (overrides wallet→identity lookup)",
71787
+ examples: ["0x71C7656EC7ab88b098defB751B7401B5f6d8976F"]
71788
+ }),
71789
+ toIdentityAddress: ethereumAddress.optional().meta({
71790
+ description: "Identity contract address of the recipient (overrides wallet→identity lookup)",
71791
+ examples: ["0x71C7656EC7ab88b098defB751B7401B5f6d8976F"]
71792
+ }),
71793
+ amount: assetAmount.refine((v) => v > 0n, "Amount must be greater than zero").meta({
71769
71794
  description: "The exact token amount in base units as a decimal string (must be greater than zero)",
71770
71795
  examples: ["1000000000000000000"]
71771
71796
  })
71772
71797
  });
71798
+ var TokenRevokeTransferApprovalInputValidatedSchema = TokenRevokeTransferApprovalInputSchema.superRefine(identityAddressPairRefinement);
71799
+ var TokenRevokeTransferApprovalBodySchema = TokenRevokeTransferApprovalInputSchema.omit({
71800
+ tokenAddress: true
71801
+ }).superRefine(identityAddressPairRefinement);
71773
71802
  var COMPLIANCE = ["DALP-1001", "DALP-1005", "DALP-1006", "DALP-1027", "DALP-1055"];
71774
71803
  var FREEZE = ["DALP-1019", "DALP-1020", "DALP-1024", "DALP-1025", "DALP-1043"];
71775
71804
  var RECOVERY = ["DALP-1076", "DALP-1079", "DALP-4051"];
@@ -72009,14 +72038,14 @@ var approveTransfer = v2Contract.route({
72009
72038
  description: "Pre-approve a specific from→to transfer of a given amount on the TransferApproval compliance module. Must be called by a registered approval authority before the holder initiates the transfer.",
72010
72039
  successDescription: "Transfer approval recorded successfully.",
72011
72040
  tags: ["v2-token"]
72012
- }).meta({ contractErrors: [...COMMON_CONTRACT_ERRORS] }).input(v2Input.paramsBody(TokenReadInputSchema, TokenApproveTransferInputSchema.omit({ tokenAddress: true }))).output(mutationOutput);
72041
+ }).meta({ contractErrors: [...COMMON_CONTRACT_ERRORS] }).input(v2Input.paramsBody(TokenReadInputSchema, TokenApproveTransferBodySchema)).output(mutationOutput);
72013
72042
  var revokeTransferApproval = v2Contract.route({
72014
72043
  method: "POST",
72015
72044
  path: "/tokens/{tokenAddress}/transfer-approval-revocations",
72016
72045
  description: "Revoke a previously granted from→to transfer approval on the TransferApproval compliance module. Must be called by a registered approval authority.",
72017
72046
  successDescription: "Transfer approval revoked successfully.",
72018
72047
  tags: ["v2-token"]
72019
- }).meta({ contractErrors: [...COMMON_CONTRACT_ERRORS] }).input(v2Input.paramsBody(TokenReadInputSchema, TokenRevokeTransferApprovalInputSchema.omit({ tokenAddress: true }))).output(mutationOutput);
72048
+ }).meta({ contractErrors: [...COMMON_CONTRACT_ERRORS] }).input(v2Input.paramsBody(TokenReadInputSchema, TokenRevokeTransferApprovalBodySchema)).output(mutationOutput);
72020
72049
  var collectAumFee = v2Contract.route({
72021
72050
  method: "POST",
72022
72051
  path: "/tokens/{tokenAddress}/aum-fee/collections",
@@ -72619,6 +72648,52 @@ var TokenMetadataResponseSchema = exports_external.object({
72619
72648
  })
72620
72649
  }).nullable()
72621
72650
  });
72651
+ var TransferApprovalSchema = exports_external.object({
72652
+ id: exports_external.string().meta({
72653
+ description: "Unique approval ID: {moduleAddress}-{token}-{fromIdentity}-{toIdentity}-{value}",
72654
+ examples: ["0xabc...-0xtoken...-0xfrom...-0xto...-1000000000000000000"]
72655
+ }),
72656
+ token: exports_external.object({ id: ethereumAddress }),
72657
+ fromIdentity: exports_external.object({ id: ethereumAddress }),
72658
+ toIdentity: exports_external.object({ id: ethereumAddress }),
72659
+ value: assetAmount.meta({
72660
+ description: "Approved transfer amount in base units",
72661
+ examples: ["1000000000000000000"]
72662
+ }),
72663
+ approverIdentity: ethereumAddress,
72664
+ expiry: timestamp().meta({
72665
+ description: "Timestamp when approval expires. Epoch zero means no expiry.",
72666
+ examples: ["0", "1893456000"]
72667
+ }),
72668
+ status: exports_external.enum(["pending", "consumed", "revoked"]).meta({
72669
+ description: "Current status of the approval",
72670
+ examples: ["pending"]
72671
+ }),
72672
+ createdAt: timestamp().meta({
72673
+ description: "Timestamp when the approval was created",
72674
+ examples: ["2023-11-14T12:00:00.000Z"]
72675
+ }),
72676
+ updatedAt: timestamp().meta({
72677
+ description: "Timestamp of the last status-changing event",
72678
+ examples: ["2023-11-14T12:05:00.000Z"]
72679
+ })
72680
+ });
72681
+ var TransferApprovalsResponseSchema = exports_external.object({
72682
+ transferApprovals: exports_external.array(TransferApprovalSchema).meta({
72683
+ description: "List of transfer approvals ordered by creation time descending",
72684
+ examples: []
72685
+ }),
72686
+ totalCount: exports_external.number().int().nonnegative().meta({
72687
+ description: "Total number of transfer approvals for this token",
72688
+ examples: [3]
72689
+ })
72690
+ });
72691
+ var TransferApprovalsInputSchema = exports_external.object({
72692
+ tokenAddress: ethereumAddress.meta({
72693
+ description: "The token contract address",
72694
+ examples: ["0x71C7656EC7ab88b098defB751B7401B5f6d8976F"]
72695
+ })
72696
+ });
72622
72697
  var TokenActionsInputSchema2 = exports_external.object({
72623
72698
  tokenAddress: ethereumAddress.meta({
72624
72699
  description: "The token contract address to filter actions by",
@@ -72695,6 +72770,13 @@ var tokenMetadata = v2Contract.route({
72695
72770
  successDescription: "Token metadata entries retrieved successfully.",
72696
72771
  tags: ["v2-token"]
72697
72772
  }).input(v2Input.params(TokenMetadataInputSchema)).output(createSingleResponse(TokenMetadataResponseSchema));
72773
+ var transferApprovals = v2Contract.route({
72774
+ method: "GET",
72775
+ path: "/tokens/{tokenAddress}/transfer-approvals",
72776
+ description: "List transfer approvals created on the TransferApprovalComplianceModule for this token. Includes pending, consumed, and revoked approvals.",
72777
+ successDescription: "List of transfer approvals with their current status.",
72778
+ tags: ["v2-compliance"]
72779
+ }).input(v2Input.params(TransferApprovalsInputSchema)).output(createSingleResponse(TransferApprovalsResponseSchema));
72698
72780
  var tokenV2ReadsContract = {
72699
72781
  read: read25,
72700
72782
  allowance,
@@ -72705,7 +72787,8 @@ var tokenV2ReadsContract = {
72705
72787
  denominationAssets,
72706
72788
  compliance,
72707
72789
  features,
72708
- metadata: tokenMetadata
72790
+ metadata: tokenMetadata,
72791
+ transferApprovals
72709
72792
  };
72710
72793
  var statsBondStatus = v2Contract.route({
72711
72794
  method: "GET",
@@ -78511,7 +78594,7 @@ var timestampSerializer = {
78511
78594
  };
78512
78595
  var package_default = {
78513
78596
  name: "@settlemint/dalp-sdk",
78514
- version: "2.1.7-main.23296648230",
78597
+ version: "2.1.7-main.23299652388",
78515
78598
  private: false,
78516
78599
  description: "Fully typed SDK for the DALP tokenization platform API",
78517
78600
  homepage: "https://settlemint.com",
@@ -78654,7 +78737,7 @@ function createDalpClient(config3) {
78654
78737
  // package.json
78655
78738
  var package_default2 = {
78656
78739
  name: "@settlemint/dalp-cli",
78657
- version: "2.1.7-main.23296648230",
78740
+ version: "2.1.7-main.23299652388",
78658
78741
  private: false,
78659
78742
  description: "CLI for the Digital Asset Lifecycle Platform — manage tokens, identities, compliance, and more from the command line.",
78660
78743
  homepage: "https://settlemint.com",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@settlemint/dalp-cli",
3
- "version": "2.1.7-main.23296648230",
3
+ "version": "2.1.7-main.23299652388",
4
4
  "private": false,
5
5
  "description": "CLI for the Digital Asset Lifecycle Platform — manage tokens, identities, compliance, and more from the command line.",
6
6
  "homepage": "https://settlemint.com",