@phantom/server-sdk 1.0.0-beta.21 → 1.0.0-beta.24

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/README.md CHANGED
@@ -126,7 +126,7 @@ console.log("Ethereum address:", ethereumAddress);
126
126
  The Server SDK provides two methods for handling transactions:
127
127
 
128
128
  1. **`signTransaction(params)`** - Signs a transaction without submitting it to the network
129
- - Returns the signed transaction
129
+ - Returns the signed transaction
130
130
  - No network interaction
131
131
  - Useful for offline signing or when you want to broadcast later
132
132
 
package/dist/index.js CHANGED
@@ -58,8 +58,13 @@ var import_bs58 = __toESM(require("bs58"));
58
58
  // package.json
59
59
  var package_default = {
60
60
  name: "@phantom/server-sdk",
61
- version: "1.0.0-beta.21",
61
+ version: "1.0.0-beta.24",
62
62
  description: "Server SDK for Phantom Wallet",
63
+ repository: {
64
+ type: "git",
65
+ url: "https://github.com/phantom/phantom-connect-sdk",
66
+ directory: "packages/server-sdk"
67
+ },
63
68
  main: "dist/index.js",
64
69
  module: "dist/index.mjs",
65
70
  types: "dist/index.d.ts",
@@ -146,7 +151,8 @@ var ServerSDK = class {
146
151
  {
147
152
  apiBaseUrl: config.apiBaseUrl || import_constants.DEFAULT_WALLET_API_URL,
148
153
  organizationId: config.organizationId,
149
- headers
154
+ headers,
155
+ walletType: "server-wallet"
150
156
  },
151
157
  stamper
152
158
  );
@@ -158,14 +164,10 @@ var ServerSDK = class {
158
164
  * @returns Promise<ParsedSignatureResult> - Parsed signature with explorer URL
159
165
  */
160
166
  async signMessage(params) {
161
- const base64UrlMessage = (0, import_base64url.stringToBase64url)(params.message);
162
- const signMessageParams = {
163
- walletId: params.walletId,
164
- message: base64UrlMessage,
165
- networkId: params.networkId,
166
- derivationIndex: params.derivationIndex
167
- };
168
- const rawResponse = (0, import_utils.isEthereumChain)(params.networkId) ? await this.client.ethereumSignMessage(signMessageParams) : await this.client.signRawPayload(signMessageParams);
167
+ const rawResponse = (0, import_utils.isEthereumChain)(params.networkId) ? await this.client.ethereumSignMessage({
168
+ ...params,
169
+ message: (0, import_base64url.stringToBase64url)(params.message)
170
+ }) : await this.client.signUtf8Message(params);
169
171
  return (0, import_parsers.parseSignMessageResponse)(rawResponse, params.networkId);
170
172
  }
171
173
  /**
@@ -214,7 +216,8 @@ var ServerSDK = class {
214
216
  {
215
217
  apiBaseUrl: this.config.apiBaseUrl || import_constants.DEFAULT_WALLET_API_URL,
216
218
  organizationId: this.config.organizationId,
217
- headers
219
+ headers,
220
+ walletType: "server-wallet"
218
221
  },
219
222
  new import_api_key_stamper.ApiKeyStamper({
220
223
  apiSecretKey: keyPair.secretKey
package/dist/index.mjs CHANGED
@@ -3,10 +3,7 @@ import {
3
3
  PhantomClient
4
4
  } from "@phantom/client";
5
5
  import { randomUUID, getSecureTimestampSync, isEthereumChain } from "@phantom/utils";
6
- import {
7
- ANALYTICS_HEADERS,
8
- DEFAULT_WALLET_API_URL
9
- } from "@phantom/constants";
6
+ import { ANALYTICS_HEADERS, DEFAULT_WALLET_API_URL } from "@phantom/constants";
10
7
  import { ApiKeyStamper } from "@phantom/api-key-stamper";
11
8
  import { base64urlEncode, stringToBase64url } from "@phantom/base64url";
12
9
  import bs58 from "bs58";
@@ -14,8 +11,13 @@ import bs58 from "bs58";
14
11
  // package.json
15
12
  var package_default = {
16
13
  name: "@phantom/server-sdk",
17
- version: "1.0.0-beta.21",
14
+ version: "1.0.0-beta.24",
18
15
  description: "Server SDK for Phantom Wallet",
16
+ repository: {
17
+ type: "git",
18
+ url: "https://github.com/phantom/phantom-connect-sdk",
19
+ directory: "packages/server-sdk"
20
+ },
19
21
  main: "dist/index.js",
20
22
  module: "dist/index.mjs",
21
23
  types: "dist/index.d.ts",
@@ -121,7 +123,8 @@ var ServerSDK = class {
121
123
  {
122
124
  apiBaseUrl: config.apiBaseUrl || DEFAULT_WALLET_API_URL,
123
125
  organizationId: config.organizationId,
124
- headers
126
+ headers,
127
+ walletType: "server-wallet"
125
128
  },
126
129
  stamper
127
130
  );
@@ -133,14 +136,10 @@ var ServerSDK = class {
133
136
  * @returns Promise<ParsedSignatureResult> - Parsed signature with explorer URL
134
137
  */
135
138
  async signMessage(params) {
136
- const base64UrlMessage = stringToBase64url(params.message);
137
- const signMessageParams = {
138
- walletId: params.walletId,
139
- message: base64UrlMessage,
140
- networkId: params.networkId,
141
- derivationIndex: params.derivationIndex
142
- };
143
- const rawResponse = isEthereumChain(params.networkId) ? await this.client.ethereumSignMessage(signMessageParams) : await this.client.signRawPayload(signMessageParams);
139
+ const rawResponse = isEthereumChain(params.networkId) ? await this.client.ethereumSignMessage({
140
+ ...params,
141
+ message: stringToBase64url(params.message)
142
+ }) : await this.client.signUtf8Message(params);
144
143
  return parseSignMessageResponse(rawResponse, params.networkId);
145
144
  }
146
145
  /**
@@ -189,7 +188,8 @@ var ServerSDK = class {
189
188
  {
190
189
  apiBaseUrl: this.config.apiBaseUrl || DEFAULT_WALLET_API_URL,
191
190
  organizationId: this.config.organizationId,
192
- headers
191
+ headers,
192
+ walletType: "server-wallet"
193
193
  },
194
194
  new ApiKeyStamper({
195
195
  apiSecretKey: keyPair.secretKey
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "@phantom/server-sdk",
3
- "version": "1.0.0-beta.21",
3
+ "version": "1.0.0-beta.24",
4
4
  "description": "Server SDK for Phantom Wallet",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/phantom/phantom-connect-sdk",
8
+ "directory": "packages/server-sdk"
9
+ },
5
10
  "main": "dist/index.js",
6
11
  "module": "dist/index.mjs",
7
12
  "types": "dist/index.d.ts",
@@ -37,12 +42,12 @@
37
42
  "typescript": "^5.0.4"
38
43
  },
39
44
  "dependencies": {
40
- "@phantom/api-key-stamper": "^1.0.0-beta.9",
41
- "@phantom/base64url": "^1.0.0-beta.9",
42
- "@phantom/client": "^1.0.0-beta.21",
43
- "@phantom/constants": "^1.0.0-beta.9",
44
- "@phantom/parsers": "^1.0.0-beta.9",
45
- "@phantom/utils": "^1.0.0-beta.21",
45
+ "@phantom/api-key-stamper": "^1.0.0-beta.12",
46
+ "@phantom/base64url": "^1.0.0-beta.12",
47
+ "@phantom/client": "^1.0.0-beta.24",
48
+ "@phantom/constants": "^1.0.0-beta.12",
49
+ "@phantom/parsers": "^1.0.0-beta.12",
50
+ "@phantom/utils": "^1.0.0-beta.24",
46
51
  "bs58": "^6.0.0"
47
52
  },
48
53
  "files": [