@pafi-dev/issuer 0.9.1 → 0.10.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.cjs +30 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +31 -10
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -898,13 +898,16 @@ var RelayService = class {
|
|
|
898
898
|
"prepareMint: deadline exceeds maximum allowed window (1 hour)"
|
|
899
899
|
);
|
|
900
900
|
}
|
|
901
|
+
const useWrapper = params.mintFeeWrapperAddress !== void 0;
|
|
902
|
+
const receiverForSig = useWrapper ? params.mintFeeWrapperAddress : params.userAddress;
|
|
901
903
|
let minterSig;
|
|
902
904
|
try {
|
|
903
905
|
const sig = await (0, import_core5.signMintRequest)(
|
|
904
906
|
params.issuerSignerWallet,
|
|
905
907
|
params.domain,
|
|
906
908
|
{
|
|
907
|
-
|
|
909
|
+
user: params.userAddress,
|
|
910
|
+
receiver: receiverForSig,
|
|
908
911
|
amount: params.amount,
|
|
909
912
|
nonce: params.mintRequestNonce,
|
|
910
913
|
deadline: params.deadline
|
|
@@ -914,27 +917,44 @@ var RelayService = class {
|
|
|
914
917
|
} catch (err) {
|
|
915
918
|
throw new RelayError(
|
|
916
919
|
"ENCODE_FAILED",
|
|
917
|
-
`prepareMint: failed to sign
|
|
920
|
+
`prepareMint: failed to sign MintForRequest: ${errorMessage(err)}`,
|
|
918
921
|
err
|
|
919
922
|
);
|
|
920
923
|
}
|
|
921
924
|
let mintCallData;
|
|
925
|
+
let mintTarget;
|
|
922
926
|
try {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
927
|
+
if (useWrapper) {
|
|
928
|
+
mintCallData = (0, import_viem3.encodeFunctionData)({
|
|
929
|
+
abi: import_core5.mintFeeWrapperAbi,
|
|
930
|
+
functionName: "mintWithFee",
|
|
931
|
+
args: [
|
|
932
|
+
params.pointTokenAddress,
|
|
933
|
+
params.userAddress,
|
|
934
|
+
params.amount,
|
|
935
|
+
params.deadline,
|
|
936
|
+
minterSig
|
|
937
|
+
]
|
|
938
|
+
});
|
|
939
|
+
mintTarget = params.mintFeeWrapperAddress;
|
|
940
|
+
} else {
|
|
941
|
+
mintCallData = (0, import_viem3.encodeFunctionData)({
|
|
942
|
+
abi: import_core5.POINT_TOKEN_V2_ABI,
|
|
943
|
+
functionName: "mint",
|
|
944
|
+
args: [params.userAddress, params.amount, params.deadline, minterSig]
|
|
945
|
+
});
|
|
946
|
+
mintTarget = params.pointTokenAddress;
|
|
947
|
+
}
|
|
928
948
|
} catch (err) {
|
|
929
949
|
throw new RelayError(
|
|
930
950
|
"ENCODE_FAILED",
|
|
931
|
-
`prepareMint: failed to encode
|
|
951
|
+
`prepareMint: failed to encode mint call: ${errorMessage(err)}`,
|
|
932
952
|
err
|
|
933
953
|
);
|
|
934
954
|
}
|
|
935
955
|
const operations = [
|
|
936
956
|
{
|
|
937
|
-
target:
|
|
957
|
+
target: mintTarget,
|
|
938
958
|
value: 0n,
|
|
939
959
|
data: mintCallData
|
|
940
960
|
}
|
|
@@ -4572,7 +4592,7 @@ var MemoryRedemptionHistoryStore = class {
|
|
|
4572
4592
|
};
|
|
4573
4593
|
|
|
4574
4594
|
// src/index.ts
|
|
4575
|
-
var PAFI_ISSUER_SDK_VERSION = true ? "0.
|
|
4595
|
+
var PAFI_ISSUER_SDK_VERSION = true ? "0.10.0" : "dev";
|
|
4576
4596
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4577
4597
|
0 && (module.exports = {
|
|
4578
4598
|
AdapterMisconfiguredError,
|