@helium/helium-entity-manager-sdk 0.0.16 → 0.0.18
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 +21 -39
- package/lib/cjs/functions/onboardIotHotspot.js.map +1 -1
- package/lib/cjs/functions/onboardMobileHotspot.js +21 -39
- package/lib/cjs/functions/onboardMobileHotspot.js.map +1 -1
- package/lib/cjs/functions/proofArgsAndAccounts.js +51 -0
- package/lib/cjs/functions/proofArgsAndAccounts.js.map +1 -0
- package/lib/cjs/functions/updateIotMetadata.js +21 -37
- package/lib/cjs/functions/updateIotMetadata.js.map +1 -1
- package/lib/cjs/functions/updateMobileMetadata.js +20 -35
- package/lib/cjs/functions/updateMobileMetadata.js.map +1 -1
- package/lib/cjs/index.js +3 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/pdas.js +3 -1
- package/lib/cjs/pdas.js.map +1 -1
- package/lib/esm/src/functions/onboardIotHotspot.js +12 -29
- package/lib/esm/src/functions/onboardIotHotspot.js.map +1 -1
- package/lib/esm/src/functions/onboardMobileHotspot.js +12 -29
- package/lib/esm/src/functions/onboardMobileHotspot.js.map +1 -1
- package/lib/esm/src/functions/proofArgsAndAccounts.js +36 -0
- package/lib/esm/src/functions/proofArgsAndAccounts.js.map +1 -0
- package/lib/esm/src/functions/updateIotMetadata.js +12 -27
- package/lib/esm/src/functions/updateIotMetadata.js.map +1 -1
- package/lib/esm/src/functions/updateMobileMetadata.js +12 -27
- package/lib/esm/src/functions/updateMobileMetadata.js.map +1 -1
- package/lib/esm/src/index.js +1 -0
- package/lib/esm/src/index.js.map +1 -1
- package/lib/esm/src/pdas.js +1 -0
- package/lib/esm/src/pdas.js.map +1 -1
- package/lib/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/src/functions/onboardIotHotspot.d.ts +6 -8
- package/lib/types/src/functions/onboardIotHotspot.d.ts.map +1 -1
- package/lib/types/src/functions/onboardMobileHotspot.d.ts +6 -7
- package/lib/types/src/functions/onboardMobileHotspot.d.ts.map +1 -1
- package/lib/types/src/functions/proofArgsAndAccounts.d.ts +20 -0
- package/lib/types/src/functions/proofArgsAndAccounts.d.ts.map +1 -0
- package/lib/types/src/functions/updateIotMetadata.d.ts +7 -8
- package/lib/types/src/functions/updateIotMetadata.d.ts.map +1 -1
- package/lib/types/src/functions/updateMobileMetadata.d.ts +5 -6
- package/lib/types/src/functions/updateMobileMetadata.d.ts.map +1 -1
- package/lib/types/src/index.d.ts +1 -0
- package/lib/types/src/index.d.ts.map +1 -1
- package/lib/types/src/pdas.d.ts +1 -0
- package/lib/types/src/pdas.d.ts.map +1 -1
- package/package.json +7 -5
- package/lib/cjs/functions/updateMetadata.js +0 -57
- package/lib/cjs/functions/updateMetadata.js.map +0 -1
- package/lib/cjs/utils.js +0 -25
- package/lib/cjs/utils.js.map +0 -1
- package/lib/esm/src/functions/updateMetadata.js +0 -42
- package/lib/esm/src/functions/updateMetadata.js.map +0 -1
- package/lib/esm/src/utils.js +0 -21
- package/lib/esm/src/utils.js.map +0 -1
- package/lib/types/src/functions/updateMetadata.d.ts +0 -133
- package/lib/types/src/functions/updateMetadata.d.ts.map +0 -1
- package/lib/types/src/utils.d.ts +0 -7
- package/lib/types/src/utils.d.ts.map +0 -1
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { HeliumEntityManager } from "@helium/idls/lib/types/helium_entity_manager";
|
|
2
|
-
import { Asset, AssetProof } from "@helium/spl-utils";
|
|
3
2
|
import { Program } from "@project-serum/anchor";
|
|
4
3
|
import { PublicKey } from "@solana/web3.js";
|
|
5
|
-
|
|
4
|
+
import { ProofArgsAndAccountsArgs } from "./proofArgsAndAccounts";
|
|
5
|
+
export declare function onboardIotHotspot({ program, rewardableEntityConfig, assetId, maker, dao, dcFeePayer, payer, ...rest }: {
|
|
6
6
|
program: Program<HeliumEntityManager>;
|
|
7
|
-
assetId: PublicKey;
|
|
8
7
|
rewardableEntityConfig: PublicKey;
|
|
9
|
-
|
|
8
|
+
payer?: PublicKey;
|
|
9
|
+
dcFeePayer?: PublicKey;
|
|
10
10
|
maker: PublicKey;
|
|
11
11
|
dao: PublicKey;
|
|
12
|
-
|
|
13
|
-
getAssetProofFn?: (url: string, assetId: PublicKey) => Promise<AssetProof | undefined>;
|
|
14
|
-
}): Promise<import("@project-serum/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<HeliumEntityManager, {
|
|
12
|
+
} & Omit<ProofArgsAndAccountsArgs, "connection">): Promise<import("@project-serum/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<HeliumEntityManager, {
|
|
15
13
|
name: "onboardIotHotspotV0";
|
|
16
14
|
accounts: [{
|
|
17
15
|
name: "payer";
|
|
@@ -19,7 +17,7 @@ export declare function onboardIotHotspot({ program, rewardableEntityConfig, ass
|
|
|
19
17
|
isSigner: true;
|
|
20
18
|
}, {
|
|
21
19
|
name: "dcFeePayer";
|
|
22
|
-
isMut:
|
|
20
|
+
isMut: true;
|
|
23
21
|
isSigner: true;
|
|
24
22
|
}, {
|
|
25
23
|
name: "issuingAuthority";
|
|
@@ -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,
|
|
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,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAwB,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGxF,wBAAsB,iBAAiB,CAAC,EACtC,OAAO,EACP,sBAAsB,EACtB,OAAO,EACP,KAAK,EACL,GAAG,EACH,UAAU,EACV,KAAK,EACL,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,GAAG,EAAE,SAAS,CAAC;CAChB,GAAG,IAAI,CAAC,wBAAwB,EAAE,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqC/C"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { HeliumEntityManager } from "@helium/idls/lib/types/helium_entity_manager";
|
|
2
|
-
import { Asset, AssetProof } from "@helium/spl-utils";
|
|
3
2
|
import { Program } from "@project-serum/anchor";
|
|
4
3
|
import { PublicKey } from "@solana/web3.js";
|
|
5
|
-
|
|
4
|
+
import { ProofArgsAndAccountsArgs } from "./proofArgsAndAccounts";
|
|
5
|
+
export declare function onboardMobileHotspot({ program, rewardableEntityConfig, assetId, maker, dao, payer, dcFeePayer, ...rest }: {
|
|
6
6
|
program: Program<HeliumEntityManager>;
|
|
7
|
+
payer?: PublicKey;
|
|
8
|
+
dcFeePayer?: PublicKey;
|
|
7
9
|
assetId: PublicKey;
|
|
8
10
|
rewardableEntityConfig: PublicKey;
|
|
9
|
-
assetEndpoint?: string;
|
|
10
11
|
maker: PublicKey;
|
|
11
12
|
dao: PublicKey;
|
|
12
|
-
|
|
13
|
-
getAssetProofFn?: (url: string, assetId: PublicKey) => Promise<AssetProof | undefined>;
|
|
14
|
-
}): Promise<import("@project-serum/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<HeliumEntityManager, {
|
|
13
|
+
} & Omit<ProofArgsAndAccountsArgs, "connection">): Promise<import("@project-serum/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<HeliumEntityManager, {
|
|
15
14
|
name: "onboardMobileHotspotV0";
|
|
16
15
|
accounts: [{
|
|
17
16
|
name: "payer";
|
|
@@ -19,7 +18,7 @@ export declare function onboardMobileHotspot({ program, rewardableEntityConfig,
|
|
|
19
18
|
isSigner: true;
|
|
20
19
|
}, {
|
|
21
20
|
name: "dcFeePayer";
|
|
22
|
-
isMut:
|
|
21
|
+
isMut: true;
|
|
23
22
|
isSigner: true;
|
|
24
23
|
}, {
|
|
25
24
|
name: "issuingAuthority";
|
|
@@ -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,
|
|
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,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAwB,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAExF,wBAAsB,oBAAoB,CAAC,EACzC,OAAO,EACP,sBAAsB,EACtB,OAAO,EACP,KAAK,EACL,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,sBAAsB,EAAE,SAAS,CAAC;IAClC,KAAK,EAAE,SAAS,CAAC;IACjB,GAAG,EAAE,SAAS,CAAC;CAChB,GAAG,IAAI,CAAC,wBAAwB,EAAE,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoC/C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
hash: number[];
|
|
15
|
+
root: number[];
|
|
16
|
+
index: number;
|
|
17
|
+
};
|
|
18
|
+
remainingAccounts: AccountMeta[];
|
|
19
|
+
}>;
|
|
20
|
+
//# sourceMappingURL=proofArgsAndAccounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AAGrE,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,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,iBAAiB,EAAE,WAAW,EAAE,CAAA;CACjC,CAAC,CAwCD"}
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
/// <reference types="bn.js" />
|
|
2
2
|
import { HeliumEntityManager } from "@helium/idls/lib/types/helium_entity_manager";
|
|
3
|
-
import { Asset, AssetProof } from "@helium/spl-utils";
|
|
4
3
|
import { BN, Program } from "@project-serum/anchor";
|
|
5
4
|
import { PublicKey } from "@solana/web3.js";
|
|
6
|
-
|
|
5
|
+
import { ProofArgsAndAccountsArgs } from "./proofArgsAndAccounts";
|
|
6
|
+
export declare function updateIotMetadata({ program, rewardableEntityConfig, assetId, location, elevation, gain, payer, dcFeePayer, ...rest }: {
|
|
7
7
|
program: Program<HeliumEntityManager>;
|
|
8
|
+
payer?: PublicKey;
|
|
9
|
+
dcFeePayer?: PublicKey;
|
|
8
10
|
location: BN | null;
|
|
9
11
|
elevation: number | null;
|
|
10
12
|
gain: number | null;
|
|
11
13
|
assetId: PublicKey;
|
|
12
14
|
rewardableEntityConfig: PublicKey;
|
|
13
|
-
|
|
14
|
-
getAssetFn?: (url: string, assetId: PublicKey) => Promise<Asset | undefined>;
|
|
15
|
-
getAssetProofFn?: (url: string, assetId: PublicKey) => Promise<AssetProof | undefined>;
|
|
16
|
-
}): Promise<import("@project-serum/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<HeliumEntityManager, {
|
|
15
|
+
} & Omit<ProofArgsAndAccountsArgs, "connection">): Promise<import("@project-serum/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<HeliumEntityManager, {
|
|
17
16
|
name: "updateIotInfoV0";
|
|
18
17
|
accounts: [{
|
|
19
18
|
name: "payer";
|
|
20
|
-
isMut:
|
|
19
|
+
isMut: true;
|
|
21
20
|
isSigner: true;
|
|
22
21
|
}, {
|
|
23
22
|
name: "dcFeePayer";
|
|
24
|
-
isMut:
|
|
23
|
+
isMut: true;
|
|
25
24
|
isSigner: true;
|
|
26
25
|
}, {
|
|
27
26
|
name: "iotInfo";
|
|
@@ -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,
|
|
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,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAwB,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAExF,wBAAsB,iBAAiB,CAAC,EACtC,OAAO,EACP,sBAAsB,EACtB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,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,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiC/C"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/// <reference types="bn.js" />
|
|
2
2
|
import { HeliumEntityManager } from "@helium/idls/lib/types/helium_entity_manager";
|
|
3
|
-
import { Asset, AssetProof } from "@helium/spl-utils";
|
|
4
3
|
import { BN, Program } from "@project-serum/anchor";
|
|
5
4
|
import { PublicKey } from "@solana/web3.js";
|
|
6
|
-
|
|
5
|
+
import { ProofArgsAndAccountsArgs } from "./proofArgsAndAccounts";
|
|
6
|
+
export declare function updateMobileMetadata({ program, rewardableEntityConfig, assetId, location, dcFeePayer, payer, ...rest }: {
|
|
7
7
|
program: Program<HeliumEntityManager>;
|
|
8
|
+
payer?: PublicKey;
|
|
9
|
+
dcFeePayer?: PublicKey;
|
|
8
10
|
location: BN | null;
|
|
9
11
|
assetId: PublicKey;
|
|
10
12
|
rewardableEntityConfig: PublicKey;
|
|
11
|
-
|
|
12
|
-
getAssetFn?: (url: string, assetId: PublicKey) => Promise<Asset | undefined>;
|
|
13
|
-
getAssetProofFn?: (url: string, assetId: PublicKey) => Promise<AssetProof | undefined>;
|
|
14
|
-
}): Promise<import("@project-serum/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<HeliumEntityManager, {
|
|
13
|
+
} & Omit<ProofArgsAndAccountsArgs, "connection">): Promise<import("@project-serum/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<HeliumEntityManager, {
|
|
15
14
|
name: "updateMobileInfoV0";
|
|
16
15
|
accounts: [{
|
|
17
16
|
name: "payer";
|
|
@@ -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,
|
|
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,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAwB,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAExF,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8B/C"}
|
package/lib/types/src/index.d.ts
CHANGED
|
@@ -8,5 +8,6 @@ export { updateIotMetadata } from "./functions/updateIotMetadata";
|
|
|
8
8
|
export { updateMobileMetadata } from "./functions/updateMobileMetadata";
|
|
9
9
|
export { onboardIotHotspot } from "./functions/onboardIotHotspot";
|
|
10
10
|
export { onboardMobileHotspot } from "./functions/onboardMobileHotspot";
|
|
11
|
+
export { proofArgsAndAccounts } from "./functions/proofArgsAndAccounts";
|
|
11
12
|
export declare const init: (provider: AnchorProvider, programId?: PublicKey, idl?: Idl | null) => Promise<Program<HeliumEntityManager>>;
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AAGnF,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,eAAO,MAAM,IAAI,aACL,cAAc,cACb,SAAS,QACd,GAAG,GAAG,IAAI,KACf,QAAQ,QAAQ,mBAAmB,CAAC,CActC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AAGnF,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,eAAO,MAAM,IAAI,aACL,cAAc,cACb,SAAS,QACd,GAAG,GAAG,IAAI,KACf,QAAQ,QAAQ,mBAAmB,CAAC,CActC,CAAC"}
|
package/lib/types/src/pdas.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { PublicKey } from "@solana/web3.js";
|
|
|
2
2
|
export declare const rewardableEntityConfigKey: (subDao: PublicKey, symbol: string, programId?: PublicKey) => [PublicKey, number];
|
|
3
3
|
export declare const hotspotCollectionKey: (maker: PublicKey, programId?: PublicKey) => [PublicKey, number];
|
|
4
4
|
export declare const makerKey: (name: String, programId?: PublicKey) => [PublicKey, number];
|
|
5
|
+
export declare const makerApprovalKey: (rewardableEntityConfig: PublicKey, maker: PublicKey, programId?: PublicKey) => [PublicKey, number];
|
|
5
6
|
export declare const keyToAssetKey: (dao: PublicKey, entityKey: Buffer | string, programId?: PublicKey) => Promise<[PublicKey, number]>;
|
|
6
7
|
export declare const iotInfoKey: (rewardableEntityConfig: PublicKey, assetId: PublicKey, programId?: PublicKey) => [PublicKey, number];
|
|
7
8
|
export declare const mobileInfoKey: (rewardableEntityConfig: PublicKey, assetId: PublicKey, programId?: PublicKey) => [PublicKey, number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdas.d.ts","sourceRoot":"","sources":["../../../src/pdas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAO5C,eAAO,MAAM,yBAAyB,WAC5B,SAAS,UACT,MAAM,cACH,SAAS,wBASnB,CAAC;AAEJ,eAAO,MAAM,oBAAoB,UACxB,SAAS,cACL,SAAS,wBAKnB,CAAC;AAEJ,eAAO,MAAM,QAAQ,SACb,MAAM,cACD,SAAS,wBAQnB,CAAC;AAEJ,eAAO,MAAM,aAAa,QACnB,SAAS,aACH,MAAM,GAAG,MAAM,cACf,SAAS,iCAWrB,CAAC;AAEF,eAAO,MAAM,UAAU,2BACG,SAAS,WACxB,SAAS,cACP,SAAS,wBAMrB,CAAC;AAEF,eAAO,MAAM,aAAa,2BACA,SAAS,WACxB,SAAS,cACP,SAAS,wBAUrB,CAAC;AAEF,eAAO,MAAM,qBAAqB,eACpB,SAAS,cACV,SAAS,wBASnB,CAAC"}
|
|
1
|
+
{"version":3,"file":"pdas.d.ts","sourceRoot":"","sources":["../../../src/pdas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAO5C,eAAO,MAAM,yBAAyB,WAC5B,SAAS,UACT,MAAM,cACH,SAAS,wBASnB,CAAC;AAEJ,eAAO,MAAM,oBAAoB,UACxB,SAAS,cACL,SAAS,wBAKnB,CAAC;AAEJ,eAAO,MAAM,QAAQ,SACb,MAAM,cACD,SAAS,wBAQnB,CAAC;AAEJ,eAAO,MAAM,gBAAgB,2BAA4B,SAAS,SAAS,SAAS,cAAa,SAAS,wBAIvG,CAAC;AAEJ,eAAO,MAAM,aAAa,QACnB,SAAS,aACH,MAAM,GAAG,MAAM,cACf,SAAS,iCAWrB,CAAC;AAEF,eAAO,MAAM,UAAU,2BACG,SAAS,WACxB,SAAS,cACP,SAAS,wBAMrB,CAAC;AAEF,eAAO,MAAM,aAAa,2BACA,SAAS,WACxB,SAAS,cACP,SAAS,wBAUrB,CAAC;AAEF,eAAO,MAAM,qBAAqB,eACpB,SAAS,cACV,SAAS,wBASnB,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.18",
|
|
9
9
|
"description": "Interface to the helium-entity-manager smart contract",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -32,11 +32,13 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@helium/address": "^4.6.2",
|
|
35
|
-
"@helium/helium-sub-daos-sdk": "^0.0.
|
|
36
|
-
"@helium/idls": "^0.0.
|
|
37
|
-
"@helium/spl-utils": "^0.0.
|
|
35
|
+
"@helium/helium-sub-daos-sdk": "^0.0.18",
|
|
36
|
+
"@helium/idls": "^0.0.18",
|
|
37
|
+
"@helium/spl-utils": "^0.0.18",
|
|
38
|
+
"@metaplex-foundation/mpl-bubblegum": "^0.6.0",
|
|
38
39
|
"@metaplex-foundation/mpl-token-metadata": "^2.2.3",
|
|
39
40
|
"@project-serum/anchor": "0.26.0",
|
|
41
|
+
"@solana/spl-account-compression": "^0.1.5",
|
|
40
42
|
"@solana/spl-token": "^0.3.6",
|
|
41
43
|
"bn.js": "^5.2.0",
|
|
42
44
|
"bs58": "^4.0.1",
|
|
@@ -50,5 +52,5 @@
|
|
|
50
52
|
"typescript": "^4.3.4",
|
|
51
53
|
"yarn": "^1.22.18"
|
|
52
54
|
},
|
|
53
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "a26c0086b2dc77d1b455b506bffca09d3c02dcb1"
|
|
54
56
|
}
|
|
@@ -1,57 +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.updateMetadata = void 0;
|
|
13
|
-
const spl_utils_1 = require("@helium/spl-utils");
|
|
14
|
-
const pdas_1 = require("../pdas");
|
|
15
|
-
function updateMetadata({ program, rewardableEntityConfig, assetId, location, elevation, gain, 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 || program.provider.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 { root, proof, leaf, treeId, nodeIndex } = assetProof;
|
|
28
|
-
const { ownership: { owner }, content: { json_uri: uri }, } = asset;
|
|
29
|
-
const eccCompact = uri.split("/").slice(-1)[0];
|
|
30
|
-
const [info] = (0, pdas_1.iotInfoKey)(rewardableEntityConfig, eccCompact);
|
|
31
|
-
return program.methods
|
|
32
|
-
.updateIotInfoV0({
|
|
33
|
-
location,
|
|
34
|
-
elevation,
|
|
35
|
-
gain,
|
|
36
|
-
hash: leaf.toBuffer().toJSON().data,
|
|
37
|
-
root: root.toBuffer().toJSON().data,
|
|
38
|
-
index: nodeIndex,
|
|
39
|
-
})
|
|
40
|
-
.accounts({
|
|
41
|
-
// hotspot: assetId,
|
|
42
|
-
rewardableEntityConfig,
|
|
43
|
-
hotspotOwner: owner,
|
|
44
|
-
iotInfo: info,
|
|
45
|
-
merkleTree: treeId,
|
|
46
|
-
})
|
|
47
|
-
.remainingAccounts(proof.map((p) => {
|
|
48
|
-
return {
|
|
49
|
-
pubkey: p,
|
|
50
|
-
isWritable: false,
|
|
51
|
-
isSigner: false,
|
|
52
|
-
};
|
|
53
|
-
}));
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
exports.updateMetadata = updateMetadata;
|
|
57
|
-
//# sourceMappingURL=updateMetadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updateMetadata.js","sourceRoot":"","sources":["../../../src/functions/updateMetadata.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,iDAA+E;AAG/E,kCAAqC;AAErC,SAAsB,cAAc,CAAC,EACnC,OAAO,EACP,sBAAsB,EACtB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,aAAa,EACb,UAAU,GAAG,oBAAQ,EACrB,eAAe,GAAG,yBAAa,GAchC;;QACC,aAAa;QACb,MAAM,QAAQ,GAAG,aAAa,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC;QAC3E,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,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC;QAC5D,MAAM,EACJ,SAAS,EAAE,EAAE,KAAK,EAAE,EACpB,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,GAC3B,GAAG,KAAK,CAAC;QACV,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE/C,MAAM,CAAC,IAAI,CAAC,GAAG,IAAA,iBAAU,EAAC,sBAAsB,EAAE,UAAU,CAAC,CAAC;QAE9D,OAAO,OAAO,CAAC,OAAO;aACnB,eAAe,CAAC;YACf,QAAQ;YACR,SAAS;YACT,IAAI;YACJ,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI;YACnC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI;YACnC,KAAK,EAAE,SAAS;SACjB,CAAC;aACD,QAAQ,CAAC;YACR,oBAAoB;YACpB,sBAAsB;YACtB,YAAY,EAAE,KAAK;YACnB,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,MAAM;SACnB,CAAC;aACD,iBAAiB,CAChB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACd,OAAO;gBACL,MAAM,EAAE,CAAC;gBACT,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,KAAK;aAChB,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACN,CAAC;CAAA;AApED,wCAoEC"}
|
package/lib/cjs/utils.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assetToMetadataArgs = void 0;
|
|
4
|
-
function assetToMetadataArgs(asset) {
|
|
5
|
-
const metadata = {
|
|
6
|
-
name: asset.content.metadata.name,
|
|
7
|
-
symbol: asset.content.metadata.symbol,
|
|
8
|
-
uri: asset.content.json_uri,
|
|
9
|
-
sellerFeeBasisPoints: asset.royalty.basis_points,
|
|
10
|
-
primarySaleHappened: asset.royalty.primary_sale_happened,
|
|
11
|
-
isMutable: asset.mutable,
|
|
12
|
-
editionNonce: asset.supply.edition_nonce,
|
|
13
|
-
tokenStandard: { nonFungible: {} },
|
|
14
|
-
collection: asset.grouping ? {
|
|
15
|
-
key: asset.grouping,
|
|
16
|
-
verified: true
|
|
17
|
-
} : null,
|
|
18
|
-
uses: null,
|
|
19
|
-
tokenProgramVersion: { original: {} },
|
|
20
|
-
creators: asset.creators,
|
|
21
|
-
};
|
|
22
|
-
return metadata;
|
|
23
|
-
}
|
|
24
|
-
exports.assetToMetadataArgs = assetToMetadataArgs;
|
|
25
|
-
//# sourceMappingURL=utils.js.map
|
package/lib/cjs/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAMA,SAAgB,mBAAmB,CAAC,KAAY;IAC9C,MAAM,QAAQ,GAAiB;QAC7B,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI;QACjC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM;QACrC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ;QAC3B,oBAAoB,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY;QAChD,mBAAmB,EAAE,KAAK,CAAC,OAAO,CAAC,qBAAqB;QACxD,SAAS,EAAE,KAAK,CAAC,OAAO;QACxB,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,aAAa;QACxC,aAAa,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;QAClC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC3B,GAAG,EAAE,KAAK,CAAC,QAAQ;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC,CAAC,IAAI;QACR,IAAI,EAAE,IAAI;QACV,mBAAmB,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;QACrC,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC;IAEF,OAAO,QAAQ,CAAA;AACjB,CAAC;AApBD,kDAoBC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { getAsset, getAssetProof } from "@helium/spl-utils";
|
|
2
|
-
import { iotInfoKey } from "../pdas";
|
|
3
|
-
export async function updateMetadata({ program, rewardableEntityConfig, assetId, location, elevation, gain, assetEndpoint, getAssetFn = getAsset, getAssetProofFn = getAssetProof, }) {
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
const endpoint = assetEndpoint || program.provider.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 { root, proof, leaf, treeId, nodeIndex } = assetProof;
|
|
15
|
-
const { ownership: { owner }, content: { json_uri: uri }, } = asset;
|
|
16
|
-
const eccCompact = uri.split("/").slice(-1)[0];
|
|
17
|
-
const [info] = iotInfoKey(rewardableEntityConfig, eccCompact);
|
|
18
|
-
return program.methods
|
|
19
|
-
.updateIotInfoV0({
|
|
20
|
-
location,
|
|
21
|
-
elevation,
|
|
22
|
-
gain,
|
|
23
|
-
hash: leaf.toBuffer().toJSON().data,
|
|
24
|
-
root: root.toBuffer().toJSON().data,
|
|
25
|
-
index: nodeIndex,
|
|
26
|
-
})
|
|
27
|
-
.accounts({
|
|
28
|
-
// hotspot: assetId,
|
|
29
|
-
rewardableEntityConfig,
|
|
30
|
-
hotspotOwner: owner,
|
|
31
|
-
iotInfo: info,
|
|
32
|
-
merkleTree: treeId,
|
|
33
|
-
})
|
|
34
|
-
.remainingAccounts(proof.map((p) => {
|
|
35
|
-
return {
|
|
36
|
-
pubkey: p,
|
|
37
|
-
isWritable: false,
|
|
38
|
-
isSigner: false,
|
|
39
|
-
};
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=updateMetadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updateMetadata.js","sourceRoot":"","sources":["../../../../src/functions/updateMetadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG/E,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EACnC,OAAO,EACP,sBAAsB,EACtB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,aAAa,EACb,UAAU,GAAG,QAAQ,EACrB,eAAe,GAAG,aAAa,GAchC;IACC,aAAa;IACb,MAAM,QAAQ,GAAG,aAAa,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC;IAC3E,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,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC;IAC5D,MAAM,EACJ,SAAS,EAAE,EAAE,KAAK,EAAE,EACpB,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,GAC3B,GAAG,KAAK,CAAC;IACV,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/C,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,sBAAsB,EAAE,UAAU,CAAC,CAAC;IAE9D,OAAO,OAAO,CAAC,OAAO;SACnB,eAAe,CAAC;QACf,QAAQ;QACR,SAAS;QACT,IAAI;QACJ,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI;QACnC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI;QACnC,KAAK,EAAE,SAAS;KACjB,CAAC;SACD,QAAQ,CAAC;QACR,oBAAoB;QACpB,sBAAsB;QACtB,YAAY,EAAE,KAAK;QACnB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,MAAM;KACnB,CAAC;SACD,iBAAiB,CAChB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACd,OAAO;YACL,MAAM,EAAE,CAAC;YACT,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,KAAK;SAChB,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;AACN,CAAC"}
|
package/lib/esm/src/utils.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function assetToMetadataArgs(asset) {
|
|
2
|
-
const metadata = {
|
|
3
|
-
name: asset.content.metadata.name,
|
|
4
|
-
symbol: asset.content.metadata.symbol,
|
|
5
|
-
uri: asset.content.json_uri,
|
|
6
|
-
sellerFeeBasisPoints: asset.royalty.basis_points,
|
|
7
|
-
primarySaleHappened: asset.royalty.primary_sale_happened,
|
|
8
|
-
isMutable: asset.mutable,
|
|
9
|
-
editionNonce: asset.supply.edition_nonce,
|
|
10
|
-
tokenStandard: { nonFungible: {} },
|
|
11
|
-
collection: asset.grouping ? {
|
|
12
|
-
key: asset.grouping,
|
|
13
|
-
verified: true
|
|
14
|
-
} : null,
|
|
15
|
-
uses: null,
|
|
16
|
-
tokenProgramVersion: { original: {} },
|
|
17
|
-
creators: asset.creators,
|
|
18
|
-
};
|
|
19
|
-
return metadata;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=utils.js.map
|
package/lib/esm/src/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,mBAAmB,CAAC,KAAY;IAC9C,MAAM,QAAQ,GAAiB;QAC7B,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI;QACjC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM;QACrC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ;QAC3B,oBAAoB,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY;QAChD,mBAAmB,EAAE,KAAK,CAAC,OAAO,CAAC,qBAAqB;QACxD,SAAS,EAAE,KAAK,CAAC,OAAO;QACxB,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,aAAa;QACxC,aAAa,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;QAClC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC3B,GAAG,EAAE,KAAK,CAAC,QAAQ;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC,CAAC,IAAI;QACR,IAAI,EAAE,IAAI;QACV,mBAAmB,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;QACrC,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC;IAEF,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/// <reference types="bn.js" />
|
|
2
|
-
import { HeliumEntityManager } from "@helium/idls/lib/types/helium_entity_manager";
|
|
3
|
-
import { Asset, AssetProof } from "@helium/spl-utils";
|
|
4
|
-
import { BN, Program } from "@project-serum/anchor";
|
|
5
|
-
import { PublicKey } from "@solana/web3.js";
|
|
6
|
-
export declare function updateMetadata({ program, rewardableEntityConfig, assetId, location, elevation, gain, assetEndpoint, getAssetFn, getAssetProofFn, }: {
|
|
7
|
-
program: Program<HeliumEntityManager>;
|
|
8
|
-
location: BN | null;
|
|
9
|
-
elevation: number | null;
|
|
10
|
-
gain: number | null;
|
|
11
|
-
assetId: PublicKey;
|
|
12
|
-
rewardableEntityConfig: PublicKey;
|
|
13
|
-
assetEndpoint?: string;
|
|
14
|
-
getAssetFn?: (url: string, assetId: PublicKey) => Promise<Asset | undefined>;
|
|
15
|
-
getAssetProofFn?: (url: string, assetId: PublicKey) => Promise<AssetProof | undefined>;
|
|
16
|
-
}): Promise<import("@project-serum/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<HeliumEntityManager, {
|
|
17
|
-
name: "updateIotInfoV0";
|
|
18
|
-
accounts: [{
|
|
19
|
-
name: "payer";
|
|
20
|
-
isMut: false;
|
|
21
|
-
isSigner: true;
|
|
22
|
-
}, {
|
|
23
|
-
name: "dcFeePayer";
|
|
24
|
-
isMut: false;
|
|
25
|
-
isSigner: true;
|
|
26
|
-
}, {
|
|
27
|
-
name: "iotInfo";
|
|
28
|
-
isMut: true;
|
|
29
|
-
isSigner: false;
|
|
30
|
-
}, {
|
|
31
|
-
name: "hotspotOwner";
|
|
32
|
-
isMut: true;
|
|
33
|
-
isSigner: true;
|
|
34
|
-
}, {
|
|
35
|
-
name: "merkleTree";
|
|
36
|
-
isMut: false;
|
|
37
|
-
isSigner: false;
|
|
38
|
-
}, {
|
|
39
|
-
name: "treeAuthority";
|
|
40
|
-
isMut: false;
|
|
41
|
-
isSigner: false;
|
|
42
|
-
pda: {
|
|
43
|
-
seeds: [{
|
|
44
|
-
kind: "account";
|
|
45
|
-
type: "publicKey";
|
|
46
|
-
path: "merkle_tree";
|
|
47
|
-
}];
|
|
48
|
-
programId: {
|
|
49
|
-
kind: "account";
|
|
50
|
-
type: "publicKey";
|
|
51
|
-
path: "bubblegum_program";
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
}, {
|
|
55
|
-
name: "dcBurner";
|
|
56
|
-
isMut: true;
|
|
57
|
-
isSigner: false;
|
|
58
|
-
}, {
|
|
59
|
-
name: "rewardableEntityConfig";
|
|
60
|
-
isMut: false;
|
|
61
|
-
isSigner: false;
|
|
62
|
-
relations: ["sub_dao"];
|
|
63
|
-
}, {
|
|
64
|
-
name: "dao";
|
|
65
|
-
isMut: false;
|
|
66
|
-
isSigner: false;
|
|
67
|
-
relations: ["dc_mint"];
|
|
68
|
-
}, {
|
|
69
|
-
name: "subDao";
|
|
70
|
-
isMut: false;
|
|
71
|
-
isSigner: false;
|
|
72
|
-
relations: ["dao"];
|
|
73
|
-
}, {
|
|
74
|
-
name: "dcMint";
|
|
75
|
-
isMut: true;
|
|
76
|
-
isSigner: false;
|
|
77
|
-
}, {
|
|
78
|
-
name: "dc";
|
|
79
|
-
isMut: false;
|
|
80
|
-
isSigner: false;
|
|
81
|
-
pda: {
|
|
82
|
-
seeds: [{
|
|
83
|
-
kind: "const";
|
|
84
|
-
type: "string";
|
|
85
|
-
value: "dc";
|
|
86
|
-
}, {
|
|
87
|
-
kind: "account";
|
|
88
|
-
type: "publicKey";
|
|
89
|
-
account: "Mint";
|
|
90
|
-
path: "dc_mint";
|
|
91
|
-
}];
|
|
92
|
-
programId: {
|
|
93
|
-
kind: "account";
|
|
94
|
-
type: "publicKey";
|
|
95
|
-
path: "data_credits_program";
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
relations: ["dc_mint"];
|
|
99
|
-
}, {
|
|
100
|
-
name: "bubblegumProgram";
|
|
101
|
-
isMut: false;
|
|
102
|
-
isSigner: false;
|
|
103
|
-
}, {
|
|
104
|
-
name: "compressionProgram";
|
|
105
|
-
isMut: false;
|
|
106
|
-
isSigner: false;
|
|
107
|
-
}, {
|
|
108
|
-
name: "dataCreditsProgram";
|
|
109
|
-
isMut: false;
|
|
110
|
-
isSigner: false;
|
|
111
|
-
}, {
|
|
112
|
-
name: "tokenProgram";
|
|
113
|
-
isMut: false;
|
|
114
|
-
isSigner: false;
|
|
115
|
-
}, {
|
|
116
|
-
name: "associatedTokenProgram";
|
|
117
|
-
isMut: false;
|
|
118
|
-
isSigner: false;
|
|
119
|
-
}, {
|
|
120
|
-
name: "systemProgram";
|
|
121
|
-
isMut: false;
|
|
122
|
-
isSigner: false;
|
|
123
|
-
}];
|
|
124
|
-
args: [{
|
|
125
|
-
name: "args";
|
|
126
|
-
type: {
|
|
127
|
-
defined: "UpdateIotInfoArgsV0";
|
|
128
|
-
};
|
|
129
|
-
}];
|
|
130
|
-
} & {
|
|
131
|
-
name: "updateIotInfoV0";
|
|
132
|
-
}>>;
|
|
133
|
-
//# sourceMappingURL=updateMetadata.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updateMetadata.d.ts","sourceRoot":"","sources":["../../../../src/functions/updateMetadata.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,KAAK,EAAE,UAAU,EAA2B,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,wBAAsB,cAAc,CAAC,EACnC,OAAO,EACP,sBAAsB,EACtB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,aAAa,EACb,UAAqB,EACrB,eAA+B,GAChC,EAAE;IACD,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACtC,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;IAClC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6CA"}
|
package/lib/types/src/utils.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Asset } from "@helium/spl-utils";
|
|
2
|
-
import { HeliumEntityManager } from "@helium/idls/lib/types/helium_entity_manager";
|
|
3
|
-
import { IdlTypes } from "@project-serum/anchor";
|
|
4
|
-
type MetadataArgs = IdlTypes<HeliumEntityManager>["MetadataArgs"];
|
|
5
|
-
export declare function assetToMetadataArgs(asset: Asset): MetadataArgs;
|
|
6
|
-
export {};
|
|
7
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,KAAK,YAAY,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAC,cAAc,CAAC,CAAC;AAElE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,YAAY,CAoB9D"}
|