@phantom/server-sdk 0.1.0 → 0.1.1

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
@@ -97,7 +97,11 @@ console.log("Addresses:", wallet.addresses);
97
97
 
98
98
  // Sign a message (base64url encoded)
99
99
  const message = Buffer.from("Hello, Phantom!").toString("base64url");
100
- const signature = await sdk.signMessage(wallet.walletId, message, NetworkId.SOLANA_MAINNET);
100
+ const signature = await sdk.signMessage({
101
+ walletId: wallet.walletId,
102
+ message,
103
+ networkId: NetworkId.SOLANA_MAINNET,
104
+ });
101
105
  console.log("Signature:", signature);
102
106
  ```
103
107
 
@@ -146,7 +150,11 @@ const serializedTx = transaction.serialize({
146
150
  const transactionBase64 = Buffer.from(serializedTx).toString("base64url");
147
151
 
148
152
  // Sign and send the transaction
149
- const signedTx = await sdk.signAndSendTransaction(wallet.walletId, transactionBase64, NetworkId.SOLANA_MAINNET);
153
+ const signedTx = await sdk.signAndSendTransaction({
154
+ walletId: wallet.walletId,
155
+ transaction: transactionBase64,
156
+ networkId: NetworkId.SOLANA_MAINNET,
157
+ });
150
158
 
151
159
  console.log("Signed transaction:", signedTx.rawTransaction);
152
160
  ```
@@ -156,11 +164,19 @@ console.log("Signed transaction:", signedTx.rawTransaction);
156
164
  ```typescript
157
165
  // Sign a message for Solana (base64url encoded)
158
166
  const solanaMessage = Buffer.from("Please sign this message to authenticate").toString("base64url");
159
- const solanaSignature = await sdk.signMessage(wallet.walletId, solanaMessage, NetworkId.SOLANA_MAINNET);
167
+ const solanaSignature = await sdk.signMessage({
168
+ walletId: wallet.walletId,
169
+ message: solanaMessage,
170
+ networkId: NetworkId.SOLANA_MAINNET,
171
+ });
160
172
 
161
173
  // Sign a message for Ethereum (base64url encoded)
162
174
  const ethMessage = Buffer.from("Sign in to our dApp").toString("base64url");
163
- const ethSignature = await sdk.signMessage(wallet.walletId, ethMessage, NetworkId.ETHEREUM_MAINNET);
175
+ const ethSignature = await sdk.signMessage({
176
+ walletId: wallet.walletId,
177
+ message: ethMessage,
178
+ networkId: NetworkId.ETHEREUM_MAINNET,
179
+ });
164
180
  ```
165
181
 
166
182
  ### Managing Wallets
@@ -218,8 +234,8 @@ For complete API documentation, visit **[docs.phantom.com/server-sdk](https://do
218
234
  ### Key Methods
219
235
 
220
236
  - `createWallet(walletName?)` - Creates a new wallet
221
- - `signAndSendTransaction(walletId, transaction, networkId)` - Signs and optionally submits transactions
222
- - `signMessage(walletId, message, networkId)` - Signs arbitrary messages
237
+ - `signAndSendTransaction(params)` - Signs and optionally submits transactions
238
+ - `signMessage(params)` - Signs arbitrary messages
223
239
  - `getWalletAddresses(walletId, derivationPaths?)` - Retrieves wallet addresses
224
240
  - `getWallets(limit?, offset?)` - Lists all wallets with pagination
225
241
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PhantomClient } from '@phantom/client';
2
- export { CreateWalletResult, DerivationPath, GetWalletsResult, NetworkConfig, NetworkId, PhantomClient, SignedTransaction, Transaction, Wallet, deriveSubmissionConfig, generateKeyPair, getDerivationPathForNetwork, getNetworkConfig, getNetworkDescription, getNetworkIdsByChain, getSupportedNetworkIds, supportsTransactionSubmission } from '@phantom/client';
2
+ export { CreateWalletResult, DerivationPath, GetWalletsResult, NetworkConfig, NetworkId, PhantomClient, SignAndSendTransactionParams, SignMessageParams, SignedTransaction, Transaction, Wallet, deriveSubmissionConfig, generateKeyPair, getDerivationPathForNetwork, getNetworkConfig, getNetworkDescription, getNetworkIdsByChain, getSupportedNetworkIds, supportsTransactionSubmission } from '@phantom/client';
3
3
  export { ApiKeyStamper } from '@phantom/api-key-stamper';
4
4
  import { DerivationInfoAddressFormatEnum } from '@phantom/openapi-wallet-service';
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phantom/server-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Server SDK for Phantom Wallet",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -13,6 +13,8 @@
13
13
  }
14
14
  },
15
15
  "scripts": {
16
+ "?pack-release": "When https://github.com/changesets/changesets/issues/432 has a solution we can remove this trick",
17
+ "pack-release": "rimraf ./_release && yarn pack && mkdir ./_release && tar zxvf ./package.tgz --directory ./_release && rm ./package.tgz",
16
18
  "build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts",
17
19
  "dev": "tsc --watch",
18
20
  "clean": "rm -rf dist",
@@ -34,11 +36,14 @@
34
36
  "typescript": "^5.0.4"
35
37
  },
36
38
  "dependencies": {
37
- "@phantom/api-key-stamper": "workspace:^",
38
- "@phantom/client": "workspace:^",
39
+ "@phantom/api-key-stamper": "^0.1.0",
40
+ "@phantom/client": "^0.1.0",
39
41
  "@phantom/openapi-wallet-service": "^0.1.7"
40
42
  },
41
43
  "files": [
42
44
  "dist"
43
- ]
44
- }
45
+ ],
46
+ "publishConfig": {
47
+ "directory": "_release/package"
48
+ }
49
+ }