@morpho-org/morpho-sdk 6.0.0-next.0 → 6.0.0-next.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.
Files changed (205) hide show
  1. package/MIGRATION-v5-to-v6.md +206 -3
  2. package/README.md +81 -41
  3. package/lib/cjs/abis.d.ts +210 -0
  4. package/lib/cjs/abis.js +142 -2
  5. package/lib/cjs/actions/blue/borrow.d.ts +1 -1
  6. package/lib/cjs/actions/blue/borrow.js +1 -1
  7. package/lib/cjs/actions/blue/common.d.ts +6 -19
  8. package/lib/cjs/actions/blue/common.js +25 -138
  9. package/lib/cjs/actions/blue/refinance.d.ts +1 -1
  10. package/lib/cjs/actions/blue/refinance.js +1 -1
  11. package/lib/cjs/actions/blue/repay.d.ts +3 -3
  12. package/lib/cjs/actions/blue/repay.js +1 -1
  13. package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +3 -3
  14. package/lib/cjs/actions/blue/repayWithdrawCollateral.js +1 -1
  15. package/lib/cjs/actions/blue/supply.d.ts +3 -3
  16. package/lib/cjs/actions/blue/supply.js +1 -1
  17. package/lib/cjs/actions/blue/supplyCollateral.d.ts +3 -3
  18. package/lib/cjs/actions/blue/supplyCollateral.js +1 -1
  19. package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +3 -3
  20. package/lib/cjs/actions/blue/supplyCollateralBorrow.js +1 -1
  21. package/lib/cjs/actions/blue/withdraw.d.ts +1 -1
  22. package/lib/cjs/actions/blue/withdraw.js +1 -1
  23. package/lib/cjs/actions/blue/withdrawCollateral.d.ts +1 -1
  24. package/lib/cjs/actions/blue/withdrawCollateral.js +1 -1
  25. package/lib/cjs/actions/bundles/common.d.ts +200 -0
  26. package/lib/cjs/actions/bundles/common.js +469 -0
  27. package/lib/cjs/actions/bundles/index.d.ts +3 -0
  28. package/lib/cjs/actions/bundles/index.js +23 -0
  29. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
  30. package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +125 -0
  31. package/lib/cjs/actions/index.d.ts +1 -0
  32. package/lib/cjs/actions/index.js +1 -0
  33. package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
  34. package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
  35. package/lib/cjs/actions/midnight/takeBorrow.d.ts +2 -2
  36. package/lib/cjs/actions/midnight/takeBorrow.js +2 -2
  37. package/lib/cjs/actions/midnight/takeLend.d.ts +2 -2
  38. package/lib/cjs/actions/midnight/takeLend.js +2 -2
  39. package/lib/cjs/actions/requirements/blue/getUnusedPermit2Nonce.d.ts +1 -1
  40. package/lib/cjs/actions/requirements/blue/getUnusedPermit2Nonce.js +1 -1
  41. package/lib/cjs/actions/requirements/blue/index.d.ts +0 -1
  42. package/lib/cjs/actions/requirements/blue/index.js +0 -1
  43. package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +1 -1
  44. package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
  45. package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +2 -1
  46. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +3 -3
  47. package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +10 -4
  48. package/lib/{esm/actions/requirements/encode/encodeErc20Permit2TransferFrom.d.ts → cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts} +12 -12
  49. package/lib/cjs/actions/requirements/encode/{encodeErc20Permit2TransferFrom.js → encodeErc20Permit2SignatureTransfer.js} +13 -13
  50. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -4
  51. package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +6 -5
  52. package/lib/cjs/actions/requirements/encode/index.d.ts +1 -1
  53. package/lib/cjs/actions/requirements/encode/index.js +1 -1
  54. package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +4 -3
  55. package/lib/cjs/actions/requirements/getRequirementsApproval.js +4 -3
  56. package/lib/cjs/actions/signatures/getTokenRequirementActions.js +2 -2
  57. package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +22 -30
  58. package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +18 -66
  59. package/lib/cjs/actions/vaultV1/deposit.d.ts +73 -57
  60. package/lib/cjs/actions/vaultV1/deposit.js +110 -109
  61. package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +43 -66
  62. package/lib/cjs/actions/vaultV1/migrateToV2.js +91 -104
  63. package/lib/cjs/actions/vaultV1/redeem.d.ts +30 -23
  64. package/lib/cjs/actions/vaultV1/redeem.js +56 -33
  65. package/lib/cjs/actions/vaultV1/withdraw.d.ts +58 -24
  66. package/lib/cjs/actions/vaultV1/withdraw.js +86 -34
  67. package/lib/cjs/actions/vaultV2/deposit.d.ts +74 -57
  68. package/lib/cjs/actions/vaultV2/deposit.js +111 -109
  69. package/lib/cjs/actions/vaultV2/redeem.d.ts +30 -24
  70. package/lib/cjs/actions/vaultV2/redeem.js +56 -34
  71. package/lib/cjs/actions/vaultV2/withdraw.d.ts +58 -25
  72. package/lib/cjs/actions/vaultV2/withdraw.js +86 -35
  73. package/lib/cjs/entities/blue/blue.d.ts +19 -19
  74. package/lib/cjs/entities/blue/blue.js +3 -1
  75. package/lib/cjs/entities/index.d.ts +1 -0
  76. package/lib/cjs/entities/index.js +15 -0
  77. package/lib/cjs/entities/midnight/midnight.d.ts +2 -2
  78. package/lib/cjs/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.d.ts → entities/requirements/getBundlesTokenRequirements.d.ts} +21 -14
  79. package/lib/cjs/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.js → entities/requirements/getBundlesTokenRequirements.js} +61 -65
  80. package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
  81. package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +74 -0
  82. package/lib/cjs/entities/requirements/index.d.ts +1 -0
  83. package/lib/cjs/entities/requirements/index.js +17 -0
  84. package/lib/cjs/entities/vaultV1/vaultV1.d.ts +348 -98
  85. package/lib/cjs/entities/vaultV1/vaultV1.js +322 -120
  86. package/lib/cjs/entities/vaultV2/vaultV2.d.ts +221 -68
  87. package/lib/cjs/entities/vaultV2/vaultV2.js +219 -77
  88. package/lib/cjs/helpers/index.d.ts +2 -1
  89. package/lib/cjs/helpers/index.js +5 -1
  90. package/lib/cjs/helpers/referralFee.d.ts +21 -0
  91. package/lib/cjs/helpers/referralFee.js +35 -0
  92. package/lib/cjs/helpers/slippage.d.ts +90 -1
  93. package/lib/cjs/helpers/slippage.js +123 -0
  94. package/lib/cjs/helpers/validate.d.ts +2 -0
  95. package/lib/cjs/helpers/validate.js +12 -1
  96. package/lib/cjs/helpers/validateRequirementSpender.d.ts +1 -1
  97. package/lib/cjs/helpers/validateRequirementSpender.js +1 -0
  98. package/lib/cjs/index.d.ts +1 -0
  99. package/lib/cjs/index.js +1 -0
  100. package/lib/cjs/types/action.d.ts +179 -70
  101. package/lib/cjs/types/action.js +12 -12
  102. package/lib/cjs/types/error.d.ts +62 -14
  103. package/lib/cjs/types/error.js +88 -22
  104. package/lib/esm/abis.d.ts +210 -0
  105. package/lib/esm/abis.js +140 -0
  106. package/lib/esm/actions/blue/borrow.d.ts +1 -1
  107. package/lib/esm/actions/blue/borrow.js +1 -1
  108. package/lib/esm/actions/blue/common.d.ts +6 -19
  109. package/lib/esm/actions/blue/common.js +27 -140
  110. package/lib/esm/actions/blue/refinance.d.ts +1 -1
  111. package/lib/esm/actions/blue/refinance.js +1 -1
  112. package/lib/esm/actions/blue/repay.d.ts +3 -3
  113. package/lib/esm/actions/blue/repay.js +1 -1
  114. package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +3 -3
  115. package/lib/esm/actions/blue/repayWithdrawCollateral.js +1 -1
  116. package/lib/esm/actions/blue/supply.d.ts +3 -3
  117. package/lib/esm/actions/blue/supply.js +1 -1
  118. package/lib/esm/actions/blue/supplyCollateral.d.ts +3 -3
  119. package/lib/esm/actions/blue/supplyCollateral.js +1 -1
  120. package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +3 -3
  121. package/lib/esm/actions/blue/supplyCollateralBorrow.js +1 -1
  122. package/lib/esm/actions/blue/withdraw.d.ts +1 -1
  123. package/lib/esm/actions/blue/withdraw.js +1 -1
  124. package/lib/esm/actions/blue/withdrawCollateral.d.ts +1 -1
  125. package/lib/esm/actions/blue/withdrawCollateral.js +1 -1
  126. package/lib/esm/actions/bundles/common.d.ts +200 -0
  127. package/lib/esm/actions/bundles/common.js +457 -0
  128. package/lib/esm/actions/bundles/index.d.ts +3 -0
  129. package/lib/esm/actions/bundles/index.js +2 -0
  130. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
  131. package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +121 -0
  132. package/lib/esm/actions/index.d.ts +1 -0
  133. package/lib/esm/actions/index.js +1 -0
  134. package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
  135. package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
  136. package/lib/esm/actions/midnight/takeBorrow.d.ts +2 -2
  137. package/lib/esm/actions/midnight/takeBorrow.js +2 -2
  138. package/lib/esm/actions/midnight/takeLend.d.ts +2 -2
  139. package/lib/esm/actions/midnight/takeLend.js +2 -2
  140. package/lib/esm/actions/requirements/blue/getUnusedPermit2Nonce.d.ts +1 -1
  141. package/lib/esm/actions/requirements/blue/getUnusedPermit2Nonce.js +1 -1
  142. package/lib/esm/actions/requirements/blue/index.d.ts +0 -1
  143. package/lib/esm/actions/requirements/blue/index.js +0 -1
  144. package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +1 -1
  145. package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
  146. package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +2 -1
  147. package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +3 -3
  148. package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +10 -4
  149. package/lib/{cjs/actions/requirements/encode/encodeErc20Permit2TransferFrom.d.ts → esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts} +12 -12
  150. package/lib/esm/actions/requirements/encode/{encodeErc20Permit2TransferFrom.js → encodeErc20Permit2SignatureTransfer.js} +11 -11
  151. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -4
  152. package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +6 -5
  153. package/lib/esm/actions/requirements/encode/index.d.ts +1 -1
  154. package/lib/esm/actions/requirements/encode/index.js +1 -1
  155. package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +4 -3
  156. package/lib/esm/actions/requirements/getRequirementsApproval.js +4 -3
  157. package/lib/esm/actions/signatures/getTokenRequirementActions.js +3 -3
  158. package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +22 -30
  159. package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +19 -67
  160. package/lib/esm/actions/vaultV1/deposit.d.ts +73 -57
  161. package/lib/esm/actions/vaultV1/deposit.js +112 -111
  162. package/lib/esm/actions/vaultV1/migrateToV2.d.ts +43 -66
  163. package/lib/esm/actions/vaultV1/migrateToV2.js +93 -106
  164. package/lib/esm/actions/vaultV1/redeem.d.ts +30 -23
  165. package/lib/esm/actions/vaultV1/redeem.js +56 -33
  166. package/lib/esm/actions/vaultV1/withdraw.d.ts +58 -24
  167. package/lib/esm/actions/vaultV1/withdraw.js +86 -34
  168. package/lib/esm/actions/vaultV2/deposit.d.ts +74 -57
  169. package/lib/esm/actions/vaultV2/deposit.js +113 -111
  170. package/lib/esm/actions/vaultV2/redeem.d.ts +30 -24
  171. package/lib/esm/actions/vaultV2/redeem.js +56 -34
  172. package/lib/esm/actions/vaultV2/withdraw.d.ts +58 -25
  173. package/lib/esm/actions/vaultV2/withdraw.js +86 -35
  174. package/lib/esm/entities/blue/blue.d.ts +19 -19
  175. package/lib/esm/entities/blue/blue.js +4 -2
  176. package/lib/esm/entities/index.d.ts +1 -0
  177. package/lib/esm/entities/index.js +1 -0
  178. package/lib/esm/entities/midnight/midnight.d.ts +2 -2
  179. package/lib/esm/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.d.ts → entities/requirements/getBundlesTokenRequirements.d.ts} +21 -14
  180. package/lib/esm/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.js → entities/requirements/getBundlesTokenRequirements.js} +51 -55
  181. package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
  182. package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +70 -0
  183. package/lib/esm/entities/requirements/index.d.ts +1 -0
  184. package/lib/esm/entities/requirements/index.js +1 -0
  185. package/lib/esm/entities/vaultV1/vaultV1.d.ts +348 -98
  186. package/lib/esm/entities/vaultV1/vaultV1.js +326 -124
  187. package/lib/esm/entities/vaultV2/vaultV2.d.ts +221 -68
  188. package/lib/esm/entities/vaultV2/vaultV2.js +222 -80
  189. package/lib/esm/helpers/index.d.ts +2 -1
  190. package/lib/esm/helpers/index.js +2 -1
  191. package/lib/esm/helpers/referralFee.d.ts +21 -0
  192. package/lib/esm/helpers/referralFee.js +31 -0
  193. package/lib/esm/helpers/slippage.d.ts +90 -1
  194. package/lib/esm/helpers/slippage.js +122 -2
  195. package/lib/esm/helpers/validate.d.ts +2 -0
  196. package/lib/esm/helpers/validate.js +11 -1
  197. package/lib/esm/helpers/validateRequirementSpender.d.ts +1 -1
  198. package/lib/esm/helpers/validateRequirementSpender.js +1 -0
  199. package/lib/esm/index.d.ts +1 -0
  200. package/lib/esm/index.js +1 -0
  201. package/lib/esm/types/action.d.ts +179 -70
  202. package/lib/esm/types/action.js +11 -11
  203. package/lib/esm/types/error.d.ts +62 -14
  204. package/lib/esm/types/error.js +80 -16
  205. package/package.json +3 -3
