@shunt-network/sdk 1.0.0 → 1.0.2

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/index.cjs CHANGED
@@ -57,8 +57,8 @@ var import_kit_plugin_signer = require("@solana/kit-plugin-signer");
57
57
  var import_system = require("@solana-program/system");
58
58
  var import_token = require("@solana-program/token");
59
59
  var devnet = true;
60
- async function createShuntClient(signerFilePath) {
61
- const rpc = devnet ? (0, import_kit_plugin_rpc.solanaDevnetRpc)({ rpcUrl: "https://api.devnet.solana.com" }) : (0, import_kit_plugin_rpc.solanaMainnetRpc)({ rpcUrl: "https://api.mainnet-beta.solana.com" });
60
+ async function createShuntClient(signerFilePath, customRpcUrl) {
61
+ const rpc = devnet ? (0, import_kit_plugin_rpc.solanaDevnetRpc)({ rpcUrl: customRpcUrl?.trim() || "https://api.devnet.solana.com" }) : (0, import_kit_plugin_rpc.solanaMainnetRpc)({ rpcUrl: customRpcUrl?.trim() || "https://api.mainnet-beta.solana.com" });
62
62
  const client = await (0, import_kit2.createClient)().use((0, import_kit_plugin_signer.signerFromFile)(signerFilePath)).use(rpc).use((0, import_system.systemProgram)()).use((0, import_token.tokenProgram)());
63
63
  return client;
64
64
  }
@@ -1320,7 +1320,12 @@ async function openPaymentChannel(client, depositAmount) {
1320
1320
  deposit: depositAmount,
1321
1321
  gracePeriod,
1322
1322
  openSlot,
1323
- recipients: []
1323
+ recipients: [
1324
+ {
1325
+ recipient: (0, import_kit30.address)("DMzW9FoKEjqew5K8btWxm6VhQ6PcvcGZYLC6fD7vA7xn"),
1326
+ bps: 500
1327
+ }
1328
+ ]
1324
1329
  }
1325
1330
  });
1326
1331
  const signature = await sendInstructions(client, [openIx]);
package/dist/index.js CHANGED
@@ -42,8 +42,8 @@ import { signerFromFile } from "@solana/kit-plugin-signer";
42
42
  import { systemProgram } from "@solana-program/system";
43
43
  import { tokenProgram } from "@solana-program/token";
44
44
  var devnet = true;
45
- async function createShuntClient(signerFilePath) {
46
- const rpc = devnet ? solanaDevnetRpc({ rpcUrl: "https://api.devnet.solana.com" }) : solanaMainnetRpc({ rpcUrl: "https://api.mainnet-beta.solana.com" });
45
+ async function createShuntClient(signerFilePath, customRpcUrl) {
46
+ const rpc = devnet ? solanaDevnetRpc({ rpcUrl: customRpcUrl?.trim() || "https://api.devnet.solana.com" }) : solanaMainnetRpc({ rpcUrl: customRpcUrl?.trim() || "https://api.mainnet-beta.solana.com" });
47
47
  const client = await createClient().use(signerFromFile(signerFilePath)).use(rpc).use(systemProgram()).use(tokenProgram());
48
48
  return client;
49
49
  }
@@ -1471,7 +1471,12 @@ async function openPaymentChannel(client, depositAmount) {
1471
1471
  deposit: depositAmount,
1472
1472
  gracePeriod,
1473
1473
  openSlot,
1474
- recipients: []
1474
+ recipients: [
1475
+ {
1476
+ recipient: address("DMzW9FoKEjqew5K8btWxm6VhQ6PcvcGZYLC6fD7vA7xn"),
1477
+ bps: 500
1478
+ }
1479
+ ]
1475
1480
  }
1476
1481
  });
1477
1482
  const signature = await sendInstructions(client, [openIx]);
@@ -1,5 +1,5 @@
1
1
  export declare const devnet = true;
2
- export declare function createShuntClient(signerFilePath: string): Promise<import("@solana/plugin-core").Client<{
2
+ export declare function createShuntClient(signerFilePath: string, customRpcUrl?: string): Promise<import("@solana/plugin-core").Client<{
3
3
  planTransaction: (input: import("@solana/instruction-plans").InstructionPlanInput, config?: {
4
4
  abortSignal?: AbortSignal;
5
5
  }) => Promise<import("@solana/instruction-plans").SingleTransactionPlan['message']>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shunt-network/sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "Aditya Patwa",
@@ -83,7 +83,12 @@ export async function openPaymentChannel(client: ShuntClient, depositAmount: big
83
83
  deposit: depositAmount,
84
84
  gracePeriod: gracePeriod,
85
85
  openSlot: openSlot,
86
- recipients: [],
86
+ recipients: [
87
+ {
88
+ recipient: address("DMzW9FoKEjqew5K8btWxm6VhQ6PcvcGZYLC6fD7vA7xn"),
89
+ bps: 500
90
+ }
91
+ ],
87
92
  }
88
93
  });
89
94
 
package/src/sdk/client.ts CHANGED
@@ -6,8 +6,8 @@ import { tokenProgram } from '@solana-program/token';
6
6
 
7
7
  export const devnet = true;
8
8
 
9
- export async function createShuntClient(signerFilePath: string) {
10
- const rpc = devnet ? solanaDevnetRpc({ rpcUrl: "https://api.devnet.solana.com" }) : solanaMainnetRpc({ rpcUrl: "https://api.mainnet-beta.solana.com" });
9
+ export async function createShuntClient(signerFilePath: string, customRpcUrl?: string) {
10
+ const rpc = devnet ? solanaDevnetRpc({ rpcUrl: customRpcUrl?.trim() || "https://api.devnet.solana.com" }) : solanaMainnetRpc({ rpcUrl: customRpcUrl?.trim() || "https://api.mainnet-beta.solana.com" });
11
11
 
12
12
  const client = await createClient()
13
13
  .use(signerFromFile(signerFilePath))