@canton-network/core-token-standard-service 2.0.0 → 2.1.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/index.js CHANGED
@@ -17,7 +17,7 @@ const KEY_MAPPING = {
17
17
  "allocation-request": "allocationRequest"
18
18
  };
19
19
  //#endregion
20
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
20
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/typeof.js
21
21
  function _typeof(o) {
22
22
  "@babel/helpers - typeof";
23
23
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -27,7 +27,7 @@ function _typeof(o) {
27
27
  }, _typeof(o);
28
28
  }
29
29
  //#endregion
30
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
30
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPrimitive.js
31
31
  function toPrimitive(t, r) {
32
32
  if ("object" != _typeof(t) || !t) return t;
33
33
  var e = t[Symbol.toPrimitive];
@@ -39,13 +39,13 @@ function toPrimitive(t, r) {
39
39
  return ("string" === r ? String : Number)(t);
40
40
  }
41
41
  //#endregion
42
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
42
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPropertyKey.js
43
43
  function toPropertyKey(t) {
44
44
  var i = toPrimitive(t, "string");
45
45
  return "symbol" == _typeof(i) ? i : i + "";
46
46
  }
47
47
  //#endregion
48
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
48
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/defineProperty.js
49
49
  function _defineProperty(e, r, t) {
50
50
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
51
51
  value: t,
@@ -623,7 +623,7 @@ var CoreService = class CoreService {
623
623
  currentSum = currentSum.plus(currentHoldingAmount);
624
624
  cIds.push(h.contractId);
625
625
  }
626
- if (currentSum.lessThan(amount)) throw new Error(`Sender doesn't have sufficient funds for this transfer. Missing amount: ${amount.minus(currentSum)}`);
626
+ if (currentSum.lessThan(amount)) throw new Error(`Sender doesn't have sufficient funds for this transfer. Missing amount: ${amount.minus(currentSum).toString()}`);
627
627
  if (cIds.length > 100) throw new Error(`Exceeded the maximum of 100 utxos in 1 transaction`);
628
628
  return cIds;
629
629
  }
@@ -810,6 +810,17 @@ var AllocationService = class AllocationService {
810
810
  }
811
811
  }, []];
812
812
  }
813
+ createAcceptAllocationInstruction(acceptCid, actors) {
814
+ return [{
815
+ templateId: ALLOCATION_INSTRUCTION_INTERFACE_ID_V2,
816
+ contractId: acceptCid,
817
+ choice: "AllocationInstruction_Accept",
818
+ choiceArgument: {
819
+ actors,
820
+ extraArgs: EMPTY_EXTRA_ARGS()
821
+ }
822
+ }, []];
823
+ }
813
824
  async createAllocationFromContext(factoryId, choiceArgs, choiceContext) {
814
825
  this.logger.debug("Creating transfer from pre-fetched context...");
815
826
  choiceArgs.extraArgs.context = {