@@ -7,21 +7,8 @@ const viem_1 = require("viem");
7
7
  const index_js_1 = require("../../helpers/index.js");
8
8
  const validate_js_1 = require("../../helpers/validate.js");
9
9
  const index_js_2 = require("../../types/index.js");
10
- /**
11
- * BlueBundlesV1 token-permit discriminator carried in the encoded permit struct: `none` (0) skips
12
- * the pull, `erc2612` (1) is an ERC-2612 permit, `permit2TransferFrom` (2) is a Permit2
13
- * SignatureTransfer. Named so a transposed literal can't silently route a permit to the wrong branch.
14
- * @internal
15
- */
16
- const BLUE_BUNDLES_V1_TOKEN_PERMIT_KIND = {
17
- none: 0,
18
- erc2612: 1,
19
- permit2TransferFrom: 2,
20
- };
21
- const EMPTY_TOKEN_PERMIT = {
22
- kind: BLUE_BUNDLES_V1_TOKEN_PERMIT_KIND.none,
23
- data: "0x",
24
- };
10
+ const common_js_1 = require("../bundles/common.js");
11
+ const index_js_3 = require("../bundles/index.js");
25
12
  const EMPTY_SIGNED_AUTHORIZATION = {
26
13
  signature: { v: 0, r: viem_1.zeroHash, s: viem_1.zeroHash },
27
14
  nonce: 0n,
@@ -29,35 +16,10 @@ const EMPTY_SIGNED_AUTHORIZATION = {
29
16
  };
30
17
  /** @internal */
31
18
  const normalizeBlueBundlesV1CommonParams = (params) => {
32
- if (params.deadline <= 0n) {
33
- throw new index_js_2.NonPositiveInputError("deadline", params.deadline);
34
- }
35
- if (params.deadline > viem_1.maxUint256) {
36
- throw new index_js_2.InputExceedsMaxError({
37
- field: "deadline",
38
- value: params.deadline,
39
- max: viem_1.maxUint256,
40
- });
41
- }
42
- const referralFeePct = params.referralFeePct ?? 0n;
43
- if (referralFeePct < 0n) {
44
- throw new index_js_2.NegativeInputError("referralFeePct", referralFeePct);
45
- }
46
- if (referralFeePct >= blue_sdk_1.MathLib.WAD) {
47
- throw new index_js_2.InputExceedsMaxError({
48
- field: "referralFeePct",
49
- value: referralFeePct,
50
- max: blue_sdk_1.MathLib.WAD - 1n,
51
- });
52
- }
53
- if (referralFeePct > 0n &&
54
- (params.referralFeeRecipient == null ||
55
- (0, viem_1.isAddressEqual)(params.referralFeeRecipient, viem_1.zeroAddress))) {
56
- throw new index_js_2.MissingReferralFeeRecipientError();
57
- }
19
+ const normalized = (0, common_js_1.normalizeBundlesCommonParams)(params);
58
20
  return {
59
- referralFeePct,
60
- referralFeeRecipient: params.referralFeeRecipient ?? viem_1.zeroAddress,
21
+ referralFeePct: normalized.referralFeePct,
22
+ referralFeeRecipient: normalized.referralFeeRecipient,
61
23
  };
62
24
  };
63
25
  exports.normalizeBlueBundlesV1CommonParams = normalizeBlueBundlesV1CommonParams;
@@ -81,88 +43,13 @@ const validateBlueBundlesV1NativeFunding = (params) => {
81
43
  exports.validateBlueBundlesV1NativeFunding = validateBlueBundlesV1NativeFunding;
82
44
  /** @internal */
83
45
  const getBlueBundlesV1TokenPermit = (params) => {
84
- const { requirementSignature } = params;
85
- if (requirementSignature == null)
86
- return EMPTY_TOKEN_PERMIT;
87
- const spender = (0, morpho_ts_1.getChainAddress)(params.chainId, "bundles.blueBundlesV1");
88
- if (!(0, viem_1.isAddressEqual)(requirementSignature.args.owner, params.userAddress)) {
89
- throw new index_js_2.DepositOwnerMismatchError(params.userAddress, requirementSignature.args.owner);
90
- }
91
- if (!(0, viem_1.isAddressEqual)(requirementSignature.args.asset, params.token)) {
92
- throw new index_js_2.DepositAssetMismatchError(params.token, requirementSignature.args.asset);
93
- }
94
- if (requirementSignature.args.amount !== params.amount) {
95
- throw new index_js_2.DepositAmountMismatchError(params.amount, requirementSignature.args.amount);
96
- }
97
- if (!(0, viem_1.isAddressEqual)(requirementSignature.action.args.spender, spender)) {
98
- throw new index_js_2.DepositSpenderMismatchError(spender, requirementSignature.action.args.spender);
99
- }
100
- if (requirementSignature.action.args.amount !== params.amount) {
101
- throw new index_js_2.DepositAmountMismatchError(params.amount, requirementSignature.action.args.amount);
102
- }
103
- if (requirementSignature.action.args.deadline !==
104
- requirementSignature.args.deadline) {
105
- throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
106
- field: "deadline",
107
- expected: String(requirementSignature.args.deadline),
108
- actual: String(requirementSignature.action.args.deadline),
109
- });
110
- }
111
- if (requirementSignature.action.type === "permit2TransferFrom") {
112
- return {
113
- kind: BLUE_BUNDLES_V1_TOKEN_PERMIT_KIND.permit2TransferFrom,
114
- data: (0, viem_1.encodeAbiParameters)([
115
- { type: "uint256", name: "nonce" },
116
- { type: "uint256", name: "deadline" },
117
- { type: "bytes", name: "signature" },
118
- ], [
119
- requirementSignature.args.nonce,
120
- requirementSignature.args.deadline,
121
- requirementSignature.args.signature,
122
- ]),
123
- };
124
- }
125
- if (requirementSignature.action.type !== "permit") {
126
- throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
127
- field: "type",
128
- expected: "permit or permit2TransferFrom",
129
- actual: requirementSignature.action.type,
130
- });
131
- }
132
- const serializedSignature = requirementSignature.args.signature;
133
- let parsed;
134
- try {
135
- parsed =
136
- (0, viem_1.size)(serializedSignature) === 64
137
- ? (0, viem_1.compactSignatureToSignature)((0, viem_1.parseCompactSignature)(serializedSignature))
138
- : (0, viem_1.parseSignature)(serializedSignature);
139
- }
140
- catch (cause) {
141
- throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
142
- field: "signature",
143
- expected: "a 64-byte compact or 65-byte serialized ECDSA signature",
144
- actual: serializedSignature,
145
- cause,
146
- });
147
- }
148
- const v = parsed.v ??
149
- (parsed.yParity == null ? undefined : BigInt(parsed.yParity + 27));
150
- if (v == null) {
151
- throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
152
- field: "signature",
153
- expected: "a signature containing v or yParity",
154
- actual: serializedSignature,
155
- });
156
- }
157
- return {
158
- kind: BLUE_BUNDLES_V1_TOKEN_PERMIT_KIND.erc2612,
159
- data: (0, viem_1.encodeAbiParameters)([
160
- { type: "uint256", name: "deadline" },
161
- { type: "uint8", name: "v" },
162
- { type: "bytes32", name: "r" },
163
- { type: "bytes32", name: "s" },
164
- ], [requirementSignature.args.deadline, Number(v), parsed.r, parsed.s]),
165
- };
46
+ return (0, index_js_3.getBundlesTokenPermit)({
47
+ userAddress: params.userAddress,
48
+ token: params.token,
49
+ spender: (0, morpho_ts_1.getChainAddress)(params.chainId, "bundles.blueBundlesV1"),
50
+ amount: params.amount,
51
+ requirementSignature: params.requirementSignature,
52
+ });
166
53
  };
