Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dfinity/cmc

Package Overview
Dependencies
Maintainers
0
Versions
818
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dfinity/cmc - npm Package Compare versions

Comparing version 3.2.0 to 3.2.1-next-2024-09-30

dist/esm/chunk-MKLB3JOX.js

5

dist/candid/cmc.certified.idl.js

@@ -45,6 +45,2 @@ /* Do not edit. Compiled with ./scripts/compile-idl-js from packages/cmc/candid/cmc.did */

}),
'RefundFailed' : IDL.Record({
'create_error' : IDL.Text,
'refund_error' : IDL.Text,
}),
});

@@ -124,2 +120,3 @@ const CreateCanisterResult = IDL.Variant({

'get_build_metadata' : IDL.Func([], [IDL.Text], []),
'get_default_subnets' : IDL.Func([], [IDL.Vec(IDL.Principal)], []),
'get_icp_xdr_conversion_rate' : IDL.Func(

@@ -126,0 +123,0 @@ [],

9

dist/candid/cmc.d.ts

@@ -22,7 +22,5 @@ import type { ActorMethod } from "@dfinity/agent";

}
export type CreateCanisterError =
| {
Refunded: { create_error: string; refund_amount: bigint };
}
| { RefundFailed: { create_error: string; refund_error: string } };
export type CreateCanisterError = {
Refunded: { create_error: string; refund_amount: bigint };
};
export type CreateCanisterResult =

@@ -104,2 +102,3 @@ | { Ok: Principal }

get_build_metadata: ActorMethod<[], string>;
get_default_subnets: ActorMethod<[], Array<Principal>>;
get_icp_xdr_conversion_rate: ActorMethod<[], IcpXdrConversionRateResponse>;

@@ -106,0 +105,0 @@ get_principals_authorized_to_create_canisters_to_subnets: ActorMethod<

@@ -45,6 +45,2 @@ /* Do not edit. Compiled with ./scripts/compile-idl-js from packages/cmc/candid/cmc.did */

}),
'RefundFailed' : IDL.Record({
'create_error' : IDL.Text,
'refund_error' : IDL.Text,
}),
});

