@dfinity/cmc 8.0.1-next-2025-12-03.1 → 8.0.1-next-2025-12-08
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/README.md +3 -3
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,12 +29,12 @@ npm i @icp-sdk/core @dfinity/utils
|
|
|
29
29
|
|
|
30
30
|
## Usage
|
|
31
31
|
|
|
32
|
-
The features are available through the class `
|
|
32
|
+
The features are available through the class `CmcCanister`. It has to be instantiated with the canister ID of the cycles minting canister. On `mainnet`, its ID is `rkp4c-7iaaa-aaaaa-aaaca-cai`.
|
|
33
33
|
|
|
34
34
|
e.g. querying the current Icp to cycles conversion rate.
|
|
35
35
|
|
|
36
36
|
```ts
|
|
37
|
-
import {
|
|
37
|
+
import { CmcCanister } from "@dfinity/cmc";
|
|
38
38
|
import { createAgent } from "@dfinity/utils";
|
|
39
39
|
|
|
40
40
|
const agent = await createAgent({
|
|
@@ -42,7 +42,7 @@ const agent = await createAgent({
|
|
|
42
42
|
host: HOST,
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
const { getIcpToCyclesConversionRate } =
|
|
45
|
+
const { getIcpToCyclesConversionRate } = CmcCanister.create({
|
|
46
46
|
agent,
|
|
47
47
|
canisterId: CYCLES_MINTING_CANISTER_ID,
|
|
48
48
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -3,4 +3,12 @@ export type Cycles = CmcDid.Cycles;
|
|
|
3
3
|
export type NotifyCreateCanisterArg = CmcDid.NotifyCreateCanisterArg;
|
|
4
4
|
export type NotifyTopUpArg = CmcDid.NotifyTopUpArg;
|
|
5
5
|
export type SubnetTypesToSubnetsResponse = CmcDid.SubnetTypesToSubnetsResponse;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use "@icp-sdk/canisters/cmc" directly instead
|
|
8
|
+
*/
|
|
6
9
|
export * from "@icp-sdk/canisters/cmc";
|
|
10
|
+
/**
|
|
11
|
+
* Legacy re-export for backward compatibility.
|
|
12
|
+
* @deprecated Use "@icp-sdk/canisters/cmc" directly instead
|
|
13
|
+
*/
|
|
14
|
+
export { CmcCanister as CMCCanister, CmcError as CMCError, type CmcCanisterOptions as CMCCanisterOptions, } from "@icp-sdk/canisters/cmc";
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"@icp-sdk/canisters/cmc";
|
|
1
|
+
export*from"@icp-sdk/canisters/cmc";import{CmcCanister as o,CmcError as p}from"@icp-sdk/canisters/cmc";export{o as CMCCanister,p as CMCError};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import type { CmcDid } from \"@icp-sdk/canisters/cmc\";\n\nexport type Cycles = CmcDid.Cycles;\nexport type NotifyCreateCanisterArg = CmcDid.NotifyCreateCanisterArg;\nexport type NotifyTopUpArg = CmcDid.NotifyTopUpArg;\nexport type SubnetTypesToSubnetsResponse = CmcDid.SubnetTypesToSubnetsResponse;\n\nexport * from \"@icp-sdk/canisters/cmc\";\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import type { CmcDid } from \"@icp-sdk/canisters/cmc\";\n\nexport type Cycles = CmcDid.Cycles;\nexport type NotifyCreateCanisterArg = CmcDid.NotifyCreateCanisterArg;\nexport type NotifyTopUpArg = CmcDid.NotifyTopUpArg;\nexport type SubnetTypesToSubnetsResponse = CmcDid.SubnetTypesToSubnetsResponse;\n\n/**\n * @deprecated Use \"@icp-sdk/canisters/cmc\" directly instead\n */\nexport * from \"@icp-sdk/canisters/cmc\";\n\n/**\n * Legacy re-export for backward compatibility.\n * @deprecated Use \"@icp-sdk/canisters/cmc\" directly instead\n */\nexport {\n CmcCanister as CMCCanister,\n CmcError as CMCError,\n type CmcCanisterOptions as CMCCanisterOptions,\n} from \"@icp-sdk/canisters/cmc\";\n"],
|
|
5
|
+
"mappings": "AAUA,WAAc,yBAMd,OACiB,eAAfA,EACY,YAAZC,MAEK",
|
|
6
|
+
"names": ["CmcCanister", "CmcError"]
|
|
7
7
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as topLevelCreateRequire } from 'module';
|
|
2
2
|
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
-
export*from"@icp-sdk/canisters/cmc";
|
|
3
|
+
export*from"@icp-sdk/canisters/cmc";import{CmcCanister as o,CmcError as p}from"@icp-sdk/canisters/cmc";export{o as CMCCanister,p as CMCError};
|
|
4
4
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import type { CmcDid } from \"@icp-sdk/canisters/cmc\";\n\nexport type Cycles = CmcDid.Cycles;\nexport type NotifyCreateCanisterArg = CmcDid.NotifyCreateCanisterArg;\nexport type NotifyTopUpArg = CmcDid.NotifyTopUpArg;\nexport type SubnetTypesToSubnetsResponse = CmcDid.SubnetTypesToSubnetsResponse;\n\nexport * from \"@icp-sdk/canisters/cmc\";\n"],
|
|
5
|
-
"mappings": ";;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import type { CmcDid } from \"@icp-sdk/canisters/cmc\";\n\nexport type Cycles = CmcDid.Cycles;\nexport type NotifyCreateCanisterArg = CmcDid.NotifyCreateCanisterArg;\nexport type NotifyTopUpArg = CmcDid.NotifyTopUpArg;\nexport type SubnetTypesToSubnetsResponse = CmcDid.SubnetTypesToSubnetsResponse;\n\n/**\n * @deprecated Use \"@icp-sdk/canisters/cmc\" directly instead\n */\nexport * from \"@icp-sdk/canisters/cmc\";\n\n/**\n * Legacy re-export for backward compatibility.\n * @deprecated Use \"@icp-sdk/canisters/cmc\" directly instead\n */\nexport {\n CmcCanister as CMCCanister,\n CmcError as CMCError,\n type CmcCanisterOptions as CMCCanisterOptions,\n} from \"@icp-sdk/canisters/cmc\";\n"],
|
|
5
|
+
"mappings": ";;AAUA,WAAc,yBAMd,OACiB,eAAfA,EACY,YAAZC,MAEK",
|
|
6
|
+
"names": ["CmcCanister", "CmcError"]
|
|
7
7
|
}
|