167
54
  exports.getBlueBundlesV1TokenPermit = getBlueBundlesV1TokenPermit;
168
55
  /** @internal */
@@ -175,28 +62,28 @@ const getBlueBundlesV1SignedAuthorization = (params) => {
175
62
  throw new index_js_2.DepositOwnerMismatchError(params.userAddress, authorizationSignature.args.owner);
176
63
  }
177
64
  if (!(0, viem_1.isAddressEqual)(authorizationSignature.args.authorized, authorized)) {
178
- throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
65
+ throw new index_js_2.BundlesRequirementSignatureMismatchError({
179
66
  field: "authorized",
180
67
  expected: authorized,
181
68
  actual: authorizationSignature.args.authorized,
182
69
  });
183
70
  }
184
71
  if (!(0, viem_1.isAddressEqual)(authorizationSignature.action.args.authorized, authorized)) {
185
- throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
72
+ throw new index_js_2.BundlesRequirementSignatureMismatchError({
186
73
  field: "authorized",
187
74
  expected: authorized,
188
75
  actual: authorizationSignature.action.args.authorized,
189
76
  });
190
77
  }
191
78
  if (!authorizationSignature.args.isAuthorized) {
192
- throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
79
+ throw new index_js_2.BundlesRequirementSignatureMismatchError({
193
80
  field: "isAuthorized",
194
81
  expected: "true",
195
82
  actual: String(authorizationSignature.args.isAuthorized),
196
83
  });
197
84
  }
