@silentswap/sdk 0.1.82 → 0.1.83
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/constants.js +1 -1
- package/dist/wallet.d.ts +7 -1
- package/dist/wallet.js +21 -15
- package/package.json +1 -1
package/dist/constants.js
CHANGED
|
@@ -21,7 +21,7 @@ export const ENVIRONMENT_CONFIGS = {
|
|
|
21
21
|
gatewayAddress: MAINNET_GATEWAY_ADDRESS,
|
|
22
22
|
proxyPublicKey: MAINNET_GATEWAY_PUBLIC_KEY,
|
|
23
23
|
s0xGatewayAddress: "0xAAef732E8B327917BF44A7892102A5ED3Bd27842",
|
|
24
|
-
s0xDepositorAddress: "
|
|
24
|
+
s0xDepositorAddress: "0x334548B9eA0dF3ba4930967A4Fe65Ff2d3e0c11F",
|
|
25
25
|
},
|
|
26
26
|
[ENVIRONMENT.STAGING]: {
|
|
27
27
|
baseUrl: STAGING_SILENTSWAP_API,
|
package/dist/wallet.d.ts
CHANGED
|
@@ -16,9 +16,15 @@ export declare function queryDepositCount(userAddress: `0x${string}`, s0xGateway
|
|
|
16
16
|
* Generate phony deposit proxy calldata for testing/estimation purposes
|
|
17
17
|
* This creates a valid calldata structure without actual signature data
|
|
18
18
|
*
|
|
19
|
+
* The tuple field order MUST match SilentSwapV2Gateway.DepositParams exactly
|
|
20
|
+
* (signer-first) — viem encodes tuples positionally, so a mismatched order would
|
|
21
|
+
* place every field in the wrong slot and produce calldata the new
|
|
22
|
+
* SilentSwapDepositor decodes as garbage. Encodes `depositProxy` (the new
|
|
23
|
+
* exact-amount, approve-based pull used by the relay path).
|
|
24
|
+
*
|
|
19
25
|
* @param signerAddress - The signer's EVM address (or zero address for anonymous)
|
|
20
26
|
* @param approvalExpiration - Timestamp when approval expires (default: 12 hours from now)
|
|
21
27
|
* @param duration - Duration of the deposit in seconds (default: 7 days)
|
|
22
|
-
* @returns Encoded calldata for
|
|
28
|
+
* @returns Encoded calldata for the depositProxy function
|
|
23
29
|
*/
|
|
24
30
|
export declare function createPhonyDepositCalldata(signerAddress?: `0x${string}`, approvalExpiration?: bigint, duration?: bigint): Hex;
|
package/dist/wallet.js
CHANGED
|
@@ -121,17 +121,23 @@ const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
|
121
121
|
* Generate phony deposit proxy calldata for testing/estimation purposes
|
|
122
122
|
* This creates a valid calldata structure without actual signature data
|
|
123
123
|
*
|
|
124
|
+
* The tuple field order MUST match SilentSwapV2Gateway.DepositParams exactly
|
|
125
|
+
* (signer-first) — viem encodes tuples positionally, so a mismatched order would
|
|
126
|
+
* place every field in the wrong slot and produce calldata the new
|
|
127
|
+
* SilentSwapDepositor decodes as garbage. Encodes `depositProxy` (the new
|
|
128
|
+
* exact-amount, approve-based pull used by the relay path).
|
|
129
|
+
*
|
|
124
130
|
* @param signerAddress - The signer's EVM address (or zero address for anonymous)
|
|
125
131
|
* @param approvalExpiration - Timestamp when approval expires (default: 12 hours from now)
|
|
126
132
|
* @param duration - Duration of the deposit in seconds (default: 7 days)
|
|
127
|
-
* @returns Encoded calldata for
|
|
133
|
+
* @returns Encoded calldata for the depositProxy function
|
|
128
134
|
*/
|
|
129
135
|
export function createPhonyDepositCalldata(signerAddress = ZERO_ADDRESS, approvalExpiration, duration = BigInt(3600 * 24 * 7)) {
|
|
130
136
|
const expiration = approvalExpiration ?? BigInt(Math.floor((Date.now() + 12 * 3600e3) / 1e3));
|
|
131
137
|
return encodeFunctionData({
|
|
132
138
|
abi: [
|
|
133
139
|
{
|
|
134
|
-
name: '
|
|
140
|
+
name: 'depositProxy',
|
|
135
141
|
type: 'function',
|
|
136
142
|
stateMutability: 'nonpayable',
|
|
137
143
|
inputs: [
|
|
@@ -139,37 +145,37 @@ export function createPhonyDepositCalldata(signerAddress = ZERO_ADDRESS, approva
|
|
|
139
145
|
name: 'params',
|
|
140
146
|
type: 'tuple',
|
|
141
147
|
components: [
|
|
148
|
+
{ name: 'signer', type: 'address' },
|
|
142
149
|
{ name: 'orderId', type: 'bytes32' },
|
|
143
|
-
{ name: 'orderApproval', type: 'bytes' },
|
|
144
|
-
{ name: 'typedDataSignature', type: 'bytes' },
|
|
145
|
-
{ name: 'receiveAuthorization', type: 'bytes' },
|
|
146
150
|
{ name: 'notary', type: 'address' },
|
|
147
151
|
{ name: 'approver', type: 'address' },
|
|
148
|
-
{ name: '
|
|
149
|
-
{ name: 'domainSepHash', type: 'bytes32' },
|
|
150
|
-
{ name: 'signer', type: 'address' },
|
|
152
|
+
{ name: 'orderApproval', type: 'bytes' },
|
|
151
153
|
{ name: 'approvalExpiration', type: 'uint256' },
|
|
152
154
|
{ name: 'duration', type: 'uint256' },
|
|
155
|
+
{ name: 'domainSepHash', type: 'bytes32' },
|
|
156
|
+
{ name: 'payloadHash', type: 'bytes32' },
|
|
157
|
+
{ name: 'typedDataSignature', type: 'bytes' },
|
|
158
|
+
{ name: 'receiveAuthorization', type: 'bytes' },
|
|
153
159
|
],
|
|
154
160
|
},
|
|
155
161
|
],
|
|
156
162
|
outputs: [],
|
|
157
163
|
},
|
|
158
164
|
],
|
|
159
|
-
functionName: '
|
|
165
|
+
functionName: 'depositProxy',
|
|
160
166
|
args: [
|
|
161
167
|
{
|
|
168
|
+
signer: signerAddress,
|
|
162
169
|
orderId: NIL_DATA_32,
|
|
163
|
-
orderApproval: NIL_DATA_65,
|
|
164
|
-
typedDataSignature: NIL_DATA_65,
|
|
165
|
-
receiveAuthorization: NIL_DATA_288,
|
|
166
170
|
notary: ZERO_ADDRESS,
|
|
167
171
|
approver: ZERO_ADDRESS,
|
|
168
|
-
|
|
169
|
-
domainSepHash: NIL_DATA_32,
|
|
170
|
-
signer: signerAddress,
|
|
172
|
+
orderApproval: NIL_DATA_65,
|
|
171
173
|
approvalExpiration: expiration,
|
|
172
174
|
duration,
|
|
175
|
+
domainSepHash: NIL_DATA_32,
|
|
176
|
+
payloadHash: NIL_DATA_32,
|
|
177
|
+
typedDataSignature: NIL_DATA_65,
|
|
178
|
+
receiveAuthorization: NIL_DATA_288,
|
|
173
179
|
},
|
|
174
180
|
],
|
|
175
181
|
});
|