create-sbc-app 0.4.1 → 0.4.2

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sbc-app",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Scaffold a new SBC App Kit project with one command.",
5
5
  "bin": {
6
6
  "create-sbc-app": "bin/cli.js"
@@ -577,17 +577,11 @@ async function getPermitSignature({
577
577
  const domain = {
578
578
  name: tokenName as string,
579
579
  version: '1',
580
- chainId: BigInt(chainId),
580
+ chainId: chainId,
581
581
  verifyingContract: tokenAddress as `0x${string}`,
582
582
  };
583
-
583
+
584
584
  const types = {
585
- EIP712Domain: [
586
- { name: 'name', type: 'string' },
587
- { name: 'version', type: 'string' },
588
- { name: 'chainId', type: 'uint256' },
589
- { name: 'verifyingContract', type: 'address' },
590
- ],
591
585
  Permit: [
592
586
  { name: 'owner', type: 'address' },
593
587
  { name: 'spender', type: 'address' },
@@ -595,18 +589,18 @@ async function getPermitSignature({
595
589
  { name: 'nonce', type: 'uint256' },
596
590
  { name: 'deadline', type: 'uint256' },
597
591
  ],
598
- } as const;
599
-
592
+ };
593
+
600
594
  const message = {
601
595
  owner: ownerChecksum,
602
596
  spender: spenderChecksum,
603
- value: value,
604
- nonce: nonce as bigint,
605
- deadline: BigInt(deadline),
597
+ value: value.toString(),
598
+ nonce: nonce.toString(),
599
+ deadline: deadline.toString(),
606
600
  };
607
-
601
+
608
602
  const signature = await walletClient.signTypedData({
609
- account: walletClient.account!,
603
+ account: ownerChecksum as `0x${string}`,
610
604
  domain,
611
605
  types,
612
606
  primaryType: 'Permit',
@@ -37,16 +37,10 @@ export function buildPermitTypedData(params: {
37
37
  domain: {
38
38
  name: tokenName,
39
39
  version: '1',
40
- chainId: BigInt(chainId),
40
+ chainId: 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
- ],
50
44
  Permit: [
51
45
  { name: 'owner', type: 'address' },
52
46
  { name: 'spender', type: 'address' },
@@ -56,7 +50,7 @@ export function buildPermitTypedData(params: {
56
50
  ],
57
51
  },
58
52
  primaryType: 'Permit',
59
- message: { owner, spender, value, nonce, deadline },
53
+ message: { owner, spender, value: value.toString(), nonce: nonce.toString(), deadline: deadline.toString() },
60
54
  } as const;
61
55
  }
62
56
 
@@ -1656,17 +1656,11 @@ async function getPermitSignature({
1656
1656
  const domain = {
1657
1657
  name: tokenName as string,
1658
1658
  version: '1',
1659
- chainId: BigInt(chainId),
1659
+ chainId: 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
- ],
1670
1664
  Permit: [
1671
1665
  { name: 'owner', type: 'address' },
1672
1666
  { name: 'spender', type: 'address' },
@@ -1674,19 +1668,18 @@ async function getPermitSignature({
1674
1668
  { name: 'nonce', type: 'uint256' },
1675
1669
  { name: 'deadline', type: 'uint256' },
1676
1670
  ],
1677
- } as const;
1671
+ };
1678
1672
 
1679
1673
  const message = {
1680
1674
  owner: ownerChecksum,
1681
1675
  spender: spenderChecksum,
1682
- value: value,
1683
- nonce: nonce as bigint,
1684
- deadline: BigInt(deadline),
1676
+ value: value.toString(),
1677
+ nonce: nonce.toString(),
1678
+ deadline: deadline.toString(),
1685
1679
  };
1686
1680
 
1687
- // walletClient.account is available on the client
1688
1681
  const signature = await walletClient.signTypedData({
1689
- account: walletClient.account!,
1682
+ account: ownerChecksum as `0x${string}`,
1690
1683
  domain,
1691
1684
  types,
1692
1685
  primaryType: 'Permit',