@pafi-dev/core 0.9.6 → 0.13.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.
Files changed (43) hide show
  1. package/README.md +146 -188
  2. package/dist/abi/index.cjs +2 -2
  3. package/dist/abi/index.cjs.map +1 -1
  4. package/dist/abi/index.d.cts +58 -106
  5. package/dist/abi/index.d.ts +58 -106
  6. package/dist/abi/index.js +3 -3
  7. package/dist/{chunk-Y5EYH2SQ.js → chunk-H3X3FYUU.js} +1 -10
  8. package/dist/chunk-H3X3FYUU.js.map +1 -0
  9. package/dist/{chunk-5NEAI2BH.cjs → chunk-NT2ZPF72.cjs} +50 -72
  10. package/dist/chunk-NT2ZPF72.cjs.map +1 -0
  11. package/dist/{chunk-BNO5SM25.cjs → chunk-TRYGIC2I.cjs} +2 -11
  12. package/dist/chunk-TRYGIC2I.cjs.map +1 -0
  13. package/dist/{chunk-HJYHGCMT.js → chunk-UEO4YN6T.js} +53 -75
  14. package/dist/chunk-UEO4YN6T.js.map +1 -0
  15. package/dist/{chunk-MIQA46E3.cjs → chunk-XXLIIWIF.cjs} +45 -53
  16. package/dist/chunk-XXLIIWIF.cjs.map +1 -0
  17. package/dist/{chunk-CWH4KOUW.js → chunk-ZJXXCG5P.js} +45 -53
  18. package/dist/chunk-ZJXXCG5P.js.map +1 -0
  19. package/dist/contract/index.cjs +2 -4
  20. package/dist/contract/index.cjs.map +1 -1
  21. package/dist/contract/index.d.cts +5 -15
  22. package/dist/contract/index.d.ts +5 -15
  23. package/dist/contract/index.js +1 -3
  24. package/dist/eip712/index.cjs +2 -8
  25. package/dist/eip712/index.cjs.map +1 -1
  26. package/dist/eip712/index.d.cts +29 -43
  27. package/dist/eip712/index.d.ts +29 -43
  28. package/dist/eip712/index.js +3 -9
  29. package/dist/index.cjs +141 -158
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +201 -182
  32. package/dist/index.d.ts +201 -182
  33. package/dist/index.js +135 -152
  34. package/dist/index.js.map +1 -1
  35. package/dist/{types-DWLZNgcw.d.cts → types-C17pznGz.d.cts} +72 -30
  36. package/dist/{types-DWLZNgcw.d.ts → types-C17pznGz.d.ts} +72 -30
  37. package/package.json +15 -5
  38. package/dist/chunk-5NEAI2BH.cjs.map +0 -1
  39. package/dist/chunk-BNO5SM25.cjs.map +0 -1
  40. package/dist/chunk-CWH4KOUW.js.map +0 -1
  41. package/dist/chunk-HJYHGCMT.js.map +0 -1
  42. package/dist/chunk-MIQA46E3.cjs.map +0 -1
  43. package/dist/chunk-Y5EYH2SQ.js.map +0 -1
@@ -3042,7 +3042,7 @@ declare const permit2Abi: readonly [{
3042
3042
  readonly outputs: readonly [];
3043
3043
  }];
3044
3044
 
