@helium/lazy-distributor-sdk 0.0.4 → 0.0.6

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.
Files changed (31) hide show
  1. package/lib/cjs/functions/distributeCompressionRewards.js +51 -0
  2. package/lib/cjs/functions/distributeCompressionRewards.js.map +1 -0
  3. package/lib/cjs/functions/initializeCompressionRecipient.js +47 -0
  4. package/lib/cjs/functions/initializeCompressionRecipient.js.map +1 -0
  5. package/lib/cjs/index.js +8 -4
  6. package/lib/cjs/index.js.map +1 -1
  7. package/lib/cjs/pdas.js +12 -1
  8. package/lib/cjs/pdas.js.map +1 -1
  9. package/lib/cjs/resolvers.js +61 -8
  10. package/lib/cjs/resolvers.js.map +1 -1
  11. package/lib/esm/src/functions/distributeCompressionRewards.js +36 -0
  12. package/lib/esm/src/functions/distributeCompressionRewards.js.map +1 -0
  13. package/lib/esm/src/functions/initializeCompressionRecipient.js +32 -0
  14. package/lib/esm/src/functions/initializeCompressionRecipient.js.map +1 -0
  15. package/lib/esm/src/index.js +5 -3
  16. package/lib/esm/src/index.js.map +1 -1
  17. package/lib/esm/src/pdas.js +10 -0
  18. package/lib/esm/src/pdas.js.map +1 -1
  19. package/lib/esm/src/resolvers.js +62 -9
  20. package/lib/esm/src/resolvers.js.map +1 -1
  21. package/lib/esm/tsconfig.esm.tsbuildinfo +1 -1
  22. package/lib/types/src/functions/distributeCompressionRewards.d.ts +134 -0
  23. package/lib/types/src/functions/distributeCompressionRewards.d.ts.map +1 -0
  24. package/lib/types/src/functions/initializeCompressionRecipient.d.ts +109 -0
  25. package/lib/types/src/functions/initializeCompressionRecipient.d.ts.map +1 -0
  26. package/lib/types/src/index.d.ts +3 -1
  27. package/lib/types/src/index.d.ts.map +1 -1
  28. package/lib/types/src/pdas.d.ts +1 -0
  29. package/lib/types/src/pdas.d.ts.map +1 -1
  30. package/lib/types/src/resolvers.d.ts.map +1 -1
  31. package/package.json +4 -4
