dequanto 0.2.44 → 0.2.45

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 (104) hide show
  1. package/lib/cjs/abi/coders/abstract-coder.js +18 -7
  2. package/lib/cjs/abi/coders/abstract-coder.js.map +1 -1
  3. package/lib/cjs/abi/fragments.js +24 -8
  4. package/lib/cjs/abi/fragments.js.map +1 -1
  5. package/lib/cjs/class/PackedRanges.js +6 -2
  6. package/lib/cjs/class/PackedRanges.js.map +1 -1
  7. package/lib/cjs/class/SubjectStream.js +3 -1
  8. package/lib/cjs/class/SubjectStream.js.map +1 -1
  9. package/lib/cjs/clients/WalletClient.js +3 -1
  10. package/lib/cjs/clients/WalletClient.js.map +1 -1
  11. package/lib/cjs/contracts/deploy/Deployments.js +1 -1
  12. package/lib/cjs/contracts/deploy/Deployments.js.map +1 -1
  13. package/lib/cjs/contracts/deploy/proxy/ProxyDeployment.js +3 -1
  14. package/lib/cjs/contracts/deploy/proxy/ProxyDeployment.js.map +1 -1
  15. package/lib/cjs/indexer/EventsIndexer.js +3 -1
  16. package/lib/cjs/indexer/EventsIndexer.js.map +1 -1
  17. package/lib/cjs/safe/GnosisSafeHandler.js +6 -1
  18. package/lib/cjs/safe/GnosisSafeHandler.js.map +1 -1
  19. package/lib/cjs/safe/transport/InMemoryServiceTransport.js +4 -4
  20. package/lib/cjs/safe/transport/InMemoryServiceTransport.js.map +1 -1
  21. package/lib/cjs/safe/transport/SafeServiceTransport.js.map +1 -1
  22. package/lib/cjs/solidity/SlotsParser.js +3 -1
  23. package/lib/cjs/solidity/SlotsParser.js.map +1 -1
  24. package/lib/cjs/tokens/TokenProviders/TPCoingecko.js +3 -1
  25. package/lib/cjs/tokens/TokenProviders/TPCoingecko.js.map +1 -1
  26. package/lib/cjs/txs/TxWriter.js +3 -1
  27. package/lib/cjs/txs/TxWriter.js.map +1 -1
  28. package/lib/cjs/txs/agents/BatchAgent.js +44 -4
  29. package/lib/cjs/txs/agents/BatchAgent.js.map +1 -1
  30. package/lib/cjs/utils/$bigfloat.js +24 -8
  31. package/lib/cjs/utils/$bigfloat.js.map +1 -1
  32. package/lib/esm/abi/coders/abstract-coder.js.map +1 -1
  33. package/lib/esm/abi/coders/abstract-coder.mjs +18 -7
  34. package/lib/esm/abi/fragments.js.map +1 -1
  35. package/lib/esm/abi/fragments.mjs +24 -8
  36. package/lib/esm/class/PackedRanges.js.map +1 -1
  37. package/lib/esm/class/PackedRanges.mjs +6 -2
  38. package/lib/esm/class/SubjectStream.js.map +1 -1
  39. package/lib/esm/class/SubjectStream.mjs +3 -1
  40. package/lib/esm/clients/WalletClient.js.map +1 -1
  41. package/lib/esm/clients/WalletClient.mjs +3 -1
  42. package/lib/esm/contracts/deploy/Deployments.js.map +1 -1
  43. package/lib/esm/contracts/deploy/Deployments.mjs +1 -1
  44. package/lib/esm/contracts/deploy/proxy/ProxyDeployment.js.map +1 -1
  45. package/lib/esm/contracts/deploy/proxy/ProxyDeployment.mjs +3 -1
  46. package/lib/esm/indexer/EventsIndexer.js.map +1 -1
  47. package/lib/esm/indexer/EventsIndexer.mjs +3 -1
  48. package/lib/esm/safe/GnosisSafeHandler.js.map +1 -1
  49. package/lib/esm/safe/GnosisSafeHandler.mjs +6 -1
  50. package/lib/esm/safe/transport/InMemoryServiceTransport.js.map +1 -1
  51. package/lib/esm/safe/transport/InMemoryServiceTransport.mjs +4 -4
  52. package/lib/esm/safe/transport/SafeServiceTransport.js.map +1 -1
  53. package/lib/esm/solidity/SlotsParser.js.map +1 -1
  54. package/lib/esm/solidity/SlotsParser.mjs +3 -1
  55. package/lib/esm/tokens/TokenProviders/TPCoingecko.js.map +1 -1
  56. package/lib/esm/tokens/TokenProviders/TPCoingecko.mjs +3 -1
  57. package/lib/esm/txs/TxWriter.js.map +1 -1
  58. package/lib/esm/txs/TxWriter.mjs +3 -1
  59. package/lib/esm/txs/agents/BatchAgent.js.map +1 -1
  60. package/lib/esm/txs/agents/BatchAgent.mjs +44 -4
  61. package/lib/esm/utils/$bigfloat.js.map +1 -1
  62. package/lib/esm/utils/$bigfloat.mjs +24 -8
  63. package/lib/types/abi/coders/abstract-coder.d.ts +18 -0
  64. package/lib/types/class/PackedRanges.d.ts +6 -0
  65. package/lib/types/class/SubjectStream.d.ts +3 -0
  66. package/lib/types/clients/WalletClient.d.ts +3 -0
  67. package/lib/types/contracts/deploy/proxy/ProxyDeployment.d.ts +3 -0
  68. package/lib/types/indexer/EventsIndexer.d.ts +3 -0
  69. package/lib/types/safe/transport/InMemoryServiceTransport.d.ts +1 -1
  70. package/lib/types/safe/transport/SafeServiceTransport.d.ts +2 -2
  71. package/lib/types/tokens/TokenProviders/TPCoingecko.d.ts +3 -0
  72. package/lib/types/txs/TxWriter.d.ts +3 -0
  73. package/lib/types/txs/agents/BatchAgent.d.ts +14 -0
  74. package/lib/types/utils/$bigfloat.d.ts +24 -0
  75. package/package.json +1 -1
  76. package/src/abi/coders/abstract-coder.ts +18 -7
  77. package/src/abi/fragments.ts +24 -8
  78. package/src/class/PackedRanges.ts +6 -2
  79. package/src/class/SubjectStream.ts +3 -1
  80. package/src/clients/WalletClient.ts +3 -1
  81. package/src/contracts/deploy/Deployments.ts +1 -1
  82. package/src/contracts/deploy/proxy/ProxyDeployment.ts +3 -1
  83. package/src/indexer/EventsIndexer.ts +3 -1
  84. package/src/safe/GnosisSafeHandler.ts +12 -10
  85. package/src/safe/transport/ISafeServiceTransport.ts +0 -3
  86. package/src/safe/transport/InMemoryServiceTransport.ts +7 -7
  87. package/src/safe/transport/SafeServiceTransport.ts +2 -5
  88. package/src/solidity/SlotsParser.ts +3 -1
  89. package/src/tokens/TokenProviders/TPCoingecko.ts +3 -1
  90. package/src/txs/TxWriter.ts +3 -1
  91. package/src/txs/agents/BatchAgent.ts +57 -4
  92. package/src/utils/$bigfloat.ts +24 -8
  93. package/lib/cjs/utils/$signRaw.js +0 -45
  94. package/lib/cjs/utils/$signRaw.js.map +0 -1
  95. package/lib/cjs/utils/$signRawNative.js +0 -91
  96. package/lib/cjs/utils/$signRawNative.js.map +0 -1
  97. package/lib/esm/utils/$signRaw.js.map +0 -1
  98. package/lib/esm/utils/$signRaw.mjs +0 -44
  99. package/lib/esm/utils/$signRawNative.js.map +0 -1
  100. package/lib/esm/utils/$signRawNative.mjs +0 -90
  101. package/lib/types/utils/$signRaw.d.ts +0 -1
  102. package/lib/types/utils/$signRawNative.d.ts +0 -1
  103. package/src/utils/$signRaw.ts +0 -50
  104. package/src/utils/$signRawNative.ts +0 -105
