@buildonspark/issuer-sdk 0.0.28 → 0.0.30

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.d.cts CHANGED
@@ -1,74 +1,9 @@
1
1
  import { ListAllTokenTransactionsCursor, OperationType } from '@buildonspark/lrc20-sdk/proto/rpc/v1/types';
2
- import { CreateLightningInvoiceParams, PayLightningInvoiceParams, TokenInfo, SparkWallet, SparkWalletProps } from '@buildonspark/spark-sdk';
3
- import { QueryAllTransfersResponse, Transfer, LeafWithPreviousTransactionData, TokenTransactionWithStatus } from '@buildonspark/spark-sdk/proto/spark';
4
- import { LRCWallet } from '@buildonspark/lrc20-sdk';
5
- import { LightningReceiveRequest } from '@buildonspark/spark-sdk/types';
6
- import { GetTokenActivityResponse, TokenPubKeyInfoResponse } from './types.cjs';
2
+ import { SparkWallet, SparkWalletProps } from '@buildonspark/spark-sdk';
3
+ import { LeafWithPreviousTransactionData } from '@buildonspark/spark-sdk/proto/spark';
4
+ import { TokenPubKeyInfoResponse, GetTokenActivityResponse } from './types.cjs';
7
5
 
8
- /**
9
- * Interface for the IssuerSparkWallet that includes all functions from both SparkWallet and IssuerSparkWallet
10
- */
11
- interface IssuerWalletInterface {
12
- getIdentityPublicKey(): Promise<string>;
13
- getSparkAddress(): Promise<string>;
14
- getTransfers(limit?: number, offset?: number): Promise<QueryAllTransfersResponse>;
15
- getBalance(forceRefetch?: boolean): Promise<{
16
- balance: bigint;
17
- tokenBalances: Map<string, {
18
- balance: bigint;
19
- }>;
20
- }>;
21
- getDepositAddress(): Promise<string>;
22
- transfer(params: {
23
- receiverSparkAddress: string;
24
- amountSats: number;
25
- }): Promise<Transfer | string>;
26
- createLightningInvoice(params: CreateLightningInvoiceParams): Promise<LightningReceiveRequest>;
27
- payLightningInvoice(params: PayLightningInvoiceParams): Promise<any>;
28
- withdraw(params: {
29
- onchainAddress: string;
30
- amountSats?: number;
31
- }): Promise<any>;
32
- transferTokens(params: {
33
- tokenPublicKey: string;
34
- tokenAmount: bigint;
35
- receiverSparkAddress: string;
36
- selectedLeaves?: LeafWithPreviousTransactionData[];
37
- }): Promise<string>;
38
- getIssuerTokenPublicKey(): Promise<string>;
39
- getIssuerTokenBalance(): Promise<{
40
- balance: bigint;
41
- }>;
42
- mintTokens(tokenAmount: bigint): Promise<string>;
43
- getTokenActivity(pageSize: number, cursor?: ListAllTokenTransactionsCursor, operationTypes?: OperationType[], beforeTimestamp?: Date): Promise<GetTokenActivityResponse>;
44
- getIssuerTokenActivity(pageSize: number, cursor?: ListAllTokenTransactionsCursor, operationTypes?: OperationType[], beforeTimestamp?: Date, afterTimestamp?: Date): Promise<GetTokenActivityResponse>;
45
- getTokenTransactions(tokenPublicKeys: string[], tokenTransactionHashes?: string[]): Promise<TokenTransactionWithStatus[]>;
46
- getTokenInfo(): Promise<TokenInfo[]>;
47
- getIssuerTokenInfo(): Promise<TokenPubKeyInfoResponse | null>;
48
- burnTokens(tokenAmount: bigint, selectedLeaves?: LeafWithPreviousTransactionData[]): Promise<string>;
49
- freezeTokens(ownerPublicKey: string): Promise<{
50
- impactedLeafIds: string[];
51
- impactedTokenAmount: bigint;
52
- }>;
53
- unfreezeTokens(ownerPublicKey: string): Promise<{
54
- impactedLeafIds: string[];
55
- impactedTokenAmount: bigint;
56
- }>;
57
- getTokenL1Address(): Promise<string>;
58
- announceTokenL1(params: {
59
- lrc20Wallet: LRCWallet;
60
- tokenName: string;
61
- tokenTicker: string;
62
- decimals: number;
63
- maxSupply: bigint;
64
- isFreezable: boolean;
65
- feeRateSatsPerVb?: number;
66
- }): Promise<string>;
67
- mintTokensL1(tokenAmount: bigint): Promise<string>;
68
- transferTokensL1(tokenAmount: bigint, p2trAddress: string): Promise<string>;
69
- }
70
-
71
- declare class IssuerSparkWallet extends SparkWallet implements IssuerWalletInterface {
6
+ declare class IssuerSparkWallet extends SparkWallet {
72
7
  private issuerTokenTransactionService;
73
8
  private tokenFreezeService;
74
9
  private tokenPublicKeyInfo?;
package/dist/index.d.ts CHANGED
@@ -1,74 +1,9 @@
1
1
  import { ListAllTokenTransactionsCursor, OperationType } from '@buildonspark/lrc20-sdk/proto/rpc/v1/types';
2
- import { CreateLightningInvoiceParams, PayLightningInvoiceParams, TokenInfo, SparkWallet, SparkWalletProps } from '@buildonspark/spark-sdk';
3
- import { QueryAllTransfersResponse, Transfer, LeafWithPreviousTransactionData, TokenTransactionWithStatus } from '@buildonspark/spark-sdk/proto/spark';
4
- import { LRCWallet } from '@buildonspark/lrc20-sdk';
5
- import { LightningReceiveRequest } from '@buildonspark/spark-sdk/types';
6
- import { GetTokenActivityResponse, TokenPubKeyInfoResponse } from './types.js';
2
+ import { SparkWallet, SparkWalletProps } from '@buildonspark/spark-sdk';
3
+ import { LeafWithPreviousTransactionData } from '@buildonspark/spark-sdk/proto/spark';
4
+ import { TokenPubKeyInfoResponse, GetTokenActivityResponse } from './types.js';
7
5
 
8
- /**
9
- * Interface for the IssuerSparkWallet that includes all functions from both SparkWallet and IssuerSparkWallet
10
- */
11
- interface IssuerWalletInterface {
12
- getIdentityPublicKey(): Promise<string>;
13
- getSparkAddress(): Promise<string>;
14
- getTransfers(limit?: number, offset?: number): Promise<QueryAllTransfersResponse>;
15
- getBalance(forceRefetch?: boolean): Promise<{
16
- balance: bigint;
17
- tokenBalances: Map<string, {
18
- balance: bigint;
19
- }>;
20
- }>;
21
- getDepositAddress(): Promise<string>;
22
- transfer(params: {
23
- receiverSparkAddress: string;
24
- amountSats: number;
25
- }): Promise<Transfer | string>;
26
- createLightningInvoice(params: CreateLightningInvoiceParams): Promise<LightningReceiveRequest>;
27
- payLightningInvoice(params: PayLightningInvoiceParams): Promise<any>;
28
- withdraw(params: {
29
- onchainAddress: string;
30
- amountSats?: number;
31
- }): Promise<any>;
32
- transferTokens(params: {
33
- tokenPublicKey: string;
34
- tokenAmount: bigint;
35
- receiverSparkAddress: string;
36
- selectedLeaves?: LeafWithPreviousTransactionData[];
37
- }): Promise<string>;
38
- getIssuerTokenPublicKey(): Promise<string>;
39
- getIssuerTokenBalance(): Promise<{
40
- balance: bigint;
41
- }>;
42
- mintTokens(tokenAmount: bigint): Promise<string>;
43
- getTokenActivity(pageSize: number, cursor?: ListAllTokenTransactionsCursor, operationTypes?: OperationType[], beforeTimestamp?: Date): Promise<GetTokenActivityResponse>;
44
- getIssuerTokenActivity(pageSize: number, cursor?: ListAllTokenTransactionsCursor, operationTypes?: OperationType[], beforeTimestamp?: Date, afterTimestamp?: Date): Promise<GetTokenActivityResponse>;
45
- getTokenTransactions(tokenPublicKeys: string[], tokenTransactionHashes?: string[]): Promise<TokenTransactionWithStatus[]>;
46
- getTokenInfo(): Promise<TokenInfo[]>;
47
- getIssuerTokenInfo(): Promise<TokenPubKeyInfoResponse | null>;
48
- burnTokens(tokenAmount: bigint, selectedLeaves?: LeafWithPreviousTransactionData[]): Promise<string>;
49
- freezeTokens(ownerPublicKey: string): Promise<{
50
- impactedLeafIds: string[];
51
- impactedTokenAmount: bigint;
52
- }>;
53
- unfreezeTokens(ownerPublicKey: string): Promise<{
54
- impactedLeafIds: string[];
55
- impactedTokenAmount: bigint;
56
- }>;
57
- getTokenL1Address(): Promise<string>;
58
- announceTokenL1(params: {
59
- lrc20Wallet: LRCWallet;
60
- tokenName: string;
61
- tokenTicker: string;
62
- decimals: number;
63
- maxSupply: bigint;
64
- isFreezable: boolean;
65
- feeRateSatsPerVb?: number;
66
- }): Promise<string>;
67
- mintTokensL1(tokenAmount: bigint): Promise<string>;
68
- transferTokensL1(tokenAmount: bigint, p2trAddress: string): Promise<string>;
69
- }
70
-
71
- declare class IssuerSparkWallet extends SparkWallet implements IssuerWalletInterface {
6
+ declare class IssuerSparkWallet extends SparkWallet {
72
7
  private issuerTokenTransactionService;
73
8
  private tokenFreezeService;
74
9
  private tokenPublicKeyInfo?;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buildonspark/issuer-sdk",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "description": "Spark Issuer SDK for token issuance",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.js",
@@ -50,12 +50,12 @@
50
50
  "test:stress": "yarn test-cmd src/tests/stress/*.test.ts",
51
51
  "types:watch": "tsc-absolute --watch",
52
52
  "types": "tsc",
53
- "generate:proto": "PATH=\"$PATH:./node_modules/.bin\" protoc --ts_proto_out=./src/proto --ts_proto_opt=outputServices=nice-grpc,useExactTypes=false,outputServices=generic-definitions,oneof=unions,importSuffix=.js --proto_path=../../protos spark.proto mock.proto spark_authn.proto"
53
+ "generate:proto": "PATH=\"$PATH:./node_modules/.bin\" protoc --ts_proto_out=./src/proto --ts_proto_opt=outputServices=nice-grpc,useExactTypes=false,outputServices=generic-definitions,oneof=unions,importSuffix=.js --proto_path=../../../../protos spark.proto mock.proto spark_authn.proto"
54
54
  },
55
55
  "dependencies": {
56
56
  "@bufbuild/protobuf": "^2.2.5",
57
- "@buildonspark/lrc20-sdk": "0.0.26",
58
- "@buildonspark/spark-sdk": "0.0.28",
57
+ "@buildonspark/lrc20-sdk": "0.0.28",
58
+ "@buildonspark/spark-sdk": "0.0.30",
59
59
  "@noble/curves": "^1.8.0",
60
60
  "@scure/bip39": "^1.5.4",
61
61
  "@scure/btc-signer": "^1.5.0",
@@ -25,7 +25,6 @@ import {
25
25
  } from "@noble/curves/abstract/utils";
26
26
  import { validateMnemonic } from "@scure/bip39";
27
27
  import { wordlist } from "@scure/bip39/wordlists/english";
28
- import { IssuerWalletInterface } from "./interface/wallet-interface.js";
29
28
  import { TokenFreezeService } from "./services/freeze.js";
30
29
  import { IssuerTokenTransactionService } from "./services/token-transactions.js";
31
30
  import { GetTokenActivityResponse, TokenPubKeyInfoResponse } from "./types.js";
@@ -39,7 +38,6 @@ const BURN_ADDRESS = "02".repeat(33);
39
38
 
40
39
  export class IssuerSparkWallet
41
40
  extends SparkWallet
42
- implements IssuerWalletInterface
43
41
  {
44
42
  private issuerTokenTransactionService: IssuerTokenTransactionService;
45
43
  private tokenFreezeService: TokenFreezeService;