@silentswap/sdk 0.0.11 → 0.0.12

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/sdk.d.ts CHANGED
@@ -5,9 +5,10 @@ import type { Hex } from 'viem';
5
5
  * Creates a SIWE message for authentication with SilentSwap
6
6
  * @param user - user's EVM address
7
7
  * @param nonce - nonce from the server (base58)
8
+ * @param domain - full domain of the SIWE message
8
9
  * @returns SIWE message
9
10
  */
10
- export declare function createSignInMessage(user: Hex, nonce: string, subdomain?: string): SignInMessage;
11
+ export declare function createSignInMessage(user: Hex, nonce: string, domain?: string): SignInMessage;
11
12
  /**
12
13
  * Creates an EIP-712 document for a SilentSwap order
13
14
  * @param quote - quote response
package/dist/sdk.js CHANGED
@@ -4,15 +4,16 @@ import { EIP712_DOMAIN_ORDER_DEFAULT, EIP712_TYPES_ORDER, EIP712_TYPES_WALLET_GE
4
4
  * Creates a SIWE message for authentication with SilentSwap
5
5
  * @param user - user's EVM address
6
6
  * @param nonce - nonce from the server (base58)
7
+ * @param domain - full domain of the SIWE message
7
8
  * @returns SIWE message
8
9
  */
9
- export function createSignInMessage(user, nonce, subdomain = 'app') {
10
+ export function createSignInMessage(user, nonce, domain = 'app.silentswap.com') {
10
11
  // create params
11
12
  const params = {
12
- domain: `${subdomain}.silentswap.com`,
13
+ domain: domain,
13
14
  address: user,
14
15
  statement: 'Sign in with Ethereum to SilentSwap',
15
- uri: `shttps://${subdomain}.silentswap.com`,
16
+ uri: `${globalThis.location?.protocol ?? 'https:'}//${domain}`,
16
17
  version: '1',
17
18
  chainId: 1, // always Ethereum mainnet
18
19
  nonce: nonce,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@silentswap/sdk",
3
3
  "type": "module",
4
- "version": "0.0.11",
4
+ "version": "0.0.12",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
7
7
  "files": [