create-sbc-app 0.4.2 → 0.4.3
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/package.json
CHANGED
|
@@ -37,10 +37,16 @@ export function buildPermitTypedData(params: {
|
|
|
37
37
|
domain: {
|
|
38
38
|
name: tokenName,
|
|
39
39
|
version: '1',
|
|
40
|
-
chainId: chainId,
|
|
40
|
+
chainId: BigInt(chainId),
|
|
41
41
|
verifyingContract: tokenAddress,
|
|
42
42
|
},
|
|
43
43
|
types: {
|
|
44
|
+
EIP712Domain: [
|
|
45
|
+
{ name: 'name', type: 'string' },
|
|
46
|
+
{ name: 'version', type: 'string' },
|
|
47
|
+
{ name: 'chainId', type: 'uint256' },
|
|
48
|
+
{ name: 'verifyingContract', type: 'address' },
|
|
49
|
+
],
|
|
44
50
|
Permit: [
|
|
45
51
|
{ name: 'owner', type: 'address' },
|
|
46
52
|
{ name: 'spender', type: 'address' },
|
|
@@ -50,7 +56,7 @@ export function buildPermitTypedData(params: {
|
|
|
50
56
|
],
|
|
51
57
|
},
|
|
52
58
|
primaryType: 'Permit',
|
|
53
|
-
message: { owner, spender, value
|
|
59
|
+
message: { owner, spender, value, nonce, deadline },
|
|
54
60
|
} as const;
|
|
55
61
|
}
|
|
56
62
|
|
|
@@ -1656,11 +1656,17 @@ async function getPermitSignature({
|
|
|
1656
1656
|
const domain = {
|
|
1657
1657
|
name: tokenName as string,
|
|
1658
1658
|
version: '1',
|
|
1659
|
-
chainId: chainId,
|
|
1659
|
+
chainId: BigInt(chainId),
|
|
1660
1660
|
verifyingContract: SBC_TOKEN_ADDRESS(chain) as `0x${string}`,
|
|
1661
1661
|
};
|
|
1662
1662
|
|
|
1663
1663
|
const types = {
|
|
1664
|
+
EIP712Domain: [
|
|
1665
|
+
{ name: 'name', type: 'string' },
|
|
1666
|
+
{ name: 'version', type: 'string' },
|
|
1667
|
+
{ name: 'chainId', type: 'uint256' },
|
|
1668
|
+
{ name: 'verifyingContract', type: 'address' },
|
|
1669
|
+
],
|
|
1664
1670
|
Permit: [
|
|
1665
1671
|
{ name: 'owner', type: 'address' },
|
|
1666
1672
|
{ name: 'spender', type: 'address' },
|
|
@@ -1668,18 +1674,19 @@ async function getPermitSignature({
|
|
|
1668
1674
|
{ name: 'nonce', type: 'uint256' },
|
|
1669
1675
|
{ name: 'deadline', type: 'uint256' },
|
|
1670
1676
|
],
|
|
1671
|
-
};
|
|
1677
|
+
} as const;
|
|
1672
1678
|
|
|
1673
1679
|
const message = {
|
|
1674
1680
|
owner: ownerChecksum,
|
|
1675
1681
|
spender: spenderChecksum,
|
|
1676
|
-
value: value
|
|
1677
|
-
nonce: nonce
|
|
1678
|
-
deadline: deadline
|
|
1682
|
+
value: value,
|
|
1683
|
+
nonce: nonce as bigint,
|
|
1684
|
+
deadline: BigInt(deadline),
|
|
1679
1685
|
};
|
|
1680
1686
|
|
|
1687
|
+
// walletClient.account is available on the client
|
|
1681
1688
|
const signature = await walletClient.signTypedData({
|
|
1682
|
-
account:
|
|
1689
|
+
account: walletClient.account!,
|
|
1683
1690
|
domain,
|
|
1684
1691
|
types,
|
|
1685
1692
|
primaryType: 'Permit',
|