@@ -0,0 +1,134 @@
1
+ import { LazyDistributor } from "@helium/idls/lib/types/lazy_distributor";
2
+ import { Asset, AssetProof } from "@helium/spl-utils";
3
+ import { Idl, Program } from "@project-serum/anchor";
4
+ import { PublicKey } from "@solana/web3.js";
5
+ export declare function distributeCompressionRewards<IDL extends Idl>({ program, assetId, lazyDistributor, getAssetFn, getAssetProofFn, }: {
6
+ program: Program<LazyDistributor>;
7
+ assetId: PublicKey;
8
+ lazyDistributor: PublicKey;
9
+ owner?: PublicKey;
10
+ getAssetFn?: (url: string, assetId: PublicKey) => Promise<Asset | undefined>;
11
+ getAssetProofFn?: (url: string, assetId: PublicKey) => Promise<AssetProof | undefined>;
12
+ }): Promise<import("@project-serum/anchor").MethodsBuilder<LazyDistributor, {
13
+ name: "distributeCompressionRewardsV0";
14
+ accounts: [{
15
+ name: "common";
16
+ accounts: [{
17
+ name: "payer";
18
+ isMut: true;
19
+ isSigner: true;
20
+ }, {
21
+ name: "lazyDistributor";
22
+ isMut: false;
23
+ isSigner: false;
24
+ relations: ["rewards_mint", "rewards_escrow"];
25
+ }, {
26
+ name: "recipient";
27
+ isMut: true;
28
+ isSigner: false;
29
+ relations: ["lazy_distributor"];
30
+ }, {
31
+ name: "rewardsMint";
32
+ isMut: false;
33
+ isSigner: false;
34
+ }, {
35
+ name: "rewardsEscrow";
36
+ isMut: true;
37
+ isSigner: false;
38
+ }, {
39
+ name: "circuitBreaker";
40
+ isMut: true;
41
+ isSigner: false;
42
+ pda: {
43
+ seeds: [{
44
+ kind: "const";
45
+ type: "string";
46
+ value: "account_windowed_breaker";
47
+ }, {
48
+ kind: "account";
49
+ type: "publicKey";
50
+ account: "TokenAccount";
51
+ path: "rewards_escrow";
52
+ }];
53
+ programId: {
54
+ kind: "account";
55
+ type: "publicKey";
56
+ path: "circuit_breaker_program";
57
+ };
58
+ };
59
+ }, {
60
+ name: "owner";
61
+ isMut: false;
62
+ isSigner: false;
63
+ }, {
64
+ name: "destinationAccount";
65
+ isMut: true;
66
+ isSigner: false;
67
+ }, {
68
+ name: "associatedTokenProgram";
69
+ isMut: false;
70
+ isSigner: false;
71
+ }, {
72
+ name: "circuitBreakerProgram";
73
+ isMut: false;
74
+ isSigner: false;
75
+ }, {
76
+ name: "systemProgram";
77
+ isMut: false;
78
+ isSigner: false;
79
+ }, {
80
+ name: "tokenProgram";
81
+ isMut: false;
82
+ isSigner: false;
83
+ }, {
84
+ name: "rent";
85
+ isMut: false;
86
+ isSigner: false;
87
+ }, {
88
+ name: "clock";
89
+ isMut: false;
90
+ isSigner: false;
91
+ }];
92
+ }, {
93
+ name: "merkleTree";
94
+ isMut: false;
95
+ isSigner: false;
96
+ }, {
97
+ name: "treeAuthority";
98
+ isMut: false;
99
+ isSigner: false;
100
+ pda: {
101
+ seeds: [{
102
+ kind: "account";
103
+ type: "publicKey";
104
+ path: "merkle_tree";
105
+ }];
106
+ programId: {
107
+ kind: "account";
108
+ type: "publicKey";
109
+ path: "bubblegum_program";
110
+ };
111
+ };
112
+ }, {
113
+ name: "bubblegumProgram";
114
+ isMut: false;
115
+ isSigner: false;
116
+ }, {
117
+ name: "compressionProgram";
118
+ isMut: false;
119
+ isSigner: false;
120
+ }, {
121
+ name: "tokenProgram";
122
+ isMut: false;
123
+ isSigner: false;
124
+ }];
125
+ args: [{
126
+ name: "args";
127
+ type: {
128
+ defined: "DistributeCompressionRewardsArgsV0";
129
+ };
130
+ }];
131
+ } & {
132
+ name: "distributeCompressionRewardsV0";
133
+ }>>;
134
+ //# sourceMappingURL=distributeCompressionRewards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distributeCompressionRewards.d.ts","sourceRoot":"","sources":["../../../../src/functions/distributeCompressionRewards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,KAAK,EAA2B,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,wBAAsB,4BAA4B,CAAC,GAAG,SAAS,GAAG,EAAE,EAClE,OAAO,EACP,OAAO,EACP,eAAe,EACf,UAAqB,EACrB,eAA+B,GAChC,EAAE;IACD,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAClC,OAAO,EAAE,SAAS,CAAC;IACnB,eAAe,EAAE,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,KAAK,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;IAC7E,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,KAAK,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;CACxF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoCA"}
@@ -0,0 +1,109 @@
1
+ import { LazyDistributor } from "@helium/idls/lib/types/lazy_distributor";
2
+ import { AssetProof } from "@helium/spl-utils";
3
+ import { Program } from "@project-serum/anchor";
4
+ import { PublicKey } from "@solana/web3.js";
5
+ export declare function initializeCompressionRecipient({ program, assetId, lazyDistributor, owner, getAssetProofFn, }: {
6
+ program: Program<LazyDistributor>;
7
+ assetId: PublicKey;
8
+ lazyDistributor: PublicKey;
9
+ owner?: PublicKey;
10
+ getAssetProofFn?: (url: string, assetId: PublicKey) => Promise<AssetProof | undefined>;
11
+ }): Promise<import("@project-serum/anchor").MethodsBuilder<LazyDistributor, {
12
+ name: "initializeCompressionRecipientV0";
13
+ accounts: [{
14
+ name: "payer";
15
+ isMut: true;
16
+ isSigner: true;
17
+ }, {
18
+ name: "lazyDistributor";
19
+ isMut: false;
20
+ isSigner: false;
21
+ pda: {
22
+ seeds: [{
23
+ kind: "const";
24
+ type: "string";
25
+ value: "lazy_distributor";
26
+ }, {
27
+ kind: "account";
28
+ type: "publicKey";
29
+ account: "LazyDistributorV0";
30
+ path: "lazy_distributor.rewards_mint";
31
+ }];
32
+ };
33
+ }, {
34
+ name: "recipient";
35
+ isMut: true;
36
+ isSigner: false;
37
+ pda: {
38
+ seeds: [{
39
+ kind: "const";
40
+ type: "string";
41
+ value: "recipient";
42
+ }, {
43
+ kind: "account";
44
+ type: "publicKey";
45
+ account: "LazyDistributorV0";
46
+ path: "lazy_distributor";
47
+ }, {
48
+ kind: "account";
49
+ type: "publicKey";
50
+ path: "merkle_tree";
51
+ }, {
52
+ kind: "arg";
53
+ type: {
54
+ defined: "InitializeCompressionRecipientArgsV0";
55
+ };
56
+ path: "args.index";
57
+ }];
58
+ };
59
+ }, {
60
+ name: "merkleTree";
61
+ isMut: false;
62
+ isSigner: false;
63
+ }, {
64
+ name: "owner";
65
+ isMut: false;
66
+ isSigner: false;
67
+ }, {
68
+ name: "delegate";
69
+ isMut: false;
70
+ isSigner: false;
71
+ }, {
72
+ name: "treeAuthority";
73
+ isMut: false;
74
+ isSigner: false;
75
+ pda: {
76
+ seeds: [{
77
+ kind: "account";
78
+ type: "publicKey";
79
+ path: "merkle_tree";
80
+ }];
81
+ programId: {
82
+ kind: "account";
83
+ type: "publicKey";
84
+ path: "bubblegum_program";
85
+ };
86
+ };
87
+ }, {
88
+ name: "bubblegumProgram";
89
+ isMut: false;
90
+ isSigner: false;
91
+ }, {
92
+ name: "compressionProgram";
93
+ isMut: false;
94
+ isSigner: false;
95
+ }, {
96
+ name: "systemProgram";
97
+ isMut: false;
98
+ isSigner: false;
99
+ }];
100
+ args: [{
101
+ name: "args";
102
+ type: {
103
+ defined: "InitializeCompressionRecipientArgsV0";
104
+ };
105
+ }];
106
+ } & {
107
+ name: "initializeCompressionRecipientV0";
108
+ }>>;
109
+ //# sourceMappingURL=initializeCompressionRecipient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initializeCompressionRecipient.d.ts","sourceRoot":"","sources":["../../../../src/functions/initializeCompressionRecipient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAiB,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EACA,OAAO,EACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,wBAAsB,8BAA8B,CAAC,EACnD,OAAO,EACP,OAAO,EACP,eAAe,EAEf,KAAyC,EACzC,eAA+B,GAChC,EAAE;IACD,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAClC,OAAO,EAAE,SAAS,CAAC;IACnB,eAAe,EAAE,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,KAAK,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;CACxF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8BA"}
@@ -1,8 +1,10 @@
1
1
  import { LazyDistributor } from "@helium/idls/lib/types/lazy_distributor";