198
85
  if (!authorizationSignature.action.args.isAuthorized) {
199
- throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
86
+ throw new index_js_2.BundlesRequirementSignatureMismatchError({
200
87
  field: "isAuthorized",
201
88
  expected: "true",
202
89
  actual: String(authorizationSignature.action.args.isAuthorized),
@@ -204,7 +91,7 @@ const getBlueBundlesV1SignedAuthorization = (params) => {
204
91
  }
205
92
  if (authorizationSignature.action.args.deadline !==
206
93
  authorizationSignature.args.deadline) {
207
- throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
94
+ throw new index_js_2.BundlesRequirementSignatureMismatchError({
208
95
  field: "deadline",
209
96
  expected: String(authorizationSignature.args.deadline),
210
97
  actual: String(authorizationSignature.action.args.deadline),
@@ -219,7 +106,7 @@ const getBlueBundlesV1SignedAuthorization = (params) => {
219
106
  : (0, viem_1.parseSignature)(serializedSignature);
220
107
  }
221
108
  catch (cause) {
222
- throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
109
+ throw new index_js_2.BundlesRequirementSignatureMismatchError({
223
110
  field: "signature",
224
111
  expected: "a 64-byte compact or 65-byte serialized ECDSA signature",
225
112
  actual: serializedSignature,
@@ -229,7 +116,7 @@ const getBlueBundlesV1SignedAuthorization = (params) => {
229
116
  const v = parsed.v ??
230
117
  (parsed.yParity == null ? undefined : BigInt(parsed.yParity + 27));
231
118
  if (v == null) {
232
- throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
119
+ throw new index_js_2.BundlesRequirementSignatureMismatchError({
233
120
  field: "signature",
234
121
  expected: "a signature containing v or yParity",
235
122
  actual: serializedSignature,
@@ -281,24 +168,24 @@ const getBlueBundlesV1ReferralFeeAssets = (assets, referralFeePct) => referralFe
281
168
  exports.getBlueBundlesV1ReferralFeeAssets = getBlueBundlesV1ReferralFeeAssets;
282
169
  /** @internal */
283
170
  const selectBlueBundlesV1RequirementSignatures = (signatures, accepts) => {
284
- const { permit, permit2TransferFrom, authorization } = (0, index_js_2.selectRequirementSignatures)(signatures, {
171
+ const { permit, permit2SignatureTransfer, authorization } = (0, index_js_2.selectRequirementSignatures)(signatures, {
285
172
  permit: accepts.token,
286
- permit2TransferFrom: accepts.token,
173
+ permit2SignatureTransfer: accepts.token,
287
174
  authorization: accepts.authorization,
288
175
  });
289
176
  if (permit?.action.type === "permit2") {
290
- throw new index_js_2.BlueBundlesV1RequirementSignatureMismatchError({
177
+ throw new index_js_2.BundlesRequirementSignatureMismatchError({
291
178
  field: "type",
292
- expected: "permit or permit2TransferFrom",
179
+ expected: "permit or permit2SignatureTransfer",
293
180
  actual: permit.action.type,
294
181
  });
295
182
  }
296
- if (permit != null && permit2TransferFrom != null) {
183
+ if (permit != null && permit2SignatureTransfer != null) {
297
184
  throw new index_js_2.AmbiguousRequirementSignaturesError("permit", 2);
298
185
  }
299
186
  return {
300
187
  token: permit ??
301
- permit2TransferFrom,
188
+ permit2SignatureTransfer,
302
189
  authorization,
303
190
  };
304
191
  };
@@ -69,7 +69,7 @@ export interface BlueRefinanceParams {
69
69
  * @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the destination market.
70
70
  * @throws {ReallocationLoanTokenMismatchError} when a source market uses another loan token.
71
71
  * @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
72
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when authorization cannot be bound safely.
72
+ * @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
73
73
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
74
74
  * @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
75
75
  * @example
@@ -42,7 +42,7 @@ const common_js_1 = require("./common.js");
42
42
  * @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the destination market.
43
43
  * @throws {ReallocationLoanTokenMismatchError} when a source market uses another loan token.
44
44
  * @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
45
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when authorization cannot be bound safely.
45
+ * @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
46
46
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
47
47
  * @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
48
48
  * @example
@@ -1,6 +1,6 @@
1
1
  import type { MarketParams } from "@morpho-org/blue-sdk";
2
2
  import { type Address } from "viem";
3
- import type { BlueBundlesV1TokenRequirementSignature, BlueRepayAction, Metadata, Transaction } from "../../types/index.js";
3
+ import type { BlueRepayAction, BundlesTokenRequirementSignature, Metadata, Transaction } from "../../types/index.js";
4
4
  /** Parameters for {@link blueRepay}. */
5
5
  export interface BlueRepayParams {
6
6
  /** Chain and scoped Morpho Blue market. */
@@ -27,7 +27,7 @@ export interface BlueRepayParams {
27
27
  /** Recipient required when `referralFeePct` is positive. */
28
28
  readonly referralFeeRecipient?: Address;
29
29
  /** Optional loan-token ERC-2612 or Permit2 SignatureTransfer result. */
30
- readonly requirementSignature?: BlueBundlesV1TokenRequirementSignature;
30
+ readonly requirementSignature?: BundlesTokenRequirementSignature;
31
31
  };
32
32
  /** Optional transaction metadata suffix. */
33
33
  readonly metadata?: Metadata;
@@ -65,7 +65,7 @@ export interface BlueRepayParams {
65
65
  * @throws {DepositAssetMismatchError} when the signed asset differs from the loan token.
66
66
  * @throws {DepositAmountMismatchError} when the signed amount differs from `maxRepayAssets`.
67
67
  * @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
68
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when a signature cannot be encoded safely.
68
+ * @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be encoded safely.
69
69
  * @throws {InputExceedsMaxError} when the referral fee is at least WAD.
70
70
  * @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
71
71
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
@@ -37,7 +37,7 @@ const repayWithdrawCollateral_js_1 = require("./repayWithdrawCollateral.js");
37
37
  * @throws {DepositAssetMismatchError} when the signed asset differs from the loan token.
38
38
  * @throws {DepositAmountMismatchError} when the signed amount differs from `maxRepayAssets`.
39
39
  * @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
40
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when a signature cannot be encoded safely.
40
+ * @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be encoded safely.
41
41
  * @throws {InputExceedsMaxError} when the referral fee is at least WAD.
42
42
  * @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
43
43
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
@@ -1,6 +1,6 @@
1
1
  import type { MarketParams } from "@morpho-org/blue-sdk";
2
2
  import { type Address } from "viem";
3
- import { type AuthorizationRequirementSignature, type BlueBundlesV1TokenRequirementSignature, type BlueRepayWithdrawCollateralAction, type Metadata, type Transaction } from "../../types/index.js";
3
+ import { type AuthorizationRequirementSignature, type BlueRepayWithdrawCollateralAction, type BundlesTokenRequirementSignature, type Metadata, type Transaction } from "../../types/index.js";
4
4
  /** Parameters for {@link blueRepayWithdrawCollateral}. */
5
5
  export interface BlueRepayWithdrawCollateralParams {
6
6
  /** Chain and scoped Morpho Blue market. */
@@ -31,7 +31,7 @@ export interface BlueRepayWithdrawCollateralParams {
31
31
  /** Recipient required when `referralFeePct` is positive. */
32
32
  readonly referralFeeRecipient?: Address;
33
33
  /** Optional loan-token ERC-2612 or Permit2 SignatureTransfer result. */
34
- readonly requirementSignature?: BlueBundlesV1TokenRequirementSignature;
34
+ readonly requirementSignature?: BundlesTokenRequirementSignature;
35
35
  /** Optional Morpho authorization signature for BlueBundlesV1. */
36
36
  readonly authorizationSignature?: AuthorizationRequirementSignature;
37
37
  };
@@ -77,7 +77,7 @@ export interface BlueRepayWithdrawCollateralParams {
77
77
  * @throws {DepositAssetMismatchError} when the signed asset differs from the loan token.
78
78
  * @throws {DepositAmountMismatchError} when the signed amount differs from `maxRepayAssets`.
79
79
  * @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
80
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when a signature cannot be bound safely.
80
+ * @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be bound safely.
81
81
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
82
82
  * @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
83
83
  * @example
@@ -45,7 +45,7 @@ const common_js_1 = require("./common.js");
45
45
  * @throws {DepositAssetMismatchError} when the signed asset differs from the loan token.
46
46
  * @throws {DepositAmountMismatchError} when the signed amount differs from `maxRepayAssets`.
47
47
  * @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
48
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when a signature cannot be bound safely.
48
+ * @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be bound safely.
49
49
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
50
50
  * @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
51
51
  * @example
@@ -1,6 +1,6 @@
1
1
  import type { MarketParams } from "@morpho-org/blue-sdk";
2
2
  import { type Address } from "viem";
3
- import type { BlueBundlesV1TokenRequirementSignature, BlueSupplyAction, Metadata, Transaction } from "../../types/index.js";
3
+ import type { BlueSupplyAction, BundlesTokenRequirementSignature, Metadata, Transaction } from "../../types/index.js";
4
4
  /** Parameters for {@link blueSupply}. */
5
5
  export interface BlueSupplyParams {
6
6
  /** Chain and scoped Morpho Blue market. */
@@ -23,7 +23,7 @@ export interface BlueSupplyParams {
23
23
  /** Recipient required when `referralFeePct` is positive. */
24
24
  readonly referralFeeRecipient?: Address;
25
25
  /** Optional ERC-2612 or Permit2 SignatureTransfer requirement result. */
26
- readonly requirementSignature?: BlueBundlesV1TokenRequirementSignature;
26
+ readonly requirementSignature?: BundlesTokenRequirementSignature;
27
27
  };
28
28
  /** Optional transaction metadata suffix. */
29
29
  readonly metadata?: Metadata;
@@ -59,7 +59,7 @@ export interface BlueSupplyParams {
59
59
  * @throws {DepositAssetMismatchError} when the signed asset differs from the loan token.
60
60
  * @throws {DepositAmountMismatchError} when the signed amount differs from `assets`.
61
61
  * @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
62
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when the signature kind or encoding is invalid.
62
+ * @throws {BundlesRequirementSignatureMismatchError} when the signature kind or encoding is invalid.
63
63
  * @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
64
64
  * @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
65
65
  * @example
@@ -36,7 +36,7 @@ const common_js_1 = require("./common.js");
36
36
  * @throws {DepositAssetMismatchError} when the signed asset differs from the loan token.
37
37
  * @throws {DepositAmountMismatchError} when the signed amount differs from `assets`.
38
38
  * @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
39
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when the signature kind or encoding is invalid.
39
+ * @throws {BundlesRequirementSignatureMismatchError} when the signature kind or encoding is invalid.
40
40
  * @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
41
41
  * @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
42
42
  * @example
@@ -1,6 +1,6 @@
1
1
  import type { MarketParams } from "@morpho-org/blue-sdk";
2
2
  import { type Address } from "viem";
3
- import type { BlueBundlesV1TokenRequirementSignature, BlueSupplyCollateralAction, Metadata, Transaction } from "../../types/index.js";
3
+ import type { BlueSupplyCollateralAction, BundlesTokenRequirementSignature, Metadata, Transaction } from "../../types/index.js";
4
4
  /** Parameters for {@link blueSupplyCollateral}. */
5
5
  export interface BlueSupplyCollateralParams {
6
6
  /** Chain and scoped Morpho Blue market. */
@@ -23,7 +23,7 @@ export interface BlueSupplyCollateralParams {
23
23
  /** Recipient required when `referralFeePct` is positive. */
24
24
  readonly referralFeeRecipient?: Address;
25
25
  /** Optional collateral ERC-2612 or Permit2 SignatureTransfer result. */
26
- readonly requirementSignature?: BlueBundlesV1TokenRequirementSignature;
26
+ readonly requirementSignature?: BundlesTokenRequirementSignature;
27
27
  };
28
28
  /** Optional transaction metadata suffix. */
29
29
  readonly metadata?: Metadata;
@@ -57,7 +57,7 @@ export interface BlueSupplyCollateralParams {
57
57
  * @throws {DepositAssetMismatchError} when the signed asset differs from the collateral token.
58
58
  * @throws {DepositAmountMismatchError} when the signed amount differs from `collateralAssets`.
59
59
  * @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
60
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when a signature cannot be encoded safely.
60
+ * @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be encoded safely.
61
61
  * @throws {InputExceedsMaxError} when the referral fee is at least WAD.
62
62
  * @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
63
63
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
@@ -33,7 +33,7 @@ const supplyCollateralBorrow_js_1 = require("./supplyCollateralBorrow.js");
33
33
  * @throws {DepositAssetMismatchError} when the signed asset differs from the collateral token.
34
34
  * @throws {DepositAmountMismatchError} when the signed amount differs from `collateralAssets`.
35
35
  * @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
36
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when a signature cannot be encoded safely.
36
+ * @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be encoded safely.
37
37
  * @throws {InputExceedsMaxError} when the referral fee is at least WAD.
38
38
  * @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
39
39
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
@@ -1,6 +1,6 @@
1
1
  import type { MarketParams } from "@morpho-org/blue-sdk";
2
2
  import { type Address } from "viem";
3
- import { type AuthorizationRequirementSignature, type BlueBundlesV1TokenRequirementSignature, type BlueSupplyCollateralBorrowAction, type Metadata, type Transaction, type VaultV2BlueReallocation } from "../../types/index.js";
3
+ import { type AuthorizationRequirementSignature, type BlueSupplyCollateralBorrowAction, type BundlesTokenRequirementSignature, type Metadata, type Transaction, type VaultV2BlueReallocation } from "../../types/index.js";
4
4
  /** Parameters for {@link blueSupplyCollateralBorrow}. */
5
5
  export interface BlueSupplyCollateralBorrowParams {
6
6
  /** Chain and scoped Morpho Blue market. */
@@ -29,7 +29,7 @@ export interface BlueSupplyCollateralBorrowParams {
29
29
  /** Recipient required when `referralFeePct` is positive. */
30
30
  readonly referralFeeRecipient?: Address;
31
31
  /** Optional collateral ERC-2612 or Permit2 SignatureTransfer result. */
32
- readonly requirementSignature?: BlueBundlesV1TokenRequirementSignature;
32
+ readonly requirementSignature?: BundlesTokenRequirementSignature;
33
33
  /** Optional Morpho authorization signature for BlueBundlesV1. */
34
34
  readonly authorizationSignature?: AuthorizationRequirementSignature;
35
35
  };
@@ -78,7 +78,7 @@ export interface BlueSupplyCollateralBorrowParams {
78
78
  * @throws {DepositAssetMismatchError} when the signed asset differs from the collateral token.
79
79
  * @throws {DepositAmountMismatchError} when the signed amount differs from `collateralAssets`.
80
80
  * @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
81
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when a signature cannot be bound safely.
81
+ * @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be bound safely.
82
82
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
83
83
  * @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
84
84
  * @example
@@ -48,7 +48,7 @@ const common_js_1 = require("./common.js");
48
48
  * @throws {DepositAssetMismatchError} when the signed asset differs from the collateral token.
49
49
  * @throws {DepositAmountMismatchError} when the signed amount differs from `collateralAssets`.
50
50
  * @throws {DepositSpenderMismatchError} when the signed spender is not BlueBundlesV1.
51
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when a signature cannot be bound safely.
51
+ * @throws {BundlesRequirementSignatureMismatchError} when a signature cannot be bound safely.
52
52
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
53
53
  * @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
54
54
  * @example
@@ -64,7 +64,7 @@ export interface BlueWithdrawParams {
64
64
  * @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the target market.
65
65
  * @throws {ReallocationLoanTokenMismatchError} when a source market uses another loan token.
66
66
  * @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
67
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when authorization cannot be bound safely.
67
+ * @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
68
68
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
69
69
  * @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
70
70
  * @example
@@ -40,7 +40,7 @@ const common_js_1 = require("./common.js");
40
40
  * @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the target market.
41
41
  * @throws {ReallocationLoanTokenMismatchError} when a source market uses another loan token.
42
42
  * @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
43
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when authorization cannot be bound safely.
43
+ * @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
44
44
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
45
45
  * @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
46
46
  * @example
@@ -52,7 +52,7 @@ export interface BlueWithdrawCollateralParams {
52
52
  * @throws {InputExceedsMaxError} when the referral fee is at least WAD.
53
53
  * @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
54
54
  * @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
55
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when authorization cannot be bound safely.
55
+ * @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
56
56
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
57
57
  * @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
58
58
  * @example
@@ -27,7 +27,7 @@ const repayWithdrawCollateral_js_1 = require("./repayWithdrawCollateral.js");
27
27
  * @throws {InputExceedsMaxError} when the referral fee is at least WAD.
28
28
  * @throws {MissingReferralFeeRecipientError} when a positive fee has no recipient.
29
29
  * @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
30
- * @throws {BlueBundlesV1RequirementSignatureMismatchError} when authorization cannot be bound safely.
30
+ * @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
31
31
  * @throws {UnsupportedChainIdError} when the chain is absent from the registry.
32
32
  * @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
33
33
  * @example