3045
- declare const v4QuoterAbi: readonly [{
3045
+ declare const v3QuoterV2Abi: readonly [{
3046
3046
  readonly type: "function";
3047
3047
  readonly name: "quoteExactInputSingle";
3048
3048
  readonly stateMutability: "nonpayable";
@@ -3050,38 +3050,31 @@ declare const v4QuoterAbi: readonly [{
3050
3050
  readonly name: "params";
3051
3051
  readonly type: "tuple";
3052
3052
  readonly components: readonly [{
3053
- readonly name: "poolKey";
3054
- readonly type: "tuple";
3055
- readonly components: readonly [{
3056
- readonly name: "currency0";
3057
- readonly type: "address";
3058
- }, {
3059
- readonly name: "currency1";
3060
- readonly type: "address";
3061
- }, {
3062
- readonly name: "fee";
3063
- readonly type: "uint24";
3064
- }, {
3065
- readonly name: "tickSpacing";
3066
- readonly type: "int24";
3067
- }, {
3068
- readonly name: "hooks";
3069
- readonly type: "address";
3070
- }];
3053
+ readonly name: "tokenIn";
3054
+ readonly type: "address";
3071
3055
  }, {
3072
- readonly name: "zeroForOne";
3073
- readonly type: "bool";
3056
+ readonly name: "tokenOut";
3057
+ readonly type: "address";
3074
3058
  }, {
3075
- readonly name: "exactAmount";
3076
- readonly type: "uint128";
3059
+ readonly name: "amountIn";
3060
+ readonly type: "uint256";
3061
+ }, {
3062
+ readonly name: "fee";
3063
+ readonly type: "uint24";
3077
3064
  }, {
3078
- readonly name: "hookData";
3079
- readonly type: "bytes";
3065
+ readonly name: "sqrtPriceLimitX96";
3066
+ readonly type: "uint160";
3080
3067
  }];
3081
3068
  }];
3082
3069
  readonly outputs: readonly [{
3083
3070
  readonly name: "amountOut";
3084
3071
  readonly type: "uint256";
3072
+ }, {
3073
+ readonly name: "sqrtPriceX96After";
3074
+ readonly type: "uint160";
3075
+ }, {
3076
+ readonly name: "initializedTicksCrossed";
3077
+ readonly type: "uint32";
3085
3078
  }, {
3086
3079
  readonly name: "gasEstimate";
3087
3080
  readonly type: "uint256";
@@ -3091,38 +3084,21 @@ declare const v4QuoterAbi: readonly [{
3091
3084
  readonly name: "quoteExactInput";
3092
3085
  readonly stateMutability: "nonpayable";
3093
3086
  readonly inputs: readonly [{
3094
- readonly name: "params";
3095
- readonly type: "tuple";
3096
- readonly components: readonly [{
3097
- readonly name: "exactCurrency";
3098
- readonly type: "address";
3099
- }, {
3100
- readonly name: "path";
3101
- readonly type: "tuple[]";
3102
- readonly components: readonly [{
3103
- readonly name: "intermediateCurrency";
3104
- readonly type: "address";
3105
- }, {
3106
- readonly name: "fee";
3107
- readonly type: "uint24";
3108
- }, {
3109
- readonly name: "tickSpacing";
3110
- readonly type: "int24";
3111
- }, {
3112
- readonly name: "hooks";
3113
- readonly type: "address";
3114
- }, {
3115
- readonly name: "hookData";
3116
- readonly type: "bytes";
3117
- }];
3118
- }, {
3119
- readonly name: "exactAmount";
3120
- readonly type: "uint128";
3121
- }];
3087
+ readonly name: "path";
3088
+ readonly type: "bytes";
3089
+ }, {
3090
+ readonly name: "amountIn";
3091
+ readonly type: "uint256";
3122
3092
  }];
3123
3093
  readonly outputs: readonly [{
3124
3094
  readonly name: "amountOut";
3125
3095
  readonly type: "uint256";
3096
+ }, {
3097
+ readonly name: "sqrtPriceX96AfterList";
3098
+ readonly type: "uint160[]";
3099
+ }, {
3100
+ readonly name: "initializedTicksCrossedList";
3101
+ readonly type: "uint32[]";
3126
3102
  }, {
3127
3103
  readonly name: "gasEstimate";
3128
3104
  readonly type: "uint256";
@@ -3135,38 +3111,31 @@ declare const v4QuoterAbi: readonly [{
3135
3111
  readonly name: "params";
3136
3112
  readonly type: "tuple";
3137
3113
  readonly components: readonly [{
3138
- readonly name: "poolKey";
3139
- readonly type: "tuple";
3140
- readonly components: readonly [{
3141
- readonly name: "currency0";
3142
- readonly type: "address";
3143
- }, {
3144
- readonly name: "currency1";
3145
- readonly type: "address";
3146
- }, {
3147
- readonly name: "fee";
3148
- readonly type: "uint24";
3149
- }, {
3150
- readonly name: "tickSpacing";
3151
- readonly type: "int24";
3152
- }, {
3153
- readonly name: "hooks";
3154
- readonly type: "address";
3155
- }];
3114
+ readonly name: "tokenIn";
3115
+ readonly type: "address";
3156
3116
  }, {
3157
- readonly name: "zeroForOne";
3158
- readonly type: "bool";
3117
+ readonly name: "tokenOut";
3118
+ readonly type: "address";
3159
3119
  }, {
3160
- readonly name: "exactAmount";
3161
- readonly type: "uint128";
3120
+ readonly name: "amount";
3121
+ readonly type: "uint256";
3122
+ }, {
3123
+ readonly name: "fee";
3124
+ readonly type: "uint24";
3162
3125
  }, {
3163
- readonly name: "hookData";
3164
- readonly type: "bytes";
3126
+ readonly name: "sqrtPriceLimitX96";
3127
+ readonly type: "uint160";
3165
3128
  }];
3166
3129
  }];
3167
3130
  readonly outputs: readonly [{
3168
3131
  readonly name: "amountIn";
3169
3132
  readonly type: "uint256";
3133
+ }, {
3134
+ readonly name: "sqrtPriceX96After";
3135
+ readonly type: "uint160";
3136
+ }, {
3137
+ readonly name: "initializedTicksCrossed";
3138
+ readonly type: "uint32";
3170
3139
  }, {
3171
3140
  readonly name: "gasEstimate";
3172
3141
  readonly type: "uint256";
@@ -3176,42 +3145,25 @@ declare const v4QuoterAbi: readonly [{
3176
3145
  readonly name: "quoteExactOutput";
3177
3146
  readonly stateMutability: "nonpayable";
3178
3147
  readonly inputs: readonly [{
3179
- readonly name: "params";
3180
- readonly type: "tuple";
3181
- readonly components: readonly [{
3182
- readonly name: "exactCurrency";
3183
- readonly type: "address";
3184
- }, {
3185
- readonly name: "path";
3186
- readonly type: "tuple[]";
3187
- readonly components: readonly [{
3188
- readonly name: "intermediateCurrency";
3189
- readonly type: "address";
3190
- }, {
3191
- readonly name: "fee";
3192
- readonly type: "uint24";
3193
- }, {
3194
- readonly name: "tickSpacing";
3195
- readonly type: "int24";
3196
- }, {
3197
- readonly name: "hooks";
3198
- readonly type: "address";
3199
- }, {
3200
- readonly name: "hookData";
3201
- readonly type: "bytes";
3202
- }];
3203
- }, {
3204
- readonly name: "exactAmount";
3205
- readonly type: "uint128";
3206
- }];
3148
+ readonly name: "path";
3149
+ readonly type: "bytes";
3150
+ }, {
3151
+ readonly name: "amountOut";
3152
+ readonly type: "uint256";
3207
3153
  }];
3208
3154
  readonly outputs: readonly [{
3209
3155
  readonly name: "amountIn";
3210
3156
  readonly type: "uint256";
3157
+ }, {
3158
+ readonly name: "sqrtPriceX96AfterList";
3159
+ readonly type: "uint160[]";
3160
+ }, {
3161
+ readonly name: "initializedTicksCrossedList";
3162
+ readonly type: "uint32[]";
3211
3163
  }, {
3212
3164
  readonly name: "gasEstimate";
3213
3165
  readonly type: "uint256";
3214
3166
  }];
3215
3167
  }];
3216
3168
 
3217
- export { erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi };
3169
+ export { erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v3QuoterV2Abi };
@@ -3042,7 +3042,7 @@ declare const permit2Abi: readonly [{
3042
3042
  readonly outputs: readonly [];
3043
3043
  }];
3044
3044
 
3045
- declare const v4QuoterAbi: readonly [{
3045
+ declare const v3QuoterV2Abi: readonly [{
3046
3046
  readonly type: "function";
3047
3047
  readonly name: "quoteExactInputSingle";
3048
3048
  readonly stateMutability: "nonpayable";
@@ -3050,38 +3050,31 @@ declare const v4QuoterAbi: readonly [{
3050
3050
  readonly name: "params";
3051
3051
  readonly type: "tuple";
3052
3052
  readonly components: readonly [{
3053
- readonly name: "poolKey";
3054
- readonly type: "tuple";
3055
- readonly components: readonly [{
3056
- readonly name: "currency0";
3057
- readonly type: "address";
3058
- }, {
3059
- readonly name: "currency1";
3060
- readonly type: "address";
3061
- }, {
3062
- readonly name: "fee";
3063
- readonly type: "uint24";
3064
- }, {
3065
- readonly name: "tickSpacing";
3066
- readonly type: "int24";
3067
- }, {
3068
- readonly name: "hooks";
3069
- readonly type: "address";
3070
- }];
3053
+ readonly name: "tokenIn";
3054
+ readonly type: "address";
3071
3055
  }, {
3072
- readonly name: "zeroForOne";
3073
- readonly type: "bool";
3056
+ readonly name: "tokenOut";
3057
+ readonly type: "address";
3074
3058
  }, {
3075
- readonly name: "exactAmount";
3076
- readonly type: "uint128";
3059
+ readonly name: "amountIn";
3060
+ readonly type: "uint256";
3061
+ }, {
3062
+ readonly name: "fee";
3063
+ readonly type: "uint24";
3077
3064
  }, {
3078
- readonly name: "hookData";
3079
- readonly type: "bytes";
3065
+ readonly name: "sqrtPriceLimitX96";
3066
+ readonly type: "uint160";
3080
3067
  }];
3081
3068
  }];
3082
3069
  readonly outputs: readonly [{
3083
3070
  readonly name: "amountOut";
3084
3071
  readonly type: "uint256";
3072
+ }, {
3073
+ readonly name: "sqrtPriceX96After";
3074
+ readonly type: "uint160";
3075
+ }, {
3076
+ readonly name: "initializedTicksCrossed";
3077
+ readonly type: "uint32";
3085
3078
  }, {
3086
3079
  readonly name: "gasEstimate";
3087
3080
  readonly type: "uint256";
@@ -3091,38 +3084,21 @@ declare const v4QuoterAbi: readonly [{
3091
3084
  readonly name: "quoteExactInput";
3092
3085
  readonly stateMutability: "nonpayable";
3093
3086
  readonly inputs: readonly [{
3094
- readonly name: "params";
3095
- readonly type: "tuple";
3096
- readonly components: readonly [{
3097
- readonly name: "exactCurrency";
3098
- readonly type: "address";
3099
- }, {
3100
- readonly name: "path";
3101
- readonly type: "tuple[]";
3102
- readonly components: readonly [{
3103
- readonly name: "intermediateCurrency";
3104
- readonly type: "address";
3105
- }, {
3106
- readonly name: "fee";
3107
- readonly type: "uint24";
3108
- }, {
3109
- readonly name: "tickSpacing";
3110
- readonly type: "int24";
3111
- }, {
3112
- readonly name: "hooks";
3113
- readonly type: "address";
3114
- }, {
3115
- readonly name: "hookData";
3116
- readonly type: "bytes";
3117
- }];
3118
- }, {
3119
- readonly name: "exactAmount";
3120
- readonly type: "uint128";
3121
- }];
3087
+ readonly name: "path";
3088
+ readonly type: "bytes";
3089
+ }, {
3090
+ readonly name: "amountIn";
3091
+ readonly type: "uint256";
3122
3092
  }];
3123
3093
  readonly outputs: readonly [{
3124
3094
  readonly name: "amountOut";
3125
3095
  readonly type: "uint256";
3096
+ }, {
3097
+ readonly name: "sqrtPriceX96AfterList";
3098
+ readonly type: "uint160[]";
3099
+ }, {
3100
+ readonly name: "initializedTicksCrossedList";
3101
+ readonly type: "uint32[]";
3126
3102
  }, {
3127
3103
  readonly name: "gasEstimate";
3128
3104
  readonly type: "uint256";
@@ -3135,38 +3111,31 @@ declare const v4QuoterAbi: readonly [{
3135
3111
  readonly name: "params";
3136
3112
  readonly type: "tuple";
3137
3113
  readonly components: readonly [{
3138
- readonly name: "poolKey";
3139
- readonly type: "tuple";
3140
- readonly components: readonly [{
3141
- readonly name: "currency0";
3142
- readonly type: "address";
3143
- }, {
3144
- readonly name: "currency1";
3145
- readonly type: "address";
3146
- }, {
3147
- readonly name: "fee";
3148
- readonly type: "uint24";
3149
- }, {
3150
- readonly name: "tickSpacing";
3151
- readonly type: "int24";
3152
- }, {
3153
- readonly name: "hooks";
3154
- readonly type: "address";
3155
- }];
3114
+ readonly name: "tokenIn";
3115
+ readonly type: "address";
3156
3116
  }, {
3157
- readonly name: "zeroForOne";
3158
- readonly type: "bool";
3117
+ readonly name: "tokenOut";
3118
+ readonly type: "address";
3159
3119
  }, {
3160
- readonly name: "exactAmount";
3161
- readonly type: "uint128";
3120
+ readonly name: "amount";
3121
+ readonly type: "uint256";
3122
+ }, {
3123
+ readonly name: "fee";
3124
+ readonly type: "uint24";
3162
3125
  }, {
3163
- readonly name: "hookData";
3164
- readonly type: "bytes";
3126
+ readonly name: "sqrtPriceLimitX96";
3127
+ readonly type: "uint160";
3165
3128
  }];
3166
3129
  }];
3167
3130
  readonly outputs: readonly [{
3168
3131
  readonly name: "amountIn";
3169
3132
  readonly type: "uint256";
3133
+ }, {
3134
+ readonly name: "sqrtPriceX96After";
3135
+ readonly type: "uint160";
3136
+ }, {
3137
+ readonly name: "initializedTicksCrossed";
3138
+ readonly type: "uint32";
3170
3139
  }, {
3171
3140
  readonly name: "gasEstimate";
3172
3141
  readonly type: "uint256";
@@ -3176,42 +3145,25 @@ declare const v4QuoterAbi: readonly [{
3176
3145
  readonly name: "quoteExactOutput";
3177
3146
  readonly stateMutability: "nonpayable";
3178
3147
  readonly inputs: readonly [{
3179
- readonly name: "params";
3180
- readonly type: "tuple";
3181
- readonly components: readonly [{
3182
- readonly name: "exactCurrency";
3183
- readonly type: "address";
3184
- }, {
3185
- readonly name: "path";
3186
- readonly type: "tuple[]";
3187
- readonly components: readonly [{
3188
- readonly name: "intermediateCurrency";
3189
- readonly type: "address";
3190
- }, {
3191
- readonly name: "fee";
3192
- readonly type: "uint24";
3193
- }, {
3194
- readonly name: "tickSpacing";
3195
- readonly type: "int24";
3196
- }, {
3197
- readonly name: "hooks";
3198
- readonly type: "address";
3199
- }, {
3200
- readonly name: "hookData";
3201
- readonly type: "bytes";
3202
- }];
3203
- }, {
3204
- readonly name: "exactAmount";
3205
- readonly type: "uint128";
3206
- }];
3148
+ readonly name: "path";
3149
+ readonly type: "bytes";
3150
+ }, {
3151
+ readonly name: "amountOut";
3152
+ readonly type: "uint256";
3207
3153
  }];
3208
3154
  readonly outputs: readonly [{
3209
3155
  readonly name: "amountIn";
3210
3156
  readonly type: "uint256";
3157
+ }, {
3158
+ readonly name: "sqrtPriceX96AfterList";
3159
+ readonly type: "uint160[]";
3160
+ }, {
3161
+ readonly name: "initializedTicksCrossedList";
3162
+ readonly type: "uint32[]";
3211
3163
  }, {
3212
3164
  readonly name: "gasEstimate";
3213
3165
  readonly type: "uint256";
3214
3166
  }];
3215
3167
  }];
3216
3168
 
3217
- export { erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi };
3169
+ export { erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v3QuoterV2Abi };
package/dist/abi/index.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  permit2Abi,
4
4
  pointTokenFactoryAbi,
5
5
  universalRouterAbi,
6
- v4QuoterAbi
7
- } from "../chunk-CWH4KOUW.js";
6
+ v3QuoterV2Abi
7
+ } from "../chunk-ZJXXCG5P.js";
8
8
  import {
9
9
  issuerRegistryAbi,
10
10
  mintFeeWrapperAbi,
@@ -23,6 +23,6 @@ export {
23
23
  pointTokenAbi,
24
24
  pointTokenFactoryAbi,
25
25
  universalRouterAbi,
26
- v4QuoterAbi
26
+ v3QuoterV2Abi
27
27
  };
28
28
  //# sourceMappingURL=index.js.map
@@ -16,14 +16,6 @@ async function getMintRequestNonce(client, pointToken, receiver) {
16
16
  args: [receiver]
17
17
  });
18
18
  }
19
- async function getReceiverConsentNonce(client, pointToken, receiver) {
20
- return client.readContract({
21
- address: pointToken,
22
- abi: pointTokenAbi,
23
- functionName: "nonces",
24
- args: [receiver]
25
- });
26
- }
27
19
  async function isMinter(client, pointToken, account) {
28
20
  return client.readContract({
29
21
  address: pointToken,
@@ -163,7 +155,6 @@ async function getMintFeeRecipients(client, wrapperAddress, pointToken) {
163
155
 
164
156
  export {
165
157
  getMintRequestNonce,
166
- getReceiverConsentNonce,
167
158
  isMinter,
168
159
  getTokenName,
169
160
  getIssuer,
@@ -178,4 +169,4 @@ export {
178
169
  getMintFeeBps,
179
170
  getMintFeeRecipients
180
171
  };
181
- //# sourceMappingURL=chunk-Y5EYH2SQ.js.map
172
+ //# sourceMappingURL=chunk-H3X3FYUU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/contract/pointToken.ts","../src/contract/issuerRegistry.ts","../src/contract/mintingOracle.ts","../src/contract/mintFeeWrapper.ts"],"sourcesContent":["import type { Address, PublicClient } from \"viem\";\nimport { pointTokenAbi } from \"../abi/pointToken\";\n\nexport async function getMintRequestNonce(\n client: PublicClient,\n pointToken: Address,\n receiver: Address,\n): Promise<bigint> {\n return client.readContract({\n address: pointToken,\n abi: pointTokenAbi,\n functionName: \"mintRequestNonces\",\n args: [receiver],\n });\n}\n\nexport async function isMinter(\n client: PublicClient,\n pointToken: Address,\n account: Address,\n): Promise<boolean> {\n return client.readContract({\n address: pointToken,\n abi: pointTokenAbi,\n functionName: \"minters\",\n args: [account],\n });\n}\n\nexport async function getTokenName(\n client: PublicClient,\n pointToken: Address,\n): Promise<string> {\n return client.readContract({\n address: pointToken,\n abi: pointTokenAbi,\n functionName: \"name\",\n });\n}\n\nexport async function getIssuer(\n client: PublicClient,\n pointToken: Address,\n): Promise<Address> {\n return client.readContract({\n address: pointToken,\n abi: pointTokenAbi,\n functionName: \"issuer\",\n });\n}\n\n/**\n * Read the ERC-20 on-chain balance for `holder`. Returned in raw 18-decimal\n * base units. Use alongside the issuer's off-chain ledger balance to render\n * a combined \"total balance\" in the app UI.\n */\nexport async function getPointTokenBalance(\n client: PublicClient,\n pointToken: Address,\n holder: Address,\n): Promise<bigint> {\n return client.readContract({\n address: pointToken,\n abi: pointTokenAbi,\n functionName: \"balanceOf\",\n args: [holder],\n });\n}\n\nexport async function getBurnRequestNonce(\n client: PublicClient,\n pointToken: Address,\n from: Address,\n): Promise<bigint> {\n return client.readContract({\n address: pointToken,\n abi: pointTokenAbi,\n functionName: \"burnRequestNonces\",\n args: [from],\n });\n}\n","import type { Address, PublicClient } from \"viem\";\nimport { issuerRegistryAbi } from \"../abi/issuerRegistry\";\nimport type { Issuer } from \"../types\";\n\n/**\n * Flat-output ABI for `getIssuer` — workaround for a viem decoding bug\n * (≤ 2.48.x) where `outputs: [{ type: 'tuple', components: [...] }]` with\n * mixed static + dynamic fields throws `IntegerOutOfRangeError` because\n * viem expects an outer offset that the actual on-chain return doesn't\n * carry (Solidity inlines `returns (Struct)` at the wire level).\n *\n * Using flat outputs (one entry per struct field) matches the on-chain\n * encoding and decodes correctly. We rebuild the named struct from the\n * resulting array.\n */\nconst GET_ISSUER_FLAT_ABI = [\n {\n type: \"function\",\n name: \"getIssuer\",\n inputs: [{ name: \"issuer\", type: \"address\" }],\n outputs: [\n { name: \"issuerAddress\", type: \"address\" },\n { name: \"signerAddress\", type: \"address\" },\n { name: \"name\", type: \"string\" },\n { name: \"symbol\", type: \"string\" },\n { name: \"active\", type: \"bool\" },\n { name: \"pointToken\", type: \"address\" },\n { name: \"mintingOracle\", type: \"address\" },\n ],\n stateMutability: \"view\",\n },\n] as const;\n\nexport async function getIssuer(\n client: PublicClient,\n registryAddress: Address,\n issuer: Address,\n): Promise<Issuer> {\n const result = (await client.readContract({\n address: registryAddress,\n abi: GET_ISSUER_FLAT_ABI,\n functionName: \"getIssuer\",\n args: [issuer],\n })) as readonly [\n Address,\n Address,\n string,\n string,\n boolean,\n Address,\n Address,\n ];\n return {\n issuerAddress: result[0],\n signerAddress: result[1],\n name: result[2],\n symbol: result[3],\n active: result[4],\n pointToken: result[5],\n mintingOracle: result[6],\n } as Issuer;\n}\n\n/**\n * Re-export the flat ABI so callers using `client.readContract` directly\n * (e.g. inside batched `Promise.all`) can use it instead of the\n * struct-returning entry from `issuerRegistryAbi`.\n */\nexport const issuerRegistryGetIssuerFlatAbi = GET_ISSUER_FLAT_ABI;\n\nexport async function isActiveIssuer(\n client: PublicClient,\n registryAddress: Address,\n issuer: Address,\n): Promise<boolean> {\n return client.readContract({\n address: registryAddress,\n abi: issuerRegistryAbi,\n functionName: \"isActiveIssuer\",\n args: [issuer],\n });\n}\n","import type { Address, PublicClient } from \"viem\";\nimport { mintingOracleAbi } from \"../abi/mintingOracle\";\n\n/**\n * Takes `pointToken` as the first arg so the oracle can look up the\n * per-token cap. Reverts if the cap would be exceeded.\n */\nexport async function verifyMintCap(\n client: PublicClient,\n oracleAddress: Address,\n pointToken: Address,\n issuer: Address,\n amount: bigint,\n): Promise<void> {\n await client.readContract({\n address: oracleAddress,\n abi: mintingOracleAbi,\n functionName: \"verifyMintCap\",\n args: [pointToken, issuer, amount],\n });\n}\n\nexport async function getPointTokenIssuer(\n client: PublicClient,\n oracleAddress: Address,\n pointToken: Address,\n): Promise<Address> {\n return client.readContract({\n address: oracleAddress,\n abi: mintingOracleAbi,\n functionName: \"pointTokenToIssuer\",\n args: [pointToken],\n });\n}\n\n/**\n * Read the per-PointToken cap config from the oracle. Returns\n * `{ declaredTotalSupply, capBasisPoints }`. The on-chain `_mint` path\n * computes `hardCap = declaredTotalSupply * capBasisPoints / 10000` and\n * reverts if `mintedSupply + amount > hardCap`. Issuers replicate this\n * math at pre-validate time to fail fast before the user signs.\n *\n * Returns `{ 0n, 0 }` when the token is not registered with the oracle —\n * caller treats that as \"no cap configured\", which means mints will\n * always revert on-chain (the oracle requires a non-zero cap).\n */\nexport async function getTokenCap(\n client: PublicClient,\n oracleAddress: Address,\n pointToken: Address,\n): Promise<{ declaredTotalSupply: bigint; capBasisPoints: number }> {\n const cap = await client.readContract({\n address: oracleAddress,\n abi: mintingOracleAbi,\n functionName: \"tokenCaps\",\n args: [pointToken],\n });\n return {\n declaredTotalSupply: cap.declaredTotalSupply,\n capBasisPoints: Number(cap.capBasisPoints),\n };\n}\n","import type { Address, PublicClient } from \"viem\";\nimport { mintFeeWrapperAbi } from \"../abi/mintFeeWrapper\";\n\n/**\n * Read the total fee in basis points (0–10000) for a specific PointToken\n * from the shared `MintFeeWrapper`. Each PointToken has its own recipient\n * list with per-recipient `basisPoints`; `totalFeeBps` is the sum.\n *\n * Returns 0 when no recipients are registered (mint goes through wrapper\n * with no fee deduction). Reverts only on RPC failure.\n */\nexport async function getMintFeeBps(\n client: PublicClient,\n wrapperAddress: Address,\n pointToken: Address,\n): Promise<number> {\n const fee = await client.readContract({\n address: wrapperAddress,\n abi: mintFeeWrapperAbi,\n functionName: \"totalFeeBps\",\n args: [pointToken],\n });\n return Number(fee);\n}\n\n/**\n * Read the recipient configuration for a PointToken — list of\n * `{ account, basisPoints }`. Useful for /config endpoints that want to\n * surface fee distribution to the frontend.\n */\nexport async function getMintFeeRecipients(\n client: PublicClient,\n wrapperAddress: Address,\n pointToken: Address,\n): Promise<readonly { account: Address; basisPoints: number }[]> {\n const recipients = await client.readContract({\n address: wrapperAddress,\n abi: mintFeeWrapperAbi,\n functionName: \"getRecipients\",\n args: [pointToken],\n });\n return recipients.map((r) => ({\n account: r.account,\n basisPoints: Number(r.basisPoints),\n }));\n}\n"],"mappings":";;;;;;;;;;AAGA,eAAsB,oBACpB,QACA,YACA,UACiB;AACjB,SAAO,OAAO,aAAa;AAAA,IACzB,SAAS;AAAA,IACT,KAAK;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,QAAQ;AAAA,EACjB,CAAC;AACH;AAEA,eAAsB,SACpB,QACA,YACA,SACkB;AAClB,SAAO,OAAO,aAAa;AAAA,IACzB,SAAS;AAAA,IACT,KAAK;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,OAAO;AAAA,EAChB,CAAC;AACH;AAEA,eAAsB,aACpB,QACA,YACiB;AACjB,SAAO,OAAO,aAAa;AAAA,IACzB,SAAS;AAAA,IACT,KAAK;AAAA,IACL,cAAc;AAAA,EAChB,CAAC;AACH;AAEA,eAAsB,UACpB,QACA,YACkB;AAClB,SAAO,OAAO,aAAa;AAAA,IACzB,SAAS;AAAA,IACT,KAAK;AAAA,IACL,cAAc;AAA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