@@ -124,2 +120,3 @@ const CreateCanisterResult = IDL.Variant({

'get_build_metadata' : IDL.Func([], [IDL.Text], ['query']),
'get_default_subnets' : IDL.Func([], [IDL.Vec(IDL.Principal)], ['query']),
'get_icp_xdr_conversion_rate' : IDL.Func(

@@ -126,0 +123,0 @@ [],

@@ -1,2 +0,2 @@

"use strict";var y=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var J=(t,e)=>{for(var r in e)y(t,r,{get:e[r],enumerable:!0})},X=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of q(e))!z.call(t,n)&&n!==r&&y(t,n,{get:()=>e[n],enumerable:!(i=$(e,n))||i.enumerable});return t};var B=t=>X(y({},"__esModule",{value:!0}),t);var j={};J(j,{CMCCanister:()=>_,CMCError:()=>a,InvalidaTransactionError:()=>s,ProcessingError:()=>p,RefundedError:()=>c,TransactionTooOldError:()=>l,throwNotifyError:()=>d});module.exports=B(j);var C=require("@dfinity/agent");var O=({IDL:t})=>{let e=t.Variant({Set:t.Principal,Unset:t.Null}),r=t.Text,i=t.Record({exchange_rate_canister:t.Opt(e),cycles_ledger_canister_id:t.Opt(t.Principal),last_purged_notification:t.Opt(t.Nat64),governance_canister_id:t.Opt(t.Principal),minting_account_id:t.Opt(r),ledger_canister_id:t.Opt(t.Principal)}),n=t.Record({subnet_type:t.Opt(t.Text)}),f=t.Variant({Filter:n,Subnet:t.Record({subnet:t.Principal})}),N=t.Variant({controllers:t.Null,public:t.Null}),m=t.Record({freezing_threshold:t.Opt(t.Nat),wasm_memory_threshold:t.Opt(t.Nat),controllers:t.Opt(t.Vec(t.Principal)),reserved_cycles_limit:t.Opt(t.Nat),log_visibility:t.Opt(N),wasm_memory_limit:t.Opt(t.Nat),memory_allocation:t.Opt(t.Nat),compute_allocation:t.Opt(t.Nat)}),g=t.Record({subnet_selection:t.Opt(f),settings:t.Opt(m),subnet_type:t.Opt(t.Text)}),x=t.Variant({Refunded:t.Record({create_error:t.Text,refund_amount:t.Nat}),RefundFailed:t.Record({create_error:t.Text,refund_error:t.Text})}),R=t.Variant({Ok:t.Principal,Err:x}),b=t.Record({xdr_permyriad_per_icp:t.Nat64,timestamp_seconds:t.Nat64}),h=t.Record({certificate:t.Vec(t.Nat8),data:b,hash_tree:t.Vec(t.Nat8)}),T=t.Record({data:t.Vec(t.Tuple(t.Principal,t.Vec(t.Principal)))}),E=t.Record({data:t.Vec(t.Tuple(t.Text,t.Vec(t.Principal)))}),o=t.Nat64,P=t.Record({controller:t.Principal,block_index:o,subnet_selection:t.Opt(f),settings:t.Opt(m),subnet_type:t.Opt(t.Text)}),u=t.Variant({Refunded:t.Record({block_index:t.Opt(o),reason:t.Text}),InvalidTransaction:t.Text,Other:t.Record({error_message:t.Text,error_code:t.Nat64}),Processing:t.Null,TransactionTooOld:o}),w=t.Variant({Ok:t.Principal,Err:u}),v=t.Opt(t.Vec(t.Nat8)),V=t.Opt(t.Vec(t.Nat8)),S=t.Record({block_index:o,deposit_memo:v,to_subaccount:V}),A=t.Record({balance:t.Nat,block_index:t.Nat,minted:t.Nat}),k=t.Variant({Ok:A,Err:u}),F=t.Record({block_index:o,canister_id:t.Principal}),U=t.Nat,M=t.Variant({Ok:U,Err:u});return t.Service({create_canister:t.Func([g],[R],[]),get_build_metadata:t.Func([],[t.Text],["query"]),get_icp_xdr_conversion_rate:t.Func([],[h],["query"]),get_principals_authorized_to_create_canisters_to_subnets:t.Func([],[T],["query"]),get_subnet_types_to_subnets:t.Func([],[E],["query"]),notify_create_canister:t.Func([P],[w],[]),notify_mint_cycles:t.Func([S],[k],[]),notify_top_up:t.Func([F],[M],[])})};var c=class extends Error{},s=class extends Error{},a=class extends Error{},p=class extends Error{},l=class extends Error{},d=({Err:t})=>{throw"Refunded"in t?new c(t.Refunded.reason):"InvalidTransaction"in t?new s(t.InvalidTransaction):"Processing"in t?new p:"TransactionTooOld"in t?new l:"Other"in t?new a(`Error in CMC with code ${t.Other.error_code}: ${t.Other.error_message}`):new Error(`Unsupported error type ${JSON.stringify(t)}`)};var _=class t{constructor(e){this.service=e;this.getIcpToCyclesConversionRate=async()=>{let{data:e}=await this.service.get_icp_xdr_conversion_rate();return e.xdr_permyriad_per_icp};this.notifyCreateCanister=async e=>{let r=await this.service.notify_create_canister(e);if("Err"in r&&d(r),"Ok"in r)return r.Ok;throw new Error(`Unsupported response type in notifyCreateCanister ${JSON.stringify(r)}`)};this.notifyTopUp=async e=>{let r=await this.service.notify_top_up(e);if("Err"in r&&d(r),"Ok"in r)return r.Ok;throw new Error(`Unsupported response type in notifyTopUp ${JSON.stringify(r)}`)};this.service=e}static create(e){let r=e.agent,i=e.canisterId,n=e.serviceOverride??C.Actor.createActor(O,{agent:r,canisterId:i});return new t(n)}};0&&(module.exports={CMCCanister,CMCError,InvalidaTransactionError,ProcessingError,RefundedError,TransactionTooOldError,throwNotifyError});
"use strict";var y=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var J=(t,e)=>{for(var r in e)y(t,r,{get:e[r],enumerable:!0})},X=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of $(e))!z.call(t,n)&&n!==r&&y(t,n,{get:()=>e[n],enumerable:!(i=q(e,n))||i.enumerable});return t};var B=t=>X(y({},"__esModule",{value:!0}),t);var j={};J(j,{CMCCanister:()=>_,CMCError:()=>a,InvalidaTransactionError:()=>s,ProcessingError:()=>p,RefundedError:()=>c,TransactionTooOldError:()=>l,throwNotifyError:()=>d});module.exports=B(j);var C=require("@dfinity/agent");var O=({IDL:t})=>{let e=t.Variant({Set:t.Principal,Unset:t.Null}),r=t.Text,i=t.Record({exchange_rate_canister:t.Opt(e),cycles_ledger_canister_id:t.Opt(t.Principal),last_purged_notification:t.Opt(t.Nat64),governance_canister_id:t.Opt(t.Principal),minting_account_id:t.Opt(r),ledger_canister_id:t.Opt(t.Principal)}),n=t.Record({subnet_type:t.Opt(t.Text)}),f=t.Variant({Filter:n,Subnet:t.Record({subnet:t.Principal})}),N=t.Variant({controllers:t.Null,public:t.Null}),m=t.Record({freezing_threshold:t.Opt(t.Nat),wasm_memory_threshold:t.Opt(t.Nat),controllers:t.Opt(t.Vec(t.Principal)),reserved_cycles_limit:t.Opt(t.Nat),log_visibility:t.Opt(N),wasm_memory_limit:t.Opt(t.Nat),memory_allocation:t.Opt(t.Nat),compute_allocation:t.Opt(t.Nat)}),g=t.Record({subnet_selection:t.Opt(f),settings:t.Opt(m),subnet_type:t.Opt(t.Text)}),x=t.Variant({Refunded:t.Record({create_error:t.Text,refund_amount:t.Nat})}),R=t.Variant({Ok:t.Principal,Err:x}),b=t.Record({xdr_permyriad_per_icp:t.Nat64,timestamp_seconds:t.Nat64}),h=t.Record({certificate:t.Vec(t.Nat8),data:b,hash_tree:t.Vec(t.Nat8)}),T=t.Record({data:t.Vec(t.Tuple(t.Principal,t.Vec(t.Principal)))}),P=t.Record({data:t.Vec(t.Tuple(t.Text,t.Vec(t.Principal)))}),o=t.Nat64,E=t.Record({controller:t.Principal,block_index:o,subnet_selection:t.Opt(f),settings:t.Opt(m),subnet_type:t.Opt(t.Text)}),u=t.Variant({Refunded:t.Record({block_index:t.Opt(o),reason:t.Text}),InvalidTransaction:t.Text,Other:t.Record({error_message:t.Text,error_code:t.Nat64}),Processing:t.Null,TransactionTooOld:o}),w=t.Variant({Ok:t.Principal,Err:u}),v=t.Opt(t.Vec(t.Nat8)),V=t.Opt(t.Vec(t.Nat8)),S=t.Record({block_index:o,deposit_memo:v,to_subaccount:V}),A=t.Record({balance:t.Nat,block_index:t.Nat,minted:t.Nat}),k=t.Variant({Ok:A,Err:u}),F=t.Record({block_index:o,canister_id:t.Principal}),U=t.Nat,M=t.Variant({Ok:U,Err:u});return t.Service({create_canister:t.Func([g],[R],[]),get_build_metadata:t.Func([],[t.Text],["query"]),get_default_subnets:t.Func([],[t.Vec(t.Principal)],["query"]),get_icp_xdr_conversion_rate:t.Func([],[h],["query"]),get_principals_authorized_to_create_canisters_to_subnets:t.Func([],[T],["query"]),get_subnet_types_to_subnets:t.Func([],[P],["query"]),notify_create_canister:t.Func([E],[w],[]),notify_mint_cycles:t.Func([S],[k],[]),notify_top_up:t.Func([F],[M],[])})};var c=class extends Error{},s=class extends Error{},a=class extends Error{},p=class extends Error{},l=class extends Error{},d=({Err:t})=>{throw"Refunded"in t?new c(t.Refunded.reason):"InvalidTransaction"in t?new s(t.InvalidTransaction):"Processing"in t?new p:"TransactionTooOld"in t?new l:"Other"in t?new a(`Error in CMC with code ${t.Other.error_code}: ${t.Other.error_message}`):new Error(`Unsupported error type ${JSON.stringify(t)}`)};var _=class t{constructor(e){this.service=e;this.getIcpToCyclesConversionRate=async()=>{let{data:e}=await this.service.get_icp_xdr_conversion_rate();return e.xdr_permyriad_per_icp};this.notifyCreateCanister=async e=>{let r=await this.service.notify_create_canister(e);if("Err"in r&&d(r),"Ok"in r)return r.Ok;throw new Error(`Unsupported response type in notifyCreateCanister ${JSON.stringify(r)}`)};this.notifyTopUp=async e=>{let r=await this.service.notify_top_up(e);if("Err"in r&&d(r),"Ok"in r)return r.Ok;throw new Error(`Unsupported response type in notifyTopUp ${JSON.stringify(r)}`)};this.service=e}static create(e){let r=e.agent,i=e.canisterId,n=e.serviceOverride??C.Actor.createActor(O,{agent:r,canisterId:i});return new t(n)}};0&&(module.exports={CMCCanister,CMCError,InvalidaTransactionError,ProcessingError,RefundedError,TransactionTooOldError,throwNotifyError});
//# sourceMappingURL=index.cjs.js.map