2
2
  import { AnchorProvider, Idl, Program } from "@project-serum/anchor";
3
3
  import { PublicKey } from "@solana/web3.js";
4
- export declare function init(provider: AnchorProvider, programId?: PublicKey, idl?: Idl | null): Promise<Program<LazyDistributor>>;
4
+ export { distributeCompressionRewards } from "./functions/distributeCompressionRewards";
5
+ export { initializeCompressionRecipient } from "./functions/initializeCompressionRecipient";
5
6
  export * from "./constants";
6
7
  export * from "./pdas";
7
8
  export * from "./resolvers";
9
+ export declare function init(provider: AnchorProvider, programId?: PublicKey, idl?: Idl | null): Promise<Program<LazyDistributor>>;
8
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,wBAAsB,IAAI,CACxB,QAAQ,EAAE,cAAc,EACxB,SAAS,GAAE,SAAsB,EACjC,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,GACf,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAcnC;AAED,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAE5F,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAE5B,wBAAsB,IAAI,CACxB,QAAQ,EAAE,cAAc,EACxB,SAAS,GAAE,SAAsB,EACjC,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,GACf,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAcnC"}
@@ -1,4 +1,5 @@
1
1
  import { PublicKey } from "@solana/web3.js";
2
2
  export declare function lazyDistributorKey(mint: PublicKey, programId?: PublicKey): [PublicKey, number];
