@helium/helium-entity-manager-sdk 0.0.49 → 0.0.50
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/lib/cjs/functions/onboardIotHotspot.js +2 -2
- package/lib/cjs/functions/onboardIotHotspot.js.map +1 -1
- package/lib/cjs/functions/onboardMobileHotspot.js +2 -2
- package/lib/cjs/functions/onboardMobileHotspot.js.map +1 -1
- package/lib/cjs/functions/updateIotMetadata.js +2 -2
- package/lib/cjs/functions/updateIotMetadata.js.map +1 -1
- package/lib/cjs/functions/updateMobileMetadata.js +2 -2
- package/lib/cjs/functions/updateMobileMetadata.js.map +1 -1
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/resolvers.js +12 -1
- package/lib/cjs/resolvers.js.map +1 -1
- package/lib/esm/src/functions/onboardIotHotspot.js +1 -1
- package/lib/esm/src/functions/onboardIotHotspot.js.map +1 -1
- package/lib/esm/src/functions/onboardMobileHotspot.js +1 -1
- package/lib/esm/src/functions/onboardMobileHotspot.js.map +1 -1
- package/lib/esm/src/functions/updateIotMetadata.js +1 -1
- package/lib/esm/src/functions/updateIotMetadata.js.map +1 -1
- package/lib/esm/src/functions/updateMobileMetadata.js +1 -1
- package/lib/esm/src/functions/updateMobileMetadata.js.map +1 -1
- package/lib/esm/src/index.js +1 -1
- package/lib/esm/src/index.js.map +1 -1
- package/lib/esm/src/resolvers.js +12 -1
- package/lib/esm/src/resolvers.js.map +1 -1
- package/lib/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/src/functions/onboardIotHotspot.d.ts +1 -1
- package/lib/types/src/functions/onboardIotHotspot.d.ts.map +1 -1
- package/lib/types/src/functions/onboardMobileHotspot.d.ts +1 -1
- package/lib/types/src/functions/onboardMobileHotspot.d.ts.map +1 -1
- package/lib/types/src/functions/updateIotMetadata.d.ts +1 -1
- package/lib/types/src/functions/updateIotMetadata.d.ts.map +1 -1
- package/lib/types/src/functions/updateMobileMetadata.d.ts +1 -1
- package/lib/types/src/functions/updateMobileMetadata.d.ts.map +1 -1
- package/lib/types/src/index.d.ts +1 -1
- package/lib/types/src/index.d.ts.map +1 -1
- package/lib/types/src/resolvers.d.ts.map +1 -1
- package/package.json +5 -5
- package/lib/cjs/functions/proofArgsAndAccounts.js +0 -52
- package/lib/cjs/functions/proofArgsAndAccounts.js.map +0 -1
- package/lib/esm/src/functions/proofArgsAndAccounts.js +0 -37
- package/lib/esm/src/functions/proofArgsAndAccounts.js.map +0 -1
- package/lib/types/src/functions/proofArgsAndAccounts.d.ts +0 -21
- package/lib/types/src/functions/proofArgsAndAccounts.d.ts.map +0 -1
|
@@ -2,7 +2,7 @@ import { HeliumEntityManager } from "@helium/idls/lib/types/helium_entity_manage
|
|
|
2
2
|
import { Program } from "@coral-xyz/anchor";
|
|
3
3
|
import BN from "bn.js";
|
|
4
4
|
import { PublicKey } from "@solana/web3.js";
|
|
5
|
-
import { ProofArgsAndAccountsArgs } from "
|
|
5
|
+
import { ProofArgsAndAccountsArgs } from "@helium/spl-utils";
|
|
6
6
|
export declare function onboardIotHotspot({ program, rewardableEntityConfig, assetId, maker, dao, dcFeePayer, payer, location, elevation, gain, ...rest }: {
|
|
7
7
|
program: Program<HeliumEntityManager>;
|
|
8
8
|
rewardableEntityConfig: PublicKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboardIotHotspot.d.ts","sourceRoot":"","sources":["../../../../src/functions/onboardIotHotspot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,MAAM,OAAO,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAEL,wBAAwB,EACzB,MAAM,
|
|
1
|
+
{"version":3,"file":"onboardIotHotspot.d.ts","sourceRoot":"","sources":["../../../../src/functions/onboardIotHotspot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,MAAM,OAAO,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAEL,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAE3B,wBAAsB,iBAAiB,CAAC,EACtC,OAAO,EACP,sBAAsB,EACtB,OAAO,EACP,KAAK,EACL,GAAG,EACH,UAAU,EACV,KAAK,EACL,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,GAAG,IAAI,EACR,EAAE;IACD,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACtC,sBAAsB,EAAE,SAAS,CAAC;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,EAAE,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,SAAS,CAAC;CAChB,GAAG,IAAI,CAAC,wBAAwB,EAAE,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4C/C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HeliumEntityManager } from "@helium/idls/lib/types/helium_entity_manager";
|
|
2
2
|
import { Program } from "@coral-xyz/anchor";
|
|
3
3
|
import { PublicKey } from "@solana/web3.js";
|
|
4
|
-
import { ProofArgsAndAccountsArgs } from "
|
|
4
|
+
import { ProofArgsAndAccountsArgs } from "@helium/spl-utils";
|
|
5
5
|
import BN from "bn.js";
|
|
6
6
|
export declare function onboardMobileHotspot({ program, rewardableEntityConfig, assetId, maker, location, dao, payer, dcFeePayer, ...rest }: {
|
|
7
7
|
program: Program<HeliumEntityManager>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboardMobileHotspot.d.ts","sourceRoot":"","sources":["../../../../src/functions/onboardMobileHotspot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAEL,wBAAwB,EACzB,MAAM,
|
|
1
|
+
{"version":3,"file":"onboardMobileHotspot.d.ts","sourceRoot":"","sources":["../../../../src/functions/onboardMobileHotspot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAEL,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvB,wBAAsB,oBAAoB,CAAC,EACzC,OAAO,EACP,sBAAsB,EACtB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,GAAG,EACH,KAAK,EACL,UAAU,EACV,GAAG,IAAI,EACR,EAAE;IACD,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,EAAE,CAAC;IACd,sBAAsB,EAAE,SAAS,CAAC;IAClC,KAAK,EAAE,SAAS,CAAC;IACjB,GAAG,EAAE,SAAS,CAAC;CAChB,GAAG,IAAI,CAAC,wBAAwB,EAAE,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0C/C"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { HeliumEntityManager } from "@helium/idls/lib/types/helium_entity_manager";
|
|
3
3
|
import { BN, Program } from "@coral-xyz/anchor";
|
|
4
4
|
import { PublicKey } from "@solana/web3.js";
|
|
5
|
-
import { ProofArgsAndAccountsArgs } from "
|
|
5
|
+
import { ProofArgsAndAccountsArgs } from "@helium/spl-utils";
|
|
6
6
|
export declare function updateIotMetadata({ program, rewardableEntityConfig, assetId, location, elevation, gain, dcFeePayer, payer, ...rest }: {
|
|
7
7
|
program: Program<HeliumEntityManager>;
|
|
8
8
|
payer?: PublicKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateIotMetadata.d.ts","sourceRoot":"","sources":["../../../../src/functions/updateIotMetadata.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAEL,wBAAwB,EACzB,MAAM,
|
|
1
|
+
{"version":3,"file":"updateIotMetadata.d.ts","sourceRoot":"","sources":["../../../../src/functions/updateIotMetadata.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAEL,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAE3B,wBAAsB,iBAAiB,CAAC,EACtC,OAAO,EACP,sBAAsB,EACtB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,UAAU,EACV,KAAK,EACL,GAAG,IAAI,EACR,EAAE;IACD,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,QAAQ,EAAE,EAAE,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC;IACnB,sBAAsB,EAAE,SAAS,CAAC;CACnC,GAAG,IAAI,CAAC,wBAAwB,EAAE,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqC/C"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { HeliumEntityManager } from "@helium/idls/lib/types/helium_entity_manager";
|
|
3
3
|
import { BN, Program } from "@coral-xyz/anchor";
|
|
4
4
|
import { PublicKey } from "@solana/web3.js";
|
|
5
|
-
import { ProofArgsAndAccountsArgs } from "
|
|
5
|
+
import { ProofArgsAndAccountsArgs } from "@helium/spl-utils";
|
|
6
6
|
export declare function updateMobileMetadata({ program, rewardableEntityConfig, assetId, location, dcFeePayer, payer, ...rest }: {
|
|
7
7
|
program: Program<HeliumEntityManager>;
|
|
8
8
|
payer?: PublicKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateMobileMetadata.d.ts","sourceRoot":"","sources":["../../../../src/functions/updateMobileMetadata.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAEL,wBAAwB,EACzB,MAAM,
|
|
1
|
+
{"version":3,"file":"updateMobileMetadata.d.ts","sourceRoot":"","sources":["../../../../src/functions/updateMobileMetadata.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAEL,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAE3B,wBAAsB,oBAAoB,CAAC,EACzC,OAAO,EACP,sBAAsB,EACtB,OAAO,EACP,QAAQ,EACR,UAAU,EACV,KAAK,EACL,GAAG,IAAI,EACR,EAAE;IACD,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,QAAQ,EAAE,EAAE,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC;IACnB,sBAAsB,EAAE,SAAS,CAAC;CACnC,GAAG,IAAI,CAAC,wBAAwB,EAAE,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmC/C"}
|
package/lib/types/src/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./constants";
|
|
2
2
|
export { onboardIotHotspot } from "./functions/onboardIotHotspot";
|
|
3
3
|
export { onboardMobileHotspot } from "./functions/onboardMobileHotspot";
|
|
4
|
-
export { proofArgsAndAccounts } from "
|
|
4
|
+
export { proofArgsAndAccounts } from "@helium/spl-utils";
|
|
5
5
|
export { updateIotMetadata } from "./functions/updateIotMetadata";
|
|
6
6
|
export { updateMobileMetadata } from "./functions/updateMobileMetadata";
|
|
7
7
|
export { init } from "./init";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../src/resolvers.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../src/resolvers.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,4BAA4B,oFAgHxC,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.
|
|
8
|
+
"version": "0.0.50",
|
|
9
9
|
"description": "Interface to the helium-entity-manager smart contract",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@coral-xyz/anchor": "0.26.0",
|
|
35
35
|
"@helium/address": "^4.6.2",
|
|
36
|
-
"@helium/helium-sub-daos-sdk": "^0.0.
|
|
37
|
-
"@helium/idls": "^0.0.
|
|
38
|
-
"@helium/spl-utils": "^0.0.
|
|
36
|
+
"@helium/helium-sub-daos-sdk": "^0.0.50",
|
|
37
|
+
"@helium/idls": "^0.0.50",
|
|
38
|
+
"@helium/spl-utils": "^0.0.50",
|
|
39
39
|
"@metaplex-foundation/mpl-bubblegum": "^0.6.2",
|
|
40
40
|
"@metaplex-foundation/mpl-token-metadata": "^2.2.3",
|
|
41
41
|
"@solana/spl-account-compression": "^0.1.5",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"typescript": "^4.3.4",
|
|
54
54
|
"yarn": "^1.22.18"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "6ebea82ff4782697743462a6f1c25eacd10c8a98"
|
|
57
57
|
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.proofArgsAndAccounts = void 0;
|
|
13
|
-
const spl_utils_1 = require("@helium/spl-utils");
|
|
14
|
-
const spl_account_compression_1 = require("@solana/spl-account-compression");
|
|
15
|
-
function proofArgsAndAccounts({ connection, assetId, assetEndpoint, getAssetFn = spl_utils_1.getAsset, getAssetProofFn = spl_utils_1.getAssetProof, }) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
const endpoint = assetEndpoint || connection._rpcEndpoint;
|
|
19
|
-
const asset = yield getAssetFn(endpoint, assetId);
|
|
20
|
-
if (!asset) {
|
|
21
|
-
throw new Error("No asset with ID " + assetId.toBase58());
|
|
22
|
-
}
|
|
23
|
-
const assetProof = yield getAssetProofFn(endpoint, assetId);
|
|
24
|
-
if (!assetProof) {
|
|
25
|
-
throw new Error("No asset proof with ID " + assetId.toBase58());
|
|
26
|
-
}
|
|
27
|
-
const { compression: { leafId }, } = asset;
|
|
28
|
-
const { root, proof, leaf, treeId } = assetProof;
|
|
29
|
-
const canopy = yield (yield spl_account_compression_1.ConcurrentMerkleTreeAccount.fromAccountAddress(connection, treeId)).getCanopyDepth();
|
|
30
|
-
return {
|
|
31
|
-
asset,
|
|
32
|
-
args: {
|
|
33
|
-
dataHash: asset.compression.dataHash.toJSON().data,
|
|
34
|
-
creatorHash: asset.compression.creatorHash.toJSON().data,
|
|
35
|
-
root: root.toBuffer().toJSON().data,
|
|
36
|
-
index: leafId,
|
|
37
|
-
},
|
|
38
|
-
accounts: {
|
|
39
|
-
merkleTree: treeId,
|
|
40
|
-
},
|
|
41
|
-
remainingAccounts: proof.slice(0, proof.length - canopy).map((p) => {
|
|
42
|
-
return {
|
|
43
|
-
pubkey: p,
|
|
44
|
-
isWritable: false,
|
|
45
|
-
isSigner: false,
|
|
46
|
-
};
|
|
47
|
-
}),
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
exports.proofArgsAndAccounts = proofArgsAndAccounts;
|
|
52
|
-
//# sourceMappingURL=proofArgsAndAccounts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proofArgsAndAccounts.js","sourceRoot":"","sources":["../../../src/functions/proofArgsAndAccounts.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+E;AAC/E,6EAA8E;AAa9E,SAAsB,oBAAoB,CAAC,EACzC,UAAU,EACV,OAAO,EACP,aAAa,EACb,UAAU,GAAG,oBAAQ,EACrB,eAAe,GAAG,yBAAa,GACN;;QAWzB,aAAa;QACb,MAAM,QAAQ,GAAG,aAAa,IAAI,UAAU,CAAC,YAAY,CAAC;QAC1D,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC3D;QACD,MAAM,UAAU,GAAG,MAAM,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC5D,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;SACjE;QACD,MAAM,EACJ,WAAW,EAAE,EAAE,MAAM,EAAE,GACxB,GAAG,KAAK,CAAC;QACV,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;QACjD,MAAM,MAAM,GAAG,MAAM,CACnB,MAAM,qDAA2B,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CACzE,CAAC,cAAc,EAAE,CAAC;QAEnB,OAAO;YACL,KAAK;YACL,IAAI,EAAE;gBACJ,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,QAAS,CAAC,MAAM,EAAE,CAAC,IAAI;gBACnD,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,WAAY,CAAC,MAAM,EAAE,CAAC,IAAI;gBACzD,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI;gBACnC,KAAK,EAAE,MAAO;aACf;YACD,QAAQ,EAAE;gBACR,UAAU,EAAE,MAAM;aACnB;YACD,iBAAiB,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBACjE,OAAO;oBACL,MAAM,EAAE,CAAC;oBACT,UAAU,EAAE,KAAK;oBACjB,QAAQ,EAAE,KAAK;iBAChB,CAAC;YACJ,CAAC,CAAC;SACH,CAAC;IACJ,CAAC;CAAA;AAtDD,oDAsDC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { getAsset, getAssetProof } from "@helium/spl-utils";
|
|
2
|
-
import { ConcurrentMerkleTreeAccount } from "@solana/spl-account-compression";
|
|
3
|
-
export async function proofArgsAndAccounts({ connection, assetId, assetEndpoint, getAssetFn = getAsset, getAssetProofFn = getAssetProof, }) {
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
const endpoint = assetEndpoint || connection._rpcEndpoint;
|
|
6
|
-
const asset = await getAssetFn(endpoint, assetId);
|
|
7
|
-
if (!asset) {
|
|
8
|
-
throw new Error("No asset with ID " + assetId.toBase58());
|
|
9
|
-
}
|
|
10
|
-
const assetProof = await getAssetProofFn(endpoint, assetId);
|
|
11
|
-
if (!assetProof) {
|
|
12
|
-
throw new Error("No asset proof with ID " + assetId.toBase58());
|
|
13
|
-
}
|
|
14
|
-
const { compression: { leafId }, } = asset;
|
|
15
|
-
const { root, proof, leaf, treeId } = assetProof;
|
|
16
|
-
const canopy = await (await ConcurrentMerkleTreeAccount.fromAccountAddress(connection, treeId)).getCanopyDepth();
|
|
17
|
-
return {
|
|
18
|
-
asset,
|
|
19
|
-
args: {
|
|
20
|
-
dataHash: asset.compression.dataHash.toJSON().data,
|
|
21
|
-
creatorHash: asset.compression.creatorHash.toJSON().data,
|
|
22
|
-
root: root.toBuffer().toJSON().data,
|
|
23
|
-
index: leafId,
|
|
24
|
-
},
|
|
25
|
-
accounts: {
|
|
26
|
-
merkleTree: treeId,
|
|
27
|
-
},
|
|
28
|
-
remainingAccounts: proof.slice(0, proof.length - canopy).map((p) => {
|
|
29
|
-
return {
|
|
30
|
-
pubkey: p,
|
|
31
|
-
isWritable: false,
|
|
32
|
-
isSigner: false,
|
|
33
|
-
};
|
|
34
|
-
}),
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=proofArgsAndAccounts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proofArgsAndAccounts.js","sourceRoot":"","sources":["../../../../src/functions/proofArgsAndAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAa9E,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,UAAU,EACV,OAAO,EACP,aAAa,EACb,UAAU,GAAG,QAAQ,EACrB,eAAe,GAAG,aAAa,GACN;IAWzB,aAAa;IACb,MAAM,QAAQ,GAAG,aAAa,IAAI,UAAU,CAAC,YAAY,CAAC;IAC1D,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAClD,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;KAC3D;IACD,MAAM,UAAU,GAAG,MAAM,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5D,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;KACjE;IACD,MAAM,EACJ,WAAW,EAAE,EAAE,MAAM,EAAE,GACxB,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IACjD,MAAM,MAAM,GAAG,MAAM,CACnB,MAAM,2BAA2B,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CACzE,CAAC,cAAc,EAAE,CAAC;IAEnB,OAAO;QACL,KAAK;QACL,IAAI,EAAE;YACJ,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,QAAS,CAAC,MAAM,EAAE,CAAC,IAAI;YACnD,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,WAAY,CAAC,MAAM,EAAE,CAAC,IAAI;YACzD,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI;YACnC,KAAK,EAAE,MAAO;SACf;QACD,QAAQ,EAAE;YACR,UAAU,EAAE,MAAM;SACnB;QACD,iBAAiB,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACjE,OAAO;gBACL,MAAM,EAAE,CAAC;gBACT,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,KAAK;aAChB,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Asset, AssetProof } from "@helium/spl-utils";
|
|
2
|
-
import { Connection, PublicKey, AccountMeta } from "@solana/web3.js";
|
|
3
|
-
export type ProofArgsAndAccountsArgs = {
|
|
4
|
-
connection: Connection;
|
|
5
|
-
assetId: PublicKey;
|
|
6
|
-
assetEndpoint?: string;
|
|
7
|
-
getAssetFn?: (url: string, assetId: PublicKey) => Promise<Asset | undefined>;
|
|
8
|
-
getAssetProofFn?: (url: string, assetId: PublicKey) => Promise<AssetProof | undefined>;
|
|
9
|
-
};
|
|
10
|
-
export declare function proofArgsAndAccounts({ connection, assetId, assetEndpoint, getAssetFn, getAssetProofFn, }: ProofArgsAndAccountsArgs): Promise<{
|
|
11
|
-
accounts: Record<string, PublicKey>;
|
|
12
|
-
asset: Asset;
|
|
13
|
-
args: {
|
|
14
|
-
dataHash: number[];
|
|
15
|
-
creatorHash: number[];
|
|
16
|
-
root: number[];
|
|
17
|
-
index: number;
|
|
18
|
-
};
|
|
19
|
-
remainingAccounts: AccountMeta[];
|
|
20
|
-
}>;
|
|
21
|
-
//# sourceMappingURL=proofArgsAndAccounts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proofArgsAndAccounts.d.ts","sourceRoot":"","sources":["../../../../src/functions/proofArgsAndAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAA2B,MAAM,mBAAmB,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAErE,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,SAAS,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,KAAK,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;IAC7E,eAAe,CAAC,EAAE,CAChB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,SAAS,KACf,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;CACtC,CAAC;AACF,wBAAsB,oBAAoB,CAAC,EACzC,UAAU,EACV,OAAO,EACP,aAAa,EACb,UAAqB,EACrB,eAA+B,GAChC,EAAE,wBAAwB,GAAG,OAAO,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACpC,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,WAAW,EAAE,MAAM,EAAE,CAAC;QACtB,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,iBAAiB,EAAE,WAAW,EAAE,CAAC;CAClC,CAAC,CAsCD"}
|