@@ -1,50 +0,0 @@
1
- import { $buffer } from './$buffer';
2
- import { $is } from './$is';
3
- import { TAddress } from '@dequanto/models/TAddress';
4
-
5
- throw new Error(`Deprecated. Use @dequanto/utils/$sig instead.`);
6
-
7
- // export namespace $signRaw {
8
- // export function signEC (message: string | Buffer, privateKey: string | Buffer) {
9
- // const sig = ecsign(
10
- // toBuffer(message) as Buffer,
11
- // toBuffer(privateKey, { encoding: 'hex' }) as Buffer
12
- // );
13
-
14
- // let r = sig.r.toString('hex').padStart(64, '0')
15
- // let s = sig.s.toString('hex').padStart(64, '0');
16
- // let v = sig.v.toString(16);
17
-
18
- // return {
19
- // v: `0x${v}`,
20
- // r: `0x${r}`,
21
- // s: `0x${s}`,
22
- // signature: `0x${r}${s}${v}`,
23
- // signatureVRS: `0x${v}${r}${s}`
24
- // }
25
- // }
26
- // export function signEIPHashed (message: string | Buffer, privateKey: string) {
27
- // const buffer = toBuffer(message);
28
- // const hash = hashPersonalMessage(buffer as Buffer);
29
- // return signEC(hash, privateKey);
30
- // }
31
-
32
- // export function ecrecover (message: string, signature: string | { v, r, s}): TAddress {
33
- // return utils.recoverAddress(message, signature) as TAddress;
34
- // }
35
-
36
- // function toBuffer (message: string | Buffer, opts?: { encoding?: 'utf8' | 'hex' }) {
37
- // if (typeof message === 'string') {
38
- // let encoding = opts?.encoding;
39
- // if (encoding == null && $is.Hex(message)) {
40
- // encoding = 'hex';
41
- // message = message.substring(2);
42
- // }
43
- // if (encoding === 'hex') {
44
- // return $buffer.fromHex(message);
45
- // }
46
- // return $buffer.fromString(message, opts?.encoding ?? 'utf8');
47
- // }
48
- // return message;
49
- // }
50
- // }
@@ -1,105 +0,0 @@
1
- import { secp256k1 } from '@noble/curves/secp256k1'
2
- import { TEth } from '@dequanto/models/TEth';
3
- import { $buffer } from './$buffer';
4
- import { $contract } from './$contract';
5
- import { $is } from './$is';
6
- import { $hex } from './$hex';
7
- import { $address } from './$address';
8
-
9
- throw new Error(`Deprecated. Use @dequanto/utils/$sig instead.`);
10
-
11
- // export namespace $signRawNative {
12
- // export function signEC (message: string | Uint8Array, privateKey: string | Uint8Array, chainId?: number) {
13
- // const sig = secp256k1.sign(
14
- // toUint8Array(message) as Uint8Array,
15
- // toUint8Array(privateKey, { encoding: 'hex' }) as Uint8Array
16
- // );
17
-
18
- // let r = sig.r.toString(16).padStart(64, '0');
19
- // let s = sig.s.toString(16).padStart(64, '0');
20
- // // https://eips.ethereum.org/EIPS/eip-155
21
- // let v = (chainId != null
22
- // ? sig.recovery + chainId * 2 + 35
23
- // : sig.recovery + 27
24
- // ).toString(16);
25
-
26
- // return {
27
- // v: `0x${v}`,
28
- // r: `0x${r}`,
29
- // s: `0x${s}`,
30
- // signature: `0x${r}${s}${v}`,
31
- // signatureVRS: `0x${v}${r}${s}`
32
- // }
33
- // }
34
- // export function signEIPHashed (message: string | Uint8Array, privateKey: string) {
35
- // const buffer = toUint8Array(message);
36
- // const hash = hashPersonalMessage(buffer);
37
- // return signEC(hash, privateKey);
38
- // }
39
-
40
- // export function ecrecover (digest: TEth.Hex | Uint8Array, signature: TEth.Hex | { v, r, s }): TEth.Address {
41
- // return recoverAddress(digest, signature);
42
- // }
43
- // export function eipRecover (message: string | Uint8Array, signature: TEth.Hex | { v, r, s }): TEth.Address {
44
- // const buffer = toUint8Array(message);
45
- // const hash = hashPersonalMessage(buffer);
46
- // return recoverAddress(hash, signature);
47
- // }
48
-
49
- // export function recoverAddress (digest: TEth.Hex | Uint8Array, signature: TEth.Hex | { v, r, s }): Promise<TEth.Address> {
50
- // const publicKey = recoverPubKey(digest, signature);
51
- // const address = $contract.keccak256(`0x${publicKey.substring(4)}`).slice(-40)
52
- // return $address.toChecksum(`0x${address}`);
53
- // }
54
- // export function recoverPubKey (digest: TEth.Hex | Uint8Array, signature: TEth.Hex | { v, r, s }) {
55
- // let { v, r, s } = $is.Hex(signature)
56
- // ? splitSignature(signature)
57
- // : signature;
58
-
59
- // let vNum = Number(v);
60
- // let recovery: 0 | 1;
61
- // if (vNum === 0 || vNum === 1) {
62
- // recovery = vNum;
63
- // } else if (vNum === 27 || vNum === 28) {
64
- // recovery = (vNum - 27) as 0 | 1;
65
- // } else if (vNum > 35) {
66
- // vNum -= 35;
67
- // recovery = vNum % 2 === 0 ? 0 : 1;
68
- // }
69
- // r = r.substring(2);
70
- // s = s.substring(2);
71
-
72
- // const publicKey = secp256k1.Signature.fromCompact(`${r}${s}`)
73
- // .addRecoveryBit(recovery)
74
- // .recoverPublicKey($hex.raw($hex.ensure(digest)))
75
- // .toHex(false);
76
- // return `0x${publicKey}`
77
- // }
78
-
79
- // function splitSignature (signature: TEth.Hex): { v, r, s} {
80
- // let r = signature.substring(2, 2 + 64);
81
- // let s = signature.substring(2 + 64, 2 + 64 + 64);
82
- // let v = signature.substring(2 + 64 + 64);
83
- // return { r, s ,v };
84
- // }
85
-
86
- // function hashPersonalMessage (buffer: Uint8Array) {
87
- // const prefix = $buffer.fromString(`\u0019Ethereum Signed Message:\n${buffer.length}`, 'utf-8')
88
- // return $contract.keccak256($buffer.concat([prefix, buffer]))
89
- // }
90
-
91
- // function toUint8Array (message: string | Uint8Array, opts?: { encoding?: 'utf8' | 'hex' }): Uint8Array {
92
- // if (typeof message === 'string') {
93
- // let encoding = opts?.encoding;
94
- // if (encoding == null && $is.Hex(message)) {
95
- // encoding = 'hex';
96
- // message = message.substring(2);
97
- // }
98
- // if (encoding === 'hex') {
99
- // return $buffer.fromHex(message);
100
- // }
101
- // return $buffer.fromString(message, opts?.encoding ?? 'utf8');
102
- // }
103
- // return message;
104
- // }
105
- // }