3
3
  export declare function recipientKey(lazyDistributor: PublicKey, mint: PublicKey, programId?: PublicKey): [PublicKey, number];
4
+ export declare function compressedRecipientKey(lazyDistributor: PublicKey, merkleTree: PublicKey, index: number, programId?: PublicKey): [PublicKey, number];
4
5
  //# sourceMappingURL=pdas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pdas.d.ts","sourceRoot":"","sources":["../../../src/pdas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,EACf,SAAS,GAAE,SAAsB,GAChC,CAAC,SAAS,EAAE,MAAM,CAAC,CAKrB;AAED,wBAAgB,YAAY,CAC1B,eAAe,EAAE,SAAS,EAC1B,IAAI,EAAE,SAAS,EACf,SAAS,GAAE,SAAsB,GAChC,CAAC,SAAS,EAAE,MAAM,CAAC,CAKrB"}
1
+ {"version":3,"file":"pdas.d.ts","sourceRoot":"","sources":["../../../src/pdas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,EACf,SAAS,GAAE,SAAsB,GAChC,CAAC,SAAS,EAAE,MAAM,CAAC,CAKrB;AAED,wBAAgB,YAAY,CAC1B,eAAe,EAAE,SAAS,EAC1B,IAAI,EAAE,SAAS,EACf,SAAS,GAAE,SAAsB,GAChC,CAAC,SAAS,EAAE,MAAM,CAAC,CAKrB;AAED,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,SAAS,EAC1B,UAAU,EAAE,SAAS,EACrB,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,SAAsB,GAChC,CAAC,SAAS,EAAE,MAAM,CAAC,CAYrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../src/resolvers.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,wBAAwB,4FA4DpC,CAAC"}
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../src/resolvers.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,wBAAwB,4FA+HpC,CAAC"}
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "registry": "https://registry.npmjs.org/"
6
6
  },
7
7
  "license": "Apache-2.0",
8
- "version": "0.0.4",
8
+ "version": "0.0.6",
9
9
  "description": "Interface to the lazy-distributor smart contract",
10
10
  "repository": {
11
11
  "type": "git",
@@ -31,8 +31,8 @@
31
31
  "prebuild": "npm run clean && npm run package"
32
32
  },
33
33
  "dependencies": {
34
- "@helium/circuit-breaker-sdk": "^0.0.4",
35
- "@helium/spl-utils": "^0.0.4",
34
+ "@helium/circuit-breaker-sdk": "^0.0.6",
35
+ "@helium/spl-utils": "^0.0.6",
36
36
  "@metaplex-foundation/mpl-token-metadata": "^2.2.3",
37
37
  "@project-serum/anchor": "0.24.2",
38
38
  "@solana/spl-token": "0.3.5",
@@ -46,5 +46,5 @@
46
46
  "typescript": "^4.3.4",
47
47
  "yarn": "^1.22.18"
48
48
  },
49
- "gitHead": "714ad551d3d6efe4be1ddd8c89a13357d105ffd3"
49
+ "gitHead": "2b194cc9ed36a339cb9281f50297fb47c9c0692a"
50
50
  }