@solana/kit-plugin-airdrop 0.2.0 → 0.5.0

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.
@@ -6,24 +6,22 @@ var kit = require('@solana/kit');
6
6
  function airdrop() {
7
7
  return (client) => {
8
8
  if ("svm" in client) {
9
- const airdrop3 = (address, amount) => {
10
- client.svm.airdrop(address, amount);
11
- return Promise.resolve();
9
+ return {
10
+ ...client,
11
+ airdrop: (address, amount) => {
12
+ client.svm.airdrop(address, amount);
13
+ return Promise.resolve();
14
+ }
12
15
  };
13
- return { ...client, airdrop: airdrop3 };
14
16
  }
15
17
  const airdropInternal = kit.airdropFactory({
16
18
  rpc: client.rpc,
17
19
  rpcSubscriptions: client.rpcSubscriptions
18
20
  });
19
- const airdrop2 = (address, amount, abortSignal) => airdropInternal({
20
- abortSignal,
21
- commitment: "confirmed",
22
- lamports: amount,
23
- recipientAddress: address
24
- }).then(() => {
25
- });
26
- return { ...client, airdrop: airdrop2 };
21
+ return {
22
+ ...client,
23
+ airdrop: (address, amount, abortSignal) => airdropInternal({ abortSignal, commitment: "confirmed", lamports: amount, recipientAddress: address })
24
+ };
27
25
  };
28
26
  }
29
27
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["airdrop","airdropFactory"],"mappings":";;;;;AA0DO,SAAS,OAAA,GAAU;AACtB,EAAA,OAAO,CAAsC,MAAA,KAAgD;AACzF,IAAA,IAAI,SAAS,MAAA,EAAQ;AACjB,MAAA,MAAMA,QAAAA,GAA2B,CAAC,OAAA,EAAS,MAAA,KAAW;AAClD,QAAA,MAAA,CAAO,GAAA,CAAI,OAAA,CAAQ,OAAA,EAAS,MAAM,CAAA;AAClC,QAAA,OAAO,QAAQ,OAAA,EAAQ;AAAA,MAC3B,CAAA;AACA,MAAA,OAAO,EAAE,GAAG,MAAA,EAAQ,OAAA,EAAAA,QAAAA,EAAQ;AAAA,IAChC;AACA,IAAA,MAAM,kBAAkBC,kBAAA,CAAe;AAAA,MACnC,KAAK,MAAA,CAAO,GAAA;AAAA,MACZ,kBAAkB,MAAA,CAAO;AAAA,KAC5B,CAAA;AACD,IAAA,MAAMD,QAAAA,GAA2B,CAAC,OAAA,EAAS,MAAA,EAAQ,gBAC/C,eAAA,CAAgB;AAAA,MACZ,WAAA;AAAA,MACA,UAAA,EAAY,WAAA;AAAA,MACZ,QAAA,EAAU,MAAA;AAAA,MACV,gBAAA,EAAkB;AAAA,KACrB,CAAA,CAAE,IAAA,CAAK,MAAM;AAAA,IAAC,CAAC,CAAA;AACpB,IAAA,OAAO,EAAE,GAAG,MAAA,EAAQ,OAAA,EAAAA,QAAAA,EAAQ;AAAA,EAChC,CAAA;AACJ","file":"index.browser.cjs","sourcesContent":["import { Address, airdropFactory, Lamports } from '@solana/kit';\n\ntype LiteSVMClient = {\n svm: { airdrop: (address: Address, lamports: Lamports) => unknown };\n};\ntype RpcClient = {\n rpc: Parameters<typeof airdropFactory>[0]['rpc'];\n rpcSubscriptions: Parameters<typeof airdropFactory>[0]['rpcSubscriptions'];\n};\n\n/**\n * Function type for the `airdrop` method added to the client.\n *\n * @param address - The address to which the airdrop will be sent.\n * @param amount - The amount of lamports to airdrop.\n * @param abortSignal - Optional signal to abort the airdrop operation.\n */\nexport type AirdropFunction = (address: Address, amount: Lamports, abortSignal?: AbortSignal) => Promise<void>;\n\n/**\n * A plugin that adds an `airdrop` method to the client.\n *\n * This will use the LiteSVM's internal airdrop method if the\n * client has LiteSVM installed. Otherwise, it will rely on the\n * `Rpc` and `RpcSubscriptions` clients to perform the airdrop.\n *\n * @example\n * RPC-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, localhostRpc } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a localhost RPC.\n * const client = createEmptyClient()\n * .use(localhostRpc())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @example\n * LiteSVM-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, litesvm } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a LiteSVM instance.\n * const client = createEmptyClient()\n * .use(litesvm())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @see {@link AirdropFunction}\n */\nexport function airdrop() {\n return <T extends LiteSVMClient | RpcClient>(client: T): T & { airdrop: AirdropFunction } => {\n if ('svm' in client) {\n const airdrop: AirdropFunction = (address, amount) => {\n client.svm.airdrop(address, amount);\n return Promise.resolve();\n };\n return { ...client, airdrop };\n }\n const airdropInternal = airdropFactory({\n rpc: client.rpc,\n rpcSubscriptions: client.rpcSubscriptions,\n });\n const airdrop: AirdropFunction = (address, amount, abortSignal) =>\n airdropInternal({\n abortSignal,\n commitment: 'confirmed',\n lamports: amount,\n recipientAddress: address,\n }).then(() => {});\n return { ...client, airdrop };\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["airdropFactory"],"mappings":";;;;;AAiDO,SAAS,OAAA,GAAU;AACtB,EAAA,OAAO,CAAsC,MAAA,KAAqC;AAC9E,IAAA,IAAI,SAAS,MAAA,EAAQ;AACjB,MAAA,OAAO;AAAA,QACH,GAAG,MAAA;AAAA,QACH,OAAA,EAAS,CAAC,OAAA,EAAS,MAAA,KAAW;AAC1B,UAAA,MAAA,CAAO,GAAA,CAAI,OAAA,CAAQ,OAAA,EAAS,MAAM,CAAA;AAClC,UAAA,OAAO,QAAQ,OAAA,EAAQ;AAAA,QAC3B;AAAA,OACJ;AAAA,IACJ;AACA,IAAA,MAAM,kBAAkBA,kBAAA,CAAe;AAAA,MACnC,KAAK,MAAA,CAAO,GAAA;AAAA,MACZ,kBAAkB,MAAA,CAAO;AAAA,KAC5B,CAAA;AACD,IAAA,OAAO;AAAA,MACH,GAAG,MAAA;AAAA,MACH,OAAA,EAAS,CAAC,OAAA,EAAS,MAAA,EAAQ,gBACvB,eAAA,CAAgB,EAAE,WAAA,EAAa,UAAA,EAAY,WAAA,EAAa,QAAA,EAAU,MAAA,EAAQ,gBAAA,EAAkB,SAAS;AAAA,KAC7G;AAAA,EACJ,CAAA;AACJ","file":"index.browser.cjs","sourcesContent":["import { Address, airdropFactory, ClientWithAirdrop, Lamports } from '@solana/kit';\n\ntype LiteSVMClient = {\n svm: { airdrop: (address: Address, lamports: Lamports) => unknown };\n};\ntype RpcClient = {\n rpc: Parameters<typeof airdropFactory>[0]['rpc'];\n rpcSubscriptions: Parameters<typeof airdropFactory>[0]['rpcSubscriptions'];\n};\n\n/**\n * A plugin that adds an `airdrop` method to the client.\n *\n * This will use the LiteSVM's internal airdrop method if the\n * client has LiteSVM installed. Otherwise, it will rely on the\n * `Rpc` and `RpcSubscriptions` clients to perform the airdrop.\n *\n * @example\n * RPC-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, localhostRpc } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a localhost RPC.\n * const client = createEmptyClient()\n * .use(localhostRpc())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @example\n * LiteSVM-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, litesvm } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a LiteSVM instance.\n * const client = createEmptyClient()\n * .use(litesvm())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @see {@link AirdropFunction}\n */\nexport function airdrop() {\n return <T extends LiteSVMClient | RpcClient>(client: T): ClientWithAirdrop & T => {\n if ('svm' in client) {\n return {\n ...client,\n airdrop: (address, amount) => {\n client.svm.airdrop(address, amount);\n return Promise.resolve();\n },\n } as ClientWithAirdrop & T;\n }\n const airdropInternal = airdropFactory({\n rpc: client.rpc,\n rpcSubscriptions: client.rpcSubscriptions,\n });\n return {\n ...client,\n airdrop: (address, amount, abortSignal) =>\n airdropInternal({ abortSignal, commitment: 'confirmed', lamports: amount, recipientAddress: address }),\n } as ClientWithAirdrop & T;\n };\n}\n"]}
@@ -4,24 +4,22 @@ import { airdropFactory } from '@solana/kit';
4
4
  function airdrop() {
5
5
  return (client) => {
6
6
  if ("svm" in client) {
7
- const airdrop3 = (address, amount) => {
8
- client.svm.airdrop(address, amount);
9
- return Promise.resolve();
7
+ return {
8
+ ...client,
9
+ airdrop: (address, amount) => {
10
+ client.svm.airdrop(address, amount);
11
+ return Promise.resolve();
12
+ }
10
13
  };
11
- return { ...client, airdrop: airdrop3 };
12
14
  }
13
15
  const airdropInternal = airdropFactory({
14
16
  rpc: client.rpc,
15
17
  rpcSubscriptions: client.rpcSubscriptions
16
18
  });
17
- const airdrop2 = (address, amount, abortSignal) => airdropInternal({
18
- abortSignal,
19
- commitment: "confirmed",
20
- lamports: amount,
21
- recipientAddress: address
22
- }).then(() => {
23
- });
24
- return { ...client, airdrop: airdrop2 };
19
+ return {
20
+ ...client,
21
+ airdrop: (address, amount, abortSignal) => airdropInternal({ abortSignal, commitment: "confirmed", lamports: amount, recipientAddress: address })
22
+ };
25
23
  };
26
24
  }
27
25
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["airdrop"],"mappings":";;;AA0DO,SAAS,OAAA,GAAU;AACtB,EAAA,OAAO,CAAsC,MAAA,KAAgD;AACzF,IAAA,IAAI,SAAS,MAAA,EAAQ;AACjB,MAAA,MAAMA,QAAAA,GAA2B,CAAC,OAAA,EAAS,MAAA,KAAW;AAClD,QAAA,MAAA,CAAO,GAAA,CAAI,OAAA,CAAQ,OAAA,EAAS,MAAM,CAAA;AAClC,QAAA,OAAO,QAAQ,OAAA,EAAQ;AAAA,MAC3B,CAAA;AACA,MAAA,OAAO,EAAE,GAAG,MAAA,EAAQ,OAAA,EAAAA,QAAAA,EAAQ;AAAA,IAChC;AACA,IAAA,MAAM,kBAAkB,cAAA,CAAe;AAAA,MACnC,KAAK,MAAA,CAAO,GAAA;AAAA,MACZ,kBAAkB,MAAA,CAAO;AAAA,KAC5B,CAAA;AACD,IAAA,MAAMA,QAAAA,GAA2B,CAAC,OAAA,EAAS,MAAA,EAAQ,gBAC/C,eAAA,CAAgB;AAAA,MACZ,WAAA;AAAA,MACA,UAAA,EAAY,WAAA;AAAA,MACZ,QAAA,EAAU,MAAA;AAAA,MACV,gBAAA,EAAkB;AAAA,KACrB,CAAA,CAAE,IAAA,CAAK,MAAM;AAAA,IAAC,CAAC,CAAA;AACpB,IAAA,OAAO,EAAE,GAAG,MAAA,EAAQ,OAAA,EAAAA,QAAAA,EAAQ;AAAA,EAChC,CAAA;AACJ","file":"index.browser.mjs","sourcesContent":["import { Address, airdropFactory, Lamports } from '@solana/kit';\n\ntype LiteSVMClient = {\n svm: { airdrop: (address: Address, lamports: Lamports) => unknown };\n};\ntype RpcClient = {\n rpc: Parameters<typeof airdropFactory>[0]['rpc'];\n rpcSubscriptions: Parameters<typeof airdropFactory>[0]['rpcSubscriptions'];\n};\n\n/**\n * Function type for the `airdrop` method added to the client.\n *\n * @param address - The address to which the airdrop will be sent.\n * @param amount - The amount of lamports to airdrop.\n * @param abortSignal - Optional signal to abort the airdrop operation.\n */\nexport type AirdropFunction = (address: Address, amount: Lamports, abortSignal?: AbortSignal) => Promise<void>;\n\n/**\n * A plugin that adds an `airdrop` method to the client.\n *\n * This will use the LiteSVM's internal airdrop method if the\n * client has LiteSVM installed. Otherwise, it will rely on the\n * `Rpc` and `RpcSubscriptions` clients to perform the airdrop.\n *\n * @example\n * RPC-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, localhostRpc } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a localhost RPC.\n * const client = createEmptyClient()\n * .use(localhostRpc())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @example\n * LiteSVM-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, litesvm } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a LiteSVM instance.\n * const client = createEmptyClient()\n * .use(litesvm())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @see {@link AirdropFunction}\n */\nexport function airdrop() {\n return <T extends LiteSVMClient | RpcClient>(client: T): T & { airdrop: AirdropFunction } => {\n if ('svm' in client) {\n const airdrop: AirdropFunction = (address, amount) => {\n client.svm.airdrop(address, amount);\n return Promise.resolve();\n };\n return { ...client, airdrop };\n }\n const airdropInternal = airdropFactory({\n rpc: client.rpc,\n rpcSubscriptions: client.rpcSubscriptions,\n });\n const airdrop: AirdropFunction = (address, amount, abortSignal) =>\n airdropInternal({\n abortSignal,\n commitment: 'confirmed',\n lamports: amount,\n recipientAddress: address,\n }).then(() => {});\n return { ...client, airdrop };\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;AAiDO,SAAS,OAAA,GAAU;AACtB,EAAA,OAAO,CAAsC,MAAA,KAAqC;AAC9E,IAAA,IAAI,SAAS,MAAA,EAAQ;AACjB,MAAA,OAAO;AAAA,QACH,GAAG,MAAA;AAAA,QACH,OAAA,EAAS,CAAC,OAAA,EAAS,MAAA,KAAW;AAC1B,UAAA,MAAA,CAAO,GAAA,CAAI,OAAA,CAAQ,OAAA,EAAS,MAAM,CAAA;AAClC,UAAA,OAAO,QAAQ,OAAA,EAAQ;AAAA,QAC3B;AAAA,OACJ;AAAA,IACJ;AACA,IAAA,MAAM,kBAAkB,cAAA,CAAe;AAAA,MACnC,KAAK,MAAA,CAAO,GAAA;AAAA,MACZ,kBAAkB,MAAA,CAAO;AAAA,KAC5B,CAAA;AACD,IAAA,OAAO;AAAA,MACH,GAAG,MAAA;AAAA,MACH,OAAA,EAAS,CAAC,OAAA,EAAS,MAAA,EAAQ,gBACvB,eAAA,CAAgB,EAAE,WAAA,EAAa,UAAA,EAAY,WAAA,EAAa,QAAA,EAAU,MAAA,EAAQ,gBAAA,EAAkB,SAAS;AAAA,KAC7G;AAAA,EACJ,CAAA;AACJ","file":"index.browser.mjs","sourcesContent":["import { Address, airdropFactory, ClientWithAirdrop, Lamports } from '@solana/kit';\n\ntype LiteSVMClient = {\n svm: { airdrop: (address: Address, lamports: Lamports) => unknown };\n};\ntype RpcClient = {\n rpc: Parameters<typeof airdropFactory>[0]['rpc'];\n rpcSubscriptions: Parameters<typeof airdropFactory>[0]['rpcSubscriptions'];\n};\n\n/**\n * A plugin that adds an `airdrop` method to the client.\n *\n * This will use the LiteSVM's internal airdrop method if the\n * client has LiteSVM installed. Otherwise, it will rely on the\n * `Rpc` and `RpcSubscriptions` clients to perform the airdrop.\n *\n * @example\n * RPC-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, localhostRpc } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a localhost RPC.\n * const client = createEmptyClient()\n * .use(localhostRpc())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @example\n * LiteSVM-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, litesvm } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a LiteSVM instance.\n * const client = createEmptyClient()\n * .use(litesvm())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @see {@link AirdropFunction}\n */\nexport function airdrop() {\n return <T extends LiteSVMClient | RpcClient>(client: T): ClientWithAirdrop & T => {\n if ('svm' in client) {\n return {\n ...client,\n airdrop: (address, amount) => {\n client.svm.airdrop(address, amount);\n return Promise.resolve();\n },\n } as ClientWithAirdrop & T;\n }\n const airdropInternal = airdropFactory({\n rpc: client.rpc,\n rpcSubscriptions: client.rpcSubscriptions,\n });\n return {\n ...client,\n airdrop: (address, amount, abortSignal) =>\n airdropInternal({ abortSignal, commitment: 'confirmed', lamports: amount, recipientAddress: address }),\n } as ClientWithAirdrop & T;\n };\n}\n"]}
@@ -6,24 +6,22 @@ var kit = require('@solana/kit');
6
6
  function airdrop() {
7
7
  return (client) => {
8
8
  if ("svm" in client) {
9
- const airdrop3 = (address, amount) => {
10
- client.svm.airdrop(address, amount);
11
- return Promise.resolve();
9
+ return {
10
+ ...client,
11
+ airdrop: (address, amount) => {
12
+ client.svm.airdrop(address, amount);
13
+ return Promise.resolve();
14
+ }
12
15
  };
13
- return { ...client, airdrop: airdrop3 };
14
16
  }
15
17
  const airdropInternal = kit.airdropFactory({
16
18
  rpc: client.rpc,
17
19
  rpcSubscriptions: client.rpcSubscriptions
18
20
  });
19
- const airdrop2 = (address, amount, abortSignal) => airdropInternal({
20
- abortSignal,
21
- commitment: "confirmed",
22
- lamports: amount,
23
- recipientAddress: address
24
- }).then(() => {
25
- });
26
- return { ...client, airdrop: airdrop2 };
21
+ return {
22
+ ...client,
23
+ airdrop: (address, amount, abortSignal) => airdropInternal({ abortSignal, commitment: "confirmed", lamports: amount, recipientAddress: address })
24
+ };
27
25
  };
28
26
  }
29
27
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["airdrop","airdropFactory"],"mappings":";;;;;AA0DO,SAAS,OAAA,GAAU;AACtB,EAAA,OAAO,CAAsC,MAAA,KAAgD;AACzF,IAAA,IAAI,SAAS,MAAA,EAAQ;AACjB,MAAA,MAAMA,QAAAA,GAA2B,CAAC,OAAA,EAAS,MAAA,KAAW;AAClD,QAAA,MAAA,CAAO,GAAA,CAAI,OAAA,CAAQ,OAAA,EAAS,MAAM,CAAA;AAClC,QAAA,OAAO,QAAQ,OAAA,EAAQ;AAAA,MAC3B,CAAA;AACA,MAAA,OAAO,EAAE,GAAG,MAAA,EAAQ,OAAA,EAAAA,QAAAA,EAAQ;AAAA,IAChC;AACA,IAAA,MAAM,kBAAkBC,kBAAA,CAAe;AAAA,MACnC,KAAK,MAAA,CAAO,GAAA;AAAA,MACZ,kBAAkB,MAAA,CAAO;AAAA,KAC5B,CAAA;AACD,IAAA,MAAMD,QAAAA,GAA2B,CAAC,OAAA,EAAS,MAAA,EAAQ,gBAC/C,eAAA,CAAgB;AAAA,MACZ,WAAA;AAAA,MACA,UAAA,EAAY,WAAA;AAAA,MACZ,QAAA,EAAU,MAAA;AAAA,MACV,gBAAA,EAAkB;AAAA,KACrB,CAAA,CAAE,IAAA,CAAK,MAAM;AAAA,IAAC,CAAC,CAAA;AACpB,IAAA,OAAO,EAAE,GAAG,MAAA,EAAQ,OAAA,EAAAA,QAAAA,EAAQ;AAAA,EAChC,CAAA;AACJ","file":"index.node.cjs","sourcesContent":["import { Address, airdropFactory, Lamports } from '@solana/kit';\n\ntype LiteSVMClient = {\n svm: { airdrop: (address: Address, lamports: Lamports) => unknown };\n};\ntype RpcClient = {\n rpc: Parameters<typeof airdropFactory>[0]['rpc'];\n rpcSubscriptions: Parameters<typeof airdropFactory>[0]['rpcSubscriptions'];\n};\n\n/**\n * Function type for the `airdrop` method added to the client.\n *\n * @param address - The address to which the airdrop will be sent.\n * @param amount - The amount of lamports to airdrop.\n * @param abortSignal - Optional signal to abort the airdrop operation.\n */\nexport type AirdropFunction = (address: Address, amount: Lamports, abortSignal?: AbortSignal) => Promise<void>;\n\n/**\n * A plugin that adds an `airdrop` method to the client.\n *\n * This will use the LiteSVM's internal airdrop method if the\n * client has LiteSVM installed. Otherwise, it will rely on the\n * `Rpc` and `RpcSubscriptions` clients to perform the airdrop.\n *\n * @example\n * RPC-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, localhostRpc } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a localhost RPC.\n * const client = createEmptyClient()\n * .use(localhostRpc())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @example\n * LiteSVM-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, litesvm } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a LiteSVM instance.\n * const client = createEmptyClient()\n * .use(litesvm())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @see {@link AirdropFunction}\n */\nexport function airdrop() {\n return <T extends LiteSVMClient | RpcClient>(client: T): T & { airdrop: AirdropFunction } => {\n if ('svm' in client) {\n const airdrop: AirdropFunction = (address, amount) => {\n client.svm.airdrop(address, amount);\n return Promise.resolve();\n };\n return { ...client, airdrop };\n }\n const airdropInternal = airdropFactory({\n rpc: client.rpc,\n rpcSubscriptions: client.rpcSubscriptions,\n });\n const airdrop: AirdropFunction = (address, amount, abortSignal) =>\n airdropInternal({\n abortSignal,\n commitment: 'confirmed',\n lamports: amount,\n recipientAddress: address,\n }).then(() => {});\n return { ...client, airdrop };\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["airdropFactory"],"mappings":";;;;;AAiDO,SAAS,OAAA,GAAU;AACtB,EAAA,OAAO,CAAsC,MAAA,KAAqC;AAC9E,IAAA,IAAI,SAAS,MAAA,EAAQ;AACjB,MAAA,OAAO;AAAA,QACH,GAAG,MAAA;AAAA,QACH,OAAA,EAAS,CAAC,OAAA,EAAS,MAAA,KAAW;AAC1B,UAAA,MAAA,CAAO,GAAA,CAAI,OAAA,CAAQ,OAAA,EAAS,MAAM,CAAA;AAClC,UAAA,OAAO,QAAQ,OAAA,EAAQ;AAAA,QAC3B;AAAA,OACJ;AAAA,IACJ;AACA,IAAA,MAAM,kBAAkBA,kBAAA,CAAe;AAAA,MACnC,KAAK,MAAA,CAAO,GAAA;AAAA,MACZ,kBAAkB,MAAA,CAAO;AAAA,KAC5B,CAAA;AACD,IAAA,OAAO;AAAA,MACH,GAAG,MAAA;AAAA,MACH,OAAA,EAAS,CAAC,OAAA,EAAS,MAAA,EAAQ,gBACvB,eAAA,CAAgB,EAAE,WAAA,EAAa,UAAA,EAAY,WAAA,EAAa,QAAA,EAAU,MAAA,EAAQ,gBAAA,EAAkB,SAAS;AAAA,KAC7G;AAAA,EACJ,CAAA;AACJ","file":"index.node.cjs","sourcesContent":["import { Address, airdropFactory, ClientWithAirdrop, Lamports } from '@solana/kit';\n\ntype LiteSVMClient = {\n svm: { airdrop: (address: Address, lamports: Lamports) => unknown };\n};\ntype RpcClient = {\n rpc: Parameters<typeof airdropFactory>[0]['rpc'];\n rpcSubscriptions: Parameters<typeof airdropFactory>[0]['rpcSubscriptions'];\n};\n\n/**\n * A plugin that adds an `airdrop` method to the client.\n *\n * This will use the LiteSVM's internal airdrop method if the\n * client has LiteSVM installed. Otherwise, it will rely on the\n * `Rpc` and `RpcSubscriptions` clients to perform the airdrop.\n *\n * @example\n * RPC-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, localhostRpc } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a localhost RPC.\n * const client = createEmptyClient()\n * .use(localhostRpc())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @example\n * LiteSVM-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, litesvm } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a LiteSVM instance.\n * const client = createEmptyClient()\n * .use(litesvm())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @see {@link AirdropFunction}\n */\nexport function airdrop() {\n return <T extends LiteSVMClient | RpcClient>(client: T): ClientWithAirdrop & T => {\n if ('svm' in client) {\n return {\n ...client,\n airdrop: (address, amount) => {\n client.svm.airdrop(address, amount);\n return Promise.resolve();\n },\n } as ClientWithAirdrop & T;\n }\n const airdropInternal = airdropFactory({\n rpc: client.rpc,\n rpcSubscriptions: client.rpcSubscriptions,\n });\n return {\n ...client,\n airdrop: (address, amount, abortSignal) =>\n airdropInternal({ abortSignal, commitment: 'confirmed', lamports: amount, recipientAddress: address }),\n } as ClientWithAirdrop & T;\n };\n}\n"]}
@@ -4,24 +4,22 @@ import { airdropFactory } from '@solana/kit';
4
4
  function airdrop() {
5
5
  return (client) => {
6
6
  if ("svm" in client) {
7
- const airdrop3 = (address, amount) => {
8
- client.svm.airdrop(address, amount);
9
- return Promise.resolve();
7
+ return {
8
+ ...client,
9
+ airdrop: (address, amount) => {
10
+ client.svm.airdrop(address, amount);
11
+ return Promise.resolve();
12
+ }
10
13
  };
11
- return { ...client, airdrop: airdrop3 };
12
14
  }
13
15
  const airdropInternal = airdropFactory({
14
16
  rpc: client.rpc,
15
17
  rpcSubscriptions: client.rpcSubscriptions
16
18
  });
17
- const airdrop2 = (address, amount, abortSignal) => airdropInternal({
18
- abortSignal,
19
- commitment: "confirmed",
20
- lamports: amount,
21
- recipientAddress: address
22
- }).then(() => {
23
- });
24
- return { ...client, airdrop: airdrop2 };
19
+ return {
20
+ ...client,
21
+ airdrop: (address, amount, abortSignal) => airdropInternal({ abortSignal, commitment: "confirmed", lamports: amount, recipientAddress: address })
22
+ };
25
23
  };
26
24
  }
27
25
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["airdrop"],"mappings":";;;AA0DO,SAAS,OAAA,GAAU;AACtB,EAAA,OAAO,CAAsC,MAAA,KAAgD;AACzF,IAAA,IAAI,SAAS,MAAA,EAAQ;AACjB,MAAA,MAAMA,QAAAA,GAA2B,CAAC,OAAA,EAAS,MAAA,KAAW;AAClD,QAAA,MAAA,CAAO,GAAA,CAAI,OAAA,CAAQ,OAAA,EAAS,MAAM,CAAA;AAClC,QAAA,OAAO,QAAQ,OAAA,EAAQ;AAAA,MAC3B,CAAA;AACA,MAAA,OAAO,EAAE,GAAG,MAAA,EAAQ,OAAA,EAAAA,QAAAA,EAAQ;AAAA,IAChC;AACA,IAAA,MAAM,kBAAkB,cAAA,CAAe;AAAA,MACnC,KAAK,MAAA,CAAO,GAAA;AAAA,MACZ,kBAAkB,MAAA,CAAO;AAAA,KAC5B,CAAA;AACD,IAAA,MAAMA,QAAAA,GAA2B,CAAC,OAAA,EAAS,MAAA,EAAQ,gBAC/C,eAAA,CAAgB;AAAA,MACZ,WAAA;AAAA,MACA,UAAA,EAAY,WAAA;AAAA,MACZ,QAAA,EAAU,MAAA;AAAA,MACV,gBAAA,EAAkB;AAAA,KACrB,CAAA,CAAE,IAAA,CAAK,MAAM;AAAA,IAAC,CAAC,CAAA;AACpB,IAAA,OAAO,EAAE,GAAG,MAAA,EAAQ,OAAA,EAAAA,QAAAA,EAAQ;AAAA,EAChC,CAAA;AACJ","file":"index.node.mjs","sourcesContent":["import { Address, airdropFactory, Lamports } from '@solana/kit';\n\ntype LiteSVMClient = {\n svm: { airdrop: (address: Address, lamports: Lamports) => unknown };\n};\ntype RpcClient = {\n rpc: Parameters<typeof airdropFactory>[0]['rpc'];\n rpcSubscriptions: Parameters<typeof airdropFactory>[0]['rpcSubscriptions'];\n};\n\n/**\n * Function type for the `airdrop` method added to the client.\n *\n * @param address - The address to which the airdrop will be sent.\n * @param amount - The amount of lamports to airdrop.\n * @param abortSignal - Optional signal to abort the airdrop operation.\n */\nexport type AirdropFunction = (address: Address, amount: Lamports, abortSignal?: AbortSignal) => Promise<void>;\n\n/**\n * A plugin that adds an `airdrop` method to the client.\n *\n * This will use the LiteSVM's internal airdrop method if the\n * client has LiteSVM installed. Otherwise, it will rely on the\n * `Rpc` and `RpcSubscriptions` clients to perform the airdrop.\n *\n * @example\n * RPC-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, localhostRpc } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a localhost RPC.\n * const client = createEmptyClient()\n * .use(localhostRpc())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @example\n * LiteSVM-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, litesvm } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a LiteSVM instance.\n * const client = createEmptyClient()\n * .use(litesvm())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @see {@link AirdropFunction}\n */\nexport function airdrop() {\n return <T extends LiteSVMClient | RpcClient>(client: T): T & { airdrop: AirdropFunction } => {\n if ('svm' in client) {\n const airdrop: AirdropFunction = (address, amount) => {\n client.svm.airdrop(address, amount);\n return Promise.resolve();\n };\n return { ...client, airdrop };\n }\n const airdropInternal = airdropFactory({\n rpc: client.rpc,\n rpcSubscriptions: client.rpcSubscriptions,\n });\n const airdrop: AirdropFunction = (address, amount, abortSignal) =>\n airdropInternal({\n abortSignal,\n commitment: 'confirmed',\n lamports: amount,\n recipientAddress: address,\n }).then(() => {});\n return { ...client, airdrop };\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;AAiDO,SAAS,OAAA,GAAU;AACtB,EAAA,OAAO,CAAsC,MAAA,KAAqC;AAC9E,IAAA,IAAI,SAAS,MAAA,EAAQ;AACjB,MAAA,OAAO;AAAA,QACH,GAAG,MAAA;AAAA,QACH,OAAA,EAAS,CAAC,OAAA,EAAS,MAAA,KAAW;AAC1B,UAAA,MAAA,CAAO,GAAA,CAAI,OAAA,CAAQ,OAAA,EAAS,MAAM,CAAA;AAClC,UAAA,OAAO,QAAQ,OAAA,EAAQ;AAAA,QAC3B;AAAA,OACJ;AAAA,IACJ;AACA,IAAA,MAAM,kBAAkB,cAAA,CAAe;AAAA,MACnC,KAAK,MAAA,CAAO,GAAA;AAAA,MACZ,kBAAkB,MAAA,CAAO;AAAA,KAC5B,CAAA;AACD,IAAA,OAAO;AAAA,MACH,GAAG,MAAA;AAAA,MACH,OAAA,EAAS,CAAC,OAAA,EAAS,MAAA,EAAQ,gBACvB,eAAA,CAAgB,EAAE,WAAA,EAAa,UAAA,EAAY,WAAA,EAAa,QAAA,EAAU,MAAA,EAAQ,gBAAA,EAAkB,SAAS;AAAA,KAC7G;AAAA,EACJ,CAAA;AACJ","file":"index.node.mjs","sourcesContent":["import { Address, airdropFactory, ClientWithAirdrop, Lamports } from '@solana/kit';\n\ntype LiteSVMClient = {\n svm: { airdrop: (address: Address, lamports: Lamports) => unknown };\n};\ntype RpcClient = {\n rpc: Parameters<typeof airdropFactory>[0]['rpc'];\n rpcSubscriptions: Parameters<typeof airdropFactory>[0]['rpcSubscriptions'];\n};\n\n/**\n * A plugin that adds an `airdrop` method to the client.\n *\n * This will use the LiteSVM's internal airdrop method if the\n * client has LiteSVM installed. Otherwise, it will rely on the\n * `Rpc` and `RpcSubscriptions` clients to perform the airdrop.\n *\n * @example\n * RPC-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, localhostRpc } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a localhost RPC.\n * const client = createEmptyClient()\n * .use(localhostRpc())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @example\n * LiteSVM-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, litesvm } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a LiteSVM instance.\n * const client = createEmptyClient()\n * .use(litesvm())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @see {@link AirdropFunction}\n */\nexport function airdrop() {\n return <T extends LiteSVMClient | RpcClient>(client: T): ClientWithAirdrop & T => {\n if ('svm' in client) {\n return {\n ...client,\n airdrop: (address, amount) => {\n client.svm.airdrop(address, amount);\n return Promise.resolve();\n },\n } as ClientWithAirdrop & T;\n }\n const airdropInternal = airdropFactory({\n rpc: client.rpc,\n rpcSubscriptions: client.rpcSubscriptions,\n });\n return {\n ...client,\n airdrop: (address, amount, abortSignal) =>\n airdropInternal({ abortSignal, commitment: 'confirmed', lamports: amount, recipientAddress: address }),\n } as ClientWithAirdrop & T;\n };\n}\n"]}
@@ -4,24 +4,22 @@ import { airdropFactory } from '@solana/kit';
4
4
  function airdrop() {
5
5
  return (client) => {
6
6
  if ("svm" in client) {
7
- const airdrop3 = (address, amount) => {
8
- client.svm.airdrop(address, amount);
9
- return Promise.resolve();
7
+ return {
8
+ ...client,
9
+ airdrop: (address, amount) => {
10
+ client.svm.airdrop(address, amount);
11
+ return Promise.resolve();
12
+ }
10
13
  };
11
- return { ...client, airdrop: airdrop3 };
12
14
  }
13
15
  const airdropInternal = airdropFactory({
14
16
  rpc: client.rpc,
15
17
  rpcSubscriptions: client.rpcSubscriptions
16
18
  });
17
- const airdrop2 = (address, amount, abortSignal) => airdropInternal({
18
- abortSignal,
19
- commitment: "confirmed",
20
- lamports: amount,
21
- recipientAddress: address
22
- }).then(() => {
23
- });
24
- return { ...client, airdrop: airdrop2 };
19
+ return {
20
+ ...client,
21
+ airdrop: (address, amount, abortSignal) => airdropInternal({ abortSignal, commitment: "confirmed", lamports: amount, recipientAddress: address })
22
+ };
25
23
  };
26
24
  }
27
25
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["airdrop"],"mappings":";;;AA0DO,SAAS,OAAA,GAAU;AACtB,EAAA,OAAO,CAAsC,MAAA,KAAgD;AACzF,IAAA,IAAI,SAAS,MAAA,EAAQ;AACjB,MAAA,MAAMA,QAAAA,GAA2B,CAAC,OAAA,EAAS,MAAA,KAAW;AAClD,QAAA,MAAA,CAAO,GAAA,CAAI,OAAA,CAAQ,OAAA,EAAS,MAAM,CAAA;AAClC,QAAA,OAAO,QAAQ,OAAA,EAAQ;AAAA,MAC3B,CAAA;AACA,MAAA,OAAO,EAAE,GAAG,MAAA,EAAQ,OAAA,EAAAA,QAAAA,EAAQ;AAAA,IAChC;AACA,IAAA,MAAM,kBAAkB,cAAA,CAAe;AAAA,MACnC,KAAK,MAAA,CAAO,GAAA;AAAA,MACZ,kBAAkB,MAAA,CAAO;AAAA,KAC5B,CAAA;AACD,IAAA,MAAMA,QAAAA,GAA2B,CAAC,OAAA,EAAS,MAAA,EAAQ,gBAC/C,eAAA,CAAgB;AAAA,MACZ,WAAA;AAAA,MACA,UAAA,EAAY,WAAA;AAAA,MACZ,QAAA,EAAU,MAAA;AAAA,MACV,gBAAA,EAAkB;AAAA,KACrB,CAAA,CAAE,IAAA,CAAK,MAAM;AAAA,IAAC,CAAC,CAAA;AACpB,IAAA,OAAO,EAAE,GAAG,MAAA,EAAQ,OAAA,EAAAA,QAAAA,EAAQ;AAAA,EAChC,CAAA;AACJ","file":"index.react-native.mjs","sourcesContent":["import { Address, airdropFactory, Lamports } from '@solana/kit';\n\ntype LiteSVMClient = {\n svm: { airdrop: (address: Address, lamports: Lamports) => unknown };\n};\ntype RpcClient = {\n rpc: Parameters<typeof airdropFactory>[0]['rpc'];\n rpcSubscriptions: Parameters<typeof airdropFactory>[0]['rpcSubscriptions'];\n};\n\n/**\n * Function type for the `airdrop` method added to the client.\n *\n * @param address - The address to which the airdrop will be sent.\n * @param amount - The amount of lamports to airdrop.\n * @param abortSignal - Optional signal to abort the airdrop operation.\n */\nexport type AirdropFunction = (address: Address, amount: Lamports, abortSignal?: AbortSignal) => Promise<void>;\n\n/**\n * A plugin that adds an `airdrop` method to the client.\n *\n * This will use the LiteSVM's internal airdrop method if the\n * client has LiteSVM installed. Otherwise, it will rely on the\n * `Rpc` and `RpcSubscriptions` clients to perform the airdrop.\n *\n * @example\n * RPC-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, localhostRpc } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a localhost RPC.\n * const client = createEmptyClient()\n * .use(localhostRpc())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @example\n * LiteSVM-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, litesvm } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a LiteSVM instance.\n * const client = createEmptyClient()\n * .use(litesvm())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @see {@link AirdropFunction}\n */\nexport function airdrop() {\n return <T extends LiteSVMClient | RpcClient>(client: T): T & { airdrop: AirdropFunction } => {\n if ('svm' in client) {\n const airdrop: AirdropFunction = (address, amount) => {\n client.svm.airdrop(address, amount);\n return Promise.resolve();\n };\n return { ...client, airdrop };\n }\n const airdropInternal = airdropFactory({\n rpc: client.rpc,\n rpcSubscriptions: client.rpcSubscriptions,\n });\n const airdrop: AirdropFunction = (address, amount, abortSignal) =>\n airdropInternal({\n abortSignal,\n commitment: 'confirmed',\n lamports: amount,\n recipientAddress: address,\n }).then(() => {});\n return { ...client, airdrop };\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;AAiDO,SAAS,OAAA,GAAU;AACtB,EAAA,OAAO,CAAsC,MAAA,KAAqC;AAC9E,IAAA,IAAI,SAAS,MAAA,EAAQ;AACjB,MAAA,OAAO;AAAA,QACH,GAAG,MAAA;AAAA,QACH,OAAA,EAAS,CAAC,OAAA,EAAS,MAAA,KAAW;AAC1B,UAAA,MAAA,CAAO,GAAA,CAAI,OAAA,CAAQ,OAAA,EAAS,MAAM,CAAA;AAClC,UAAA,OAAO,QAAQ,OAAA,EAAQ;AAAA,QAC3B;AAAA,OACJ;AAAA,IACJ;AACA,IAAA,MAAM,kBAAkB,cAAA,CAAe;AAAA,MACnC,KAAK,MAAA,CAAO,GAAA;AAAA,MACZ,kBAAkB,MAAA,CAAO;AAAA,KAC5B,CAAA;AACD,IAAA,OAAO;AAAA,MACH,GAAG,MAAA;AAAA,MACH,OAAA,EAAS,CAAC,OAAA,EAAS,MAAA,EAAQ,gBACvB,eAAA,CAAgB,EAAE,WAAA,EAAa,UAAA,EAAY,WAAA,EAAa,QAAA,EAAU,MAAA,EAAQ,gBAAA,EAAkB,SAAS;AAAA,KAC7G;AAAA,EACJ,CAAA;AACJ","file":"index.react-native.mjs","sourcesContent":["import { Address, airdropFactory, ClientWithAirdrop, Lamports } from '@solana/kit';\n\ntype LiteSVMClient = {\n svm: { airdrop: (address: Address, lamports: Lamports) => unknown };\n};\ntype RpcClient = {\n rpc: Parameters<typeof airdropFactory>[0]['rpc'];\n rpcSubscriptions: Parameters<typeof airdropFactory>[0]['rpcSubscriptions'];\n};\n\n/**\n * A plugin that adds an `airdrop` method to the client.\n *\n * This will use the LiteSVM's internal airdrop method if the\n * client has LiteSVM installed. Otherwise, it will rely on the\n * `Rpc` and `RpcSubscriptions` clients to perform the airdrop.\n *\n * @example\n * RPC-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, localhostRpc } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a localhost RPC.\n * const client = createEmptyClient()\n * .use(localhostRpc())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @example\n * LiteSVM-based airdrop.\n * ```ts\n * import { createEmptyClient } from '@solana/kit';\n * import { airdrop, litesvm } from '@solana/kit-plugins';\n *\n * // Install the airdrop plugin using a LiteSVM instance.\n * const client = createEmptyClient()\n * .use(litesvm())\n * .use(airdrop());\n *\n * // Use the airdrop method.\n * client.airdrop(myAddress, lamports(1_000_000_000n));\n * ```\n *\n * @see {@link AirdropFunction}\n */\nexport function airdrop() {\n return <T extends LiteSVMClient | RpcClient>(client: T): ClientWithAirdrop & T => {\n if ('svm' in client) {\n return {\n ...client,\n airdrop: (address, amount) => {\n client.svm.airdrop(address, amount);\n return Promise.resolve();\n },\n } as ClientWithAirdrop & T;\n }\n const airdropInternal = airdropFactory({\n rpc: client.rpc,\n rpcSubscriptions: client.rpcSubscriptions,\n });\n return {\n ...client,\n airdrop: (address, amount, abortSignal) =>\n airdropInternal({ abortSignal, commitment: 'confirmed', lamports: amount, recipientAddress: address }),\n } as ClientWithAirdrop & T;\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Address, airdropFactory, Lamports } from '@solana/kit';
1
+ import { Address, airdropFactory, ClientWithAirdrop, Lamports } from '@solana/kit';
2
2
  type LiteSVMClient = {
3
3
  svm: {
4
4
  airdrop: (address: Address, lamports: Lamports) => unknown;
@@ -8,14 +8,6 @@ type RpcClient = {
8
8
  rpc: Parameters<typeof airdropFactory>[0]['rpc'];
9
9
  rpcSubscriptions: Parameters<typeof airdropFactory>[0]['rpcSubscriptions'];
10
10
  };
11
- /**
12
- * Function type for the `airdrop` method added to the client.
13
- *
14
- * @param address - The address to which the airdrop will be sent.
15
- * @param amount - The amount of lamports to airdrop.
16
- * @param abortSignal - Optional signal to abort the airdrop operation.
17
- */
18
- export type AirdropFunction = (address: Address, amount: Lamports, abortSignal?: AbortSignal) => Promise<void>;
19
11
  /**
20
12
  * A plugin that adds an `airdrop` method to the client.
21
13
  *
@@ -55,8 +47,6 @@ export type AirdropFunction = (address: Address, amount: Lamports, abortSignal?:
55
47
  *
56
48
  * @see {@link AirdropFunction}
57
49
  */
58
- export declare function airdrop(): <T extends LiteSVMClient | RpcClient>(client: T) => T & {
59
- airdrop: AirdropFunction;
60
- };
50
+ export declare function airdrop(): <T extends LiteSVMClient | RpcClient>(client: T) => ClientWithAirdrop & T;
61
51
  export {};
62
52
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEhE,KAAK,aAAa,GAAG;IACjB,GAAG,EAAE;QAAE,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAA;KAAE,CAAC;CACvE,CAAC;AACF,KAAK,SAAS,GAAG;IACb,GAAG,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACjD,gBAAgB,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;CAC9E,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE/G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,OAAO,KACX,CAAC,SAAS,aAAa,GAAG,SAAS,EAAE,QAAQ,CAAC,KAAG,CAAC,GAAG;IAAE,OAAO,EAAE,eAAe,CAAA;CAAE,CAqB5F"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEnF,KAAK,aAAa,GAAG;IACjB,GAAG,EAAE;QAAE,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAA;KAAE,CAAC;CACvE,CAAC;AACF,KAAK,SAAS,GAAG;IACb,GAAG,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACjD,gBAAgB,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;CAC9E,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,OAAO,KACX,CAAC,SAAS,aAAa,GAAG,SAAS,EAAE,QAAQ,CAAC,KAAG,iBAAiB,GAAG,CAAC,CAoBjF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/kit-plugin-airdrop",
3
- "version": "0.2.0",
3
+ "version": "0.5.0",
4
4
  "description": "Airdrop helpers for Kit clients",
5
5
  "exports": {
6
6
  "types": "./dist/types/index.d.ts",
@@ -35,11 +35,11 @@
35
35
  "airdrop"
36
36
  ],
37
37
  "peerDependencies": {
38
- "@solana/kit": "^5.2.0"
38
+ "@solana/kit": "^6.1.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@solana/kit-plugin-litesvm": "0.2.0",
42
- "@solana/kit-plugin-rpc": "0.2.0"
41
+ "@solana/kit-plugin-rpc": "0.3.0",
42
+ "@solana/kit-plugin-litesvm": "0.3.1"
43
43
  },
44
44
  "license": "MIT",
45
45
  "repository": {