@@ -1,2 +0,2 @@

import{a}from"./chunk-VL2WH3AX.js";import"./chunk-XRC5EOJ2.js";export{a as CMCCanister};
import{a}from"./chunk-MKLB3JOX.js";import"./chunk-XRC5EOJ2.js";export{a as CMCCanister};
//# sourceMappingURL=cmc.canister.js.map

@@ -1,2 +0,2 @@

import{a as r}from"./chunk-VL2WH3AX.js";import{a as e,b as o,c as t,d as p,e as C,f}from"./chunk-XRC5EOJ2.js";export{r as CMCCanister,t as CMCError,o as InvalidaTransactionError,p as ProcessingError,e as RefundedError,C as TransactionTooOldError,f as throwNotifyError};
import{a as r}from"./chunk-MKLB3JOX.js";import{a as e,b as o,c as t,d as p,e as C,f}from"./chunk-XRC5EOJ2.js";export{r as CMCCanister,t as CMCError,o as InvalidaTransactionError,p as ProcessingError,e as RefundedError,C as TransactionTooOldError,f as throwNotifyError};
//# sourceMappingURL=index.js.map
{
"name": "@dfinity/cmc",
"version": "3.2.0",
"version": "3.2.1-next-2024-09-30",
"description": "A library for interfacing with the cycle minting canister.",

@@ -39,7 +39,7 @@ "license": "Apache-2.0",

"peerDependencies": {
"@dfinity/agent": "^2.0.0",
"@dfinity/candid": "^2.0.0",
"@dfinity/principal": "^2.0.0",
"@dfinity/utils": "^2.5.0"
"@dfinity/agent": "*",
"@dfinity/candid": "*",
"@dfinity/principal": "*",
"@dfinity/utils": "*"
}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc