@dfinity/sns
Version:
A library for interfacing with a Service Nervous System (SNS) project.
3 lines (2 loc) • 7.63 kB
JavaScript
import{Canister as b,createServices as x}from"@dfinity/utils";var F=({IDL:t})=>{let i=t.Record({last_spawned_timestamp_seconds:t.Opt(t.Nat64),last_reset_timestamp_seconds:t.Opt(t.Nat64),requires_periodic_tasks:t.Opt(t.Bool)}),a=t.Record({dapp_canister_ids:t.Vec(t.Principal),timers:t.Opt(i),testflight:t.Bool,archive_canister_ids:t.Vec(t.Principal),governance_canister_id:t.Opt(t.Principal),index_canister_id:t.Opt(t.Principal),swap_canister_id:t.Opt(t.Principal),ledger_canister_id:t.Opt(t.Principal)}),r=t.Record({canister_id:t.Principal}),s=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),n=t.Variant({controllers:t.Null,public:t.Null,allowed_viewers:t.Vec(t.Principal)}),p=t.Record({freezing_threshold:t.Opt(t.Nat),wasm_memory_threshold:t.Opt(t.Nat),controllers: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)}),c=t.Record({response_payload_bytes_total:t.Opt(t.Nat),num_instructions_total:t.Opt(t.Nat),num_calls_total:t.Opt(t.Nat),request_payload_bytes_total:t.Opt(t.Nat)}),l=t.Record({status:s,memory_size:t.Nat,cycles:t.Nat,settings:p,query_stats:t.Opt(c),idle_cycles_burned_per_day:t.Opt(t.Nat),module_hash:t.Opt(t.Vec(t.Nat8)),reserved_cycles:t.Opt(t.Nat)}),_=t.Variant({reinstall:t.Null,upgrade:t.Null,install:t.Null}),d=t.Record({wasm_module_hash:t.Vec(t.Nat8),chunk_hashes_list:t.Vec(t.Vec(t.Nat8)),store_canister_id:t.Principal}),m=t.Record({arg:t.Vec(t.Nat8),wasm_module:t.Vec(t.Nat8),stop_before_installing:t.Bool,mode:_,canister_id:t.Principal,chunked_canister_wasm:t.Opt(d),memory_allocation:t.Opt(t.Nat),compute_allocation:t.Opt(t.Nat)}),u=t.Record({update_canister_list:t.Opt(t.Bool)}),O=t.Record({freezing_threshold:t.Nat,wasm_memory_threshold:t.Opt(t.Nat),controllers:t.Vec(t.Principal),wasm_memory_limit:t.Opt(t.Nat),memory_allocation:t.Nat,compute_allocation:t.Nat}),R=t.Record({status:s,memory_size:t.Nat,cycles:t.Nat,settings:O,query_stats:t.Opt(c),idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),e=t.Record({status:t.Opt(R),canister_id:t.Opt(t.Principal)}),N=t.Record({root:t.Opt(e),swap:t.Opt(e),ledger:t.Opt(e),index:t.Opt(e),governance:t.Opt(e),dapps:t.Vec(e),archives:t.Vec(e)}),y=t.Record({timers:t.Opt(i)}),g=t.Record({root:t.Opt(t.Principal),swap:t.Opt(t.Principal),ledger:t.Opt(t.Principal),index:t.Opt(t.Principal),governance:t.Opt(t.Principal),dapps:t.Vec(t.Principal),archives:t.Vec(t.Principal)}),h=t.Record({freezing_threshold:t.Opt(t.Nat64),wasm_memory_threshold:t.Opt(t.Nat64),canister_ids:t.Vec(t.Principal),reserved_cycles_limit:t.Opt(t.Nat64),log_visibility:t.Opt(t.Int32),wasm_memory_limit:t.Opt(t.Nat64),memory_allocation:t.Opt(t.Nat64),compute_allocation:t.Opt(t.Nat64)}),P=t.Record({failure_reason:t.Opt(t.Text)}),C=t.Record({canister_id:t.Opt(t.Principal)}),o=t.Record({canister_ids:t.Vec(t.Principal)}),S=t.Record({canister_ids:t.Opt(o),controller_principal_ids:t.Vec(t.Principal)}),V=t.Record({code:t.Opt(t.Int32),description:t.Text}),v=t.Record({err:t.Opt(V),dapp_canister_id:t.Opt(t.Principal)}),w=t.Record({failed_updates:t.Vec(v)});return t.Service({canister_status:t.Func([r],[l],[]),change_canister:t.Func([m],[],[]),get_build_metadata:t.Func([],[t.Text],[]),get_sns_canisters_summary:t.Func([u],[N],[]),get_timers:t.Func([t.Record({})],[y],[]),list_sns_canisters:t.Func([t.Record({})],[g],[]),manage_dapp_canister_settings:t.Func([h],[P],[]),register_dapp_canister:t.Func([C],[t.Record({})],[]),register_dapp_canisters:t.Func([o],[t.Record({})],[]),reset_timers:t.Func([t.Record({})],[t.Record({})],[]),set_dapp_controllers:t.Func([S],[w],[])})};var f=({IDL:t})=>{let i=t.Record({last_spawned_timestamp_seconds:t.Opt(t.Nat64),last_reset_timestamp_seconds:t.Opt(t.Nat64),requires_periodic_tasks:t.Opt(t.Bool)}),a=t.Record({dapp_canister_ids:t.Vec(t.Principal),timers:t.Opt(i),testflight:t.Bool,archive_canister_ids:t.Vec(t.Principal),governance_canister_id:t.Opt(t.Principal),index_canister_id:t.Opt(t.Principal),swap_canister_id:t.Opt(t.Principal),ledger_canister_id:t.Opt(t.Principal)}),r=t.Record({canister_id:t.Principal}),s=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),n=t.Variant({controllers:t.Null,public:t.Null,allowed_viewers:t.Vec(t.Principal)}),p=t.Record({freezing_threshold:t.Opt(t.Nat),wasm_memory_threshold:t.Opt(t.Nat),controllers: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)}),c=t.Record({response_payload_bytes_total:t.Opt(t.Nat),num_instructions_total:t.Opt(t.Nat),num_calls_total:t.Opt(t.Nat),request_payload_bytes_total:t.Opt(t.Nat)}),l=t.Record({status:s,memory_size:t.Nat,cycles:t.Nat,settings:p,query_stats:t.Opt(c),idle_cycles_burned_per_day:t.Opt(t.Nat),module_hash:t.Opt(t.Vec(t.Nat8)),reserved_cycles:t.Opt(t.Nat)}),_=t.Variant({reinstall:t.Null,upgrade:t.Null,install:t.Null}),d=t.Record({wasm_module_hash:t.Vec(t.Nat8),chunk_hashes_list:t.Vec(t.Vec(t.Nat8)),store_canister_id:t.Principal}),m=t.Record({arg:t.Vec(t.Nat8),wasm_module:t.Vec(t.Nat8),stop_before_installing:t.Bool,mode:_,canister_id:t.Principal,chunked_canister_wasm:t.Opt(d),memory_allocation:t.Opt(t.Nat),compute_allocation:t.Opt(t.Nat)}),u=t.Record({update_canister_list:t.Opt(t.Bool)}),O=t.Record({freezing_threshold:t.Nat,wasm_memory_threshold:t.Opt(t.Nat),controllers:t.Vec(t.Principal),wasm_memory_limit:t.Opt(t.Nat),memory_allocation:t.Nat,compute_allocation:t.Nat}),R=t.Record({status:s,memory_size:t.Nat,cycles:t.Nat,settings:O,query_stats:t.Opt(c),idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),e=t.Record({status:t.Opt(R),canister_id:t.Opt(t.Principal)}),N=t.Record({root:t.Opt(e),swap:t.Opt(e),ledger:t.Opt(e),index:t.Opt(e),governance:t.Opt(e),dapps:t.Vec(e),archives:t.Vec(e)}),y=t.Record({timers:t.Opt(i)}),g=t.Record({root:t.Opt(t.Principal),swap:t.Opt(t.Principal),ledger:t.Opt(t.Principal),index:t.Opt(t.Principal),governance:t.Opt(t.Principal),dapps:t.Vec(t.Principal),archives:t.Vec(t.Principal)}),h=t.Record({freezing_threshold:t.Opt(t.Nat64),wasm_memory_threshold:t.Opt(t.Nat64),canister_ids:t.Vec(t.Principal),reserved_cycles_limit:t.Opt(t.Nat64),log_visibility:t.Opt(t.Int32),wasm_memory_limit:t.Opt(t.Nat64),memory_allocation:t.Opt(t.Nat64),compute_allocation:t.Opt(t.Nat64)}),P=t.Record({failure_reason:t.Opt(t.Text)}),C=t.Record({canister_id:t.Opt(t.Principal)}),o=t.Record({canister_ids:t.Vec(t.Principal)}),S=t.Record({canister_ids:t.Opt(o),controller_principal_ids:t.Vec(t.Principal)}),V=t.Record({code:t.Opt(t.Int32),description:t.Text}),v=t.Record({err:t.Opt(V),dapp_canister_id:t.Opt(t.Principal)}),w=t.Record({failed_updates:t.Vec(v)});return t.Service({canister_status:t.Func([r],[l],[]),change_canister:t.Func([m],[],[]),get_build_metadata:t.Func([],[t.Text],["query"]),get_sns_canisters_summary:t.Func([u],[N],[]),get_timers:t.Func([t.Record({})],[y],["query"]),list_sns_canisters:t.Func([t.Record({})],[g],["query"]),manage_dapp_canister_settings:t.Func([h],[P],[]),register_dapp_canister:t.Func([C],[t.Record({})],[]),register_dapp_canisters:t.Func([o],[t.Record({})],[]),reset_timers:t.Func([t.Record({})],[t.Record({})],[]),set_dapp_controllers:t.Func([S],[w],[])})};var q=class t extends b{constructor(){super(...arguments);this.listSnsCanisters=async({certified:a=!0})=>this.caller({certified:a}).list_sns_canisters({})}static create(a){let{service:r,certifiedService:s,canisterId:n}=x({options:a,idlFactory:f,certifiedIdlFactory:F});return new t(n,r,s)}};export{q as a};
//# sourceMappingURL=chunk-PUAIJI6X.js.map