@dfinity/sns 0.0.4-next-2022-09-25 → 0.0.4

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 CHANGED
@@ -75,6 +75,8 @@ console.log("Summary data:", metadata, token);
75
75
  ### :toolbox: Functions
76
76
 
77
77
  - [initSnsWrapper](#gear-initsnswrapper)
78
+ - [encodeSnsAccount](#gear-encodesnsaccount)
79
+ - [decodeSnsAccount](#gear-decodesnsaccount)
78
80
 
79
81
  #### :gear: initSnsWrapper
80
82
 
@@ -84,6 +86,32 @@ Lookup for the canister ids of a Sns and initialize the wrapper to access its fe
84
86
  | ---------------- | ---------------- |
85
87
  | `initSnsWrapper` | `InitSnsWrapper` |
86
88
 
89
+ #### :gear: encodeSnsAccount
90
+
91
+ Encodes an SNS account into a string.
92
+ Formatting Reference: https://github.com/dfinity/ICRC-1/pull/55/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R238
93
+
94
+ | Function | Type |
95
+ | ------------------ | ----------------------------------------------- |
96
+ | `encodeSnsAccount` | `({ owner, subaccount }: SnsAccount) => string` |
97
+
98
+ Parameters:
99
+
100
+ - `snsAccount`: : Principal, subaccount?: Uint8Array }
101
+
102
+ #### :gear: decodeSnsAccount
103
+
104
+ Decodes a string into an SNS account.
105
+ Formatting Reference: https://github.com/dfinity/ICRC-1/pull/55/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R268
106
+
107
+ | Function | Type |
108
+ | ------------------ | --------------------------------------- |
109
+ | `decodeSnsAccount` | `(accountString: string) => SnsAccount` |
110
+
111
+ Parameters:
112
+
113
+ - `snsAccountString`: string
114
+
87
115
  ### :factory: SnsGovernanceCanister
88
116
 
89
117
  #### Constructors
@@ -1,2 +1,2 @@
1
- "use strict";var ke=Object.defineProperty;var Ze=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var Ie=Object.prototype.hasOwnProperty;var De=(e,o)=>{for(var s in o)ke(e,s,{get:o[s],enumerable:!0})},Le=(e,o,s,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of $e(o))!Ie.call(e,a)&&a!==s&&ke(e,a,{get:()=>o[a],enumerable:!(r=Ze(o,a))||r.enumerable});return e};var et=e=>Le(ke({},"__esModule",{value:!0}),e);var ot={};De(ot,{SnsGovernanceCanister:()=>C,SnsGovernanceError:()=>X,SnsLedgerCanister:()=>F,SnsMetadataResponseEntries:()=>Je,SnsNeuronPermissionType:()=>Ee,SnsRootCanister:()=>M,SnsSwapCanister:()=>k,SnsSwapLifecycle:()=>Ge,SnsWrapper:()=>D,initSnsWrapper:()=>st});module.exports=et(ot);var Ee=(n=>(n[n.NEURON_PERMISSION_TYPE_UNSPECIFIED=0]="NEURON_PERMISSION_TYPE_UNSPECIFIED",n[n.NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE=1]="NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE",n[n.NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS=2]="NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS",n[n.NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL=3]="NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL",n[n.NEURON_PERMISSION_TYPE_VOTE=4]="NEURON_PERMISSION_TYPE_VOTE",n[n.NEURON_PERMISSION_TYPE_DISBURSE=5]="NEURON_PERMISSION_TYPE_DISBURSE",n[n.NEURON_PERMISSION_TYPE_SPLIT=6]="NEURON_PERMISSION_TYPE_SPLIT",n[n.NEURON_PERMISSION_TYPE_MERGE_MATURITY=7]="NEURON_PERMISSION_TYPE_MERGE_MATURITY",n[n.NEURON_PERMISSION_TYPE_DISBURSE_MATURITY=8]="NEURON_PERMISSION_TYPE_DISBURSE_MATURITY",n))(Ee||{});var Ge=(t=>(t[t.Unspecified=0]="Unspecified",t[t.Pending=1]="Pending",t[t.Open=2]="Open",t[t.Committed=3]="Committed",t[t.Aborted=4]="Aborted",t))(Ge||{});var X=class extends Error{};var w=require("@dfinity/utils");var qe=({IDL:e})=>{let o=e.Record({validator_canister_id:e.Opt(e.Principal),target_canister_id:e.Opt(e.Principal),validator_method_name:e.Opt(e.Text),target_method_name:e.Opt(e.Text)}),s=e.Variant({NativeNervousSystemFunction:e.Record({}),GenericNervousSystemFunction:o}),r=e.Record({id:e.Nat64,name:e.Text,description:e.Opt(e.Text),function_type:e.Opt(s)}),a=e.Record({not_dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),garbage_collectable_neurons_count:e.Nat64,neurons_with_invalid_stake_count:e.Nat64,not_dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),neurons_with_less_than_6_months_dissolve_delay_count:e.Nat64,dissolved_neurons_count:e.Nat64,total_staked_e8s:e.Nat64,total_supply_governance_tokens:e.Nat64,not_dissolving_neurons_count:e.Nat64,dissolved_neurons_e8s:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:e.Nat64,dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),timestamp_seconds:e.Nat64}),t=e.Record({id:e.Vec(e.Nat8)}),c=e.Record({followees:e.Vec(t)}),d=e.Record({followees:e.Vec(e.Tuple(e.Nat64,c))}),i=e.Record({permissions:e.Vec(e.Int32)}),n=e.Record({start_timestamp_seconds:e.Opt(e.Nat64),final_reward_rate_basis_points:e.Opt(e.Nat64),initial_reward_rate_basis_points:e.Opt(e.Nat64),reward_rate_transition_duration_seconds:e.Opt(e.Nat64),round_duration_seconds:e.Opt(e.Nat64)}),_=e.Record({default_followees:e.Opt(d),max_dissolve_delay_seconds:e.Opt(e.Nat64),max_followees_per_function:e.Opt(e.Nat64),neuron_claimer_permissions:e.Opt(i),neuron_minimum_stake_e8s:e.Opt(e.Nat64),max_neuron_age_for_age_bonus:e.Opt(e.Nat64),initial_voting_period_seconds:e.Opt(e.Nat64),neuron_minimum_dissolve_delay_to_vote_seconds:e.Opt(e.Nat64),reject_cost_e8s:e.Opt(e.Nat64),max_proposals_to_keep_per_action:e.Opt(e.Nat32),wait_for_quiet_deadline_increase_seconds:e.Opt(e.Nat64),max_number_of_neurons:e.Opt(e.Nat64),transaction_fee_e8s:e.Opt(e.Nat64),max_number_of_proposals_with_ballots:e.Opt(e.Nat64),neuron_grantable_permissions:e.Opt(i),voting_rewards_parameters:e.Opt(n),max_number_of_principals_per_neuron:e.Opt(e.Nat64)}),m=e.Record({archive_wasm_hash:e.Vec(e.Nat8),root_wasm_hash:e.Vec(e.Nat8),swap_wasm_hash:e.Vec(e.Nat8),ledger_wasm_hash:e.Vec(e.Nat8),governance_wasm_hash:e.Vec(e.Nat8)}),p=e.Record({id:e.Nat64}),N=e.Record({actual_timestamp_seconds:e.Nat64,distributed_e8s_equivalent:e.Nat64,round:e.Nat64,settled_proposals:e.Vec(p)}),l=e.Record({mark_failed_at_seconds:e.Nat64,checking_upgrade_lock:e.Nat64,proposal_id:e.Nat64,target_version:e.Opt(m)}),u=e.Record({error_message:e.Text,error_type:e.Int32}),R=e.Record({vote:e.Int32,cast_timestamp_seconds:e.Nat64,voting_power:e.Nat64}),S=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),P=e.Record({new_canister_wasm:e.Vec(e.Nat8),canister_id:e.Opt(e.Principal)}),V=e.Record({url:e.Opt(e.Text),logo:e.Opt(e.Text),name:e.Opt(e.Text),description:e.Opt(e.Text)}),G=e.Record({function_id:e.Nat64,payload:e.Vec(e.Nat8)}),q=e.Record({motion_text:e.Text}),A=e.Variant({ManageNervousSystemParameters:_,AddGenericNervousSystemFunction:r,RemoveGenericNervousSystemFunction:e.Nat64,UpgradeSnsToNextVersion:e.Record({}),UpgradeSnsControlledCanister:P,Unspecified:e.Record({}),ManageSnsMetadata:V,ExecuteGenericNervousSystemFunction:G,Motion:q}),O=e.Record({url:e.Text,title:e.Text,action:e.Opt(A),summary:e.Text}),B=e.Record({current_deadline_timestamp_seconds:e.Nat64}),g=e.Record({id:e.Opt(p),payload_text_rendering:e.Opt(e.Text),action:e.Nat64,failure_reason:e.Opt(u),ballots:e.Vec(e.Tuple(e.Text,R)),reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,proposal_creation_timestamp_seconds:e.Nat64,initial_voting_period_seconds:e.Nat64,reject_cost_e8s:e.Nat64,latest_tally:e.Opt(S),wait_for_quiet_deadline_increase_seconds:e.Nat64,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(O),proposer:e.Opt(t),wait_for_quiet_state:e.Opt(B),is_eligible_for_rewards:e.Bool,executed_timestamp_seconds:e.Nat64}),T=e.Record({memo:e.Nat64,amount_e8s:e.Nat64}),x=e.Record({function_id:e.Nat64,followees:e.Vec(t)}),U=e.Record({subaccount:e.Vec(e.Nat8)}),y=e.Record({owner:e.Opt(e.Principal),subaccount:e.Opt(U)}),v=e.Record({to_account:e.Opt(y),percentage_to_disburse:e.Nat32}),z=e.Record({additional_dissolve_delay_seconds:e.Nat32}),Q=e.Record({dissolve_timestamp_seconds:e.Nat64}),W=e.Variant({StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:z,SetDissolveTimestamp:Q}),h=e.Record({operation:e.Opt(W)}),b=e.Record({vote:e.Int32,proposal:e.Opt(p)}),Y=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),te=e.Variant({MemoAndController:Y,NeuronId:e.Record({})}),H=e.Record({by:e.Opt(te)}),J=e.Record({permissions_to_remove:e.Opt(i),principal_id:e.Opt(e.Principal)}),K=e.Record({permissions_to_add:e.Opt(i),principal_id:e.Opt(e.Principal)}),Z=e.Record({percentage_to_merge:e.Nat32}),se=e.Record({e8s:e.Nat64}),$=e.Record({to_account:e.Opt(y),amount:e.Opt(se)}),oe=e.Variant({Split:T,Follow:x,DisburseMaturity:v,Configure:h,RegisterVote:b,MakeProposal:O,ClaimOrRefreshNeuron:H,RemoveNeuronPermissions:J,AddNeuronPermissions:K,MergeMaturity:Z,Disburse:$}),re=e.Record({command:e.Opt(oe),timestamp:e.Nat64}),ne=e.Record({principal:e.Opt(e.Principal),permission_type:e.Vec(e.Int32)}),ae=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),j=e.Record({id:e.Opt(t),permissions:e.Vec(ne),maturity_e8s_equivalent:e.Nat64,cached_neuron_stake_e8s:e.Nat64,created_timestamp_seconds:e.Nat64,aging_since_timestamp_seconds:e.Nat64,dissolve_state:e.Opt(ae),voting_power_percentage_multiplier:e.Nat64,followees:e.Vec(e.Tuple(e.Nat64,c)),neuron_fees_e8s:e.Nat64}),Ke=e.Record({root_canister_id:e.Opt(e.Principal),id_to_nervous_system_functions:e.Vec(e.Tuple(e.Nat64,r)),metrics:e.Opt(a),mode:e.Int32,parameters:e.Opt(_),deployed_version:e.Opt(m),sns_initialization_parameters:e.Text,latest_reward_event:e.Opt(N),pending_version:e.Opt(l),swap_canister_id:e.Opt(e.Principal),ledger_canister_id:e.Opt(e.Principal),proposals:e.Vec(e.Tuple(e.Nat64,g)),in_flight_commands:e.Vec(e.Tuple(e.Text,re)),sns_metadata:e.Opt(V),neurons:e.Vec(e.Tuple(e.Text,j)),genesis_timestamp_seconds:e.Nat64}),ie=e.Record({url:e.Opt(e.Text),logo:e.Opt(e.Text),name:e.Opt(e.Text),description:e.Opt(e.Text)}),ce=e.Record({neuron_id:e.Opt(t)}),_e=e.Variant({Error:u,Neuron:j}),pe=e.Record({result:e.Opt(_e)}),I=e.Record({proposal_id:e.Opt(p)}),de=e.Variant({Error:u,Proposal:g}),le=e.Record({result:e.Opt(de)}),ue=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),me=e.Record({controller:e.Principal,freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),Ne=e.Record({controller:e.Principal,status:ue,freezing_threshold:e.Nat,balance:e.Vec(e.Tuple(e.Vec(e.Nat8),e.Nat)),memory_size:e.Nat,cycles:e.Nat,settings:me,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),Re=e.Record({deployed_version:e.Opt(m),pending_version:e.Opt(l)}),Oe=e.Record({sns_initialization_parameters:e.Text}),ge=e.Record({reserved_ids:e.Vec(e.Nat64),functions:e.Vec(r)}),ye=e.Record({of_principal:e.Opt(e.Principal),limit:e.Nat32,start_page_at:e.Opt(t)}),ve=e.Record({neurons:e.Vec(j)}),fe=e.Record({include_reward_status:e.Vec(e.Int32),before_proposal:e.Opt(p),limit:e.Nat32,exclude_type:e.Vec(e.Nat64),include_status:e.Vec(e.Int32)}),Se=e.Record({proposals:e.Vec(g)}),Pe=e.Variant({Split:T,Follow:x,DisburseMaturity:v,ClaimOrRefresh:H,Configure:h,RegisterVote:b,MakeProposal:O,RemoveNeuronPermissions:J,AddNeuronPermissions:K,MergeMaturity:Z,Disburse:$}),Ve=e.Record({subaccount:e.Vec(e.Nat8),command:e.Opt(Pe)}),Te=e.Record({created_neuron_id:e.Opt(t)}),xe=e.Record({transfer_block_height:e.Nat64,amount_disbursed_e8s:e.Nat64}),he=e.Record({refreshed_neuron_id:e.Opt(t)}),be=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),we=e.Record({transfer_block_height:e.Nat64}),Ce=e.Variant({Error:u,Split:Te,Follow:e.Record({}),DisburseMaturity:xe,ClaimOrRefresh:he,Configure:e.Record({}),RegisterVote:e.Record({}),MakeProposal:I,RemoveNeuronPermission:e.Record({}),MergeMaturity:be,Disburse:we,AddNeuronPermission:e.Record({})}),Fe=e.Record({command:e.Opt(Ce)}),Me=e.Record({mode:e.Int32});return e.Service({get_build_metadata:e.Func([],[e.Text],[]),get_metadata:e.Func([e.Record({})],[ie],[]),get_nervous_system_parameters:e.Func([e.Null],[_],[]),get_neuron:e.Func([ce],[pe],[]),get_proposal:e.Func([I],[le],[]),get_root_canister_status:e.Func([e.Null],[Ne],[]),get_running_sns_version:e.Func([e.Record({})],[Re],[]),get_sns_initialization_parameters:e.Func([e.Record({})],[Oe],[]),list_nervous_system_functions:e.Func([],[ge],[]),list_neurons:e.Func([ye],[ve],[]),list_proposals:e.Func([fe],[Se],[]),manage_neuron:e.Func([Ve],[Fe],[]),set_mode:e.Func([Me],[e.Record({})],[])})};var Ae=({IDL:e})=>{let o=e.Record({validator_canister_id:e.Opt(e.Principal),target_canister_id:e.Opt(e.Principal),validator_method_name:e.Opt(e.Text),target_method_name:e.Opt(e.Text)}),s=e.Variant({NativeNervousSystemFunction:e.Record({}),GenericNervousSystemFunction:o}),r=e.Record({id:e.Nat64,name:e.Text,description:e.Opt(e.Text),function_type:e.Opt(s)}),a=e.Record({not_dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),garbage_collectable_neurons_count:e.Nat64,neurons_with_invalid_stake_count:e.Nat64,not_dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),neurons_with_less_than_6_months_dissolve_delay_count:e.Nat64,dissolved_neurons_count:e.Nat64,total_staked_e8s:e.Nat64,total_supply_governance_tokens:e.Nat64,not_dissolving_neurons_count:e.Nat64,dissolved_neurons_e8s:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:e.Nat64,dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),timestamp_seconds:e.Nat64}),t=e.Record({id:e.Vec(e.Nat8)}),c=e.Record({followees:e.Vec(t)}),d=e.Record({followees:e.Vec(e.Tuple(e.Nat64,c))}),i=e.Record({permissions:e.Vec(e.Int32)}),n=e.Record({start_timestamp_seconds:e.Opt(e.Nat64),final_reward_rate_basis_points:e.Opt(e.Nat64),initial_reward_rate_basis_points:e.Opt(e.Nat64),reward_rate_transition_duration_seconds:e.Opt(e.Nat64),round_duration_seconds:e.Opt(e.Nat64)}),_=e.Record({default_followees:e.Opt(d),max_dissolve_delay_seconds:e.Opt(e.Nat64),max_followees_per_function:e.Opt(e.Nat64),neuron_claimer_permissions:e.Opt(i),neuron_minimum_stake_e8s:e.Opt(e.Nat64),max_neuron_age_for_age_bonus:e.Opt(e.Nat64),initial_voting_period_seconds:e.Opt(e.Nat64),neuron_minimum_dissolve_delay_to_vote_seconds:e.Opt(e.Nat64),reject_cost_e8s:e.Opt(e.Nat64),max_proposals_to_keep_per_action:e.Opt(e.Nat32),wait_for_quiet_deadline_increase_seconds:e.Opt(e.Nat64),max_number_of_neurons:e.Opt(e.Nat64),transaction_fee_e8s:e.Opt(e.Nat64),max_number_of_proposals_with_ballots:e.Opt(e.Nat64),neuron_grantable_permissions:e.Opt(i),voting_rewards_parameters:e.Opt(n),max_number_of_principals_per_neuron:e.Opt(e.Nat64)}),m=e.Record({archive_wasm_hash:e.Vec(e.Nat8),root_wasm_hash:e.Vec(e.Nat8),swap_wasm_hash:e.Vec(e.Nat8),ledger_wasm_hash:e.Vec(e.Nat8),governance_wasm_hash:e.Vec(e.Nat8)}),p=e.Record({id:e.Nat64}),N=e.Record({actual_timestamp_seconds:e.Nat64,distributed_e8s_equivalent:e.Nat64,round:e.Nat64,settled_proposals:e.Vec(p)}),l=e.Record({mark_failed_at_seconds:e.Nat64,checking_upgrade_lock:e.Nat64,proposal_id:e.Nat64,target_version:e.Opt(m)}),u=e.Record({error_message:e.Text,error_type:e.Int32}),R=e.Record({vote:e.Int32,cast_timestamp_seconds:e.Nat64,voting_power:e.Nat64}),S=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),P=e.Record({new_canister_wasm:e.Vec(e.Nat8),canister_id:e.Opt(e.Principal)}),V=e.Record({url:e.Opt(e.Text),logo:e.Opt(e.Text),name:e.Opt(e.Text),description:e.Opt(e.Text)}),G=e.Record({function_id:e.Nat64,payload:e.Vec(e.Nat8)}),q=e.Record({motion_text:e.Text}),A=e.Variant({ManageNervousSystemParameters:_,AddGenericNervousSystemFunction:r,RemoveGenericNervousSystemFunction:e.Nat64,UpgradeSnsToNextVersion:e.Record({}),UpgradeSnsControlledCanister:P,Unspecified:e.Record({}),ManageSnsMetadata:V,ExecuteGenericNervousSystemFunction:G,Motion:q}),O=e.Record({url:e.Text,title:e.Text,action:e.Opt(A),summary:e.Text}),B=e.Record({current_deadline_timestamp_seconds:e.Nat64}),g=e.Record({id:e.Opt(p),payload_text_rendering:e.Opt(e.Text),action:e.Nat64,failure_reason:e.Opt(u),ballots:e.Vec(e.Tuple(e.Text,R)),reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,proposal_creation_timestamp_seconds:e.Nat64,initial_voting_period_seconds:e.Nat64,reject_cost_e8s:e.Nat64,latest_tally:e.Opt(S),wait_for_quiet_deadline_increase_seconds:e.Nat64,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(O),proposer:e.Opt(t),wait_for_quiet_state:e.Opt(B),is_eligible_for_rewards:e.Bool,executed_timestamp_seconds:e.Nat64}),T=e.Record({memo:e.Nat64,amount_e8s:e.Nat64}),x=e.Record({function_id:e.Nat64,followees:e.Vec(t)}),U=e.Record({subaccount:e.Vec(e.Nat8)}),y=e.Record({owner:e.Opt(e.Principal),subaccount:e.Opt(U)}),v=e.Record({to_account:e.Opt(y),percentage_to_disburse:e.Nat32}),z=e.Record({additional_dissolve_delay_seconds:e.Nat32}),Q=e.Record({dissolve_timestamp_seconds:e.Nat64}),W=e.Variant({StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:z,SetDissolveTimestamp:Q}),h=e.Record({operation:e.Opt(W)}),b=e.Record({vote:e.Int32,proposal:e.Opt(p)}),Y=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),te=e.Variant({MemoAndController:Y,NeuronId:e.Record({})}),H=e.Record({by:e.Opt(te)}),J=e.Record({permissions_to_remove:e.Opt(i),principal_id:e.Opt(e.Principal)}),K=e.Record({permissions_to_add:e.Opt(i),principal_id:e.Opt(e.Principal)}),Z=e.Record({percentage_to_merge:e.Nat32}),se=e.Record({e8s:e.Nat64}),$=e.Record({to_account:e.Opt(y),amount:e.Opt(se)}),oe=e.Variant({Split:T,Follow:x,DisburseMaturity:v,Configure:h,RegisterVote:b,MakeProposal:O,ClaimOrRefreshNeuron:H,RemoveNeuronPermissions:J,AddNeuronPermissions:K,MergeMaturity:Z,Disburse:$}),re=e.Record({command:e.Opt(oe),timestamp:e.Nat64}),ne=e.Record({principal:e.Opt(e.Principal),permission_type:e.Vec(e.Int32)}),ae=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),j=e.Record({id:e.Opt(t),permissions:e.Vec(ne),maturity_e8s_equivalent:e.Nat64,cached_neuron_stake_e8s:e.Nat64,created_timestamp_seconds:e.Nat64,aging_since_timestamp_seconds:e.Nat64,dissolve_state:e.Opt(ae),voting_power_percentage_multiplier:e.Nat64,followees:e.Vec(e.Tuple(e.Nat64,c)),neuron_fees_e8s:e.Nat64}),Ke=e.Record({root_canister_id:e.Opt(e.Principal),id_to_nervous_system_functions:e.Vec(e.Tuple(e.Nat64,r)),metrics:e.Opt(a),mode:e.Int32,parameters:e.Opt(_),deployed_version:e.Opt(m),sns_initialization_parameters:e.Text,latest_reward_event:e.Opt(N),pending_version:e.Opt(l),swap_canister_id:e.Opt(e.Principal),ledger_canister_id:e.Opt(e.Principal),proposals:e.Vec(e.Tuple(e.Nat64,g)),in_flight_commands:e.Vec(e.Tuple(e.Text,re)),sns_metadata:e.Opt(V),neurons:e.Vec(e.Tuple(e.Text,j)),genesis_timestamp_seconds:e.Nat64}),ie=e.Record({url:e.Opt(e.Text),logo:e.Opt(e.Text),name:e.Opt(e.Text),description:e.Opt(e.Text)}),ce=e.Record({neuron_id:e.Opt(t)}),_e=e.Variant({Error:u,Neuron:j}),pe=e.Record({result:e.Opt(_e)}),I=e.Record({proposal_id:e.Opt(p)}),de=e.Variant({Error:u,Proposal:g}),le=e.Record({result:e.Opt(de)}),ue=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),me=e.Record({controller:e.Principal,freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),Ne=e.Record({controller:e.Principal,status:ue,freezing_threshold:e.Nat,balance:e.Vec(e.Tuple(e.Vec(e.Nat8),e.Nat)),memory_size:e.Nat,cycles:e.Nat,settings:me,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),Re=e.Record({deployed_version:e.Opt(m),pending_version:e.Opt(l)}),Oe=e.Record({sns_initialization_parameters:e.Text}),ge=e.Record({reserved_ids:e.Vec(e.Nat64),functions:e.Vec(r)}),ye=e.Record({of_principal:e.Opt(e.Principal),limit:e.Nat32,start_page_at:e.Opt(t)}),ve=e.Record({neurons:e.Vec(j)}),fe=e.Record({include_reward_status:e.Vec(e.Int32),before_proposal:e.Opt(p),limit:e.Nat32,exclude_type:e.Vec(e.Nat64),include_status:e.Vec(e.Int32)}),Se=e.Record({proposals:e.Vec(g)}),Pe=e.Variant({Split:T,Follow:x,DisburseMaturity:v,ClaimOrRefresh:H,Configure:h,RegisterVote:b,MakeProposal:O,RemoveNeuronPermissions:J,AddNeuronPermissions:K,MergeMaturity:Z,Disburse:$}),Ve=e.Record({subaccount:e.Vec(e.Nat8),command:e.Opt(Pe)}),Te=e.Record({created_neuron_id:e.Opt(t)}),xe=e.Record({transfer_block_height:e.Nat64,amount_disbursed_e8s:e.Nat64}),he=e.Record({refreshed_neuron_id:e.Opt(t)}),be=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),we=e.Record({transfer_block_height:e.Nat64}),Ce=e.Variant({Error:u,Split:Te,Follow:e.Record({}),DisburseMaturity:xe,ClaimOrRefresh:he,Configure:e.Record({}),RegisterVote:e.Record({}),MakeProposal:I,RemoveNeuronPermission:e.Record({}),MergeMaturity:be,Disburse:we,AddNeuronPermission:e.Record({})}),Fe=e.Record({command:e.Opt(Ce)}),Me=e.Record({mode:e.Int32});return e.Service({get_build_metadata:e.Func([],[e.Text],["query"]),get_metadata:e.Func([e.Record({})],[ie],["query"]),get_nervous_system_parameters:e.Func([e.Null],[_],["query"]),get_neuron:e.Func([ce],[pe],["query"]),get_proposal:e.Func([I],[le],["query"]),get_root_canister_status:e.Func([e.Null],[Ne],[]),get_running_sns_version:e.Func([e.Record({})],[Re],["query"]),get_sns_initialization_parameters:e.Func([e.Record({})],[Oe],["query"]),list_nervous_system_functions:e.Func([],[ge],["query"]),list_neurons:e.Func([ye],[ve],["query"]),list_proposals:e.Func([fe],[Se],["query"]),manage_neuron:e.Func([Ve],[Fe],[]),set_mode:e.Func([Me],[e.Record({})],[])})};var Be=({neuronId:e,permissions:o,principal:s})=>({subaccount:e.id,command:[{AddNeuronPermissions:{permissions_to_add:[{permissions:Int32Array.from(o)}],principal_id:[s]}}]}),Ue=({neuronId:e,permissions:o,principal:s})=>({subaccount:e.id,command:[{RemoveNeuronPermissions:{permissions_to_remove:[{permissions:Int32Array.from(o)}],principal_id:[s]}}]});var f=class{constructor(o,s,r){this.id=o;this.service=s;this.certifiedService=r;this.caller=({certified:o=!0})=>o?this.certifiedService:this.service}get canisterId(){return this.id}};var C=class extends f{constructor(){super(...arguments);this.listNeurons=async s=>{let{principal:r,limit:a,beforeNeuronId:t}=s,{neurons:c}=await this.caller(s).list_neurons({of_principal:(0,w.toNullable)(r),limit:a??100,start_page_at:(0,w.toNullable)(t)});return c};this.metadata=s=>this.caller(s).get_metadata({});this.getNeuron=async s=>{let{neuronId:r}=s,{result:a}=await this.caller(s).get_neuron({neuron_id:(0,w.toNullable)(r)}),t=(0,w.fromNullable)(a);if(t===void 0||"Error"in t)throw new X((t==null?void 0:t.Error.error_message)??"Response type not supported");return t.Neuron};this.manageNeuron=async s=>{let r=await this.caller({certified:!0}).manage_neuron(s);return this.assertManageNeuronError(r),r};this.addNeuronPermissions=async s=>{let r=Be(s);await this.manageNeuron(r)};this.removeNeuronPermissions=async s=>{let r=Ue(s);await this.manageNeuron(r)};this.assertManageNeuronError=({command:s})=>{let r=s[0];if(r!==void 0&&"Error"in r)throw new X(r.Error.error_message)}}static create(s){let{service:r,certifiedService:a,canisterId:t}=(0,w.createServices)({options:s,idlFactory:Ae,certifiedIdlFactory:qe});return new C(t,r,a)}};var L=require("@dfinity/utils");var ze=({IDL:e})=>{let o=e.Variant({Int:e.Int,Nat:e.Nat,Blob:e.Vec(e.Nat8),Text:e.Text}),s=e.Vec(e.Nat8),r=e.Record({owner:e.Principal,subaccount:e.Opt(s)}),a=e.Record({token_symbol:e.Text,transfer_fee:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,o)),minting_account:r,initial_balances:e.Vec(e.Tuple(r,e.Nat64)),archive_options:e.Record({num_blocks_to_archive:e.Nat64,trigger_threshold:e.Nat64,max_message_size_bytes:e.Opt(e.Nat64),cycles_for_archive_creation:e.Opt(e.Nat64),node_max_memory_size_bytes:e.Opt(e.Nat64),controller_id:e.Principal}),token_name:e.Text}),t=e.Nat,c=e.Nat64,d=e.Record({to:r,fee:e.Opt(t),memo:e.Opt(e.Vec(e.Nat8)),from_subaccount:e.Opt(s),created_at_time:e.Opt(c),amount:t}),i=e.Nat,n=e.Variant({GenericError:e.Record({message:e.Text,error_code:e.Nat}),TemporarilyUnavailable:e.Null,BadBurn:e.Record({min_burn_amount:t}),Duplicate:e.Record({duplicate_of:i}),BadFee:e.Record({expected_fee:t}),CreatedInFuture:e.Record({ledger_time:e.Nat64}),TooOld:e.Null,InsufficientFunds:e.Record({balance:t})}),_=e.Variant({Ok:i,Err:n});return e.Service({icrc1_balance_of:e.Func([r],[t],[]),icrc1_decimals:e.Func([],[e.Nat8],[]),icrc1_fee:e.Func([],[t],[]),icrc1_metadata:e.Func([],[e.Vec(e.Tuple(e.Text,o))],[]),icrc1_minting_account:e.Func([],[e.Opt(r)],[]),icrc1_name:e.Func([],[e.Text],[]),icrc1_supported_standards:e.Func([],[e.Vec(e.Record({url:e.Text,name:e.Text}))],[]),icrc1_symbol:e.Func([],[e.Text],[]),icrc1_total_supply:e.Func([],[t],[]),icrc1_transfer:e.Func([d],[_],[])})};var Qe=({IDL:e})=>{let o=e.Variant({Int:e.Int,Nat:e.Nat,Blob:e.Vec(e.Nat8),Text:e.Text}),s=e.Vec(e.Nat8),r=e.Record({owner:e.Principal,subaccount:e.Opt(s)}),a=e.Record({token_symbol:e.Text,transfer_fee:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,o)),minting_account:r,initial_balances:e.Vec(e.Tuple(r,e.Nat64)),archive_options:e.Record({num_blocks_to_archive:e.Nat64,trigger_threshold:e.Nat64,max_message_size_bytes:e.Opt(e.Nat64),cycles_for_archive_creation:e.Opt(e.Nat64),node_max_memory_size_bytes:e.Opt(e.Nat64),controller_id:e.Principal}),token_name:e.Text}),t=e.Nat,c=e.Nat64,d=e.Record({to:r,fee:e.Opt(t),memo:e.Opt(e.Vec(e.Nat8)),from_subaccount:e.Opt(s),created_at_time:e.Opt(c),amount:t}),i=e.Nat,n=e.Variant({GenericError:e.Record({message:e.Text,error_code:e.Nat}),TemporarilyUnavailable:e.Null,BadBurn:e.Record({min_burn_amount:t}),Duplicate:e.Record({duplicate_of:i}),BadFee:e.Record({expected_fee:t}),CreatedInFuture:e.Record({ledger_time:e.Nat64}),TooOld:e.Null,InsufficientFunds:e.Record({balance:t})}),_=e.Variant({Ok:i,Err:n});return e.Service({icrc1_balance_of:e.Func([r],[t],["query"]),icrc1_decimals:e.Func([],[e.Nat8],["query"]),icrc1_fee:e.Func([],[t],["query"]),icrc1_metadata:e.Func([],[e.Vec(e.Tuple(e.Text,o))],["query"]),icrc1_minting_account:e.Func([],[e.Opt(r)],["query"]),icrc1_name:e.Func([],[e.Text],["query"]),icrc1_supported_standards:e.Func([],[e.Vec(e.Record({url:e.Text,name:e.Text}))],["query"]),icrc1_symbol:e.Func([],[e.Text],["query"]),icrc1_total_supply:e.Func([],[t],["query"]),icrc1_transfer:e.Func([d],[_],[])})};var F=class extends f{constructor(){super(...arguments);this.metadata=s=>this.caller(s).icrc1_metadata();this.balance=s=>this.caller({certified:s.certified}).icrc1_balance_of({owner:s.owner,subaccount:(0,L.toNullable)(s.subaccount)})}static create(s){let{service:r,certifiedService:a,canisterId:t}=(0,L.createServices)({options:s,idlFactory:Qe,certifiedIdlFactory:ze});return new F(t,r,a)}};var je=require("@dfinity/utils");var We=({IDL:e})=>{let o=e.Record({dapp_canister_ids:e.Vec(e.Principal),latest_ledger_archive_poll_timestamp_seconds:e.Opt(e.Nat64),archive_canister_ids:e.Vec(e.Principal),governance_canister_id:e.Opt(e.Principal),swap_canister_id:e.Opt(e.Principal),ledger_canister_id:e.Opt(e.Principal)}),s=e.Record({canister_id:e.Principal}),r=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),a=e.Record({controller:e.Principal,status:r,memory_size:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),t=e.Record({update_canister_list:e.Opt(e.Bool)}),c=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),d=e.Record({controller:e.Principal,freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),i=e.Record({controller:e.Principal,status:c,freezing_threshold:e.Nat,balance:e.Vec(e.Tuple(e.Vec(e.Nat8),e.Nat)),memory_size:e.Nat,cycles:e.Nat,settings:d,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),n=e.Record({status:e.Opt(i),canister_id:e.Opt(e.Principal)}),_=e.Record({root:e.Opt(n),swap:e.Opt(n),ledger:e.Opt(n),governance:e.Opt(n),dapps:e.Vec(n),archives:e.Vec(n)}),m=e.Record({root:e.Opt(e.Principal),swap:e.Opt(e.Principal),ledger:e.Opt(e.Principal),governance:e.Opt(e.Principal),dapps:e.Vec(e.Principal),archives:e.Vec(e.Principal)}),p=e.Record({canister_id:e.Opt(e.Principal)}),N=e.Record({controller_principal_ids:e.Vec(e.Principal)}),l=e.Record({code:e.Opt(e.Int32),description:e.Text}),u=e.Record({err:e.Opt(l),dapp_canister_id:e.Opt(e.Principal)}),R=e.Record({failed_updates:e.Vec(u)});return e.Service({canister_status:e.Func([s],[a],[]),get_build_metadata:e.Func([],[e.Text],[]),get_sns_canisters_summary:e.Func([t],[_],[]),list_sns_canisters:e.Func([e.Record({})],[m],[]),register_dapp_canister:e.Func([p],[e.Record({})],[]),set_dapp_controllers:e.Func([N],[R],[])})};var Ye=({IDL:e})=>{let o=e.Record({dapp_canister_ids:e.Vec(e.Principal),latest_ledger_archive_poll_timestamp_seconds:e.Opt(e.Nat64),archive_canister_ids:e.Vec(e.Principal),governance_canister_id:e.Opt(e.Principal),swap_canister_id:e.Opt(e.Principal),ledger_canister_id:e.Opt(e.Principal)}),s=e.Record({canister_id:e.Principal}),r=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),a=e.Record({controller:e.Principal,status:r,memory_size:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),t=e.Record({update_canister_list:e.Opt(e.Bool)}),c=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),d=e.Record({controller:e.Principal,freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),i=e.Record({controller:e.Principal,status:c,freezing_threshold:e.Nat,balance:e.Vec(e.Tuple(e.Vec(e.Nat8),e.Nat)),memory_size:e.Nat,cycles:e.Nat,settings:d,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),n=e.Record({status:e.Opt(i),canister_id:e.Opt(e.Principal)}),_=e.Record({root:e.Opt(n),swap:e.Opt(n),ledger:e.Opt(n),governance:e.Opt(n),dapps:e.Vec(n),archives:e.Vec(n)}),m=e.Record({root:e.Opt(e.Principal),swap:e.Opt(e.Principal),ledger:e.Opt(e.Principal),governance:e.Opt(e.Principal),dapps:e.Vec(e.Principal),archives:e.Vec(e.Principal)}),p=e.Record({canister_id:e.Opt(e.Principal)}),N=e.Record({controller_principal_ids:e.Vec(e.Principal)}),l=e.Record({code:e.Opt(e.Int32),description:e.Text}),u=e.Record({err:e.Opt(l),dapp_canister_id:e.Opt(e.Principal)}),R=e.Record({failed_updates:e.Vec(u)});return e.Service({canister_status:e.Func([s],[a],[]),get_build_metadata:e.Func([],[e.Text],["query"]),get_sns_canisters_summary:e.Func([t],[_],[]),list_sns_canisters:e.Func([e.Record({})],[m],["query"]),register_dapp_canister:e.Func([p],[e.Record({})],[]),set_dapp_controllers:e.Func([N],[R],[])})};var M=class extends f{constructor(){super(...arguments);this.listSnsCanisters=async({certified:s=!0})=>this.caller({certified:s}).list_sns_canisters({})}static create(s){let{service:r,certifiedService:a,canisterId:t}=(0,je.createServices)({options:s,idlFactory:Ye,certifiedIdlFactory:We});return new M(t,r,a)}};var E=require("@dfinity/utils");var D=class{constructor({root:o,governance:s,ledger:r,swap:a,certified:t}){this.listNeurons=o=>this.governance.listNeurons(this.mergeParams(o));this.metadata=o=>Promise.all([this.governance.metadata(this.mergeParams(o)),this.ledger.metadata(this.mergeParams(o))]);this.ledgerMetadata=o=>this.ledger.metadata(this.mergeParams(o));this.balance=o=>this.ledger.balance(this.mergeParams(o));this.getNeuron=o=>this.governance.getNeuron(this.mergeParams(o));this.addNeuronPermissions=o=>this.governance.addNeuronPermissions(o);this.removeNeuronPermissions=o=>this.governance.removeNeuronPermissions(o);this.swapState=o=>this.swap.state(this.mergeParams(o));this.notifyParticipation=o=>this.swap.notifyParticipation(o);this.getUserCommitment=o=>this.swap.getUserCommitment(this.mergeParams(o));this.root=o,this.governance=s,this.ledger=r,this.swap=a,this.certified=t}get canisterIds(){return{rootCanisterId:this.root.canisterId,ledgerCanisterId:this.ledger.canisterId,governanceCanisterId:this.governance.canisterId,swapCanisterId:this.swap.canisterId}}mergeParams(o){return{...o,certified:this.certified}}};var ee=require("@dfinity/utils");var Xe=({IDL:e})=>{let o=e.Record({sns_root_canister_id:e.Text,fallback_controller_principal_ids:e.Vec(e.Text),nns_governance_canister_id:e.Text,icp_ledger_canister_id:e.Text,sns_ledger_canister_id:e.Text,sns_governance_canister_id:e.Text}),s=e.Record({icp_e8s:e.Nat64,fee_override_e8s:e.Nat64}),r=e.Record({error_message:e.Text,error_type:e.Int32}),a=e.Record({governance_error:e.Opt(r)}),t=e.Record({code:e.Opt(e.Int32),description:e.Text}),c=e.Variant({Ok:a,Err:t}),d=e.Record({possibility:e.Opt(c)}),i=e.Record({err:e.Opt(t),dapp_canister_id:e.Opt(e.Principal)}),n=e.Record({failed_updates:e.Vec(i)}),_=e.Variant({Ok:n,Err:t}),m=e.Record({possibility:e.Opt(_)}),p=e.Variant({Err:t}),N=e.Record({possibility:e.Opt(p)}),l=e.Record({failure:e.Nat32,skipped:e.Nat32,success:e.Nat32}),u=e.Record({settle_community_fund_participation_result:e.Opt(d),set_dapp_controllers_result:e.Opt(m),sns_governance_normal_mode_enabled:e.Opt(N),sweep_icp:e.Opt(l),sweep_sns:e.Opt(l),create_neuron:e.Opt(l)}),R=e.Record({principal_id:e.Opt(e.Principal)}),S=e.Record({transfer_start_timestamp_seconds:e.Nat64,amount_e8s:e.Nat64,transfer_success_timestamp_seconds:e.Nat64}),P=e.Record({icp:e.Opt(S)}),V=e.Record({buyer_state:e.Opt(P)}),G=e.Record({buyers_total:e.Nat64}),q=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),A=e.Record({controller:e.Principal,freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),O=e.Record({controller:e.Principal,status:q,freezing_threshold:e.Nat,balance:e.Vec(e.Tuple(e.Vec(e.Nat8),e.Nat)),memory_size:e.Nat,cycles:e.Nat,settings:A,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),B=e.Record({hotkey_principal:e.Text,nns_neuron_id:e.Nat64}),g=e.Record({buyer_principal:e.Text}),T=e.Variant({CommunityFund:B,Direct:g}),x=e.Record({sns:e.Opt(S),investor:e.Opt(T)}),U=e.Record({nns_neuron_id:e.Nat64,amount_icp_e8s:e.Nat64}),y=e.Record({hotkey_principal:e.Text,cf_neurons:e.Vec(U)}),v=e.Record({min_participant_icp_e8s:e.Nat64,max_icp_e8s:e.Nat64,swap_due_timestamp_seconds:e.Nat64,min_participants:e.Nat32,sns_token_e8s:e.Nat64,max_participant_icp_e8s:e.Nat64,min_icp_e8s:e.Nat64}),z=e.Record({neuron_recipes:e.Vec(x),cf_participants:e.Vec(y),init:e.Opt(o),lifecycle:e.Int32,buyers:e.Vec(e.Tuple(e.Text,P)),params:e.Opt(v),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),Q=e.Record({sns_tokens_per_icp:e.Float32,buyer_total_icp_e8s:e.Nat64}),W=e.Record({swap:e.Opt(z),derived:e.Opt(Q)}),h=e.Record({cf_participants:e.Vec(y),params:e.Opt(v),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),b=e.Record({buyer:e.Text}),Y=e.Record({icp_accepted_participation_e8s:e.Nat64,icp_ledger_account_balance_e8s:e.Nat64});return e.Service({error_refund_icp:e.Func([s],[e.Record({})],[]),finalize_swap:e.Func([e.Record({})],[u],[]),get_buyer_state:e.Func([R],[V],[]),get_buyers_total:e.Func([e.Record({})],[G],[]),get_canister_status:e.Func([e.Record({})],[O],[]),get_state:e.Func([e.Record({})],[W],[]),open:e.Func([h],[e.Record({})],[]),refresh_buyer_tokens:e.Func([b],[Y],[])})};var He=({IDL:e})=>{let o=e.Record({sns_root_canister_id:e.Text,fallback_controller_principal_ids:e.Vec(e.Text),nns_governance_canister_id:e.Text,icp_ledger_canister_id:e.Text,sns_ledger_canister_id:e.Text,sns_governance_canister_id:e.Text}),s=e.Record({icp_e8s:e.Nat64,fee_override_e8s:e.Nat64}),r=e.Record({error_message:e.Text,error_type:e.Int32}),a=e.Record({governance_error:e.Opt(r)}),t=e.Record({code:e.Opt(e.Int32),description:e.Text}),c=e.Variant({Ok:a,Err:t}),d=e.Record({possibility:e.Opt(c)}),i=e.Record({err:e.Opt(t),dapp_canister_id:e.Opt(e.Principal)}),n=e.Record({failed_updates:e.Vec(i)}),_=e.Variant({Ok:n,Err:t}),m=e.Record({possibility:e.Opt(_)}),p=e.Variant({Err:t}),N=e.Record({possibility:e.Opt(p)}),l=e.Record({failure:e.Nat32,skipped:e.Nat32,success:e.Nat32}),u=e.Record({settle_community_fund_participation_result:e.Opt(d),set_dapp_controllers_result:e.Opt(m),sns_governance_normal_mode_enabled:e.Opt(N),sweep_icp:e.Opt(l),sweep_sns:e.Opt(l),create_neuron:e.Opt(l)}),R=e.Record({principal_id:e.Opt(e.Principal)}),S=e.Record({transfer_start_timestamp_seconds:e.Nat64,amount_e8s:e.Nat64,transfer_success_timestamp_seconds:e.Nat64}),P=e.Record({icp:e.Opt(S)}),V=e.Record({buyer_state:e.Opt(P)}),G=e.Record({buyers_total:e.Nat64}),q=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),A=e.Record({controller:e.Principal,freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),O=e.Record({controller:e.Principal,status:q,freezing_threshold:e.Nat,balance:e.Vec(e.Tuple(e.Vec(e.Nat8),e.Nat)),memory_size:e.Nat,cycles:e.Nat,settings:A,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),B=e.Record({hotkey_principal:e.Text,nns_neuron_id:e.Nat64}),g=e.Record({buyer_principal:e.Text}),T=e.Variant({CommunityFund:B,Direct:g}),x=e.Record({sns:e.Opt(S),investor:e.Opt(T)}),U=e.Record({nns_neuron_id:e.Nat64,amount_icp_e8s:e.Nat64}),y=e.Record({hotkey_principal:e.Text,cf_neurons:e.Vec(U)}),v=e.Record({min_participant_icp_e8s:e.Nat64,max_icp_e8s:e.Nat64,swap_due_timestamp_seconds:e.Nat64,min_participants:e.Nat32,sns_token_e8s:e.Nat64,max_participant_icp_e8s:e.Nat64,min_icp_e8s:e.Nat64}),z=e.Record({neuron_recipes:e.Vec(x),cf_participants:e.Vec(y),init:e.Opt(o),lifecycle:e.Int32,buyers:e.Vec(e.Tuple(e.Text,P)),params:e.Opt(v),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),Q=e.Record({sns_tokens_per_icp:e.Float32,buyer_total_icp_e8s:e.Nat64}),W=e.Record({swap:e.Opt(z),derived:e.Opt(Q)}),h=e.Record({cf_participants:e.Vec(y),params:e.Opt(v),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),b=e.Record({buyer:e.Text}),Y=e.Record({icp_accepted_participation_e8s:e.Nat64,icp_ledger_account_balance_e8s:e.Nat64});return e.Service({error_refund_icp:e.Func([s],[e.Record({})],[]),finalize_swap:e.Func([e.Record({})],[u],[]),get_buyer_state:e.Func([R],[V],["query"]),get_buyers_total:e.Func([e.Record({})],[G],[]),get_canister_status:e.Func([e.Record({})],[O],[]),get_state:e.Func([e.Record({})],[W],["query"]),open:e.Func([h],[e.Record({})],[]),refresh_buyer_tokens:e.Func([b],[Y],[])})};var k=class extends f{constructor(){super(...arguments);this.state=s=>this.caller(s).get_state({});this.notifyParticipation=async s=>{await this.caller({certified:!0}).refresh_buyer_tokens(s)};this.getUserCommitment=async s=>{let{buyer_state:r}=await this.caller({certified:s.certified}).get_buyer_state({principal_id:s.principal_id});return(0,ee.fromNullable)(r)}}static create(s){let{service:r,certifiedService:a,canisterId:t}=(0,ee.createServices)({options:s,idlFactory:He,certifiedIdlFactory:Xe});return new k(t,r,a)}};var st=async({agent:e,rootOptions:o,certified:s=!0})=>{let r=M.create({...o,agent:e}),{ledger:a,swap:t,governance:c}=await r.listSnsCanisters({certified:s}),d=(0,E.fromNullable)(c),i=(0,E.fromNullable)(a),n=(0,E.fromNullable)(t);return(0,E.assertNonNullish)(d),(0,E.assertNonNullish)(i),(0,E.assertNonNullish)(n),new D({root:r,governance:C.create({canisterId:d,agent:e}),ledger:F.create({canisterId:i,agent:e}),swap:k.create({canisterId:n,agent:e}),certified:s})};var Je=(a=>(a.SYMBOL="icrc1:symbol",a.NAME="icrc1:name",a.DECIMALS="icrc1:decimals",a.FEE="icrc1:fee",a))(Je||{});0&&(module.exports={SnsGovernanceCanister,SnsGovernanceError,SnsLedgerCanister,SnsMetadataResponseEntries,SnsNeuronPermissionType,SnsRootCanister,SnsSwapCanister,SnsSwapLifecycle,SnsWrapper,initSnsWrapper});
1
+ "use strict";var Ee=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var et=Object.prototype.hasOwnProperty;var tt=(e,r)=>{for(var s in r)Ee(e,s,{get:r[s],enumerable:!0})},st=(e,r,s,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Le(r))!et.call(e,a)&&a!==s&&Ee(e,a,{get:()=>r[a],enumerable:!(o=De(r,a))||o.enumerable});return e};var rt=e=>st(Ee({},"__esModule",{value:!0}),e);var _t={};tt(_t,{SnsGovernanceCanister:()=>C,SnsGovernanceError:()=>X,SnsLedgerCanister:()=>F,SnsMetadataResponseEntries:()=>Je,SnsNeuronPermissionType:()=>Ge,SnsRootCanister:()=>M,SnsSwapCanister:()=>k,SnsSwapLifecycle:()=>Ae,SnsWrapper:()=>D,decodeSnsAccount:()=>ct,encodeSnsAccount:()=>it,initSnsWrapper:()=>nt});module.exports=rt(_t);var Ge=(n=>(n[n.NEURON_PERMISSION_TYPE_UNSPECIFIED=0]="NEURON_PERMISSION_TYPE_UNSPECIFIED",n[n.NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE=1]="NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE",n[n.NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS=2]="NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS",n[n.NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL=3]="NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL",n[n.NEURON_PERMISSION_TYPE_VOTE=4]="NEURON_PERMISSION_TYPE_VOTE",n[n.NEURON_PERMISSION_TYPE_DISBURSE=5]="NEURON_PERMISSION_TYPE_DISBURSE",n[n.NEURON_PERMISSION_TYPE_SPLIT=6]="NEURON_PERMISSION_TYPE_SPLIT",n[n.NEURON_PERMISSION_TYPE_MERGE_MATURITY=7]="NEURON_PERMISSION_TYPE_MERGE_MATURITY",n[n.NEURON_PERMISSION_TYPE_DISBURSE_MATURITY=8]="NEURON_PERMISSION_TYPE_DISBURSE_MATURITY",n))(Ge||{});var Ae=(t=>(t[t.Unspecified=0]="Unspecified",t[t.Pending=1]="Pending",t[t.Open=2]="Open",t[t.Committed=3]="Committed",t[t.Aborted=4]="Aborted",t))(Ae||{});var X=class extends Error{};var w=require("@dfinity/utils");var qe=({IDL:e})=>{let r=e.Record({validator_canister_id:e.Opt(e.Principal),target_canister_id:e.Opt(e.Principal),validator_method_name:e.Opt(e.Text),target_method_name:e.Opt(e.Text)}),s=e.Variant({NativeNervousSystemFunction:e.Record({}),GenericNervousSystemFunction:r}),o=e.Record({id:e.Nat64,name:e.Text,description:e.Opt(e.Text),function_type:e.Opt(s)}),a=e.Record({not_dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),garbage_collectable_neurons_count:e.Nat64,neurons_with_invalid_stake_count:e.Nat64,not_dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),neurons_with_less_than_6_months_dissolve_delay_count:e.Nat64,dissolved_neurons_count:e.Nat64,total_staked_e8s:e.Nat64,total_supply_governance_tokens:e.Nat64,not_dissolving_neurons_count:e.Nat64,dissolved_neurons_e8s:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:e.Nat64,dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),timestamp_seconds:e.Nat64}),t=e.Record({id:e.Vec(e.Nat8)}),c=e.Record({followees:e.Vec(t)}),_=e.Record({followees:e.Vec(e.Tuple(e.Nat64,c))}),i=e.Record({permissions:e.Vec(e.Int32)}),n=e.Record({start_timestamp_seconds:e.Opt(e.Nat64),final_reward_rate_basis_points:e.Opt(e.Nat64),initial_reward_rate_basis_points:e.Opt(e.Nat64),reward_rate_transition_duration_seconds:e.Opt(e.Nat64),round_duration_seconds:e.Opt(e.Nat64)}),p=e.Record({default_followees:e.Opt(_),max_dissolve_delay_seconds:e.Opt(e.Nat64),max_followees_per_function:e.Opt(e.Nat64),neuron_claimer_permissions:e.Opt(i),neuron_minimum_stake_e8s:e.Opt(e.Nat64),max_neuron_age_for_age_bonus:e.Opt(e.Nat64),initial_voting_period_seconds:e.Opt(e.Nat64),neuron_minimum_dissolve_delay_to_vote_seconds:e.Opt(e.Nat64),reject_cost_e8s:e.Opt(e.Nat64),max_proposals_to_keep_per_action:e.Opt(e.Nat32),wait_for_quiet_deadline_increase_seconds:e.Opt(e.Nat64),max_number_of_neurons:e.Opt(e.Nat64),transaction_fee_e8s:e.Opt(e.Nat64),max_number_of_proposals_with_ballots:e.Opt(e.Nat64),neuron_grantable_permissions:e.Opt(i),voting_rewards_parameters:e.Opt(n),max_number_of_principals_per_neuron:e.Opt(e.Nat64)}),m=e.Record({archive_wasm_hash:e.Vec(e.Nat8),root_wasm_hash:e.Vec(e.Nat8),swap_wasm_hash:e.Vec(e.Nat8),ledger_wasm_hash:e.Vec(e.Nat8),governance_wasm_hash:e.Vec(e.Nat8)}),d=e.Record({id:e.Nat64}),N=e.Record({actual_timestamp_seconds:e.Nat64,distributed_e8s_equivalent:e.Nat64,round:e.Nat64,settled_proposals:e.Vec(d)}),l=e.Record({mark_failed_at_seconds:e.Nat64,checking_upgrade_lock:e.Nat64,proposal_id:e.Nat64,target_version:e.Opt(m)}),u=e.Record({error_message:e.Text,error_type:e.Int32}),R=e.Record({vote:e.Int32,cast_timestamp_seconds:e.Nat64,voting_power:e.Nat64}),S=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),P=e.Record({new_canister_wasm:e.Vec(e.Nat8),canister_id:e.Opt(e.Principal)}),T=e.Record({url:e.Opt(e.Text),logo:e.Opt(e.Text),name:e.Opt(e.Text),description:e.Opt(e.Text)}),G=e.Record({function_id:e.Nat64,payload:e.Vec(e.Nat8)}),A=e.Record({motion_text:e.Text}),q=e.Variant({ManageNervousSystemParameters:p,AddGenericNervousSystemFunction:o,RemoveGenericNervousSystemFunction:e.Nat64,UpgradeSnsToNextVersion:e.Record({}),UpgradeSnsControlledCanister:P,Unspecified:e.Record({}),ManageSnsMetadata:T,ExecuteGenericNervousSystemFunction:G,Motion:A}),g=e.Record({url:e.Text,title:e.Text,action:e.Opt(q),summary:e.Text}),B=e.Record({current_deadline_timestamp_seconds:e.Nat64}),O=e.Record({id:e.Opt(d),payload_text_rendering:e.Opt(e.Text),action:e.Nat64,failure_reason:e.Opt(u),ballots:e.Vec(e.Tuple(e.Text,R)),reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,proposal_creation_timestamp_seconds:e.Nat64,initial_voting_period_seconds:e.Nat64,reject_cost_e8s:e.Nat64,latest_tally:e.Opt(S),wait_for_quiet_deadline_increase_seconds:e.Nat64,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(g),proposer:e.Opt(t),wait_for_quiet_state:e.Opt(B),is_eligible_for_rewards:e.Bool,executed_timestamp_seconds:e.Nat64}),V=e.Record({memo:e.Nat64,amount_e8s:e.Nat64}),x=e.Record({function_id:e.Nat64,followees:e.Vec(t)}),U=e.Record({subaccount:e.Vec(e.Nat8)}),y=e.Record({owner:e.Opt(e.Principal),subaccount:e.Opt(U)}),v=e.Record({to_account:e.Opt(y),percentage_to_disburse:e.Nat32}),z=e.Record({additional_dissolve_delay_seconds:e.Nat32}),Q=e.Record({dissolve_timestamp_seconds:e.Nat64}),W=e.Variant({StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:z,SetDissolveTimestamp:Q}),h=e.Record({operation:e.Opt(W)}),b=e.Record({vote:e.Int32,proposal:e.Opt(d)}),Y=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),se=e.Variant({MemoAndController:Y,NeuronId:e.Record({})}),H=e.Record({by:e.Opt(se)}),Z=e.Record({permissions_to_remove:e.Opt(i),principal_id:e.Opt(e.Principal)}),J=e.Record({permissions_to_add:e.Opt(i),principal_id:e.Opt(e.Principal)}),K=e.Record({percentage_to_merge:e.Nat32}),re=e.Record({e8s:e.Nat64}),$=e.Record({to_account:e.Opt(y),amount:e.Opt(re)}),oe=e.Variant({Split:V,Follow:x,DisburseMaturity:v,Configure:h,RegisterVote:b,MakeProposal:g,ClaimOrRefreshNeuron:H,RemoveNeuronPermissions:Z,AddNeuronPermissions:J,MergeMaturity:K,Disburse:$}),ne=e.Record({command:e.Opt(oe),timestamp:e.Nat64}),ae=e.Record({principal:e.Opt(e.Principal),permission_type:e.Vec(e.Int32)}),ie=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),j=e.Record({id:e.Opt(t),permissions:e.Vec(ae),maturity_e8s_equivalent:e.Nat64,cached_neuron_stake_e8s:e.Nat64,created_timestamp_seconds:e.Nat64,aging_since_timestamp_seconds:e.Nat64,dissolve_state:e.Opt(ie),voting_power_percentage_multiplier:e.Nat64,followees:e.Vec(e.Tuple(e.Nat64,c)),neuron_fees_e8s:e.Nat64}),Ie=e.Record({root_canister_id:e.Opt(e.Principal),id_to_nervous_system_functions:e.Vec(e.Tuple(e.Nat64,o)),metrics:e.Opt(a),mode:e.Int32,parameters:e.Opt(p),deployed_version:e.Opt(m),sns_initialization_parameters:e.Text,latest_reward_event:e.Opt(N),pending_version:e.Opt(l),swap_canister_id:e.Opt(e.Principal),ledger_canister_id:e.Opt(e.Principal),proposals:e.Vec(e.Tuple(e.Nat64,O)),in_flight_commands:e.Vec(e.Tuple(e.Text,ne)),sns_metadata:e.Opt(T),neurons:e.Vec(e.Tuple(e.Text,j)),genesis_timestamp_seconds:e.Nat64}),ce=e.Record({url:e.Opt(e.Text),logo:e.Opt(e.Text),name:e.Opt(e.Text),description:e.Opt(e.Text)}),_e=e.Record({neuron_id:e.Opt(t)}),pe=e.Variant({Error:u,Neuron:j}),de=e.Record({result:e.Opt(pe)}),I=e.Record({proposal_id:e.Opt(d)}),le=e.Variant({Error:u,Proposal:O}),ue=e.Record({result:e.Opt(le)}),me=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),Ne=e.Record({controller:e.Principal,freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),Re=e.Record({controller:e.Principal,status:me,freezing_threshold:e.Nat,balance:e.Vec(e.Tuple(e.Vec(e.Nat8),e.Nat)),memory_size:e.Nat,cycles:e.Nat,settings:Ne,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),ge=e.Record({deployed_version:e.Opt(m),pending_version:e.Opt(l)}),Oe=e.Record({sns_initialization_parameters:e.Text}),ye=e.Record({reserved_ids:e.Vec(e.Nat64),functions:e.Vec(o)}),ve=e.Record({of_principal:e.Opt(e.Principal),limit:e.Nat32,start_page_at:e.Opt(t)}),fe=e.Record({neurons:e.Vec(j)}),Se=e.Record({include_reward_status:e.Vec(e.Int32),before_proposal:e.Opt(d),limit:e.Nat32,exclude_type:e.Vec(e.Nat64),include_status:e.Vec(e.Int32)}),Pe=e.Record({proposals:e.Vec(O)}),Te=e.Variant({Split:V,Follow:x,DisburseMaturity:v,ClaimOrRefresh:H,Configure:h,RegisterVote:b,MakeProposal:g,RemoveNeuronPermissions:Z,AddNeuronPermissions:J,MergeMaturity:K,Disburse:$}),Ve=e.Record({subaccount:e.Vec(e.Nat8),command:e.Opt(Te)}),xe=e.Record({created_neuron_id:e.Opt(t)}),he=e.Record({transfer_block_height:e.Nat64,amount_disbursed_e8s:e.Nat64}),be=e.Record({refreshed_neuron_id:e.Opt(t)}),we=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),Ce=e.Record({transfer_block_height:e.Nat64}),Fe=e.Variant({Error:u,Split:xe,Follow:e.Record({}),DisburseMaturity:he,ClaimOrRefresh:be,Configure:e.Record({}),RegisterVote:e.Record({}),MakeProposal:I,RemoveNeuronPermission:e.Record({}),MergeMaturity:we,Disburse:Ce,AddNeuronPermission:e.Record({})}),Me=e.Record({command:e.Opt(Fe)}),ke=e.Record({mode:e.Int32});return e.Service({get_build_metadata:e.Func([],[e.Text],[]),get_metadata:e.Func([e.Record({})],[ce],[]),get_nervous_system_parameters:e.Func([e.Null],[p],[]),get_neuron:e.Func([_e],[de],[]),get_proposal:e.Func([I],[ue],[]),get_root_canister_status:e.Func([e.Null],[Re],[]),get_running_sns_version:e.Func([e.Record({})],[ge],[]),get_sns_initialization_parameters:e.Func([e.Record({})],[Oe],[]),list_nervous_system_functions:e.Func([],[ye],[]),list_neurons:e.Func([ve],[fe],[]),list_proposals:e.Func([Se],[Pe],[]),manage_neuron:e.Func([Ve],[Me],[]),set_mode:e.Func([ke],[e.Record({})],[])})};var Be=({IDL:e})=>{let r=e.Record({validator_canister_id:e.Opt(e.Principal),target_canister_id:e.Opt(e.Principal),validator_method_name:e.Opt(e.Text),target_method_name:e.Opt(e.Text)}),s=e.Variant({NativeNervousSystemFunction:e.Record({}),GenericNervousSystemFunction:r}),o=e.Record({id:e.Nat64,name:e.Text,description:e.Opt(e.Text),function_type:e.Opt(s)}),a=e.Record({not_dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),garbage_collectable_neurons_count:e.Nat64,neurons_with_invalid_stake_count:e.Nat64,not_dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),neurons_with_less_than_6_months_dissolve_delay_count:e.Nat64,dissolved_neurons_count:e.Nat64,total_staked_e8s:e.Nat64,total_supply_governance_tokens:e.Nat64,not_dissolving_neurons_count:e.Nat64,dissolved_neurons_e8s:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:e.Nat64,dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),timestamp_seconds:e.Nat64}),t=e.Record({id:e.Vec(e.Nat8)}),c=e.Record({followees:e.Vec(t)}),_=e.Record({followees:e.Vec(e.Tuple(e.Nat64,c))}),i=e.Record({permissions:e.Vec(e.Int32)}),n=e.Record({start_timestamp_seconds:e.Opt(e.Nat64),final_reward_rate_basis_points:e.Opt(e.Nat64),initial_reward_rate_basis_points:e.Opt(e.Nat64),reward_rate_transition_duration_seconds:e.Opt(e.Nat64),round_duration_seconds:e.Opt(e.Nat64)}),p=e.Record({default_followees:e.Opt(_),max_dissolve_delay_seconds:e.Opt(e.Nat64),max_followees_per_function:e.Opt(e.Nat64),neuron_claimer_permissions:e.Opt(i),neuron_minimum_stake_e8s:e.Opt(e.Nat64),max_neuron_age_for_age_bonus:e.Opt(e.Nat64),initial_voting_period_seconds:e.Opt(e.Nat64),neuron_minimum_dissolve_delay_to_vote_seconds:e.Opt(e.Nat64),reject_cost_e8s:e.Opt(e.Nat64),max_proposals_to_keep_per_action:e.Opt(e.Nat32),wait_for_quiet_deadline_increase_seconds:e.Opt(e.Nat64),max_number_of_neurons:e.Opt(e.Nat64),transaction_fee_e8s:e.Opt(e.Nat64),max_number_of_proposals_with_ballots:e.Opt(e.Nat64),neuron_grantable_permissions:e.Opt(i),voting_rewards_parameters:e.Opt(n),max_number_of_principals_per_neuron:e.Opt(e.Nat64)}),m=e.Record({archive_wasm_hash:e.Vec(e.Nat8),root_wasm_hash:e.Vec(e.Nat8),swap_wasm_hash:e.Vec(e.Nat8),ledger_wasm_hash:e.Vec(e.Nat8),governance_wasm_hash:e.Vec(e.Nat8)}),d=e.Record({id:e.Nat64}),N=e.Record({actual_timestamp_seconds:e.Nat64,distributed_e8s_equivalent:e.Nat64,round:e.Nat64,settled_proposals:e.Vec(d)}),l=e.Record({mark_failed_at_seconds:e.Nat64,checking_upgrade_lock:e.Nat64,proposal_id:e.Nat64,target_version:e.Opt(m)}),u=e.Record({error_message:e.Text,error_type:e.Int32}),R=e.Record({vote:e.Int32,cast_timestamp_seconds:e.Nat64,voting_power:e.Nat64}),S=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),P=e.Record({new_canister_wasm:e.Vec(e.Nat8),canister_id:e.Opt(e.Principal)}),T=e.Record({url:e.Opt(e.Text),logo:e.Opt(e.Text),name:e.Opt(e.Text),description:e.Opt(e.Text)}),G=e.Record({function_id:e.Nat64,payload:e.Vec(e.Nat8)}),A=e.Record({motion_text:e.Text}),q=e.Variant({ManageNervousSystemParameters:p,AddGenericNervousSystemFunction:o,RemoveGenericNervousSystemFunction:e.Nat64,UpgradeSnsToNextVersion:e.Record({}),UpgradeSnsControlledCanister:P,Unspecified:e.Record({}),ManageSnsMetadata:T,ExecuteGenericNervousSystemFunction:G,Motion:A}),g=e.Record({url:e.Text,title:e.Text,action:e.Opt(q),summary:e.Text}),B=e.Record({current_deadline_timestamp_seconds:e.Nat64}),O=e.Record({id:e.Opt(d),payload_text_rendering:e.Opt(e.Text),action:e.Nat64,failure_reason:e.Opt(u),ballots:e.Vec(e.Tuple(e.Text,R)),reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,proposal_creation_timestamp_seconds:e.Nat64,initial_voting_period_seconds:e.Nat64,reject_cost_e8s:e.Nat64,latest_tally:e.Opt(S),wait_for_quiet_deadline_increase_seconds:e.Nat64,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(g),proposer:e.Opt(t),wait_for_quiet_state:e.Opt(B),is_eligible_for_rewards:e.Bool,executed_timestamp_seconds:e.Nat64}),V=e.Record({memo:e.Nat64,amount_e8s:e.Nat64}),x=e.Record({function_id:e.Nat64,followees:e.Vec(t)}),U=e.Record({subaccount:e.Vec(e.Nat8)}),y=e.Record({owner:e.Opt(e.Principal),subaccount:e.Opt(U)}),v=e.Record({to_account:e.Opt(y),percentage_to_disburse:e.Nat32}),z=e.Record({additional_dissolve_delay_seconds:e.Nat32}),Q=e.Record({dissolve_timestamp_seconds:e.Nat64}),W=e.Variant({StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:z,SetDissolveTimestamp:Q}),h=e.Record({operation:e.Opt(W)}),b=e.Record({vote:e.Int32,proposal:e.Opt(d)}),Y=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),se=e.Variant({MemoAndController:Y,NeuronId:e.Record({})}),H=e.Record({by:e.Opt(se)}),Z=e.Record({permissions_to_remove:e.Opt(i),principal_id:e.Opt(e.Principal)}),J=e.Record({permissions_to_add:e.Opt(i),principal_id:e.Opt(e.Principal)}),K=e.Record({percentage_to_merge:e.Nat32}),re=e.Record({e8s:e.Nat64}),$=e.Record({to_account:e.Opt(y),amount:e.Opt(re)}),oe=e.Variant({Split:V,Follow:x,DisburseMaturity:v,Configure:h,RegisterVote:b,MakeProposal:g,ClaimOrRefreshNeuron:H,RemoveNeuronPermissions:Z,AddNeuronPermissions:J,MergeMaturity:K,Disburse:$}),ne=e.Record({command:e.Opt(oe),timestamp:e.Nat64}),ae=e.Record({principal:e.Opt(e.Principal),permission_type:e.Vec(e.Int32)}),ie=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),j=e.Record({id:e.Opt(t),permissions:e.Vec(ae),maturity_e8s_equivalent:e.Nat64,cached_neuron_stake_e8s:e.Nat64,created_timestamp_seconds:e.Nat64,aging_since_timestamp_seconds:e.Nat64,dissolve_state:e.Opt(ie),voting_power_percentage_multiplier:e.Nat64,followees:e.Vec(e.Tuple(e.Nat64,c)),neuron_fees_e8s:e.Nat64}),Ie=e.Record({root_canister_id:e.Opt(e.Principal),id_to_nervous_system_functions:e.Vec(e.Tuple(e.Nat64,o)),metrics:e.Opt(a),mode:e.Int32,parameters:e.Opt(p),deployed_version:e.Opt(m),sns_initialization_parameters:e.Text,latest_reward_event:e.Opt(N),pending_version:e.Opt(l),swap_canister_id:e.Opt(e.Principal),ledger_canister_id:e.Opt(e.Principal),proposals:e.Vec(e.Tuple(e.Nat64,O)),in_flight_commands:e.Vec(e.Tuple(e.Text,ne)),sns_metadata:e.Opt(T),neurons:e.Vec(e.Tuple(e.Text,j)),genesis_timestamp_seconds:e.Nat64}),ce=e.Record({url:e.Opt(e.Text),logo:e.Opt(e.Text),name:e.Opt(e.Text),description:e.Opt(e.Text)}),_e=e.Record({neuron_id:e.Opt(t)}),pe=e.Variant({Error:u,Neuron:j}),de=e.Record({result:e.Opt(pe)}),I=e.Record({proposal_id:e.Opt(d)}),le=e.Variant({Error:u,Proposal:O}),ue=e.Record({result:e.Opt(le)}),me=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),Ne=e.Record({controller:e.Principal,freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),Re=e.Record({controller:e.Principal,status:me,freezing_threshold:e.Nat,balance:e.Vec(e.Tuple(e.Vec(e.Nat8),e.Nat)),memory_size:e.Nat,cycles:e.Nat,settings:Ne,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),ge=e.Record({deployed_version:e.Opt(m),pending_version:e.Opt(l)}),Oe=e.Record({sns_initialization_parameters:e.Text}),ye=e.Record({reserved_ids:e.Vec(e.Nat64),functions:e.Vec(o)}),ve=e.Record({of_principal:e.Opt(e.Principal),limit:e.Nat32,start_page_at:e.Opt(t)}),fe=e.Record({neurons:e.Vec(j)}),Se=e.Record({include_reward_status:e.Vec(e.Int32),before_proposal:e.Opt(d),limit:e.Nat32,exclude_type:e.Vec(e.Nat64),include_status:e.Vec(e.Int32)}),Pe=e.Record({proposals:e.Vec(O)}),Te=e.Variant({Split:V,Follow:x,DisburseMaturity:v,ClaimOrRefresh:H,Configure:h,RegisterVote:b,MakeProposal:g,RemoveNeuronPermissions:Z,AddNeuronPermissions:J,MergeMaturity:K,Disburse:$}),Ve=e.Record({subaccount:e.Vec(e.Nat8),command:e.Opt(Te)}),xe=e.Record({created_neuron_id:e.Opt(t)}),he=e.Record({transfer_block_height:e.Nat64,amount_disbursed_e8s:e.Nat64}),be=e.Record({refreshed_neuron_id:e.Opt(t)}),we=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),Ce=e.Record({transfer_block_height:e.Nat64}),Fe=e.Variant({Error:u,Split:xe,Follow:e.Record({}),DisburseMaturity:he,ClaimOrRefresh:be,Configure:e.Record({}),RegisterVote:e.Record({}),MakeProposal:I,RemoveNeuronPermission:e.Record({}),MergeMaturity:we,Disburse:Ce,AddNeuronPermission:e.Record({})}),Me=e.Record({command:e.Opt(Fe)}),ke=e.Record({mode:e.Int32});return e.Service({get_build_metadata:e.Func([],[e.Text],["query"]),get_metadata:e.Func([e.Record({})],[ce],["query"]),get_nervous_system_parameters:e.Func([e.Null],[p],["query"]),get_neuron:e.Func([_e],[de],["query"]),get_proposal:e.Func([I],[ue],["query"]),get_root_canister_status:e.Func([e.Null],[Re],[]),get_running_sns_version:e.Func([e.Record({})],[ge],["query"]),get_sns_initialization_parameters:e.Func([e.Record({})],[Oe],["query"]),list_nervous_system_functions:e.Func([],[ye],["query"]),list_neurons:e.Func([ve],[fe],["query"]),list_proposals:e.Func([Se],[Pe],["query"]),manage_neuron:e.Func([Ve],[Me],[]),set_mode:e.Func([ke],[e.Record({})],[])})};var Ue=({neuronId:e,permissions:r,principal:s})=>({subaccount:e.id,command:[{AddNeuronPermissions:{permissions_to_add:[{permissions:Int32Array.from(r)}],principal_id:[s]}}]}),ze=({neuronId:e,permissions:r,principal:s})=>({subaccount:e.id,command:[{RemoveNeuronPermissions:{permissions_to_remove:[{permissions:Int32Array.from(r)}],principal_id:[s]}}]});var f=class{constructor(r,s,o){this.id=r;this.service=s;this.certifiedService=o;this.caller=({certified:r=!0})=>r?this.certifiedService:this.service}get canisterId(){return this.id}};var C=class extends f{constructor(){super(...arguments);this.listNeurons=async s=>{let{principal:o,limit:a,beforeNeuronId:t}=s,{neurons:c}=await this.caller(s).list_neurons({of_principal:(0,w.toNullable)(o),limit:a??100,start_page_at:(0,w.toNullable)(t)});return c};this.metadata=s=>this.caller(s).get_metadata({});this.getNeuron=async s=>{let{neuronId:o}=s,{result:a}=await this.caller(s).get_neuron({neuron_id:(0,w.toNullable)(o)}),t=(0,w.fromNullable)(a);if(t===void 0||"Error"in t)throw new X((t==null?void 0:t.Error.error_message)??"Response type not supported");return t.Neuron};this.manageNeuron=async s=>{let o=await this.caller({certified:!0}).manage_neuron(s);return this.assertManageNeuronError(o),o};this.addNeuronPermissions=async s=>{let o=Ue(s);await this.manageNeuron(o)};this.removeNeuronPermissions=async s=>{let o=ze(s);await this.manageNeuron(o)};this.assertManageNeuronError=({command:s})=>{let o=s[0];if(o!==void 0&&"Error"in o)throw new X(o.Error.error_message)}}static create(s){let{service:o,certifiedService:a,canisterId:t}=(0,w.createServices)({options:s,idlFactory:Be,certifiedIdlFactory:qe});return new C(t,o,a)}};var ee=require("@dfinity/utils");var Qe=({IDL:e})=>{let r=e.Variant({Int:e.Int,Nat:e.Nat,Blob:e.Vec(e.Nat8),Text:e.Text}),s=e.Vec(e.Nat8),o=e.Record({owner:e.Principal,subaccount:e.Opt(s)}),a=e.Record({token_symbol:e.Text,transfer_fee:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,r)),minting_account:o,initial_balances:e.Vec(e.Tuple(o,e.Nat64)),archive_options:e.Record({num_blocks_to_archive:e.Nat64,trigger_threshold:e.Nat64,max_message_size_bytes:e.Opt(e.Nat64),cycles_for_archive_creation:e.Opt(e.Nat64),node_max_memory_size_bytes:e.Opt(e.Nat64),controller_id:e.Principal}),token_name:e.Text}),t=e.Nat,c=e.Nat64,_=e.Record({to:o,fee:e.Opt(t),memo:e.Opt(e.Vec(e.Nat8)),from_subaccount:e.Opt(s),created_at_time:e.Opt(c),amount:t}),i=e.Nat,n=e.Variant({GenericError:e.Record({message:e.Text,error_code:e.Nat}),TemporarilyUnavailable:e.Null,BadBurn:e.Record({min_burn_amount:t}),Duplicate:e.Record({duplicate_of:i}),BadFee:e.Record({expected_fee:t}),CreatedInFuture:e.Record({ledger_time:e.Nat64}),TooOld:e.Null,InsufficientFunds:e.Record({balance:t})}),p=e.Variant({Ok:i,Err:n});return e.Service({icrc1_balance_of:e.Func([o],[t],[]),icrc1_decimals:e.Func([],[e.Nat8],[]),icrc1_fee:e.Func([],[t],[]),icrc1_metadata:e.Func([],[e.Vec(e.Tuple(e.Text,r))],[]),icrc1_minting_account:e.Func([],[e.Opt(o)],[]),icrc1_name:e.Func([],[e.Text],[]),icrc1_supported_standards:e.Func([],[e.Vec(e.Record({url:e.Text,name:e.Text}))],[]),icrc1_symbol:e.Func([],[e.Text],[]),icrc1_total_supply:e.Func([],[t],[]),icrc1_transfer:e.Func([_],[p],[])})};var We=({IDL:e})=>{let r=e.Variant({Int:e.Int,Nat:e.Nat,Blob:e.Vec(e.Nat8),Text:e.Text}),s=e.Vec(e.Nat8),o=e.Record({owner:e.Principal,subaccount:e.Opt(s)}),a=e.Record({token_symbol:e.Text,transfer_fee:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,r)),minting_account:o,initial_balances:e.Vec(e.Tuple(o,e.Nat64)),archive_options:e.Record({num_blocks_to_archive:e.Nat64,trigger_threshold:e.Nat64,max_message_size_bytes:e.Opt(e.Nat64),cycles_for_archive_creation:e.Opt(e.Nat64),node_max_memory_size_bytes:e.Opt(e.Nat64),controller_id:e.Principal}),token_name:e.Text}),t=e.Nat,c=e.Nat64,_=e.Record({to:o,fee:e.Opt(t),memo:e.Opt(e.Vec(e.Nat8)),from_subaccount:e.Opt(s),created_at_time:e.Opt(c),amount:t}),i=e.Nat,n=e.Variant({GenericError:e.Record({message:e.Text,error_code:e.Nat}),TemporarilyUnavailable:e.Null,BadBurn:e.Record({min_burn_amount:t}),Duplicate:e.Record({duplicate_of:i}),BadFee:e.Record({expected_fee:t}),CreatedInFuture:e.Record({ledger_time:e.Nat64}),TooOld:e.Null,InsufficientFunds:e.Record({balance:t})}),p=e.Variant({Ok:i,Err:n});return e.Service({icrc1_balance_of:e.Func([o],[t],["query"]),icrc1_decimals:e.Func([],[e.Nat8],["query"]),icrc1_fee:e.Func([],[t],["query"]),icrc1_metadata:e.Func([],[e.Vec(e.Tuple(e.Text,r))],["query"]),icrc1_minting_account:e.Func([],[e.Opt(o)],["query"]),icrc1_name:e.Func([],[e.Text],["query"]),icrc1_supported_standards:e.Func([],[e.Vec(e.Record({url:e.Text,name:e.Text}))],["query"]),icrc1_symbol:e.Func([],[e.Text],["query"]),icrc1_total_supply:e.Func([],[t],["query"]),icrc1_transfer:e.Func([_],[p],[])})};var F=class extends f{constructor(){super(...arguments);this.metadata=s=>this.caller(s).icrc1_metadata();this.balance=s=>this.caller({certified:s.certified}).icrc1_balance_of({owner:s.owner,subaccount:(0,ee.toNullable)(s.subaccount)})}static create(s){let{service:o,certifiedService:a,canisterId:t}=(0,ee.createServices)({options:s,idlFactory:We,certifiedIdlFactory:Qe});return new F(t,o,a)}};var Xe=require("@dfinity/utils");var Ye=({IDL:e})=>{let r=e.Record({dapp_canister_ids:e.Vec(e.Principal),latest_ledger_archive_poll_timestamp_seconds:e.Opt(e.Nat64),archive_canister_ids:e.Vec(e.Principal),governance_canister_id:e.Opt(e.Principal),swap_canister_id:e.Opt(e.Principal),ledger_canister_id:e.Opt(e.Principal)}),s=e.Record({canister_id:e.Principal}),o=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),a=e.Record({controller:e.Principal,status:o,memory_size:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),t=e.Record({update_canister_list:e.Opt(e.Bool)}),c=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),_=e.Record({controller:e.Principal,freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),i=e.Record({controller:e.Principal,status:c,freezing_threshold:e.Nat,balance:e.Vec(e.Tuple(e.Vec(e.Nat8),e.Nat)),memory_size:e.Nat,cycles:e.Nat,settings:_,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),n=e.Record({status:e.Opt(i),canister_id:e.Opt(e.Principal)}),p=e.Record({root:e.Opt(n),swap:e.Opt(n),ledger:e.Opt(n),governance:e.Opt(n),dapps:e.Vec(n),archives:e.Vec(n)}),m=e.Record({root:e.Opt(e.Principal),swap:e.Opt(e.Principal),ledger:e.Opt(e.Principal),governance:e.Opt(e.Principal),dapps:e.Vec(e.Principal),archives:e.Vec(e.Principal)}),d=e.Record({canister_id:e.Opt(e.Principal)}),N=e.Record({controller_principal_ids:e.Vec(e.Principal)}),l=e.Record({code:e.Opt(e.Int32),description:e.Text}),u=e.Record({err:e.Opt(l),dapp_canister_id:e.Opt(e.Principal)}),R=e.Record({failed_updates:e.Vec(u)});return e.Service({canister_status:e.Func([s],[a],[]),get_build_metadata:e.Func([],[e.Text],[]),get_sns_canisters_summary:e.Func([t],[p],[]),list_sns_canisters:e.Func([e.Record({})],[m],[]),register_dapp_canister:e.Func([d],[e.Record({})],[]),set_dapp_controllers:e.Func([N],[R],[])})};var je=({IDL:e})=>{let r=e.Record({dapp_canister_ids:e.Vec(e.Principal),latest_ledger_archive_poll_timestamp_seconds:e.Opt(e.Nat64),archive_canister_ids:e.Vec(e.Principal),governance_canister_id:e.Opt(e.Principal),swap_canister_id:e.Opt(e.Principal),ledger_canister_id:e.Opt(e.Principal)}),s=e.Record({canister_id:e.Principal}),o=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),a=e.Record({controller:e.Principal,status:o,memory_size:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),t=e.Record({update_canister_list:e.Opt(e.Bool)}),c=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),_=e.Record({controller:e.Principal,freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),i=e.Record({controller:e.Principal,status:c,freezing_threshold:e.Nat,balance:e.Vec(e.Tuple(e.Vec(e.Nat8),e.Nat)),memory_size:e.Nat,cycles:e.Nat,settings:_,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),n=e.Record({status:e.Opt(i),canister_id:e.Opt(e.Principal)}),p=e.Record({root:e.Opt(n),swap:e.Opt(n),ledger:e.Opt(n),governance:e.Opt(n),dapps:e.Vec(n),archives:e.Vec(n)}),m=e.Record({root:e.Opt(e.Principal),swap:e.Opt(e.Principal),ledger:e.Opt(e.Principal),governance:e.Opt(e.Principal),dapps:e.Vec(e.Principal),archives:e.Vec(e.Principal)}),d=e.Record({canister_id:e.Opt(e.Principal)}),N=e.Record({controller_principal_ids:e.Vec(e.Principal)}),l=e.Record({code:e.Opt(e.Int32),description:e.Text}),u=e.Record({err:e.Opt(l),dapp_canister_id:e.Opt(e.Principal)}),R=e.Record({failed_updates:e.Vec(u)});return e.Service({canister_status:e.Func([s],[a],[]),get_build_metadata:e.Func([],[e.Text],["query"]),get_sns_canisters_summary:e.Func([t],[p],[]),list_sns_canisters:e.Func([e.Record({})],[m],["query"]),register_dapp_canister:e.Func([d],[e.Record({})],[]),set_dapp_controllers:e.Func([N],[R],[])})};var M=class extends f{constructor(){super(...arguments);this.listSnsCanisters=async({certified:s=!0})=>this.caller({certified:s}).list_sns_canisters({})}static create(s){let{service:o,certifiedService:a,canisterId:t}=(0,Xe.createServices)({options:s,idlFactory:je,certifiedIdlFactory:Ye});return new M(t,o,a)}};var E=require("@dfinity/utils");var D=class{constructor({root:r,governance:s,ledger:o,swap:a,certified:t}){this.listNeurons=r=>this.governance.listNeurons(this.mergeParams(r));this.metadata=r=>Promise.all([this.governance.metadata(this.mergeParams(r)),this.ledger.metadata(this.mergeParams(r))]);this.ledgerMetadata=r=>this.ledger.metadata(this.mergeParams(r));this.balance=r=>this.ledger.balance(this.mergeParams(r));this.getNeuron=r=>this.governance.getNeuron(this.mergeParams(r));this.addNeuronPermissions=r=>this.governance.addNeuronPermissions(r);this.removeNeuronPermissions=r=>this.governance.removeNeuronPermissions(r);this.swapState=r=>this.swap.state(this.mergeParams(r));this.notifyParticipation=r=>this.swap.notifyParticipation(r);this.getUserCommitment=r=>this.swap.getUserCommitment(this.mergeParams(r));this.root=r,this.governance=s,this.ledger=o,this.swap=a,this.certified=t}get canisterIds(){return{rootCanisterId:this.root.canisterId,ledgerCanisterId:this.ledger.canisterId,governanceCanisterId:this.governance.canisterId,swapCanisterId:this.swap.canisterId}}mergeParams(r){return{...r,certified:this.certified}}};var te=require("@dfinity/utils");var He=({IDL:e})=>{let r=e.Record({sns_root_canister_id:e.Text,fallback_controller_principal_ids:e.Vec(e.Text),nns_governance_canister_id:e.Text,icp_ledger_canister_id:e.Text,sns_ledger_canister_id:e.Text,sns_governance_canister_id:e.Text}),s=e.Record({icp_e8s:e.Nat64,fee_override_e8s:e.Nat64}),o=e.Record({error_message:e.Text,error_type:e.Int32}),a=e.Record({governance_error:e.Opt(o)}),t=e.Record({code:e.Opt(e.Int32),description:e.Text}),c=e.Variant({Ok:a,Err:t}),_=e.Record({possibility:e.Opt(c)}),i=e.Record({err:e.Opt(t),dapp_canister_id:e.Opt(e.Principal)}),n=e.Record({failed_updates:e.Vec(i)}),p=e.Variant({Ok:n,Err:t}),m=e.Record({possibility:e.Opt(p)}),d=e.Variant({Err:t}),N=e.Record({possibility:e.Opt(d)}),l=e.Record({failure:e.Nat32,skipped:e.Nat32,success:e.Nat32}),u=e.Record({settle_community_fund_participation_result:e.Opt(_),set_dapp_controllers_result:e.Opt(m),sns_governance_normal_mode_enabled:e.Opt(N),sweep_icp:e.Opt(l),sweep_sns:e.Opt(l),create_neuron:e.Opt(l)}),R=e.Record({principal_id:e.Opt(e.Principal)}),S=e.Record({transfer_start_timestamp_seconds:e.Nat64,amount_e8s:e.Nat64,transfer_success_timestamp_seconds:e.Nat64}),P=e.Record({icp:e.Opt(S)}),T=e.Record({buyer_state:e.Opt(P)}),G=e.Record({buyers_total:e.Nat64}),A=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),q=e.Record({controller:e.Principal,freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),g=e.Record({controller:e.Principal,status:A,freezing_threshold:e.Nat,balance:e.Vec(e.Tuple(e.Vec(e.Nat8),e.Nat)),memory_size:e.Nat,cycles:e.Nat,settings:q,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),B=e.Record({hotkey_principal:e.Text,nns_neuron_id:e.Nat64}),O=e.Record({buyer_principal:e.Text}),V=e.Variant({CommunityFund:B,Direct:O}),x=e.Record({sns:e.Opt(S),investor:e.Opt(V)}),U=e.Record({nns_neuron_id:e.Nat64,amount_icp_e8s:e.Nat64}),y=e.Record({hotkey_principal:e.Text,cf_neurons:e.Vec(U)}),v=e.Record({min_participant_icp_e8s:e.Nat64,max_icp_e8s:e.Nat64,swap_due_timestamp_seconds:e.Nat64,min_participants:e.Nat32,sns_token_e8s:e.Nat64,max_participant_icp_e8s:e.Nat64,min_icp_e8s:e.Nat64}),z=e.Record({neuron_recipes:e.Vec(x),cf_participants:e.Vec(y),init:e.Opt(r),lifecycle:e.Int32,buyers:e.Vec(e.Tuple(e.Text,P)),params:e.Opt(v),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),Q=e.Record({sns_tokens_per_icp:e.Float32,buyer_total_icp_e8s:e.Nat64}),W=e.Record({swap:e.Opt(z),derived:e.Opt(Q)}),h=e.Record({cf_participants:e.Vec(y),params:e.Opt(v),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),b=e.Record({buyer:e.Text}),Y=e.Record({icp_accepted_participation_e8s:e.Nat64,icp_ledger_account_balance_e8s:e.Nat64});return e.Service({error_refund_icp:e.Func([s],[e.Record({})],[]),finalize_swap:e.Func([e.Record({})],[u],[]),get_buyer_state:e.Func([R],[T],[]),get_buyers_total:e.Func([e.Record({})],[G],[]),get_canister_status:e.Func([e.Record({})],[g],[]),get_state:e.Func([e.Record({})],[W],[]),open:e.Func([h],[e.Record({})],[]),refresh_buyer_tokens:e.Func([b],[Y],[])})};var Ze=({IDL:e})=>{let r=e.Record({sns_root_canister_id:e.Text,fallback_controller_principal_ids:e.Vec(e.Text),nns_governance_canister_id:e.Text,icp_ledger_canister_id:e.Text,sns_ledger_canister_id:e.Text,sns_governance_canister_id:e.Text}),s=e.Record({icp_e8s:e.Nat64,fee_override_e8s:e.Nat64}),o=e.Record({error_message:e.Text,error_type:e.Int32}),a=e.Record({governance_error:e.Opt(o)}),t=e.Record({code:e.Opt(e.Int32),description:e.Text}),c=e.Variant({Ok:a,Err:t}),_=e.Record({possibility:e.Opt(c)}),i=e.Record({err:e.Opt(t),dapp_canister_id:e.Opt(e.Principal)}),n=e.Record({failed_updates:e.Vec(i)}),p=e.Variant({Ok:n,Err:t}),m=e.Record({possibility:e.Opt(p)}),d=e.Variant({Err:t}),N=e.Record({possibility:e.Opt(d)}),l=e.Record({failure:e.Nat32,skipped:e.Nat32,success:e.Nat32}),u=e.Record({settle_community_fund_participation_result:e.Opt(_),set_dapp_controllers_result:e.Opt(m),sns_governance_normal_mode_enabled:e.Opt(N),sweep_icp:e.Opt(l),sweep_sns:e.Opt(l),create_neuron:e.Opt(l)}),R=e.Record({principal_id:e.Opt(e.Principal)}),S=e.Record({transfer_start_timestamp_seconds:e.Nat64,amount_e8s:e.Nat64,transfer_success_timestamp_seconds:e.Nat64}),P=e.Record({icp:e.Opt(S)}),T=e.Record({buyer_state:e.Opt(P)}),G=e.Record({buyers_total:e.Nat64}),A=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),q=e.Record({controller:e.Principal,freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),g=e.Record({controller:e.Principal,status:A,freezing_threshold:e.Nat,balance:e.Vec(e.Tuple(e.Vec(e.Nat8),e.Nat)),memory_size:e.Nat,cycles:e.Nat,settings:q,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),B=e.Record({hotkey_principal:e.Text,nns_neuron_id:e.Nat64}),O=e.Record({buyer_principal:e.Text}),V=e.Variant({CommunityFund:B,Direct:O}),x=e.Record({sns:e.Opt(S),investor:e.Opt(V)}),U=e.Record({nns_neuron_id:e.Nat64,amount_icp_e8s:e.Nat64}),y=e.Record({hotkey_principal:e.Text,cf_neurons:e.Vec(U)}),v=e.Record({min_participant_icp_e8s:e.Nat64,max_icp_e8s:e.Nat64,swap_due_timestamp_seconds:e.Nat64,min_participants:e.Nat32,sns_token_e8s:e.Nat64,max_participant_icp_e8s:e.Nat64,min_icp_e8s:e.Nat64}),z=e.Record({neuron_recipes:e.Vec(x),cf_participants:e.Vec(y),init:e.Opt(r),lifecycle:e.Int32,buyers:e.Vec(e.Tuple(e.Text,P)),params:e.Opt(v),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),Q=e.Record({sns_tokens_per_icp:e.Float32,buyer_total_icp_e8s:e.Nat64}),W=e.Record({swap:e.Opt(z),derived:e.Opt(Q)}),h=e.Record({cf_participants:e.Vec(y),params:e.Opt(v),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),b=e.Record({buyer:e.Text}),Y=e.Record({icp_accepted_participation_e8s:e.Nat64,icp_ledger_account_balance_e8s:e.Nat64});return e.Service({error_refund_icp:e.Func([s],[e.Record({})],[]),finalize_swap:e.Func([e.Record({})],[u],[]),get_buyer_state:e.Func([R],[T],["query"]),get_buyers_total:e.Func([e.Record({})],[G],[]),get_canister_status:e.Func([e.Record({})],[g],[]),get_state:e.Func([e.Record({})],[W],["query"]),open:e.Func([h],[e.Record({})],[]),refresh_buyer_tokens:e.Func([b],[Y],[])})};var k=class extends f{constructor(){super(...arguments);this.state=s=>this.caller(s).get_state({});this.notifyParticipation=async s=>{await this.caller({certified:!0}).refresh_buyer_tokens(s)};this.getUserCommitment=async s=>{let{buyer_state:o}=await this.caller({certified:s.certified}).get_buyer_state({principal_id:s.principal_id});return(0,te.fromNullable)(o)}}static create(s){let{service:o,certifiedService:a,canisterId:t}=(0,te.createServices)({options:s,idlFactory:Ze,certifiedIdlFactory:He});return new k(t,o,a)}};var nt=async({agent:e,rootOptions:r,certified:s=!0})=>{let o=M.create({...r,agent:e}),{ledger:a,swap:t,governance:c}=await o.listSnsCanisters({certified:s}),_=(0,E.fromNullable)(c),i=(0,E.fromNullable)(a),n=(0,E.fromNullable)(t);return(0,E.assertNonNullish)(_),(0,E.assertNonNullish)(i),(0,E.assertNonNullish)(n),new D({root:o,governance:C.create({canisterId:_,agent:e}),ledger:F.create({canisterId:i,agent:e}),swap:k.create({canisterId:n,agent:e}),certified:s})};var Je=(a=>(a.SYMBOL="icrc1:symbol",a.NAME="icrc1:name",a.DECIMALS="icrc1:decimals",a.FEE="icrc1:fee",a))(Je||{});var L=require("@dfinity/principal"),$e=parseInt("FF",16),Ke=32,at=e=>{let r=Array.from(e);for(;r[0]===0;)r.shift();return Uint8Array.from(r)},it=({owner:e,subaccount:r})=>{if(r===void 0)return e.toText();let s=at(r);if(s.length===0)return e.toText();let o=Uint8Array.from([...e.toUint8Array(),...s,s.length,$e]);return L.Principal.fromUint8Array(o).toText()},ct=e=>{let r=L.Principal.fromText(e),[s,o,...a]=r.toUint8Array().reverse();if(s!==$e)return{owner:L.Principal.fromText(e)};if(o>Ke||o===0||o===void 0)throw new Error("Invalid account string");let t=a.slice(0,o);if(t[0]===0||t.length!==o)throw new Error("Invalid account string");for(;t.length<Ke;)t.push(0);let c=Uint8Array.from(t.reverse()),_=a.reverse().filter((i,n)=>n<a.length-o);return{owner:L.Principal.fromUint8Array(Uint8Array.from(_)),subaccount:c}};0&&(module.exports={SnsGovernanceCanister,SnsGovernanceError,SnsLedgerCanister,SnsMetadataResponseEntries,SnsNeuronPermissionType,SnsRootCanister,SnsSwapCanister,SnsSwapLifecycle,SnsWrapper,decodeSnsAccount,encodeSnsAccount,initSnsWrapper});
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/index.ts", "../../src/enums/governance.enums.ts", "../../src/enums/swap.enums.ts", "../../src/errors/governance.errors.ts", "../../src/governance.canister.ts", "../../candid/sns_governance.certified.idl.js", "../../candid/sns_governance.idl.js", "../../src/converters/governance.converters.ts", "../../src/services/canister.ts", "../../src/ledger.canister.ts", "../../candid/icrc1_ledger.certified.idl.js", "../../candid/icrc1_ledger.idl.js", "../../src/root.canister.ts", "../../candid/sns_root.certified.idl.js", "../../candid/sns_root.idl.js", "../../src/sns.ts", "../../src/sns.wrapper.ts", "../../src/swap.canister.ts", "../../candid/sns_swap.certified.idl.js", "../../candid/sns_swap.idl.js", "../../src/types/ledger.responses.ts"],
4
- "sourcesContent": ["export type {\n GetMetadataResponse as SnsGetMetadataResponse,\n ManageNeuron as SnsManageNeuron,\n ManageNeuronResponse as SnsManageNeuronResponse,\n Neuron as SnsNeuron,\n NeuronId as SnsNeuronId,\n} from \"../candid/sns_governance\";\nexport type { CanisterStatusResultV2 as SnsCanisterStatus } from \"../candid/sns_root\";\nexport type {\n BuyerState as SnsSwapBuyerState,\n CfParticipant,\n DerivedState as SnsSwapDerivedState,\n GetBuyerStateRequest as SnsGetBuyerStateRequest,\n GetBuyerStateResponse as SnsGetBuyerStateResponse,\n Init as SnsSwapInit,\n Params as SnsParams,\n SnsNeuronRecipe,\n Swap as SnsSwap,\n TransferableAmount as SnsTransferableAmount,\n} from \"../candid/sns_swap\";\nexport * from \"./enums/governance.enums\";\nexport * from \"./enums/swap.enums\";\nexport * from \"./errors/governance.errors\";\nexport { SnsGovernanceCanister } from \"./governance.canister\";\nexport { SnsLedgerCanister } from \"./ledger.canister\";\nexport { SnsRootCanister } from \"./root.canister\";\nexport * from \"./sns\";\nexport * from \"./sns.wrapper\";\nexport { SnsSwapCanister } from \"./swap.canister\";\nexport type { SnsCanisterOptions } from \"./types/canister.options\";\nexport type {\n SnsGetNeuronParams,\n SnsListNeuronsParams,\n} from \"./types/governance.params\";\nexport * from \"./types/ledger.responses\";\nexport type { QueryParams } from \"./types/query.params\";\n", "// Source: https://github.com/dfinity/ic/blob/1998263b426df0a22f0d0706695c0826f0ab4d7d/rs/sns/governance/proto/ic_sns_governance/pb/v1/governance.proto#L10\nexport enum SnsNeuronPermissionType {\n NEURON_PERMISSION_TYPE_UNSPECIFIED = 0,\n\n // The principal has permission to configure the neuron's dissolve state. This includes\n // start dissolving, stop dissolving, and increasing the dissolve delay for the neuron.\n NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE = 1,\n\n // The principal has permission to add additional principals to modify the neuron.\n // The nervous system parameter `NervousSystemParameters::neuron_grantable_permissions`\n // determines the maximum set of privileges that a principal can grant to another principal in\n // the given SNS.\n NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS = 2,\n\n // The principal has permission to submit proposals on behalf of the neuron.\n // Submitting proposals can change a neuron's stake and thus this\n // is potentially a balance changing operation.\n NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL = 3,\n\n // The principal has permission to vote and follow other neurons on behalf of the neuron.\n NEURON_PERMISSION_TYPE_VOTE = 4,\n\n // The principal has permission to disburse the neuron.\n NEURON_PERMISSION_TYPE_DISBURSE = 5,\n\n // The principal has permission to split the neuron.\n NEURON_PERMISSION_TYPE_SPLIT = 6,\n\n // The principal has permission to merge the neuron's maturity into\n // the neuron's stake.\n NEURON_PERMISSION_TYPE_MERGE_MATURITY = 7,\n\n // The principal has permission to disburse the neuron's maturity to a\n // given ledger account.\n NEURON_PERMISSION_TYPE_DISBURSE_MATURITY = 8,\n}\n", "// Source: https://github.com/dfinity/ic/blob/master/rs/sns/swap/gen/ic_sns_swap.pb.v1.rs - Lifecycle\nexport enum SnsSwapLifecycle {\n Unspecified = 0,\n Pending = 1,\n Open = 2,\n Committed = 3,\n Aborted = 4,\n}\n", "export class SnsGovernanceError extends Error {}\n", "import type { Principal } from \"@dfinity/principal\";\nimport { createServices, fromNullable, toNullable } from \"@dfinity/utils\";\nimport type {\n GetMetadataResponse,\n ManageNeuron,\n ManageNeuronResponse,\n Neuron,\n NeuronId,\n _SERVICE as SnsGovernanceService,\n} from \"../candid/sns_governance\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/sns_governance.certified.idl\";\nimport { idlFactory } from \"../candid/sns_governance.idl\";\nimport { MAX_LIST_NEURONS_RESULTS } from \"./constants/governance.constants\";\nimport {\n toAddPermissionsRequest,\n toRemovePermissionsRequest,\n} from \"./converters/governance.converters\";\nimport { SnsGovernanceError } from \"./errors/governance.errors\";\nimport { Canister } from \"./services/canister\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type {\n SnsGetNeuronParams,\n SnsListNeuronsParams,\n SnsNeuronPermissionsParams,\n} from \"./types/governance.params\";\nimport type { QueryParams } from \"./types/query.params\";\n\nexport class SnsGovernanceCanister extends Canister<SnsGovernanceService> {\n /**\n * Instantiate a canister to interact with the governance of a Sns project.\n *\n * @param {SnsCanisterOptions} options Miscellaneous options to initialize the canister. Its ID being the only mandatory parammeter.\n */\n static create(options: SnsCanisterOptions<SnsGovernanceService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsGovernanceService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsGovernanceCanister(canisterId, service, certifiedService);\n }\n\n /**\n * List the neurons of the Sns\n */\n listNeurons = async (params: SnsListNeuronsParams): Promise<Neuron[]> => {\n const { principal, limit, beforeNeuronId } = params;\n\n const { neurons } = await this.caller(params).list_neurons({\n of_principal: toNullable<Principal>(principal),\n limit: limit ?? MAX_LIST_NEURONS_RESULTS,\n start_page_at: toNullable<NeuronId>(beforeNeuronId),\n });\n return neurons;\n };\n\n /**\n * Get the Sns metadata (title, description, etc.)\n */\n metadata = (params: QueryParams): Promise<GetMetadataResponse> =>\n this.caller(params).get_metadata({});\n\n /**\n * Get the neuron of the Sns\n */\n getNeuron = async (\n params: SnsGetNeuronParams & QueryParams\n ): Promise<Neuron> => {\n const { neuronId } = params;\n\n const { result } = await this.caller(params).get_neuron({\n neuron_id: toNullable(neuronId),\n });\n const data = fromNullable(result);\n if (data === undefined || \"Error\" in data) {\n throw new SnsGovernanceError(\n data?.Error.error_message ?? \"Response type not supported\"\n );\n }\n return data.Neuron;\n };\n\n /**\n * Manage neuron. For advanced users.\n */\n manageNeuron = async (\n request: ManageNeuron\n ): Promise<ManageNeuronResponse> => {\n const response = await this.caller({ certified: true }).manage_neuron(\n request\n );\n this.assertManageNeuronError(response);\n return response;\n };\n\n /**\n * Add permissions to a neuron for a specific principal\n */\n addNeuronPermissions = async (\n params: SnsNeuronPermissionsParams\n ): Promise<void> => {\n const request: ManageNeuron = toAddPermissionsRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Remove permissions to a neuron for a specific principal\n */\n removeNeuronPermissions = async (\n params: SnsNeuronPermissionsParams\n ): Promise<void> => {\n const request: ManageNeuron = toRemovePermissionsRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n *\n * @param response ManageNeuronResponse\n * @throws SnsGovernanceError\n */\n private assertManageNeuronError = ({\n command,\n }: ManageNeuronResponse): void => {\n // TODO: use upcoming fromDefinedNullable\n const firstCommand = command[0];\n if (firstCommand !== undefined && \"Error\" in firstCommand) {\n throw new SnsGovernanceError(firstCommand.Error.error_message);\n }\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_governance.did */\nexport const idlFactory = ({ IDL }) => {\n const GenericNervousSystemFunction = IDL.Record({\n 'validator_canister_id' : IDL.Opt(IDL.Principal),\n 'target_canister_id' : IDL.Opt(IDL.Principal),\n 'validator_method_name' : IDL.Opt(IDL.Text),\n 'target_method_name' : IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n 'NativeNervousSystemFunction' : IDL.Record({}),\n 'GenericNervousSystemFunction' : GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n 'id' : IDL.Nat64,\n 'name' : IDL.Text,\n 'description' : IDL.Opt(IDL.Text),\n 'function_type' : IDL.Opt(FunctionType),\n });\n const GovernanceCachedMetrics = IDL.Record({\n 'not_dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'garbage_collectable_neurons_count' : IDL.Nat64,\n 'neurons_with_invalid_stake_count' : IDL.Nat64,\n 'not_dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64,\n 'dissolved_neurons_count' : IDL.Nat64,\n 'total_staked_e8s' : IDL.Nat64,\n 'total_supply_governance_tokens' : IDL.Nat64,\n 'not_dissolving_neurons_count' : IDL.Nat64,\n 'dissolved_neurons_e8s' : IDL.Nat64,\n 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,\n 'dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'dissolving_neurons_count' : IDL.Nat64,\n 'dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'timestamp_seconds' : IDL.Nat64,\n });\n const NeuronId = IDL.Record({ 'id' : IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ 'followees' : IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n 'permissions' : IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n 'start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'final_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'initial_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'reward_rate_transition_duration_seconds' : IDL.Opt(IDL.Nat64),\n 'round_duration_seconds' : IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n 'default_followees' : IDL.Opt(DefaultFollowees),\n 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64),\n 'max_followees_per_function' : IDL.Opt(IDL.Nat64),\n 'neuron_claimer_permissions' : IDL.Opt(NeuronPermissionList),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'max_neuron_age_for_age_bonus' : IDL.Opt(IDL.Nat64),\n 'initial_voting_period_seconds' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_dissolve_delay_to_vote_seconds' : IDL.Opt(IDL.Nat64),\n 'reject_cost_e8s' : IDL.Opt(IDL.Nat64),\n 'max_proposals_to_keep_per_action' : IDL.Opt(IDL.Nat32),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Opt(IDL.Nat64),\n 'max_number_of_neurons' : IDL.Opt(IDL.Nat64),\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'max_number_of_proposals_with_ballots' : IDL.Opt(IDL.Nat64),\n 'neuron_grantable_permissions' : IDL.Opt(NeuronPermissionList),\n 'voting_rewards_parameters' : IDL.Opt(VotingRewardsParameters),\n 'max_number_of_principals_per_neuron' : IDL.Opt(IDL.Nat64),\n });\n const Version = IDL.Record({\n 'archive_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'root_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'swap_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'ledger_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'governance_wasm_hash' : IDL.Vec(IDL.Nat8),\n });\n const ProposalId = IDL.Record({ 'id' : IDL.Nat64 });\n const RewardEvent = IDL.Record({\n 'actual_timestamp_seconds' : IDL.Nat64,\n 'distributed_e8s_equivalent' : IDL.Nat64,\n 'round' : IDL.Nat64,\n 'settled_proposals' : IDL.Vec(ProposalId),\n });\n const UpgradeInProgress = IDL.Record({\n 'mark_failed_at_seconds' : IDL.Nat64,\n 'checking_upgrade_lock' : IDL.Nat64,\n 'proposal_id' : IDL.Nat64,\n 'target_version' : IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Ballot = IDL.Record({\n 'vote' : IDL.Int32,\n 'cast_timestamp_seconds' : IDL.Nat64,\n 'voting_power' : IDL.Nat64,\n });\n const Tally = IDL.Record({\n 'no' : IDL.Nat64,\n 'yes' : IDL.Nat64,\n 'total' : IDL.Nat64,\n 'timestamp_seconds' : IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n 'new_canister_wasm' : IDL.Vec(IDL.Nat8),\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const ManageSnsMetadata = IDL.Record({\n 'url' : IDL.Opt(IDL.Text),\n 'logo' : IDL.Opt(IDL.Text),\n 'name' : IDL.Opt(IDL.Text),\n 'description' : IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'payload' : IDL.Vec(IDL.Nat8),\n });\n const Motion = IDL.Record({ 'motion_text' : IDL.Text });\n const Action = IDL.Variant({\n 'ManageNervousSystemParameters' : NervousSystemParameters,\n 'AddGenericNervousSystemFunction' : NervousSystemFunction,\n 'RemoveGenericNervousSystemFunction' : IDL.Nat64,\n 'UpgradeSnsToNextVersion' : IDL.Record({}),\n 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,\n 'Unspecified' : IDL.Record({}),\n 'ManageSnsMetadata' : ManageSnsMetadata,\n 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,\n 'Motion' : Motion,\n });\n const Proposal = IDL.Record({\n 'url' : IDL.Text,\n 'title' : IDL.Text,\n 'action' : IDL.Opt(Action),\n 'summary' : IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n 'current_deadline_timestamp_seconds' : IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n 'id' : IDL.Opt(ProposalId),\n 'payload_text_rendering' : IDL.Opt(IDL.Text),\n 'action' : IDL.Nat64,\n 'failure_reason' : IDL.Opt(GovernanceError),\n 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n 'reward_event_round' : IDL.Nat64,\n 'failed_timestamp_seconds' : IDL.Nat64,\n 'proposal_creation_timestamp_seconds' : IDL.Nat64,\n 'initial_voting_period_seconds' : IDL.Nat64,\n 'reject_cost_e8s' : IDL.Nat64,\n 'latest_tally' : IDL.Opt(Tally),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Nat64,\n 'decided_timestamp_seconds' : IDL.Nat64,\n 'proposal' : IDL.Opt(Proposal),\n 'proposer' : IDL.Opt(NeuronId),\n 'wait_for_quiet_state' : IDL.Opt(WaitForQuietState),\n 'is_eligible_for_rewards' : IDL.Bool,\n 'executed_timestamp_seconds' : IDL.Nat64,\n });\n const Split = IDL.Record({ 'memo' : IDL.Nat64, 'amount_e8s' : IDL.Nat64 });\n const Follow = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'followees' : IDL.Vec(NeuronId),\n });\n const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n 'owner' : IDL.Opt(IDL.Principal),\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const DisburseMaturity = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'percentage_to_disburse' : IDL.Nat32,\n });\n const IncreaseDissolveDelay = IDL.Record({\n 'additional_dissolve_delay_seconds' : IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n 'dissolve_timestamp_seconds' : IDL.Nat64,\n });\n const Operation = IDL.Variant({\n 'StopDissolving' : IDL.Record({}),\n 'StartDissolving' : IDL.Record({}),\n 'IncreaseDissolveDelay' : IncreaseDissolveDelay,\n 'SetDissolveTimestamp' : SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ 'operation' : IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n 'vote' : IDL.Int32,\n 'proposal' : IDL.Opt(ProposalId),\n });\n const MemoAndController = IDL.Record({\n 'controller' : IDL.Opt(IDL.Principal),\n 'memo' : IDL.Nat64,\n });\n const By = IDL.Variant({\n 'MemoAndController' : MemoAndController,\n 'NeuronId' : IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ 'by' : IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n 'permissions_to_remove' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n 'permissions_to_add' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });\n const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });\n const Disburse = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'amount' : IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n 'Split' : Split,\n 'Follow' : Follow,\n 'DisburseMaturity' : DisburseMaturity,\n 'Configure' : Configure,\n 'RegisterVote' : RegisterVote,\n 'MakeProposal' : Proposal,\n 'ClaimOrRefreshNeuron' : ClaimOrRefresh,\n 'RemoveNeuronPermissions' : RemoveNeuronPermissions,\n 'AddNeuronPermissions' : AddNeuronPermissions,\n 'MergeMaturity' : MergeMaturity,\n 'Disburse' : Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n 'command' : IDL.Opt(Command_2),\n 'timestamp' : IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n 'principal' : IDL.Opt(IDL.Principal),\n 'permission_type' : IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n 'DissolveDelaySeconds' : IDL.Nat64,\n 'WhenDissolvedTimestampSeconds' : IDL.Nat64,\n });\n const Neuron = IDL.Record({\n 'id' : IDL.Opt(NeuronId),\n 'permissions' : IDL.Vec(NeuronPermission),\n 'maturity_e8s_equivalent' : IDL.Nat64,\n 'cached_neuron_stake_e8s' : IDL.Nat64,\n 'created_timestamp_seconds' : IDL.Nat64,\n 'aging_since_timestamp_seconds' : IDL.Nat64,\n 'dissolve_state' : IDL.Opt(DissolveState),\n 'voting_power_percentage_multiplier' : IDL.Nat64,\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n 'neuron_fees_e8s' : IDL.Nat64,\n });\n const Governance = IDL.Record({\n 'root_canister_id' : IDL.Opt(IDL.Principal),\n 'id_to_nervous_system_functions' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction)\n ),\n 'metrics' : IDL.Opt(GovernanceCachedMetrics),\n 'mode' : IDL.Int32,\n 'parameters' : IDL.Opt(NervousSystemParameters),\n 'deployed_version' : IDL.Opt(Version),\n 'sns_initialization_parameters' : IDL.Text,\n 'latest_reward_event' : IDL.Opt(RewardEvent),\n 'pending_version' : IDL.Opt(UpgradeInProgress),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n 'sns_metadata' : IDL.Opt(ManageSnsMetadata),\n 'neurons' : IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n 'genesis_timestamp_seconds' : IDL.Nat64,\n });\n const GetMetadataResponse = IDL.Record({\n 'url' : IDL.Opt(IDL.Text),\n 'logo' : IDL.Opt(IDL.Text),\n 'name' : IDL.Opt(IDL.Text),\n 'description' : IDL.Opt(IDL.Text),\n });\n const GetNeuron = IDL.Record({ 'neuron_id' : IDL.Opt(NeuronId) });\n const Result = IDL.Variant({ 'Error' : GovernanceError, 'Neuron' : Neuron });\n const GetNeuronResponse = IDL.Record({ 'result' : IDL.Opt(Result) });\n const GetProposal = IDL.Record({ 'proposal_id' : IDL.Opt(ProposalId) });\n const Result_1 = IDL.Variant({\n 'Error' : GovernanceError,\n 'Proposal' : ProposalData,\n });\n const GetProposalResponse = IDL.Record({ 'result' : IDL.Opt(Result_1) });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'controller' : IDL.Principal,\n 'freezing_threshold' : IDL.Nat,\n 'controllers' : IDL.Vec(IDL.Principal),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType,\n 'freezing_threshold' : IDL.Nat,\n 'balance' : IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)),\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetRunningSnsVersionResponse = IDL.Record({\n 'deployed_version' : IDL.Opt(Version),\n 'pending_version' : IDL.Opt(UpgradeInProgress),\n });\n const GetSnsInitializationParametersResponse = IDL.Record({\n 'sns_initialization_parameters' : IDL.Text,\n });\n const ListNervousSystemFunctionsResponse = IDL.Record({\n 'reserved_ids' : IDL.Vec(IDL.Nat64),\n 'functions' : IDL.Vec(NervousSystemFunction),\n });\n const ListNeurons = IDL.Record({\n 'of_principal' : IDL.Opt(IDL.Principal),\n 'limit' : IDL.Nat32,\n 'start_page_at' : IDL.Opt(NeuronId),\n });\n const ListNeuronsResponse = IDL.Record({ 'neurons' : IDL.Vec(Neuron) });\n const ListProposals = IDL.Record({\n 'include_reward_status' : IDL.Vec(IDL.Int32),\n 'before_proposal' : IDL.Opt(ProposalId),\n 'limit' : IDL.Nat32,\n 'exclude_type' : IDL.Vec(IDL.Nat64),\n 'include_status' : IDL.Vec(IDL.Int32),\n });\n const ListProposalsResponse = IDL.Record({\n 'proposals' : IDL.Vec(ProposalData),\n });\n const Command = IDL.Variant({\n 'Split' : Split,\n 'Follow' : Follow,\n 'DisburseMaturity' : DisburseMaturity,\n 'ClaimOrRefresh' : ClaimOrRefresh,\n 'Configure' : Configure,\n 'RegisterVote' : RegisterVote,\n 'MakeProposal' : Proposal,\n 'RemoveNeuronPermissions' : RemoveNeuronPermissions,\n 'AddNeuronPermissions' : AddNeuronPermissions,\n 'MergeMaturity' : MergeMaturity,\n 'Disburse' : Disburse,\n });\n const ManageNeuron = IDL.Record({\n 'subaccount' : IDL.Vec(IDL.Nat8),\n 'command' : IDL.Opt(Command),\n });\n const SplitResponse = IDL.Record({ 'created_neuron_id' : IDL.Opt(NeuronId) });\n const DisburseMaturityResponse = IDL.Record({\n 'transfer_block_height' : IDL.Nat64,\n 'amount_disbursed_e8s' : IDL.Nat64,\n });\n const ClaimOrRefreshResponse = IDL.Record({\n 'refreshed_neuron_id' : IDL.Opt(NeuronId),\n });\n const MergeMaturityResponse = IDL.Record({\n 'merged_maturity_e8s' : IDL.Nat64,\n 'new_stake_e8s' : IDL.Nat64,\n });\n const DisburseResponse = IDL.Record({ 'transfer_block_height' : IDL.Nat64 });\n const Command_1 = IDL.Variant({\n 'Error' : GovernanceError,\n 'Split' : SplitResponse,\n 'Follow' : IDL.Record({}),\n 'DisburseMaturity' : DisburseMaturityResponse,\n 'ClaimOrRefresh' : ClaimOrRefreshResponse,\n 'Configure' : IDL.Record({}),\n 'RegisterVote' : IDL.Record({}),\n 'MakeProposal' : GetProposal,\n 'RemoveNeuronPermission' : IDL.Record({}),\n 'MergeMaturity' : MergeMaturityResponse,\n 'Disburse' : DisburseResponse,\n 'AddNeuronPermission' : IDL.Record({}),\n });\n const ManageNeuronResponse = IDL.Record({ 'command' : IDL.Opt(Command_1) });\n const SetMode = IDL.Record({ 'mode' : IDL.Int32 });\n return IDL.Service({\n 'get_build_metadata' : IDL.Func([], [IDL.Text], []),\n 'get_metadata' : IDL.Func([IDL.Record({})], [GetMetadataResponse], []),\n 'get_nervous_system_parameters' : IDL.Func(\n [IDL.Null],\n [NervousSystemParameters],\n [],\n ),\n 'get_neuron' : IDL.Func([GetNeuron], [GetNeuronResponse], []),\n 'get_proposal' : IDL.Func([GetProposal], [GetProposalResponse], []),\n 'get_root_canister_status' : IDL.Func(\n [IDL.Null],\n [CanisterStatusResultV2],\n [],\n ),\n 'get_running_sns_version' : IDL.Func(\n [IDL.Record({})],\n [GetRunningSnsVersionResponse],\n [],\n ),\n 'get_sns_initialization_parameters' : IDL.Func(\n [IDL.Record({})],\n [GetSnsInitializationParametersResponse],\n [],\n ),\n 'list_nervous_system_functions' : IDL.Func(\n [],\n [ListNervousSystemFunctionsResponse],\n [],\n ),\n 'list_neurons' : IDL.Func([ListNeurons], [ListNeuronsResponse], []),\n 'list_proposals' : IDL.Func([ListProposals], [ListProposalsResponse], []),\n 'manage_neuron' : IDL.Func([ManageNeuron], [ManageNeuronResponse], []),\n 'set_mode' : IDL.Func([SetMode], [IDL.Record({})], []),\n });\n};\nexport const init = ({ IDL }) => {\n const GenericNervousSystemFunction = IDL.Record({\n 'validator_canister_id' : IDL.Opt(IDL.Principal),\n 'target_canister_id' : IDL.Opt(IDL.Principal),\n 'validator_method_name' : IDL.Opt(IDL.Text),\n 'target_method_name' : IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n 'NativeNervousSystemFunction' : IDL.Record({}),\n 'GenericNervousSystemFunction' : GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n 'id' : IDL.Nat64,\n 'name' : IDL.Text,\n 'description' : IDL.Opt(IDL.Text),\n 'function_type' : IDL.Opt(FunctionType),\n });\n const GovernanceCachedMetrics = IDL.Record({\n 'not_dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'garbage_collectable_neurons_count' : IDL.Nat64,\n 'neurons_with_invalid_stake_count' : IDL.Nat64,\n 'not_dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64,\n 'dissolved_neurons_count' : IDL.Nat64,\n 'total_staked_e8s' : IDL.Nat64,\n 'total_supply_governance_tokens' : IDL.Nat64,\n 'not_dissolving_neurons_count' : IDL.Nat64,\n 'dissolved_neurons_e8s' : IDL.Nat64,\n 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,\n 'dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'dissolving_neurons_count' : IDL.Nat64,\n 'dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'timestamp_seconds' : IDL.Nat64,\n });\n const NeuronId = IDL.Record({ 'id' : IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ 'followees' : IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n 'permissions' : IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n 'start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'final_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'initial_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'reward_rate_transition_duration_seconds' : IDL.Opt(IDL.Nat64),\n 'round_duration_seconds' : IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n 'default_followees' : IDL.Opt(DefaultFollowees),\n 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64),\n 'max_followees_per_function' : IDL.Opt(IDL.Nat64),\n 'neuron_claimer_permissions' : IDL.Opt(NeuronPermissionList),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'max_neuron_age_for_age_bonus' : IDL.Opt(IDL.Nat64),\n 'initial_voting_period_seconds' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_dissolve_delay_to_vote_seconds' : IDL.Opt(IDL.Nat64),\n 'reject_cost_e8s' : IDL.Opt(IDL.Nat64),\n 'max_proposals_to_keep_per_action' : IDL.Opt(IDL.Nat32),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Opt(IDL.Nat64),\n 'max_number_of_neurons' : IDL.Opt(IDL.Nat64),\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'max_number_of_proposals_with_ballots' : IDL.Opt(IDL.Nat64),\n 'neuron_grantable_permissions' : IDL.Opt(NeuronPermissionList),\n 'voting_rewards_parameters' : IDL.Opt(VotingRewardsParameters),\n 'max_number_of_principals_per_neuron' : IDL.Opt(IDL.Nat64),\n });\n const Version = IDL.Record({\n 'archive_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'root_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'swap_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'ledger_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'governance_wasm_hash' : IDL.Vec(IDL.Nat8),\n });\n const ProposalId = IDL.Record({ 'id' : IDL.Nat64 });\n const RewardEvent = IDL.Record({\n 'actual_timestamp_seconds' : IDL.Nat64,\n 'distributed_e8s_equivalent' : IDL.Nat64,\n 'round' : IDL.Nat64,\n 'settled_proposals' : IDL.Vec(ProposalId),\n });\n const UpgradeInProgress = IDL.Record({\n 'mark_failed_at_seconds' : IDL.Nat64,\n 'checking_upgrade_lock' : IDL.Nat64,\n 'proposal_id' : IDL.Nat64,\n 'target_version' : IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Ballot = IDL.Record({\n 'vote' : IDL.Int32,\n 'cast_timestamp_seconds' : IDL.Nat64,\n 'voting_power' : IDL.Nat64,\n });\n const Tally = IDL.Record({\n 'no' : IDL.Nat64,\n 'yes' : IDL.Nat64,\n 'total' : IDL.Nat64,\n 'timestamp_seconds' : IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n 'new_canister_wasm' : IDL.Vec(IDL.Nat8),\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const ManageSnsMetadata = IDL.Record({\n 'url' : IDL.Opt(IDL.Text),\n 'logo' : IDL.Opt(IDL.Text),\n 'name' : IDL.Opt(IDL.Text),\n 'description' : IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'payload' : IDL.Vec(IDL.Nat8),\n });\n const Motion = IDL.Record({ 'motion_text' : IDL.Text });\n const Action = IDL.Variant({\n 'ManageNervousSystemParameters' : NervousSystemParameters,\n 'AddGenericNervousSystemFunction' : NervousSystemFunction,\n 'RemoveGenericNervousSystemFunction' : IDL.Nat64,\n 'UpgradeSnsToNextVersion' : IDL.Record({}),\n 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,\n 'Unspecified' : IDL.Record({}),\n 'ManageSnsMetadata' : ManageSnsMetadata,\n 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,\n 'Motion' : Motion,\n });\n const Proposal = IDL.Record({\n 'url' : IDL.Text,\n 'title' : IDL.Text,\n 'action' : IDL.Opt(Action),\n 'summary' : IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n 'current_deadline_timestamp_seconds' : IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n 'id' : IDL.Opt(ProposalId),\n 'payload_text_rendering' : IDL.Opt(IDL.Text),\n 'action' : IDL.Nat64,\n 'failure_reason' : IDL.Opt(GovernanceError),\n 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n 'reward_event_round' : IDL.Nat64,\n 'failed_timestamp_seconds' : IDL.Nat64,\n 'proposal_creation_timestamp_seconds' : IDL.Nat64,\n 'initial_voting_period_seconds' : IDL.Nat64,\n 'reject_cost_e8s' : IDL.Nat64,\n 'latest_tally' : IDL.Opt(Tally),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Nat64,\n 'decided_timestamp_seconds' : IDL.Nat64,\n 'proposal' : IDL.Opt(Proposal),\n 'proposer' : IDL.Opt(NeuronId),\n 'wait_for_quiet_state' : IDL.Opt(WaitForQuietState),\n 'is_eligible_for_rewards' : IDL.Bool,\n 'executed_timestamp_seconds' : IDL.Nat64,\n });\n const Split = IDL.Record({ 'memo' : IDL.Nat64, 'amount_e8s' : IDL.Nat64 });\n const Follow = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'followees' : IDL.Vec(NeuronId),\n });\n const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n 'owner' : IDL.Opt(IDL.Principal),\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const DisburseMaturity = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'percentage_to_disburse' : IDL.Nat32,\n });\n const IncreaseDissolveDelay = IDL.Record({\n 'additional_dissolve_delay_seconds' : IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n 'dissolve_timestamp_seconds' : IDL.Nat64,\n });\n const Operation = IDL.Variant({\n 'StopDissolving' : IDL.Record({}),\n 'StartDissolving' : IDL.Record({}),\n 'IncreaseDissolveDelay' : IncreaseDissolveDelay,\n 'SetDissolveTimestamp' : SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ 'operation' : IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n 'vote' : IDL.Int32,\n 'proposal' : IDL.Opt(ProposalId),\n });\n const MemoAndController = IDL.Record({\n 'controller' : IDL.Opt(IDL.Principal),\n 'memo' : IDL.Nat64,\n });\n const By = IDL.Variant({\n 'MemoAndController' : MemoAndController,\n 'NeuronId' : IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ 'by' : IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n 'permissions_to_remove' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n 'permissions_to_add' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });\n const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });\n const Disburse = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'amount' : IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n 'Split' : Split,\n 'Follow' : Follow,\n 'DisburseMaturity' : DisburseMaturity,\n 'Configure' : Configure,\n 'RegisterVote' : RegisterVote,\n 'MakeProposal' : Proposal,\n 'ClaimOrRefreshNeuron' : ClaimOrRefresh,\n 'RemoveNeuronPermissions' : RemoveNeuronPermissions,\n 'AddNeuronPermissions' : AddNeuronPermissions,\n 'MergeMaturity' : MergeMaturity,\n 'Disburse' : Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n 'command' : IDL.Opt(Command_2),\n 'timestamp' : IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n 'principal' : IDL.Opt(IDL.Principal),\n 'permission_type' : IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n 'DissolveDelaySeconds' : IDL.Nat64,\n 'WhenDissolvedTimestampSeconds' : IDL.Nat64,\n });\n const Neuron = IDL.Record({\n 'id' : IDL.Opt(NeuronId),\n 'permissions' : IDL.Vec(NeuronPermission),\n 'maturity_e8s_equivalent' : IDL.Nat64,\n 'cached_neuron_stake_e8s' : IDL.Nat64,\n 'created_timestamp_seconds' : IDL.Nat64,\n 'aging_since_timestamp_seconds' : IDL.Nat64,\n 'dissolve_state' : IDL.Opt(DissolveState),\n 'voting_power_percentage_multiplier' : IDL.Nat64,\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n 'neuron_fees_e8s' : IDL.Nat64,\n });\n const Governance = IDL.Record({\n 'root_canister_id' : IDL.Opt(IDL.Principal),\n 'id_to_nervous_system_functions' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction)\n ),\n 'metrics' : IDL.Opt(GovernanceCachedMetrics),\n 'mode' : IDL.Int32,\n 'parameters' : IDL.Opt(NervousSystemParameters),\n 'deployed_version' : IDL.Opt(Version),\n 'sns_initialization_parameters' : IDL.Text,\n 'latest_reward_event' : IDL.Opt(RewardEvent),\n 'pending_version' : IDL.Opt(UpgradeInProgress),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n 'sns_metadata' : IDL.Opt(ManageSnsMetadata),\n 'neurons' : IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n 'genesis_timestamp_seconds' : IDL.Nat64,\n });\n return [Governance];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_governance.did */\nexport const idlFactory = ({ IDL }) => {\n const GenericNervousSystemFunction = IDL.Record({\n 'validator_canister_id' : IDL.Opt(IDL.Principal),\n 'target_canister_id' : IDL.Opt(IDL.Principal),\n 'validator_method_name' : IDL.Opt(IDL.Text),\n 'target_method_name' : IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n 'NativeNervousSystemFunction' : IDL.Record({}),\n 'GenericNervousSystemFunction' : GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n 'id' : IDL.Nat64,\n 'name' : IDL.Text,\n 'description' : IDL.Opt(IDL.Text),\n 'function_type' : IDL.Opt(FunctionType),\n });\n const GovernanceCachedMetrics = IDL.Record({\n 'not_dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'garbage_collectable_neurons_count' : IDL.Nat64,\n 'neurons_with_invalid_stake_count' : IDL.Nat64,\n 'not_dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64,\n 'dissolved_neurons_count' : IDL.Nat64,\n 'total_staked_e8s' : IDL.Nat64,\n 'total_supply_governance_tokens' : IDL.Nat64,\n 'not_dissolving_neurons_count' : IDL.Nat64,\n 'dissolved_neurons_e8s' : IDL.Nat64,\n 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,\n 'dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'dissolving_neurons_count' : IDL.Nat64,\n 'dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'timestamp_seconds' : IDL.Nat64,\n });\n const NeuronId = IDL.Record({ 'id' : IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ 'followees' : IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n 'permissions' : IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n 'start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'final_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'initial_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'reward_rate_transition_duration_seconds' : IDL.Opt(IDL.Nat64),\n 'round_duration_seconds' : IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n 'default_followees' : IDL.Opt(DefaultFollowees),\n 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64),\n 'max_followees_per_function' : IDL.Opt(IDL.Nat64),\n 'neuron_claimer_permissions' : IDL.Opt(NeuronPermissionList),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'max_neuron_age_for_age_bonus' : IDL.Opt(IDL.Nat64),\n 'initial_voting_period_seconds' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_dissolve_delay_to_vote_seconds' : IDL.Opt(IDL.Nat64),\n 'reject_cost_e8s' : IDL.Opt(IDL.Nat64),\n 'max_proposals_to_keep_per_action' : IDL.Opt(IDL.Nat32),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Opt(IDL.Nat64),\n 'max_number_of_neurons' : IDL.Opt(IDL.Nat64),\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'max_number_of_proposals_with_ballots' : IDL.Opt(IDL.Nat64),\n 'neuron_grantable_permissions' : IDL.Opt(NeuronPermissionList),\n 'voting_rewards_parameters' : IDL.Opt(VotingRewardsParameters),\n 'max_number_of_principals_per_neuron' : IDL.Opt(IDL.Nat64),\n });\n const Version = IDL.Record({\n 'archive_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'root_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'swap_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'ledger_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'governance_wasm_hash' : IDL.Vec(IDL.Nat8),\n });\n const ProposalId = IDL.Record({ 'id' : IDL.Nat64 });\n const RewardEvent = IDL.Record({\n 'actual_timestamp_seconds' : IDL.Nat64,\n 'distributed_e8s_equivalent' : IDL.Nat64,\n 'round' : IDL.Nat64,\n 'settled_proposals' : IDL.Vec(ProposalId),\n });\n const UpgradeInProgress = IDL.Record({\n 'mark_failed_at_seconds' : IDL.Nat64,\n 'checking_upgrade_lock' : IDL.Nat64,\n 'proposal_id' : IDL.Nat64,\n 'target_version' : IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Ballot = IDL.Record({\n 'vote' : IDL.Int32,\n 'cast_timestamp_seconds' : IDL.Nat64,\n 'voting_power' : IDL.Nat64,\n });\n const Tally = IDL.Record({\n 'no' : IDL.Nat64,\n 'yes' : IDL.Nat64,\n 'total' : IDL.Nat64,\n 'timestamp_seconds' : IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n 'new_canister_wasm' : IDL.Vec(IDL.Nat8),\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const ManageSnsMetadata = IDL.Record({\n 'url' : IDL.Opt(IDL.Text),\n 'logo' : IDL.Opt(IDL.Text),\n 'name' : IDL.Opt(IDL.Text),\n 'description' : IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'payload' : IDL.Vec(IDL.Nat8),\n });\n const Motion = IDL.Record({ 'motion_text' : IDL.Text });\n const Action = IDL.Variant({\n 'ManageNervousSystemParameters' : NervousSystemParameters,\n 'AddGenericNervousSystemFunction' : NervousSystemFunction,\n 'RemoveGenericNervousSystemFunction' : IDL.Nat64,\n 'UpgradeSnsToNextVersion' : IDL.Record({}),\n 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,\n 'Unspecified' : IDL.Record({}),\n 'ManageSnsMetadata' : ManageSnsMetadata,\n 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,\n 'Motion' : Motion,\n });\n const Proposal = IDL.Record({\n 'url' : IDL.Text,\n 'title' : IDL.Text,\n 'action' : IDL.Opt(Action),\n 'summary' : IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n 'current_deadline_timestamp_seconds' : IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n 'id' : IDL.Opt(ProposalId),\n 'payload_text_rendering' : IDL.Opt(IDL.Text),\n 'action' : IDL.Nat64,\n 'failure_reason' : IDL.Opt(GovernanceError),\n 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n 'reward_event_round' : IDL.Nat64,\n 'failed_timestamp_seconds' : IDL.Nat64,\n 'proposal_creation_timestamp_seconds' : IDL.Nat64,\n 'initial_voting_period_seconds' : IDL.Nat64,\n 'reject_cost_e8s' : IDL.Nat64,\n 'latest_tally' : IDL.Opt(Tally),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Nat64,\n 'decided_timestamp_seconds' : IDL.Nat64,\n 'proposal' : IDL.Opt(Proposal),\n 'proposer' : IDL.Opt(NeuronId),\n 'wait_for_quiet_state' : IDL.Opt(WaitForQuietState),\n 'is_eligible_for_rewards' : IDL.Bool,\n 'executed_timestamp_seconds' : IDL.Nat64,\n });\n const Split = IDL.Record({ 'memo' : IDL.Nat64, 'amount_e8s' : IDL.Nat64 });\n const Follow = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'followees' : IDL.Vec(NeuronId),\n });\n const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n 'owner' : IDL.Opt(IDL.Principal),\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const DisburseMaturity = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'percentage_to_disburse' : IDL.Nat32,\n });\n const IncreaseDissolveDelay = IDL.Record({\n 'additional_dissolve_delay_seconds' : IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n 'dissolve_timestamp_seconds' : IDL.Nat64,\n });\n const Operation = IDL.Variant({\n 'StopDissolving' : IDL.Record({}),\n 'StartDissolving' : IDL.Record({}),\n 'IncreaseDissolveDelay' : IncreaseDissolveDelay,\n 'SetDissolveTimestamp' : SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ 'operation' : IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n 'vote' : IDL.Int32,\n 'proposal' : IDL.Opt(ProposalId),\n });\n const MemoAndController = IDL.Record({\n 'controller' : IDL.Opt(IDL.Principal),\n 'memo' : IDL.Nat64,\n });\n const By = IDL.Variant({\n 'MemoAndController' : MemoAndController,\n 'NeuronId' : IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ 'by' : IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n 'permissions_to_remove' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n 'permissions_to_add' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });\n const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });\n const Disburse = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'amount' : IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n 'Split' : Split,\n 'Follow' : Follow,\n 'DisburseMaturity' : DisburseMaturity,\n 'Configure' : Configure,\n 'RegisterVote' : RegisterVote,\n 'MakeProposal' : Proposal,\n 'ClaimOrRefreshNeuron' : ClaimOrRefresh,\n 'RemoveNeuronPermissions' : RemoveNeuronPermissions,\n 'AddNeuronPermissions' : AddNeuronPermissions,\n 'MergeMaturity' : MergeMaturity,\n 'Disburse' : Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n 'command' : IDL.Opt(Command_2),\n 'timestamp' : IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n 'principal' : IDL.Opt(IDL.Principal),\n 'permission_type' : IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n 'DissolveDelaySeconds' : IDL.Nat64,\n 'WhenDissolvedTimestampSeconds' : IDL.Nat64,\n });\n const Neuron = IDL.Record({\n 'id' : IDL.Opt(NeuronId),\n 'permissions' : IDL.Vec(NeuronPermission),\n 'maturity_e8s_equivalent' : IDL.Nat64,\n 'cached_neuron_stake_e8s' : IDL.Nat64,\n 'created_timestamp_seconds' : IDL.Nat64,\n 'aging_since_timestamp_seconds' : IDL.Nat64,\n 'dissolve_state' : IDL.Opt(DissolveState),\n 'voting_power_percentage_multiplier' : IDL.Nat64,\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n 'neuron_fees_e8s' : IDL.Nat64,\n });\n const Governance = IDL.Record({\n 'root_canister_id' : IDL.Opt(IDL.Principal),\n 'id_to_nervous_system_functions' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction)\n ),\n 'metrics' : IDL.Opt(GovernanceCachedMetrics),\n 'mode' : IDL.Int32,\n 'parameters' : IDL.Opt(NervousSystemParameters),\n 'deployed_version' : IDL.Opt(Version),\n 'sns_initialization_parameters' : IDL.Text,\n 'latest_reward_event' : IDL.Opt(RewardEvent),\n 'pending_version' : IDL.Opt(UpgradeInProgress),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n 'sns_metadata' : IDL.Opt(ManageSnsMetadata),\n 'neurons' : IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n 'genesis_timestamp_seconds' : IDL.Nat64,\n });\n const GetMetadataResponse = IDL.Record({\n 'url' : IDL.Opt(IDL.Text),\n 'logo' : IDL.Opt(IDL.Text),\n 'name' : IDL.Opt(IDL.Text),\n 'description' : IDL.Opt(IDL.Text),\n });\n const GetNeuron = IDL.Record({ 'neuron_id' : IDL.Opt(NeuronId) });\n const Result = IDL.Variant({ 'Error' : GovernanceError, 'Neuron' : Neuron });\n const GetNeuronResponse = IDL.Record({ 'result' : IDL.Opt(Result) });\n const GetProposal = IDL.Record({ 'proposal_id' : IDL.Opt(ProposalId) });\n const Result_1 = IDL.Variant({\n 'Error' : GovernanceError,\n 'Proposal' : ProposalData,\n });\n const GetProposalResponse = IDL.Record({ 'result' : IDL.Opt(Result_1) });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'controller' : IDL.Principal,\n 'freezing_threshold' : IDL.Nat,\n 'controllers' : IDL.Vec(IDL.Principal),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType,\n 'freezing_threshold' : IDL.Nat,\n 'balance' : IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)),\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetRunningSnsVersionResponse = IDL.Record({\n 'deployed_version' : IDL.Opt(Version),\n 'pending_version' : IDL.Opt(UpgradeInProgress),\n });\n const GetSnsInitializationParametersResponse = IDL.Record({\n 'sns_initialization_parameters' : IDL.Text,\n });\n const ListNervousSystemFunctionsResponse = IDL.Record({\n 'reserved_ids' : IDL.Vec(IDL.Nat64),\n 'functions' : IDL.Vec(NervousSystemFunction),\n });\n const ListNeurons = IDL.Record({\n 'of_principal' : IDL.Opt(IDL.Principal),\n 'limit' : IDL.Nat32,\n 'start_page_at' : IDL.Opt(NeuronId),\n });\n const ListNeuronsResponse = IDL.Record({ 'neurons' : IDL.Vec(Neuron) });\n const ListProposals = IDL.Record({\n 'include_reward_status' : IDL.Vec(IDL.Int32),\n 'before_proposal' : IDL.Opt(ProposalId),\n 'limit' : IDL.Nat32,\n 'exclude_type' : IDL.Vec(IDL.Nat64),\n 'include_status' : IDL.Vec(IDL.Int32),\n });\n const ListProposalsResponse = IDL.Record({\n 'proposals' : IDL.Vec(ProposalData),\n });\n const Command = IDL.Variant({\n 'Split' : Split,\n 'Follow' : Follow,\n 'DisburseMaturity' : DisburseMaturity,\n 'ClaimOrRefresh' : ClaimOrRefresh,\n 'Configure' : Configure,\n 'RegisterVote' : RegisterVote,\n 'MakeProposal' : Proposal,\n 'RemoveNeuronPermissions' : RemoveNeuronPermissions,\n 'AddNeuronPermissions' : AddNeuronPermissions,\n 'MergeMaturity' : MergeMaturity,\n 'Disburse' : Disburse,\n });\n const ManageNeuron = IDL.Record({\n 'subaccount' : IDL.Vec(IDL.Nat8),\n 'command' : IDL.Opt(Command),\n });\n const SplitResponse = IDL.Record({ 'created_neuron_id' : IDL.Opt(NeuronId) });\n const DisburseMaturityResponse = IDL.Record({\n 'transfer_block_height' : IDL.Nat64,\n 'amount_disbursed_e8s' : IDL.Nat64,\n });\n const ClaimOrRefreshResponse = IDL.Record({\n 'refreshed_neuron_id' : IDL.Opt(NeuronId),\n });\n const MergeMaturityResponse = IDL.Record({\n 'merged_maturity_e8s' : IDL.Nat64,\n 'new_stake_e8s' : IDL.Nat64,\n });\n const DisburseResponse = IDL.Record({ 'transfer_block_height' : IDL.Nat64 });\n const Command_1 = IDL.Variant({\n 'Error' : GovernanceError,\n 'Split' : SplitResponse,\n 'Follow' : IDL.Record({}),\n 'DisburseMaturity' : DisburseMaturityResponse,\n 'ClaimOrRefresh' : ClaimOrRefreshResponse,\n 'Configure' : IDL.Record({}),\n 'RegisterVote' : IDL.Record({}),\n 'MakeProposal' : GetProposal,\n 'RemoveNeuronPermission' : IDL.Record({}),\n 'MergeMaturity' : MergeMaturityResponse,\n 'Disburse' : DisburseResponse,\n 'AddNeuronPermission' : IDL.Record({}),\n });\n const ManageNeuronResponse = IDL.Record({ 'command' : IDL.Opt(Command_1) });\n const SetMode = IDL.Record({ 'mode' : IDL.Int32 });\n return IDL.Service({\n 'get_build_metadata' : IDL.Func([], [IDL.Text], ['query']),\n 'get_metadata' : IDL.Func(\n [IDL.Record({})],\n [GetMetadataResponse],\n ['query'],\n ),\n 'get_nervous_system_parameters' : IDL.Func(\n [IDL.Null],\n [NervousSystemParameters],\n ['query'],\n ),\n 'get_neuron' : IDL.Func([GetNeuron], [GetNeuronResponse], ['query']),\n 'get_proposal' : IDL.Func([GetProposal], [GetProposalResponse], ['query']),\n 'get_root_canister_status' : IDL.Func(\n [IDL.Null],\n [CanisterStatusResultV2],\n [],\n ),\n 'get_running_sns_version' : IDL.Func(\n [IDL.Record({})],\n [GetRunningSnsVersionResponse],\n ['query'],\n ),\n 'get_sns_initialization_parameters' : IDL.Func(\n [IDL.Record({})],\n [GetSnsInitializationParametersResponse],\n ['query'],\n ),\n 'list_nervous_system_functions' : IDL.Func(\n [],\n [ListNervousSystemFunctionsResponse],\n ['query'],\n ),\n 'list_neurons' : IDL.Func([ListNeurons], [ListNeuronsResponse], ['query']),\n 'list_proposals' : IDL.Func(\n [ListProposals],\n [ListProposalsResponse],\n ['query'],\n ),\n 'manage_neuron' : IDL.Func([ManageNeuron], [ManageNeuronResponse], []),\n 'set_mode' : IDL.Func([SetMode], [IDL.Record({})], []),\n });\n};\nexport const init = ({ IDL }) => {\n const GenericNervousSystemFunction = IDL.Record({\n 'validator_canister_id' : IDL.Opt(IDL.Principal),\n 'target_canister_id' : IDL.Opt(IDL.Principal),\n 'validator_method_name' : IDL.Opt(IDL.Text),\n 'target_method_name' : IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n 'NativeNervousSystemFunction' : IDL.Record({}),\n 'GenericNervousSystemFunction' : GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n 'id' : IDL.Nat64,\n 'name' : IDL.Text,\n 'description' : IDL.Opt(IDL.Text),\n 'function_type' : IDL.Opt(FunctionType),\n });\n const GovernanceCachedMetrics = IDL.Record({\n 'not_dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'garbage_collectable_neurons_count' : IDL.Nat64,\n 'neurons_with_invalid_stake_count' : IDL.Nat64,\n 'not_dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64,\n 'dissolved_neurons_count' : IDL.Nat64,\n 'total_staked_e8s' : IDL.Nat64,\n 'total_supply_governance_tokens' : IDL.Nat64,\n 'not_dissolving_neurons_count' : IDL.Nat64,\n 'dissolved_neurons_e8s' : IDL.Nat64,\n 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,\n 'dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'dissolving_neurons_count' : IDL.Nat64,\n 'dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'timestamp_seconds' : IDL.Nat64,\n });\n const NeuronId = IDL.Record({ 'id' : IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ 'followees' : IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n 'permissions' : IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n 'start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'final_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'initial_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'reward_rate_transition_duration_seconds' : IDL.Opt(IDL.Nat64),\n 'round_duration_seconds' : IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n 'default_followees' : IDL.Opt(DefaultFollowees),\n 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64),\n 'max_followees_per_function' : IDL.Opt(IDL.Nat64),\n 'neuron_claimer_permissions' : IDL.Opt(NeuronPermissionList),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'max_neuron_age_for_age_bonus' : IDL.Opt(IDL.Nat64),\n 'initial_voting_period_seconds' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_dissolve_delay_to_vote_seconds' : IDL.Opt(IDL.Nat64),\n 'reject_cost_e8s' : IDL.Opt(IDL.Nat64),\n 'max_proposals_to_keep_per_action' : IDL.Opt(IDL.Nat32),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Opt(IDL.Nat64),\n 'max_number_of_neurons' : IDL.Opt(IDL.Nat64),\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'max_number_of_proposals_with_ballots' : IDL.Opt(IDL.Nat64),\n 'neuron_grantable_permissions' : IDL.Opt(NeuronPermissionList),\n 'voting_rewards_parameters' : IDL.Opt(VotingRewardsParameters),\n 'max_number_of_principals_per_neuron' : IDL.Opt(IDL.Nat64),\n });\n const Version = IDL.Record({\n 'archive_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'root_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'swap_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'ledger_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'governance_wasm_hash' : IDL.Vec(IDL.Nat8),\n });\n const ProposalId = IDL.Record({ 'id' : IDL.Nat64 });\n const RewardEvent = IDL.Record({\n 'actual_timestamp_seconds' : IDL.Nat64,\n 'distributed_e8s_equivalent' : IDL.Nat64,\n 'round' : IDL.Nat64,\n 'settled_proposals' : IDL.Vec(ProposalId),\n });\n const UpgradeInProgress = IDL.Record({\n 'mark_failed_at_seconds' : IDL.Nat64,\n 'checking_upgrade_lock' : IDL.Nat64,\n 'proposal_id' : IDL.Nat64,\n 'target_version' : IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Ballot = IDL.Record({\n 'vote' : IDL.Int32,\n 'cast_timestamp_seconds' : IDL.Nat64,\n 'voting_power' : IDL.Nat64,\n });\n const Tally = IDL.Record({\n 'no' : IDL.Nat64,\n 'yes' : IDL.Nat64,\n 'total' : IDL.Nat64,\n 'timestamp_seconds' : IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n 'new_canister_wasm' : IDL.Vec(IDL.Nat8),\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const ManageSnsMetadata = IDL.Record({\n 'url' : IDL.Opt(IDL.Text),\n 'logo' : IDL.Opt(IDL.Text),\n 'name' : IDL.Opt(IDL.Text),\n 'description' : IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'payload' : IDL.Vec(IDL.Nat8),\n });\n const Motion = IDL.Record({ 'motion_text' : IDL.Text });\n const Action = IDL.Variant({\n 'ManageNervousSystemParameters' : NervousSystemParameters,\n 'AddGenericNervousSystemFunction' : NervousSystemFunction,\n 'RemoveGenericNervousSystemFunction' : IDL.Nat64,\n 'UpgradeSnsToNextVersion' : IDL.Record({}),\n 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,\n 'Unspecified' : IDL.Record({}),\n 'ManageSnsMetadata' : ManageSnsMetadata,\n 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,\n 'Motion' : Motion,\n });\n const Proposal = IDL.Record({\n 'url' : IDL.Text,\n 'title' : IDL.Text,\n 'action' : IDL.Opt(Action),\n 'summary' : IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n 'current_deadline_timestamp_seconds' : IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n 'id' : IDL.Opt(ProposalId),\n 'payload_text_rendering' : IDL.Opt(IDL.Text),\n 'action' : IDL.Nat64,\n 'failure_reason' : IDL.Opt(GovernanceError),\n 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n 'reward_event_round' : IDL.Nat64,\n 'failed_timestamp_seconds' : IDL.Nat64,\n 'proposal_creation_timestamp_seconds' : IDL.Nat64,\n 'initial_voting_period_seconds' : IDL.Nat64,\n 'reject_cost_e8s' : IDL.Nat64,\n 'latest_tally' : IDL.Opt(Tally),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Nat64,\n 'decided_timestamp_seconds' : IDL.Nat64,\n 'proposal' : IDL.Opt(Proposal),\n 'proposer' : IDL.Opt(NeuronId),\n 'wait_for_quiet_state' : IDL.Opt(WaitForQuietState),\n 'is_eligible_for_rewards' : IDL.Bool,\n 'executed_timestamp_seconds' : IDL.Nat64,\n });\n const Split = IDL.Record({ 'memo' : IDL.Nat64, 'amount_e8s' : IDL.Nat64 });\n const Follow = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'followees' : IDL.Vec(NeuronId),\n });\n const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n 'owner' : IDL.Opt(IDL.Principal),\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const DisburseMaturity = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'percentage_to_disburse' : IDL.Nat32,\n });\n const IncreaseDissolveDelay = IDL.Record({\n 'additional_dissolve_delay_seconds' : IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n 'dissolve_timestamp_seconds' : IDL.Nat64,\n });\n const Operation = IDL.Variant({\n 'StopDissolving' : IDL.Record({}),\n 'StartDissolving' : IDL.Record({}),\n 'IncreaseDissolveDelay' : IncreaseDissolveDelay,\n 'SetDissolveTimestamp' : SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ 'operation' : IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n 'vote' : IDL.Int32,\n 'proposal' : IDL.Opt(ProposalId),\n });\n const MemoAndController = IDL.Record({\n 'controller' : IDL.Opt(IDL.Principal),\n 'memo' : IDL.Nat64,\n });\n const By = IDL.Variant({\n 'MemoAndController' : MemoAndController,\n 'NeuronId' : IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ 'by' : IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n 'permissions_to_remove' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n 'permissions_to_add' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });\n const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });\n const Disburse = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'amount' : IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n 'Split' : Split,\n 'Follow' : Follow,\n 'DisburseMaturity' : DisburseMaturity,\n 'Configure' : Configure,\n 'RegisterVote' : RegisterVote,\n 'MakeProposal' : Proposal,\n 'ClaimOrRefreshNeuron' : ClaimOrRefresh,\n 'RemoveNeuronPermissions' : RemoveNeuronPermissions,\n 'AddNeuronPermissions' : AddNeuronPermissions,\n 'MergeMaturity' : MergeMaturity,\n 'Disburse' : Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n 'command' : IDL.Opt(Command_2),\n 'timestamp' : IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n 'principal' : IDL.Opt(IDL.Principal),\n 'permission_type' : IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n 'DissolveDelaySeconds' : IDL.Nat64,\n 'WhenDissolvedTimestampSeconds' : IDL.Nat64,\n });\n const Neuron = IDL.Record({\n 'id' : IDL.Opt(NeuronId),\n 'permissions' : IDL.Vec(NeuronPermission),\n 'maturity_e8s_equivalent' : IDL.Nat64,\n 'cached_neuron_stake_e8s' : IDL.Nat64,\n 'created_timestamp_seconds' : IDL.Nat64,\n 'aging_since_timestamp_seconds' : IDL.Nat64,\n 'dissolve_state' : IDL.Opt(DissolveState),\n 'voting_power_percentage_multiplier' : IDL.Nat64,\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n 'neuron_fees_e8s' : IDL.Nat64,\n });\n const Governance = IDL.Record({\n 'root_canister_id' : IDL.Opt(IDL.Principal),\n 'id_to_nervous_system_functions' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction)\n ),\n 'metrics' : IDL.Opt(GovernanceCachedMetrics),\n 'mode' : IDL.Int32,\n 'parameters' : IDL.Opt(NervousSystemParameters),\n 'deployed_version' : IDL.Opt(Version),\n 'sns_initialization_parameters' : IDL.Text,\n 'latest_reward_event' : IDL.Opt(RewardEvent),\n 'pending_version' : IDL.Opt(UpgradeInProgress),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n 'sns_metadata' : IDL.Opt(ManageSnsMetadata),\n 'neurons' : IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n 'genesis_timestamp_seconds' : IDL.Nat64,\n });\n return [Governance];\n};\n", "import type { ManageNeuron } from \"../../candid/sns_governance\";\nimport type { SnsNeuronPermissionsParams } from \"../types/governance.params\";\n\nexport const toAddPermissionsRequest = ({\n neuronId,\n permissions,\n principal,\n}: SnsNeuronPermissionsParams): ManageNeuron => ({\n subaccount: neuronId.id,\n command: [\n {\n AddNeuronPermissions: {\n permissions_to_add: [{ permissions: Int32Array.from(permissions) }],\n principal_id: [principal],\n },\n },\n ],\n});\n\nexport const toRemovePermissionsRequest = ({\n neuronId,\n permissions,\n principal,\n}: SnsNeuronPermissionsParams): ManageNeuron => ({\n subaccount: neuronId.id,\n command: [\n {\n RemoveNeuronPermissions: {\n permissions_to_remove: [{ permissions: Int32Array.from(permissions) }],\n principal_id: [principal],\n },\n },\n ],\n});\n", "import type { Principal } from \"@dfinity/principal\";\nimport type { QueryParams } from \"../types/query.params\";\n\nexport abstract class Canister<T> {\n protected constructor(\n private readonly id: Principal,\n protected readonly service: T,\n protected readonly certifiedService: T\n ) {}\n\n get canisterId(): Principal {\n return this.id;\n }\n\n protected caller = ({ certified = true }: QueryParams): T =>\n certified ? this.certifiedService : this.service;\n}\n", "import { createServices, toNullable } from \"@dfinity/utils\";\nimport type {\n Tokens,\n _SERVICE as SnsLedgerService,\n} from \"../candid/icrc1_ledger\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/icrc1_ledger.certified.idl\";\nimport { idlFactory } from \"../candid/icrc1_ledger.idl\";\nimport { Canister } from \"./services/canister\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type { BalanceParams } from \"./types/ledger.params\";\nimport type { SnsTokenMetadataResponse } from \"./types/ledger.responses\";\nimport type { QueryParams } from \"./types/query.params\";\n\nexport class SnsLedgerCanister extends Canister<SnsLedgerService> {\n static create(options: SnsCanisterOptions<SnsLedgerService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsLedgerService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsLedgerCanister(canisterId, service, certifiedService);\n }\n\n /**\n * The token metadata (name, symbol, etc.).\n */\n metadata = (params: QueryParams): Promise<SnsTokenMetadataResponse> =>\n this.caller(params).icrc1_metadata();\n\n /**\n * Returns the balance of the given account.\n *\n * @param {BalanceParams} params The parameters to get the balance of an account.\n * @returns {Promise<Tokens>} The balance of the given account.\n */\n balance = (params: BalanceParams): Promise<Tokens> =>\n this.caller({ certified: params.certified }).icrc1_balance_of({\n owner: params.owner,\n subaccount: toNullable(params.subaccount),\n });\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/icrc1_ledger.did */\nexport const idlFactory = ({ IDL }) => {\n const Value = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const InitArgs = IDL.Record({\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat64,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, Value)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat64)),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'trigger_threshold' : IDL.Nat64,\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'token_name' : IDL.Text,\n });\n const Tokens = IDL.Nat;\n const Timestamp = IDL.Nat64;\n const TransferArg = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(Tokens),\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'from_subaccount' : IDL.Opt(Subaccount),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : Tokens,\n });\n const BlockIndex = IDL.Nat;\n const TransferError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'BadBurn' : IDL.Record({ 'min_burn_amount' : Tokens }),\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : Tokens }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : IDL.Nat64 }),\n 'TooOld' : IDL.Null,\n 'InsufficientFunds' : IDL.Record({ 'balance' : Tokens }),\n });\n const TransferResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : TransferError,\n });\n return IDL.Service({\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], []),\n 'icrc1_decimals' : IDL.Func([], [IDL.Nat8], []),\n 'icrc1_fee' : IDL.Func([], [Tokens], []),\n 'icrc1_metadata' : IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, Value))], []),\n 'icrc1_minting_account' : IDL.Func([], [IDL.Opt(Account)], []),\n 'icrc1_name' : IDL.Func([], [IDL.Text], []),\n 'icrc1_supported_standards' : IDL.Func(\n [],\n [IDL.Vec(IDL.Record({ 'url' : IDL.Text, 'name' : IDL.Text }))],\n [],\n ),\n 'icrc1_symbol' : IDL.Func([], [IDL.Text], []),\n 'icrc1_total_supply' : IDL.Func([], [Tokens], []),\n 'icrc1_transfer' : IDL.Func([TransferArg], [TransferResult], []),\n });\n};\nexport const init = ({ IDL }) => {\n const Value = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const InitArgs = IDL.Record({\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat64,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, Value)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat64)),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'trigger_threshold' : IDL.Nat64,\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'token_name' : IDL.Text,\n });\n return [InitArgs];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/icrc1_ledger.did */\nexport const idlFactory = ({ IDL }) => {\n const Value = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const InitArgs = IDL.Record({\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat64,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, Value)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat64)),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'trigger_threshold' : IDL.Nat64,\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'token_name' : IDL.Text,\n });\n const Tokens = IDL.Nat;\n const Timestamp = IDL.Nat64;\n const TransferArg = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(Tokens),\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'from_subaccount' : IDL.Opt(Subaccount),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : Tokens,\n });\n const BlockIndex = IDL.Nat;\n const TransferError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'BadBurn' : IDL.Record({ 'min_burn_amount' : Tokens }),\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : Tokens }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : IDL.Nat64 }),\n 'TooOld' : IDL.Null,\n 'InsufficientFunds' : IDL.Record({ 'balance' : Tokens }),\n });\n const TransferResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : TransferError,\n });\n return IDL.Service({\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], ['query']),\n 'icrc1_decimals' : IDL.Func([], [IDL.Nat8], ['query']),\n 'icrc1_fee' : IDL.Func([], [Tokens], ['query']),\n 'icrc1_metadata' : IDL.Func(\n [],\n [IDL.Vec(IDL.Tuple(IDL.Text, Value))],\n ['query'],\n ),\n 'icrc1_minting_account' : IDL.Func([], [IDL.Opt(Account)], ['query']),\n 'icrc1_name' : IDL.Func([], [IDL.Text], ['query']),\n 'icrc1_supported_standards' : IDL.Func(\n [],\n [IDL.Vec(IDL.Record({ 'url' : IDL.Text, 'name' : IDL.Text }))],\n ['query'],\n ),\n 'icrc1_symbol' : IDL.Func([], [IDL.Text], ['query']),\n 'icrc1_total_supply' : IDL.Func([], [Tokens], ['query']),\n 'icrc1_transfer' : IDL.Func([TransferArg], [TransferResult], []),\n });\n};\nexport const init = ({ IDL }) => {\n const Value = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const InitArgs = IDL.Record({\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat64,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, Value)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat64)),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'trigger_threshold' : IDL.Nat64,\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'token_name' : IDL.Text,\n });\n return [InitArgs];\n};\n", "import { createServices } from \"@dfinity/utils\";\nimport type {\n ListSnsCanistersResponse,\n _SERVICE as SnsRootService,\n} from \"../candid/sns_root\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/sns_root.certified.idl\";\nimport { idlFactory } from \"../candid/sns_root.idl\";\nimport { Canister } from \"./services/canister\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\n\nexport class SnsRootCanister extends Canister<SnsRootService> {\n static create(options: SnsCanisterOptions<SnsRootService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsRootService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsRootCanister(canisterId, service, certifiedService);\n }\n\n /**\n * List the canisters that are part of the Sns.\n *\n * Source code: https://github.com/dfinity/ic/blob/master/rs/sns/root/src/lib.rs\n *\n * @param {Object} params\n * @param {boolean} [params.certified=true] - Query or update calls\n *\n * @returns {ListSnsCanistersResponse} - A list of canisters ('root' | 'governance' | 'ledger' | 'dapps' | 'swap' | 'archives')\n */\n listSnsCanisters = async ({\n certified = true,\n }: {\n certified?: boolean;\n }): Promise<ListSnsCanistersResponse> => {\n return this.caller({ certified }).list_sns_canisters({});\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_root.did */\nexport const idlFactory = ({ IDL }) => {\n const SnsRootCanister = IDL.Record({\n 'dapp_canister_ids' : IDL.Vec(IDL.Principal),\n 'latest_ledger_archive_poll_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'archive_canister_ids' : IDL.Vec(IDL.Principal),\n 'governance_canister_id' : IDL.Opt(IDL.Principal),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n });\n const CanisterIdRecord = IDL.Record({ 'canister_id' : IDL.Principal });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const CanisterStatusResult = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType,\n 'memory_size' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetSnsCanistersSummaryRequest = IDL.Record({\n 'update_canister_list' : IDL.Opt(IDL.Bool),\n });\n const CanisterStatusType_1 = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'controller' : IDL.Principal,\n 'freezing_threshold' : IDL.Nat,\n 'controllers' : IDL.Vec(IDL.Principal),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType_1,\n 'freezing_threshold' : IDL.Nat,\n 'balance' : IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)),\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const CanisterSummary = IDL.Record({\n 'status' : IDL.Opt(CanisterStatusResultV2),\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const GetSnsCanistersSummaryResponse = IDL.Record({\n 'root' : IDL.Opt(CanisterSummary),\n 'swap' : IDL.Opt(CanisterSummary),\n 'ledger' : IDL.Opt(CanisterSummary),\n 'governance' : IDL.Opt(CanisterSummary),\n 'dapps' : IDL.Vec(CanisterSummary),\n 'archives' : IDL.Vec(CanisterSummary),\n });\n const ListSnsCanistersResponse = IDL.Record({\n 'root' : IDL.Opt(IDL.Principal),\n 'swap' : IDL.Opt(IDL.Principal),\n 'ledger' : IDL.Opt(IDL.Principal),\n 'governance' : IDL.Opt(IDL.Principal),\n 'dapps' : IDL.Vec(IDL.Principal),\n 'archives' : IDL.Vec(IDL.Principal),\n });\n const RegisterDappCanisterRequest = IDL.Record({\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersRequest = IDL.Record({\n 'controller_principal_ids' : IDL.Vec(IDL.Principal),\n });\n const CanisterCallError = IDL.Record({\n 'code' : IDL.Opt(IDL.Int32),\n 'description' : IDL.Text,\n });\n const FailedUpdate = IDL.Record({\n 'err' : IDL.Opt(CanisterCallError),\n 'dapp_canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n 'failed_updates' : IDL.Vec(FailedUpdate),\n });\n return IDL.Service({\n 'canister_status' : IDL.Func(\n [CanisterIdRecord],\n [CanisterStatusResult],\n [],\n ),\n 'get_build_metadata' : IDL.Func([], [IDL.Text], []),\n 'get_sns_canisters_summary' : IDL.Func(\n [GetSnsCanistersSummaryRequest],\n [GetSnsCanistersSummaryResponse],\n [],\n ),\n 'list_sns_canisters' : IDL.Func(\n [IDL.Record({})],\n [ListSnsCanistersResponse],\n [],\n ),\n 'register_dapp_canister' : IDL.Func(\n [RegisterDappCanisterRequest],\n [IDL.Record({})],\n [],\n ),\n 'set_dapp_controllers' : IDL.Func(\n [SetDappControllersRequest],\n [SetDappControllersResponse],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const SnsRootCanister = IDL.Record({\n 'dapp_canister_ids' : IDL.Vec(IDL.Principal),\n 'latest_ledger_archive_poll_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'archive_canister_ids' : IDL.Vec(IDL.Principal),\n 'governance_canister_id' : IDL.Opt(IDL.Principal),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n });\n return [SnsRootCanister];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_root.did */\nexport const idlFactory = ({ IDL }) => {\n const SnsRootCanister = IDL.Record({\n 'dapp_canister_ids' : IDL.Vec(IDL.Principal),\n 'latest_ledger_archive_poll_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'archive_canister_ids' : IDL.Vec(IDL.Principal),\n 'governance_canister_id' : IDL.Opt(IDL.Principal),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n });\n const CanisterIdRecord = IDL.Record({ 'canister_id' : IDL.Principal });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const CanisterStatusResult = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType,\n 'memory_size' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetSnsCanistersSummaryRequest = IDL.Record({\n 'update_canister_list' : IDL.Opt(IDL.Bool),\n });\n const CanisterStatusType_1 = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'controller' : IDL.Principal,\n 'freezing_threshold' : IDL.Nat,\n 'controllers' : IDL.Vec(IDL.Principal),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType_1,\n 'freezing_threshold' : IDL.Nat,\n 'balance' : IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)),\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const CanisterSummary = IDL.Record({\n 'status' : IDL.Opt(CanisterStatusResultV2),\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const GetSnsCanistersSummaryResponse = IDL.Record({\n 'root' : IDL.Opt(CanisterSummary),\n 'swap' : IDL.Opt(CanisterSummary),\n 'ledger' : IDL.Opt(CanisterSummary),\n 'governance' : IDL.Opt(CanisterSummary),\n 'dapps' : IDL.Vec(CanisterSummary),\n 'archives' : IDL.Vec(CanisterSummary),\n });\n const ListSnsCanistersResponse = IDL.Record({\n 'root' : IDL.Opt(IDL.Principal),\n 'swap' : IDL.Opt(IDL.Principal),\n 'ledger' : IDL.Opt(IDL.Principal),\n 'governance' : IDL.Opt(IDL.Principal),\n 'dapps' : IDL.Vec(IDL.Principal),\n 'archives' : IDL.Vec(IDL.Principal),\n });\n const RegisterDappCanisterRequest = IDL.Record({\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersRequest = IDL.Record({\n 'controller_principal_ids' : IDL.Vec(IDL.Principal),\n });\n const CanisterCallError = IDL.Record({\n 'code' : IDL.Opt(IDL.Int32),\n 'description' : IDL.Text,\n });\n const FailedUpdate = IDL.Record({\n 'err' : IDL.Opt(CanisterCallError),\n 'dapp_canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n 'failed_updates' : IDL.Vec(FailedUpdate),\n });\n return IDL.Service({\n 'canister_status' : IDL.Func(\n [CanisterIdRecord],\n [CanisterStatusResult],\n [],\n ),\n 'get_build_metadata' : IDL.Func([], [IDL.Text], ['query']),\n 'get_sns_canisters_summary' : IDL.Func(\n [GetSnsCanistersSummaryRequest],\n [GetSnsCanistersSummaryResponse],\n [],\n ),\n 'list_sns_canisters' : IDL.Func(\n [IDL.Record({})],\n [ListSnsCanistersResponse],\n ['query'],\n ),\n 'register_dapp_canister' : IDL.Func(\n [RegisterDappCanisterRequest],\n [IDL.Record({})],\n [],\n ),\n 'set_dapp_controllers' : IDL.Func(\n [SetDappControllersRequest],\n [SetDappControllersResponse],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const SnsRootCanister = IDL.Record({\n 'dapp_canister_ids' : IDL.Vec(IDL.Principal),\n 'latest_ledger_archive_poll_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'archive_canister_ids' : IDL.Vec(IDL.Principal),\n 'governance_canister_id' : IDL.Opt(IDL.Principal),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n });\n return [SnsRootCanister];\n};\n", "import type { Agent } from \"@dfinity/agent\";\nimport type { Principal } from \"@dfinity/principal\";\nimport { assertNonNullish, fromNullable } from \"@dfinity/utils\";\nimport type {\n ListSnsCanistersResponse,\n _SERVICE as SnsRootService,\n} from \"../candid/sns_root\";\nimport { SnsGovernanceCanister } from \"./governance.canister\";\nimport { SnsLedgerCanister } from \"./ledger.canister\";\nimport { SnsRootCanister } from \"./root.canister\";\nimport { SnsWrapper } from \"./sns.wrapper\";\nimport { SnsSwapCanister } from \"./swap.canister\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type { QueryParams } from \"./types/query.params\";\n\n/**\n * Options to discover and initialize all canisters of a Sns.\n */\nexport interface InitSnsCanistersOptions extends QueryParams {\n /** An agent that can be used to override the default agent. Useful to target another environment that mainnet. */\n agent?: Agent;\n /** The options that will be used to instantiate the actors of the root canister of the particular Sns. */\n rootOptions: Omit<SnsCanisterOptions<SnsRootService>, \"agent\">;\n}\n\nexport interface InitSnsWrapper {\n (options: InitSnsCanistersOptions): Promise<SnsWrapper>;\n}\n\n/**\n * Lookup for the canister ids of a Sns and initialize the wrapper to access its features.\n */\nexport const initSnsWrapper: InitSnsWrapper = async ({\n agent,\n rootOptions,\n certified = true,\n}: InitSnsCanistersOptions): Promise<SnsWrapper> => {\n const rootCanister: SnsRootCanister = SnsRootCanister.create({\n ...rootOptions,\n agent,\n });\n\n const { ledger, swap, governance }: ListSnsCanistersResponse =\n await rootCanister.listSnsCanisters({ certified });\n\n const governanceCanisterId: Principal | undefined = fromNullable(governance);\n const ledgerCanisterId: Principal | undefined = fromNullable(ledger);\n const swapCanisterId: Principal | undefined = fromNullable(swap);\n\n assertNonNullish(governanceCanisterId);\n assertNonNullish(ledgerCanisterId);\n assertNonNullish(swapCanisterId);\n\n return new SnsWrapper({\n root: rootCanister,\n governance: SnsGovernanceCanister.create({\n canisterId: governanceCanisterId,\n agent,\n }),\n ledger: SnsLedgerCanister.create({ canisterId: ledgerCanisterId, agent }),\n swap: SnsSwapCanister.create({ canisterId: swapCanisterId, agent }),\n certified,\n });\n};\n", "import type { Principal } from \"@dfinity/principal\";\nimport type { Tokens } from \"../candid/icrc1_ledger\";\nimport type { GetMetadataResponse, Neuron } from \"../candid/sns_governance\";\nimport type {\n BuyerState,\n GetBuyerStateRequest,\n GetStateResponse,\n RefreshBuyerTokensRequest,\n} from \"../candid/sns_swap\";\nimport type { SnsGovernanceCanister } from \"./governance.canister\";\nimport type { SnsLedgerCanister } from \"./ledger.canister\";\nimport type { SnsRootCanister } from \"./root.canister\";\nimport type { SnsSwapCanister } from \"./swap.canister\";\nimport type {\n SnsGetNeuronParams,\n SnsListNeuronsParams,\n SnsNeuronPermissionsParams,\n} from \"./types/governance.params\";\nimport type { BalanceParams } from \"./types/ledger.params\";\nimport type { SnsTokenMetadataResponse } from \"./types/ledger.responses\";\nimport type { QueryParams } from \"./types/query.params\";\n\ninterface SnsWrapperOptions {\n /** The wrapper for the \"root\" canister of the particular Sns */\n root: SnsRootCanister;\n /** The wrapper for the \"governance\" canister of the particular Sns */\n governance: SnsGovernanceCanister;\n /** The wrapper for the \"ledger\" canister of the particular Sns */\n ledger: SnsLedgerCanister;\n /** The wrapper for the \"swap\" canister of the particular Sns */\n swap: SnsSwapCanister;\n\n /** The wrapper has been instantiated and should perform query or update calls */\n certified: boolean;\n}\n\n/**\n * Sns wrapper - notably used by NNS-dapp - ease the access to a particular Sns.\n * It knows all the Sns' canisters, wrap and enhance their available features.\n * A wrapper either performs query or update calls.\n */\nexport class SnsWrapper {\n private readonly root: SnsRootCanister;\n private readonly governance: SnsGovernanceCanister;\n private readonly ledger: SnsLedgerCanister;\n private readonly swap: SnsSwapCanister;\n private readonly certified: boolean;\n\n /**\n * Constructor to instantiate a Sns\n */\n constructor({\n root,\n governance,\n ledger,\n swap,\n certified,\n }: SnsWrapperOptions) {\n this.root = root;\n this.governance = governance;\n this.ledger = ledger;\n this.swap = swap;\n this.certified = certified;\n }\n\n /**\n * Binds the list of canister ids of the Sns.\n */\n get canisterIds(): {\n rootCanisterId: Principal;\n ledgerCanisterId: Principal;\n governanceCanisterId: Principal;\n swapCanisterId: Principal;\n } {\n return {\n rootCanisterId: this.root.canisterId,\n ledgerCanisterId: this.ledger.canisterId,\n governanceCanisterId: this.governance.canisterId,\n swapCanisterId: this.swap.canisterId,\n };\n }\n\n listNeurons = (\n params: Omit<SnsListNeuronsParams, \"certified\">\n ): Promise<Neuron[]> => this.governance.listNeurons(this.mergeParams(params));\n\n metadata = (\n params: Omit<QueryParams, \"certified\">\n ): Promise<[GetMetadataResponse, SnsTokenMetadataResponse]> =>\n Promise.all([\n this.governance.metadata(this.mergeParams(params)),\n this.ledger.metadata(this.mergeParams(params)),\n ]);\n\n ledgerMetadata = (\n params: Omit<QueryParams, \"certified\">\n ): Promise<SnsTokenMetadataResponse> =>\n this.ledger.metadata(this.mergeParams(params));\n\n balance = (params: Omit<BalanceParams, \"certified\">): Promise<Tokens> =>\n this.ledger.balance(this.mergeParams(params));\n\n getNeuron = (\n params: Omit<SnsGetNeuronParams, \"certified\">\n ): Promise<Neuron> => this.governance.getNeuron(this.mergeParams(params));\n\n // Always certified\n addNeuronPermissions = (params: SnsNeuronPermissionsParams): Promise<void> =>\n this.governance.addNeuronPermissions(params);\n\n // Always certified\n removeNeuronPermissions = (\n params: SnsNeuronPermissionsParams\n ): Promise<void> => this.governance.removeNeuronPermissions(params);\n\n swapState = (\n params: Omit<QueryParams, \"certified\">\n ): Promise<GetStateResponse> => this.swap.state(this.mergeParams(params));\n\n // Always certified\n notifyParticipation = (params: RefreshBuyerTokensRequest): Promise<void> =>\n this.swap.notifyParticipation(params);\n\n getUserCommitment = (\n params: GetBuyerStateRequest\n ): Promise<BuyerState | undefined> =>\n this.swap.getUserCommitment(this.mergeParams(params));\n\n private mergeParams<T>(params: T): QueryParams & T {\n return {\n ...params,\n certified: this.certified,\n };\n }\n}\n", "import { createServices, fromNullable } from \"@dfinity/utils\";\nimport type {\n BuyerState,\n GetBuyerStateRequest,\n GetStateResponse,\n RefreshBuyerTokensRequest,\n _SERVICE as SnsSwapService,\n} from \"../candid/sns_swap\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/sns_swap.certified.idl\";\nimport { idlFactory } from \"../candid/sns_swap.idl\";\nimport { Canister } from \"./services/canister\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type { QueryParams } from \"./types/query.params\";\n\nexport class SnsSwapCanister extends Canister<SnsSwapService> {\n static create(options: SnsCanisterOptions<SnsSwapService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsSwapService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsSwapCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Get the state of the swap\n */\n state = (params: QueryParams): Promise<GetStateResponse> =>\n this.caller(params).get_state({});\n\n /**\n * Notify of the user participating in the swap\n */\n notifyParticipation = async (\n params: RefreshBuyerTokensRequest\n ): Promise<void> => {\n await this.caller({ certified: true }).refresh_buyer_tokens(params);\n };\n\n /**\n * Get user commitment\n */\n getUserCommitment = async (\n params: GetBuyerStateRequest & QueryParams\n ): Promise<BuyerState | undefined> => {\n const { buyer_state } = await this.caller({\n certified: params.certified,\n }).get_buyer_state({ principal_id: params.principal_id });\n return fromNullable(buyer_state);\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_swap.did */\nexport const idlFactory = ({ IDL }) => {\n const Init = IDL.Record({\n 'sns_root_canister_id' : IDL.Text,\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'nns_governance_canister_id' : IDL.Text,\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'sns_governance_canister_id' : IDL.Text,\n });\n const ErrorRefundIcpRequest = IDL.Record({\n 'icp_e8s' : IDL.Nat64,\n 'fee_override_e8s' : IDL.Nat64,\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Response = IDL.Record({\n 'governance_error' : IDL.Opt(GovernanceError),\n });\n const CanisterCallError = IDL.Record({\n 'code' : IDL.Opt(IDL.Int32),\n 'description' : IDL.Text,\n });\n const Possibility = IDL.Variant({\n 'Ok' : Response,\n 'Err' : CanisterCallError,\n });\n const SettleCommunityFundParticipationResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility),\n });\n const FailedUpdate = IDL.Record({\n 'err' : IDL.Opt(CanisterCallError),\n 'dapp_canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n 'failed_updates' : IDL.Vec(FailedUpdate),\n });\n const Possibility_1 = IDL.Variant({\n 'Ok' : SetDappControllersResponse,\n 'Err' : CanisterCallError,\n });\n const SetDappControllersCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_1),\n });\n const Possibility_2 = IDL.Variant({ 'Err' : CanisterCallError });\n const SetModeCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_2),\n });\n const SweepResult = IDL.Record({\n 'failure' : IDL.Nat32,\n 'skipped' : IDL.Nat32,\n 'success' : IDL.Nat32,\n });\n const FinalizeSwapResponse = IDL.Record({\n 'settle_community_fund_participation_result' : IDL.Opt(\n SettleCommunityFundParticipationResult\n ),\n 'set_dapp_controllers_result' : IDL.Opt(SetDappControllersCallResult),\n 'sns_governance_normal_mode_enabled' : IDL.Opt(SetModeCallResult),\n 'sweep_icp' : IDL.Opt(SweepResult),\n 'sweep_sns' : IDL.Opt(SweepResult),\n 'create_neuron' : IDL.Opt(SweepResult),\n });\n const GetBuyerStateRequest = IDL.Record({\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const TransferableAmount = IDL.Record({\n 'transfer_start_timestamp_seconds' : IDL.Nat64,\n 'amount_e8s' : IDL.Nat64,\n 'transfer_success_timestamp_seconds' : IDL.Nat64,\n });\n const BuyerState = IDL.Record({ 'icp' : IDL.Opt(TransferableAmount) });\n const GetBuyerStateResponse = IDL.Record({\n 'buyer_state' : IDL.Opt(BuyerState),\n });\n const GetBuyersTotalResponse = IDL.Record({ 'buyers_total' : IDL.Nat64 });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'controller' : IDL.Principal,\n 'freezing_threshold' : IDL.Nat,\n 'controllers' : IDL.Vec(IDL.Principal),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType,\n 'freezing_threshold' : IDL.Nat,\n 'balance' : IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)),\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const CfInvestment = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'nns_neuron_id' : IDL.Nat64,\n });\n const DirectInvestment = IDL.Record({ 'buyer_principal' : IDL.Text });\n const Investor = IDL.Variant({\n 'CommunityFund' : CfInvestment,\n 'Direct' : DirectInvestment,\n });\n const SnsNeuronRecipe = IDL.Record({\n 'sns' : IDL.Opt(TransferableAmount),\n 'investor' : IDL.Opt(Investor),\n });\n const CfNeuron = IDL.Record({\n 'nns_neuron_id' : IDL.Nat64,\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'cf_neurons' : IDL.Vec(CfNeuron),\n });\n const Params = IDL.Record({\n 'min_participant_icp_e8s' : IDL.Nat64,\n 'max_icp_e8s' : IDL.Nat64,\n 'swap_due_timestamp_seconds' : IDL.Nat64,\n 'min_participants' : IDL.Nat32,\n 'sns_token_e8s' : IDL.Nat64,\n 'max_participant_icp_e8s' : IDL.Nat64,\n 'min_icp_e8s' : IDL.Nat64,\n });\n const Swap = IDL.Record({\n 'neuron_recipes' : IDL.Vec(SnsNeuronRecipe),\n 'cf_participants' : IDL.Vec(CfParticipant),\n 'init' : IDL.Opt(Init),\n 'lifecycle' : IDL.Int32,\n 'buyers' : IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),\n 'params' : IDL.Opt(Params),\n 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),\n });\n const DerivedState = IDL.Record({\n 'sns_tokens_per_icp' : IDL.Float32,\n 'buyer_total_icp_e8s' : IDL.Nat64,\n });\n const GetStateResponse = IDL.Record({\n 'swap' : IDL.Opt(Swap),\n 'derived' : IDL.Opt(DerivedState),\n });\n const OpenRequest = IDL.Record({\n 'cf_participants' : IDL.Vec(CfParticipant),\n 'params' : IDL.Opt(Params),\n 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),\n });\n const RefreshBuyerTokensRequest = IDL.Record({ 'buyer' : IDL.Text });\n const RefreshBuyerTokensResponse = IDL.Record({\n 'icp_accepted_participation_e8s' : IDL.Nat64,\n 'icp_ledger_account_balance_e8s' : IDL.Nat64,\n });\n return IDL.Service({\n 'error_refund_icp' : IDL.Func(\n [ErrorRefundIcpRequest],\n [IDL.Record({})],\n [],\n ),\n 'finalize_swap' : IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),\n 'get_buyer_state' : IDL.Func(\n [GetBuyerStateRequest],\n [GetBuyerStateResponse],\n [],\n ),\n 'get_buyers_total' : IDL.Func(\n [IDL.Record({})],\n [GetBuyersTotalResponse],\n [],\n ),\n 'get_canister_status' : IDL.Func(\n [IDL.Record({})],\n [CanisterStatusResultV2],\n [],\n ),\n 'get_state' : IDL.Func([IDL.Record({})], [GetStateResponse], []),\n 'open' : IDL.Func([OpenRequest], [IDL.Record({})], []),\n 'refresh_buyer_tokens' : IDL.Func(\n [RefreshBuyerTokensRequest],\n [RefreshBuyerTokensResponse],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const Init = IDL.Record({\n 'sns_root_canister_id' : IDL.Text,\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'nns_governance_canister_id' : IDL.Text,\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'sns_governance_canister_id' : IDL.Text,\n });\n return [Init];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_swap.did */\nexport const idlFactory = ({ IDL }) => {\n const Init = IDL.Record({\n 'sns_root_canister_id' : IDL.Text,\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'nns_governance_canister_id' : IDL.Text,\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'sns_governance_canister_id' : IDL.Text,\n });\n const ErrorRefundIcpRequest = IDL.Record({\n 'icp_e8s' : IDL.Nat64,\n 'fee_override_e8s' : IDL.Nat64,\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Response = IDL.Record({\n 'governance_error' : IDL.Opt(GovernanceError),\n });\n const CanisterCallError = IDL.Record({\n 'code' : IDL.Opt(IDL.Int32),\n 'description' : IDL.Text,\n });\n const Possibility = IDL.Variant({\n 'Ok' : Response,\n 'Err' : CanisterCallError,\n });\n const SettleCommunityFundParticipationResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility),\n });\n const FailedUpdate = IDL.Record({\n 'err' : IDL.Opt(CanisterCallError),\n 'dapp_canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n 'failed_updates' : IDL.Vec(FailedUpdate),\n });\n const Possibility_1 = IDL.Variant({\n 'Ok' : SetDappControllersResponse,\n 'Err' : CanisterCallError,\n });\n const SetDappControllersCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_1),\n });\n const Possibility_2 = IDL.Variant({ 'Err' : CanisterCallError });\n const SetModeCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_2),\n });\n const SweepResult = IDL.Record({\n 'failure' : IDL.Nat32,\n 'skipped' : IDL.Nat32,\n 'success' : IDL.Nat32,\n });\n const FinalizeSwapResponse = IDL.Record({\n 'settle_community_fund_participation_result' : IDL.Opt(\n SettleCommunityFundParticipationResult\n ),\n 'set_dapp_controllers_result' : IDL.Opt(SetDappControllersCallResult),\n 'sns_governance_normal_mode_enabled' : IDL.Opt(SetModeCallResult),\n 'sweep_icp' : IDL.Opt(SweepResult),\n 'sweep_sns' : IDL.Opt(SweepResult),\n 'create_neuron' : IDL.Opt(SweepResult),\n });\n const GetBuyerStateRequest = IDL.Record({\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const TransferableAmount = IDL.Record({\n 'transfer_start_timestamp_seconds' : IDL.Nat64,\n 'amount_e8s' : IDL.Nat64,\n 'transfer_success_timestamp_seconds' : IDL.Nat64,\n });\n const BuyerState = IDL.Record({ 'icp' : IDL.Opt(TransferableAmount) });\n const GetBuyerStateResponse = IDL.Record({\n 'buyer_state' : IDL.Opt(BuyerState),\n });\n const GetBuyersTotalResponse = IDL.Record({ 'buyers_total' : IDL.Nat64 });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'controller' : IDL.Principal,\n 'freezing_threshold' : IDL.Nat,\n 'controllers' : IDL.Vec(IDL.Principal),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType,\n 'freezing_threshold' : IDL.Nat,\n 'balance' : IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)),\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const CfInvestment = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'nns_neuron_id' : IDL.Nat64,\n });\n const DirectInvestment = IDL.Record({ 'buyer_principal' : IDL.Text });\n const Investor = IDL.Variant({\n 'CommunityFund' : CfInvestment,\n 'Direct' : DirectInvestment,\n });\n const SnsNeuronRecipe = IDL.Record({\n 'sns' : IDL.Opt(TransferableAmount),\n 'investor' : IDL.Opt(Investor),\n });\n const CfNeuron = IDL.Record({\n 'nns_neuron_id' : IDL.Nat64,\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'cf_neurons' : IDL.Vec(CfNeuron),\n });\n const Params = IDL.Record({\n 'min_participant_icp_e8s' : IDL.Nat64,\n 'max_icp_e8s' : IDL.Nat64,\n 'swap_due_timestamp_seconds' : IDL.Nat64,\n 'min_participants' : IDL.Nat32,\n 'sns_token_e8s' : IDL.Nat64,\n 'max_participant_icp_e8s' : IDL.Nat64,\n 'min_icp_e8s' : IDL.Nat64,\n });\n const Swap = IDL.Record({\n 'neuron_recipes' : IDL.Vec(SnsNeuronRecipe),\n 'cf_participants' : IDL.Vec(CfParticipant),\n 'init' : IDL.Opt(Init),\n 'lifecycle' : IDL.Int32,\n 'buyers' : IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),\n 'params' : IDL.Opt(Params),\n 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),\n });\n const DerivedState = IDL.Record({\n 'sns_tokens_per_icp' : IDL.Float32,\n 'buyer_total_icp_e8s' : IDL.Nat64,\n });\n const GetStateResponse = IDL.Record({\n 'swap' : IDL.Opt(Swap),\n 'derived' : IDL.Opt(DerivedState),\n });\n const OpenRequest = IDL.Record({\n 'cf_participants' : IDL.Vec(CfParticipant),\n 'params' : IDL.Opt(Params),\n 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),\n });\n const RefreshBuyerTokensRequest = IDL.Record({ 'buyer' : IDL.Text });\n const RefreshBuyerTokensResponse = IDL.Record({\n 'icp_accepted_participation_e8s' : IDL.Nat64,\n 'icp_ledger_account_balance_e8s' : IDL.Nat64,\n });\n return IDL.Service({\n 'error_refund_icp' : IDL.Func(\n [ErrorRefundIcpRequest],\n [IDL.Record({})],\n [],\n ),\n 'finalize_swap' : IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),\n 'get_buyer_state' : IDL.Func(\n [GetBuyerStateRequest],\n [GetBuyerStateResponse],\n ['query'],\n ),\n 'get_buyers_total' : IDL.Func(\n [IDL.Record({})],\n [GetBuyersTotalResponse],\n [],\n ),\n 'get_canister_status' : IDL.Func(\n [IDL.Record({})],\n [CanisterStatusResultV2],\n [],\n ),\n 'get_state' : IDL.Func([IDL.Record({})], [GetStateResponse], ['query']),\n 'open' : IDL.Func([OpenRequest], [IDL.Record({})], []),\n 'refresh_buyer_tokens' : IDL.Func(\n [RefreshBuyerTokensRequest],\n [RefreshBuyerTokensResponse],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const Init = IDL.Record({\n 'sns_root_canister_id' : IDL.Text,\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'nns_governance_canister_id' : IDL.Text,\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'sns_governance_canister_id' : IDL.Text,\n });\n return [Init];\n};\n", "import type { Value } from \"../../candid/icrc1_ledger\";\n\n// Source: https://github.com/dfinity/icrc-1#standard-metadata-entries\nexport enum SnsMetadataResponseEntries {\n SYMBOL = \"icrc1:symbol\",\n NAME = \"icrc1:name\",\n DECIMALS = \"icrc1:decimals\",\n FEE = \"icrc1:fee\",\n}\n\nexport type SnsTokenMetadataResponse = [\n string | SnsMetadataResponseEntries,\n Value\n][];\n"],
5
- "mappings": "ubAAA,kSCCO,GAAK,IAAL,CAAK,GACV,wCAAqC,GAArC,qCAIA,oDAAkD,GAAlD,kDAMA,6CAA2C,GAA3C,2CAKA,2CAAyC,GAAzC,yCAGA,gCAA8B,GAA9B,8BAGA,oCAAkC,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BAAa,CAAI,EAE/D,6BAAiB,CAAoB,EACrC,uBAAiB,CAAgB,EACjC,uBAAiB,CAAc,EAExB,GAAI,GAAW,CACpB,KAAM,EACN,WAAY,EAAsB,OAAO,CACvC,WAAY,EACZ,OACF,CAAC,EACD,OAAQ,EAAkB,OAAO,CAAE,WAAY,EAAkB,OAAM,CAAC,EACxE,KAAM,EAAgB,OAAO,CAAE,WAAY,EAAgB,OAAM,CAAC,EAClE,WACF,CAAC,CACH,EK5DO,GAAK,IAAL,CAAK,GACV,UAAS,eACT,OAAO,aACP,WAAW,iBACX,MAAM,YAJI",
3
+ "sources": ["../../src/index.ts", "../../src/enums/governance.enums.ts", "../../src/enums/swap.enums.ts", "../../src/errors/governance.errors.ts", "../../src/governance.canister.ts", "../../candid/sns_governance.certified.idl.js", "../../candid/sns_governance.idl.js", "../../src/converters/governance.converters.ts", "../../src/services/canister.ts", "../../src/ledger.canister.ts", "../../candid/icrc1_ledger.certified.idl.js", "../../candid/icrc1_ledger.idl.js", "../../src/root.canister.ts", "../../candid/sns_root.certified.idl.js", "../../candid/sns_root.idl.js", "../../src/sns.ts", "../../src/sns.wrapper.ts", "../../src/swap.canister.ts", "../../candid/sns_swap.certified.idl.js", "../../candid/sns_swap.idl.js", "../../src/types/ledger.responses.ts", "../../src/utils/ledger.utils.ts"],
4
+ "sourcesContent": ["export type {\n GetMetadataResponse as SnsGetMetadataResponse,\n ManageNeuron as SnsManageNeuron,\n ManageNeuronResponse as SnsManageNeuronResponse,\n Neuron as SnsNeuron,\n NeuronId as SnsNeuronId,\n} from \"../candid/sns_governance\";\nexport type { CanisterStatusResultV2 as SnsCanisterStatus } from \"../candid/sns_root\";\nexport type {\n BuyerState as SnsSwapBuyerState,\n CfParticipant,\n DerivedState as SnsSwapDerivedState,\n GetBuyerStateRequest as SnsGetBuyerStateRequest,\n GetBuyerStateResponse as SnsGetBuyerStateResponse,\n Init as SnsSwapInit,\n Params as SnsParams,\n SnsNeuronRecipe,\n Swap as SnsSwap,\n TransferableAmount as SnsTransferableAmount,\n} from \"../candid/sns_swap\";\nexport * from \"./enums/governance.enums\";\nexport * from \"./enums/swap.enums\";\nexport * from \"./errors/governance.errors\";\nexport { SnsGovernanceCanister } from \"./governance.canister\";\nexport { SnsLedgerCanister } from \"./ledger.canister\";\nexport { SnsRootCanister } from \"./root.canister\";\nexport * from \"./sns\";\nexport * from \"./sns.wrapper\";\nexport { SnsSwapCanister } from \"./swap.canister\";\nexport type { SnsCanisterOptions } from \"./types/canister.options\";\nexport type {\n SnsGetNeuronParams,\n SnsListNeuronsParams,\n} from \"./types/governance.params\";\nexport * from \"./types/ledger.responses\";\nexport type { QueryParams } from \"./types/query.params\";\nexport * from \"./utils/ledger.utils\";\n", "// Source: https://github.com/dfinity/ic/blob/1998263b426df0a22f0d0706695c0826f0ab4d7d/rs/sns/governance/proto/ic_sns_governance/pb/v1/governance.proto#L10\nexport enum SnsNeuronPermissionType {\n NEURON_PERMISSION_TYPE_UNSPECIFIED = 0,\n\n // The principal has permission to configure the neuron's dissolve state. This includes\n // start dissolving, stop dissolving, and increasing the dissolve delay for the neuron.\n NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE = 1,\n\n // The principal has permission to add additional principals to modify the neuron.\n // The nervous system parameter `NervousSystemParameters::neuron_grantable_permissions`\n // determines the maximum set of privileges that a principal can grant to another principal in\n // the given SNS.\n NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS = 2,\n\n // The principal has permission to submit proposals on behalf of the neuron.\n // Submitting proposals can change a neuron's stake and thus this\n // is potentially a balance changing operation.\n NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL = 3,\n\n // The principal has permission to vote and follow other neurons on behalf of the neuron.\n NEURON_PERMISSION_TYPE_VOTE = 4,\n\n // The principal has permission to disburse the neuron.\n NEURON_PERMISSION_TYPE_DISBURSE = 5,\n\n // The principal has permission to split the neuron.\n NEURON_PERMISSION_TYPE_SPLIT = 6,\n\n // The principal has permission to merge the neuron's maturity into\n // the neuron's stake.\n NEURON_PERMISSION_TYPE_MERGE_MATURITY = 7,\n\n // The principal has permission to disburse the neuron's maturity to a\n // given ledger account.\n NEURON_PERMISSION_TYPE_DISBURSE_MATURITY = 8,\n}\n", "// Source: https://github.com/dfinity/ic/blob/master/rs/sns/swap/gen/ic_sns_swap.pb.v1.rs - Lifecycle\nexport enum SnsSwapLifecycle {\n Unspecified = 0,\n Pending = 1,\n Open = 2,\n Committed = 3,\n Aborted = 4,\n}\n", "export class SnsGovernanceError extends Error {}\n", "import type { Principal } from \"@dfinity/principal\";\nimport { createServices, fromNullable, toNullable } from \"@dfinity/utils\";\nimport type {\n GetMetadataResponse,\n ManageNeuron,\n ManageNeuronResponse,\n Neuron,\n NeuronId,\n _SERVICE as SnsGovernanceService,\n} from \"../candid/sns_governance\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/sns_governance.certified.idl\";\nimport { idlFactory } from \"../candid/sns_governance.idl\";\nimport { MAX_LIST_NEURONS_RESULTS } from \"./constants/governance.constants\";\nimport {\n toAddPermissionsRequest,\n toRemovePermissionsRequest,\n} from \"./converters/governance.converters\";\nimport { SnsGovernanceError } from \"./errors/governance.errors\";\nimport { Canister } from \"./services/canister\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type {\n SnsGetNeuronParams,\n SnsListNeuronsParams,\n SnsNeuronPermissionsParams,\n} from \"./types/governance.params\";\nimport type { QueryParams } from \"./types/query.params\";\n\nexport class SnsGovernanceCanister extends Canister<SnsGovernanceService> {\n /**\n * Instantiate a canister to interact with the governance of a Sns project.\n *\n * @param {SnsCanisterOptions} options Miscellaneous options to initialize the canister. Its ID being the only mandatory parammeter.\n */\n static create(options: SnsCanisterOptions<SnsGovernanceService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsGovernanceService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsGovernanceCanister(canisterId, service, certifiedService);\n }\n\n /**\n * List the neurons of the Sns\n */\n listNeurons = async (params: SnsListNeuronsParams): Promise<Neuron[]> => {\n const { principal, limit, beforeNeuronId } = params;\n\n const { neurons } = await this.caller(params).list_neurons({\n of_principal: toNullable<Principal>(principal),\n limit: limit ?? MAX_LIST_NEURONS_RESULTS,\n start_page_at: toNullable<NeuronId>(beforeNeuronId),\n });\n return neurons;\n };\n\n /**\n * Get the Sns metadata (title, description, etc.)\n */\n metadata = (params: QueryParams): Promise<GetMetadataResponse> =>\n this.caller(params).get_metadata({});\n\n /**\n * Get the neuron of the Sns\n */\n getNeuron = async (\n params: SnsGetNeuronParams & QueryParams\n ): Promise<Neuron> => {\n const { neuronId } = params;\n\n const { result } = await this.caller(params).get_neuron({\n neuron_id: toNullable(neuronId),\n });\n const data = fromNullable(result);\n if (data === undefined || \"Error\" in data) {\n throw new SnsGovernanceError(\n data?.Error.error_message ?? \"Response type not supported\"\n );\n }\n return data.Neuron;\n };\n\n /**\n * Manage neuron. For advanced users.\n */\n manageNeuron = async (\n request: ManageNeuron\n ): Promise<ManageNeuronResponse> => {\n const response = await this.caller({ certified: true }).manage_neuron(\n request\n );\n this.assertManageNeuronError(response);\n return response;\n };\n\n /**\n * Add permissions to a neuron for a specific principal\n */\n addNeuronPermissions = async (\n params: SnsNeuronPermissionsParams\n ): Promise<void> => {\n const request: ManageNeuron = toAddPermissionsRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Remove permissions to a neuron for a specific principal\n */\n removeNeuronPermissions = async (\n params: SnsNeuronPermissionsParams\n ): Promise<void> => {\n const request: ManageNeuron = toRemovePermissionsRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n *\n * @param response ManageNeuronResponse\n * @throws SnsGovernanceError\n */\n private assertManageNeuronError = ({\n command,\n }: ManageNeuronResponse): void => {\n // TODO: use upcoming fromDefinedNullable\n const firstCommand = command[0];\n if (firstCommand !== undefined && \"Error\" in firstCommand) {\n throw new SnsGovernanceError(firstCommand.Error.error_message);\n }\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_governance.did */\nexport const idlFactory = ({ IDL }) => {\n const GenericNervousSystemFunction = IDL.Record({\n 'validator_canister_id' : IDL.Opt(IDL.Principal),\n 'target_canister_id' : IDL.Opt(IDL.Principal),\n 'validator_method_name' : IDL.Opt(IDL.Text),\n 'target_method_name' : IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n 'NativeNervousSystemFunction' : IDL.Record({}),\n 'GenericNervousSystemFunction' : GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n 'id' : IDL.Nat64,\n 'name' : IDL.Text,\n 'description' : IDL.Opt(IDL.Text),\n 'function_type' : IDL.Opt(FunctionType),\n });\n const GovernanceCachedMetrics = IDL.Record({\n 'not_dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'garbage_collectable_neurons_count' : IDL.Nat64,\n 'neurons_with_invalid_stake_count' : IDL.Nat64,\n 'not_dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64,\n 'dissolved_neurons_count' : IDL.Nat64,\n 'total_staked_e8s' : IDL.Nat64,\n 'total_supply_governance_tokens' : IDL.Nat64,\n 'not_dissolving_neurons_count' : IDL.Nat64,\n 'dissolved_neurons_e8s' : IDL.Nat64,\n 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,\n 'dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'dissolving_neurons_count' : IDL.Nat64,\n 'dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'timestamp_seconds' : IDL.Nat64,\n });\n const NeuronId = IDL.Record({ 'id' : IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ 'followees' : IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n 'permissions' : IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n 'start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'final_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'initial_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'reward_rate_transition_duration_seconds' : IDL.Opt(IDL.Nat64),\n 'round_duration_seconds' : IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n 'default_followees' : IDL.Opt(DefaultFollowees),\n 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64),\n 'max_followees_per_function' : IDL.Opt(IDL.Nat64),\n 'neuron_claimer_permissions' : IDL.Opt(NeuronPermissionList),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'max_neuron_age_for_age_bonus' : IDL.Opt(IDL.Nat64),\n 'initial_voting_period_seconds' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_dissolve_delay_to_vote_seconds' : IDL.Opt(IDL.Nat64),\n 'reject_cost_e8s' : IDL.Opt(IDL.Nat64),\n 'max_proposals_to_keep_per_action' : IDL.Opt(IDL.Nat32),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Opt(IDL.Nat64),\n 'max_number_of_neurons' : IDL.Opt(IDL.Nat64),\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'max_number_of_proposals_with_ballots' : IDL.Opt(IDL.Nat64),\n 'neuron_grantable_permissions' : IDL.Opt(NeuronPermissionList),\n 'voting_rewards_parameters' : IDL.Opt(VotingRewardsParameters),\n 'max_number_of_principals_per_neuron' : IDL.Opt(IDL.Nat64),\n });\n const Version = IDL.Record({\n 'archive_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'root_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'swap_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'ledger_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'governance_wasm_hash' : IDL.Vec(IDL.Nat8),\n });\n const ProposalId = IDL.Record({ 'id' : IDL.Nat64 });\n const RewardEvent = IDL.Record({\n 'actual_timestamp_seconds' : IDL.Nat64,\n 'distributed_e8s_equivalent' : IDL.Nat64,\n 'round' : IDL.Nat64,\n 'settled_proposals' : IDL.Vec(ProposalId),\n });\n const UpgradeInProgress = IDL.Record({\n 'mark_failed_at_seconds' : IDL.Nat64,\n 'checking_upgrade_lock' : IDL.Nat64,\n 'proposal_id' : IDL.Nat64,\n 'target_version' : IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Ballot = IDL.Record({\n 'vote' : IDL.Int32,\n 'cast_timestamp_seconds' : IDL.Nat64,\n 'voting_power' : IDL.Nat64,\n });\n const Tally = IDL.Record({\n 'no' : IDL.Nat64,\n 'yes' : IDL.Nat64,\n 'total' : IDL.Nat64,\n 'timestamp_seconds' : IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n 'new_canister_wasm' : IDL.Vec(IDL.Nat8),\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const ManageSnsMetadata = IDL.Record({\n 'url' : IDL.Opt(IDL.Text),\n 'logo' : IDL.Opt(IDL.Text),\n 'name' : IDL.Opt(IDL.Text),\n 'description' : IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'payload' : IDL.Vec(IDL.Nat8),\n });\n const Motion = IDL.Record({ 'motion_text' : IDL.Text });\n const Action = IDL.Variant({\n 'ManageNervousSystemParameters' : NervousSystemParameters,\n 'AddGenericNervousSystemFunction' : NervousSystemFunction,\n 'RemoveGenericNervousSystemFunction' : IDL.Nat64,\n 'UpgradeSnsToNextVersion' : IDL.Record({}),\n 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,\n 'Unspecified' : IDL.Record({}),\n 'ManageSnsMetadata' : ManageSnsMetadata,\n 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,\n 'Motion' : Motion,\n });\n const Proposal = IDL.Record({\n 'url' : IDL.Text,\n 'title' : IDL.Text,\n 'action' : IDL.Opt(Action),\n 'summary' : IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n 'current_deadline_timestamp_seconds' : IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n 'id' : IDL.Opt(ProposalId),\n 'payload_text_rendering' : IDL.Opt(IDL.Text),\n 'action' : IDL.Nat64,\n 'failure_reason' : IDL.Opt(GovernanceError),\n 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n 'reward_event_round' : IDL.Nat64,\n 'failed_timestamp_seconds' : IDL.Nat64,\n 'proposal_creation_timestamp_seconds' : IDL.Nat64,\n 'initial_voting_period_seconds' : IDL.Nat64,\n 'reject_cost_e8s' : IDL.Nat64,\n 'latest_tally' : IDL.Opt(Tally),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Nat64,\n 'decided_timestamp_seconds' : IDL.Nat64,\n 'proposal' : IDL.Opt(Proposal),\n 'proposer' : IDL.Opt(NeuronId),\n 'wait_for_quiet_state' : IDL.Opt(WaitForQuietState),\n 'is_eligible_for_rewards' : IDL.Bool,\n 'executed_timestamp_seconds' : IDL.Nat64,\n });\n const Split = IDL.Record({ 'memo' : IDL.Nat64, 'amount_e8s' : IDL.Nat64 });\n const Follow = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'followees' : IDL.Vec(NeuronId),\n });\n const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n 'owner' : IDL.Opt(IDL.Principal),\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const DisburseMaturity = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'percentage_to_disburse' : IDL.Nat32,\n });\n const IncreaseDissolveDelay = IDL.Record({\n 'additional_dissolve_delay_seconds' : IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n 'dissolve_timestamp_seconds' : IDL.Nat64,\n });\n const Operation = IDL.Variant({\n 'StopDissolving' : IDL.Record({}),\n 'StartDissolving' : IDL.Record({}),\n 'IncreaseDissolveDelay' : IncreaseDissolveDelay,\n 'SetDissolveTimestamp' : SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ 'operation' : IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n 'vote' : IDL.Int32,\n 'proposal' : IDL.Opt(ProposalId),\n });\n const MemoAndController = IDL.Record({\n 'controller' : IDL.Opt(IDL.Principal),\n 'memo' : IDL.Nat64,\n });\n const By = IDL.Variant({\n 'MemoAndController' : MemoAndController,\n 'NeuronId' : IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ 'by' : IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n 'permissions_to_remove' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n 'permissions_to_add' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });\n const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });\n const Disburse = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'amount' : IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n 'Split' : Split,\n 'Follow' : Follow,\n 'DisburseMaturity' : DisburseMaturity,\n 'Configure' : Configure,\n 'RegisterVote' : RegisterVote,\n 'MakeProposal' : Proposal,\n 'ClaimOrRefreshNeuron' : ClaimOrRefresh,\n 'RemoveNeuronPermissions' : RemoveNeuronPermissions,\n 'AddNeuronPermissions' : AddNeuronPermissions,\n 'MergeMaturity' : MergeMaturity,\n 'Disburse' : Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n 'command' : IDL.Opt(Command_2),\n 'timestamp' : IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n 'principal' : IDL.Opt(IDL.Principal),\n 'permission_type' : IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n 'DissolveDelaySeconds' : IDL.Nat64,\n 'WhenDissolvedTimestampSeconds' : IDL.Nat64,\n });\n const Neuron = IDL.Record({\n 'id' : IDL.Opt(NeuronId),\n 'permissions' : IDL.Vec(NeuronPermission),\n 'maturity_e8s_equivalent' : IDL.Nat64,\n 'cached_neuron_stake_e8s' : IDL.Nat64,\n 'created_timestamp_seconds' : IDL.Nat64,\n 'aging_since_timestamp_seconds' : IDL.Nat64,\n 'dissolve_state' : IDL.Opt(DissolveState),\n 'voting_power_percentage_multiplier' : IDL.Nat64,\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n 'neuron_fees_e8s' : IDL.Nat64,\n });\n const Governance = IDL.Record({\n 'root_canister_id' : IDL.Opt(IDL.Principal),\n 'id_to_nervous_system_functions' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction)\n ),\n 'metrics' : IDL.Opt(GovernanceCachedMetrics),\n 'mode' : IDL.Int32,\n 'parameters' : IDL.Opt(NervousSystemParameters),\n 'deployed_version' : IDL.Opt(Version),\n 'sns_initialization_parameters' : IDL.Text,\n 'latest_reward_event' : IDL.Opt(RewardEvent),\n 'pending_version' : IDL.Opt(UpgradeInProgress),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n 'sns_metadata' : IDL.Opt(ManageSnsMetadata),\n 'neurons' : IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n 'genesis_timestamp_seconds' : IDL.Nat64,\n });\n const GetMetadataResponse = IDL.Record({\n 'url' : IDL.Opt(IDL.Text),\n 'logo' : IDL.Opt(IDL.Text),\n 'name' : IDL.Opt(IDL.Text),\n 'description' : IDL.Opt(IDL.Text),\n });\n const GetNeuron = IDL.Record({ 'neuron_id' : IDL.Opt(NeuronId) });\n const Result = IDL.Variant({ 'Error' : GovernanceError, 'Neuron' : Neuron });\n const GetNeuronResponse = IDL.Record({ 'result' : IDL.Opt(Result) });\n const GetProposal = IDL.Record({ 'proposal_id' : IDL.Opt(ProposalId) });\n const Result_1 = IDL.Variant({\n 'Error' : GovernanceError,\n 'Proposal' : ProposalData,\n });\n const GetProposalResponse = IDL.Record({ 'result' : IDL.Opt(Result_1) });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'controller' : IDL.Principal,\n 'freezing_threshold' : IDL.Nat,\n 'controllers' : IDL.Vec(IDL.Principal),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType,\n 'freezing_threshold' : IDL.Nat,\n 'balance' : IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)),\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetRunningSnsVersionResponse = IDL.Record({\n 'deployed_version' : IDL.Opt(Version),\n 'pending_version' : IDL.Opt(UpgradeInProgress),\n });\n const GetSnsInitializationParametersResponse = IDL.Record({\n 'sns_initialization_parameters' : IDL.Text,\n });\n const ListNervousSystemFunctionsResponse = IDL.Record({\n 'reserved_ids' : IDL.Vec(IDL.Nat64),\n 'functions' : IDL.Vec(NervousSystemFunction),\n });\n const ListNeurons = IDL.Record({\n 'of_principal' : IDL.Opt(IDL.Principal),\n 'limit' : IDL.Nat32,\n 'start_page_at' : IDL.Opt(NeuronId),\n });\n const ListNeuronsResponse = IDL.Record({ 'neurons' : IDL.Vec(Neuron) });\n const ListProposals = IDL.Record({\n 'include_reward_status' : IDL.Vec(IDL.Int32),\n 'before_proposal' : IDL.Opt(ProposalId),\n 'limit' : IDL.Nat32,\n 'exclude_type' : IDL.Vec(IDL.Nat64),\n 'include_status' : IDL.Vec(IDL.Int32),\n });\n const ListProposalsResponse = IDL.Record({\n 'proposals' : IDL.Vec(ProposalData),\n });\n const Command = IDL.Variant({\n 'Split' : Split,\n 'Follow' : Follow,\n 'DisburseMaturity' : DisburseMaturity,\n 'ClaimOrRefresh' : ClaimOrRefresh,\n 'Configure' : Configure,\n 'RegisterVote' : RegisterVote,\n 'MakeProposal' : Proposal,\n 'RemoveNeuronPermissions' : RemoveNeuronPermissions,\n 'AddNeuronPermissions' : AddNeuronPermissions,\n 'MergeMaturity' : MergeMaturity,\n 'Disburse' : Disburse,\n });\n const ManageNeuron = IDL.Record({\n 'subaccount' : IDL.Vec(IDL.Nat8),\n 'command' : IDL.Opt(Command),\n });\n const SplitResponse = IDL.Record({ 'created_neuron_id' : IDL.Opt(NeuronId) });\n const DisburseMaturityResponse = IDL.Record({\n 'transfer_block_height' : IDL.Nat64,\n 'amount_disbursed_e8s' : IDL.Nat64,\n });\n const ClaimOrRefreshResponse = IDL.Record({\n 'refreshed_neuron_id' : IDL.Opt(NeuronId),\n });\n const MergeMaturityResponse = IDL.Record({\n 'merged_maturity_e8s' : IDL.Nat64,\n 'new_stake_e8s' : IDL.Nat64,\n });\n const DisburseResponse = IDL.Record({ 'transfer_block_height' : IDL.Nat64 });\n const Command_1 = IDL.Variant({\n 'Error' : GovernanceError,\n 'Split' : SplitResponse,\n 'Follow' : IDL.Record({}),\n 'DisburseMaturity' : DisburseMaturityResponse,\n 'ClaimOrRefresh' : ClaimOrRefreshResponse,\n 'Configure' : IDL.Record({}),\n 'RegisterVote' : IDL.Record({}),\n 'MakeProposal' : GetProposal,\n 'RemoveNeuronPermission' : IDL.Record({}),\n 'MergeMaturity' : MergeMaturityResponse,\n 'Disburse' : DisburseResponse,\n 'AddNeuronPermission' : IDL.Record({}),\n });\n const ManageNeuronResponse = IDL.Record({ 'command' : IDL.Opt(Command_1) });\n const SetMode = IDL.Record({ 'mode' : IDL.Int32 });\n return IDL.Service({\n 'get_build_metadata' : IDL.Func([], [IDL.Text], []),\n 'get_metadata' : IDL.Func([IDL.Record({})], [GetMetadataResponse], []),\n 'get_nervous_system_parameters' : IDL.Func(\n [IDL.Null],\n [NervousSystemParameters],\n [],\n ),\n 'get_neuron' : IDL.Func([GetNeuron], [GetNeuronResponse], []),\n 'get_proposal' : IDL.Func([GetProposal], [GetProposalResponse], []),\n 'get_root_canister_status' : IDL.Func(\n [IDL.Null],\n [CanisterStatusResultV2],\n [],\n ),\n 'get_running_sns_version' : IDL.Func(\n [IDL.Record({})],\n [GetRunningSnsVersionResponse],\n [],\n ),\n 'get_sns_initialization_parameters' : IDL.Func(\n [IDL.Record({})],\n [GetSnsInitializationParametersResponse],\n [],\n ),\n 'list_nervous_system_functions' : IDL.Func(\n [],\n [ListNervousSystemFunctionsResponse],\n [],\n ),\n 'list_neurons' : IDL.Func([ListNeurons], [ListNeuronsResponse], []),\n 'list_proposals' : IDL.Func([ListProposals], [ListProposalsResponse], []),\n 'manage_neuron' : IDL.Func([ManageNeuron], [ManageNeuronResponse], []),\n 'set_mode' : IDL.Func([SetMode], [IDL.Record({})], []),\n });\n};\nexport const init = ({ IDL }) => {\n const GenericNervousSystemFunction = IDL.Record({\n 'validator_canister_id' : IDL.Opt(IDL.Principal),\n 'target_canister_id' : IDL.Opt(IDL.Principal),\n 'validator_method_name' : IDL.Opt(IDL.Text),\n 'target_method_name' : IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n 'NativeNervousSystemFunction' : IDL.Record({}),\n 'GenericNervousSystemFunction' : GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n 'id' : IDL.Nat64,\n 'name' : IDL.Text,\n 'description' : IDL.Opt(IDL.Text),\n 'function_type' : IDL.Opt(FunctionType),\n });\n const GovernanceCachedMetrics = IDL.Record({\n 'not_dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'garbage_collectable_neurons_count' : IDL.Nat64,\n 'neurons_with_invalid_stake_count' : IDL.Nat64,\n 'not_dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64,\n 'dissolved_neurons_count' : IDL.Nat64,\n 'total_staked_e8s' : IDL.Nat64,\n 'total_supply_governance_tokens' : IDL.Nat64,\n 'not_dissolving_neurons_count' : IDL.Nat64,\n 'dissolved_neurons_e8s' : IDL.Nat64,\n 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,\n 'dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'dissolving_neurons_count' : IDL.Nat64,\n 'dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'timestamp_seconds' : IDL.Nat64,\n });\n const NeuronId = IDL.Record({ 'id' : IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ 'followees' : IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n 'permissions' : IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n 'start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'final_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'initial_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'reward_rate_transition_duration_seconds' : IDL.Opt(IDL.Nat64),\n 'round_duration_seconds' : IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n 'default_followees' : IDL.Opt(DefaultFollowees),\n 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64),\n 'max_followees_per_function' : IDL.Opt(IDL.Nat64),\n 'neuron_claimer_permissions' : IDL.Opt(NeuronPermissionList),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'max_neuron_age_for_age_bonus' : IDL.Opt(IDL.Nat64),\n 'initial_voting_period_seconds' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_dissolve_delay_to_vote_seconds' : IDL.Opt(IDL.Nat64),\n 'reject_cost_e8s' : IDL.Opt(IDL.Nat64),\n 'max_proposals_to_keep_per_action' : IDL.Opt(IDL.Nat32),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Opt(IDL.Nat64),\n 'max_number_of_neurons' : IDL.Opt(IDL.Nat64),\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'max_number_of_proposals_with_ballots' : IDL.Opt(IDL.Nat64),\n 'neuron_grantable_permissions' : IDL.Opt(NeuronPermissionList),\n 'voting_rewards_parameters' : IDL.Opt(VotingRewardsParameters),\n 'max_number_of_principals_per_neuron' : IDL.Opt(IDL.Nat64),\n });\n const Version = IDL.Record({\n 'archive_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'root_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'swap_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'ledger_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'governance_wasm_hash' : IDL.Vec(IDL.Nat8),\n });\n const ProposalId = IDL.Record({ 'id' : IDL.Nat64 });\n const RewardEvent = IDL.Record({\n 'actual_timestamp_seconds' : IDL.Nat64,\n 'distributed_e8s_equivalent' : IDL.Nat64,\n 'round' : IDL.Nat64,\n 'settled_proposals' : IDL.Vec(ProposalId),\n });\n const UpgradeInProgress = IDL.Record({\n 'mark_failed_at_seconds' : IDL.Nat64,\n 'checking_upgrade_lock' : IDL.Nat64,\n 'proposal_id' : IDL.Nat64,\n 'target_version' : IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Ballot = IDL.Record({\n 'vote' : IDL.Int32,\n 'cast_timestamp_seconds' : IDL.Nat64,\n 'voting_power' : IDL.Nat64,\n });\n const Tally = IDL.Record({\n 'no' : IDL.Nat64,\n 'yes' : IDL.Nat64,\n 'total' : IDL.Nat64,\n 'timestamp_seconds' : IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n 'new_canister_wasm' : IDL.Vec(IDL.Nat8),\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const ManageSnsMetadata = IDL.Record({\n 'url' : IDL.Opt(IDL.Text),\n 'logo' : IDL.Opt(IDL.Text),\n 'name' : IDL.Opt(IDL.Text),\n 'description' : IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'payload' : IDL.Vec(IDL.Nat8),\n });\n const Motion = IDL.Record({ 'motion_text' : IDL.Text });\n const Action = IDL.Variant({\n 'ManageNervousSystemParameters' : NervousSystemParameters,\n 'AddGenericNervousSystemFunction' : NervousSystemFunction,\n 'RemoveGenericNervousSystemFunction' : IDL.Nat64,\n 'UpgradeSnsToNextVersion' : IDL.Record({}),\n 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,\n 'Unspecified' : IDL.Record({}),\n 'ManageSnsMetadata' : ManageSnsMetadata,\n 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,\n 'Motion' : Motion,\n });\n const Proposal = IDL.Record({\n 'url' : IDL.Text,\n 'title' : IDL.Text,\n 'action' : IDL.Opt(Action),\n 'summary' : IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n 'current_deadline_timestamp_seconds' : IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n 'id' : IDL.Opt(ProposalId),\n 'payload_text_rendering' : IDL.Opt(IDL.Text),\n 'action' : IDL.Nat64,\n 'failure_reason' : IDL.Opt(GovernanceError),\n 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n 'reward_event_round' : IDL.Nat64,\n 'failed_timestamp_seconds' : IDL.Nat64,\n 'proposal_creation_timestamp_seconds' : IDL.Nat64,\n 'initial_voting_period_seconds' : IDL.Nat64,\n 'reject_cost_e8s' : IDL.Nat64,\n 'latest_tally' : IDL.Opt(Tally),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Nat64,\n 'decided_timestamp_seconds' : IDL.Nat64,\n 'proposal' : IDL.Opt(Proposal),\n 'proposer' : IDL.Opt(NeuronId),\n 'wait_for_quiet_state' : IDL.Opt(WaitForQuietState),\n 'is_eligible_for_rewards' : IDL.Bool,\n 'executed_timestamp_seconds' : IDL.Nat64,\n });\n const Split = IDL.Record({ 'memo' : IDL.Nat64, 'amount_e8s' : IDL.Nat64 });\n const Follow = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'followees' : IDL.Vec(NeuronId),\n });\n const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n 'owner' : IDL.Opt(IDL.Principal),\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const DisburseMaturity = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'percentage_to_disburse' : IDL.Nat32,\n });\n const IncreaseDissolveDelay = IDL.Record({\n 'additional_dissolve_delay_seconds' : IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n 'dissolve_timestamp_seconds' : IDL.Nat64,\n });\n const Operation = IDL.Variant({\n 'StopDissolving' : IDL.Record({}),\n 'StartDissolving' : IDL.Record({}),\n 'IncreaseDissolveDelay' : IncreaseDissolveDelay,\n 'SetDissolveTimestamp' : SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ 'operation' : IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n 'vote' : IDL.Int32,\n 'proposal' : IDL.Opt(ProposalId),\n });\n const MemoAndController = IDL.Record({\n 'controller' : IDL.Opt(IDL.Principal),\n 'memo' : IDL.Nat64,\n });\n const By = IDL.Variant({\n 'MemoAndController' : MemoAndController,\n 'NeuronId' : IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ 'by' : IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n 'permissions_to_remove' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n 'permissions_to_add' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });\n const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });\n const Disburse = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'amount' : IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n 'Split' : Split,\n 'Follow' : Follow,\n 'DisburseMaturity' : DisburseMaturity,\n 'Configure' : Configure,\n 'RegisterVote' : RegisterVote,\n 'MakeProposal' : Proposal,\n 'ClaimOrRefreshNeuron' : ClaimOrRefresh,\n 'RemoveNeuronPermissions' : RemoveNeuronPermissions,\n 'AddNeuronPermissions' : AddNeuronPermissions,\n 'MergeMaturity' : MergeMaturity,\n 'Disburse' : Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n 'command' : IDL.Opt(Command_2),\n 'timestamp' : IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n 'principal' : IDL.Opt(IDL.Principal),\n 'permission_type' : IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n 'DissolveDelaySeconds' : IDL.Nat64,\n 'WhenDissolvedTimestampSeconds' : IDL.Nat64,\n });\n const Neuron = IDL.Record({\n 'id' : IDL.Opt(NeuronId),\n 'permissions' : IDL.Vec(NeuronPermission),\n 'maturity_e8s_equivalent' : IDL.Nat64,\n 'cached_neuron_stake_e8s' : IDL.Nat64,\n 'created_timestamp_seconds' : IDL.Nat64,\n 'aging_since_timestamp_seconds' : IDL.Nat64,\n 'dissolve_state' : IDL.Opt(DissolveState),\n 'voting_power_percentage_multiplier' : IDL.Nat64,\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n 'neuron_fees_e8s' : IDL.Nat64,\n });\n const Governance = IDL.Record({\n 'root_canister_id' : IDL.Opt(IDL.Principal),\n 'id_to_nervous_system_functions' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction)\n ),\n 'metrics' : IDL.Opt(GovernanceCachedMetrics),\n 'mode' : IDL.Int32,\n 'parameters' : IDL.Opt(NervousSystemParameters),\n 'deployed_version' : IDL.Opt(Version),\n 'sns_initialization_parameters' : IDL.Text,\n 'latest_reward_event' : IDL.Opt(RewardEvent),\n 'pending_version' : IDL.Opt(UpgradeInProgress),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n 'sns_metadata' : IDL.Opt(ManageSnsMetadata),\n 'neurons' : IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n 'genesis_timestamp_seconds' : IDL.Nat64,\n });\n return [Governance];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_governance.did */\nexport const idlFactory = ({ IDL }) => {\n const GenericNervousSystemFunction = IDL.Record({\n 'validator_canister_id' : IDL.Opt(IDL.Principal),\n 'target_canister_id' : IDL.Opt(IDL.Principal),\n 'validator_method_name' : IDL.Opt(IDL.Text),\n 'target_method_name' : IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n 'NativeNervousSystemFunction' : IDL.Record({}),\n 'GenericNervousSystemFunction' : GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n 'id' : IDL.Nat64,\n 'name' : IDL.Text,\n 'description' : IDL.Opt(IDL.Text),\n 'function_type' : IDL.Opt(FunctionType),\n });\n const GovernanceCachedMetrics = IDL.Record({\n 'not_dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'garbage_collectable_neurons_count' : IDL.Nat64,\n 'neurons_with_invalid_stake_count' : IDL.Nat64,\n 'not_dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64,\n 'dissolved_neurons_count' : IDL.Nat64,\n 'total_staked_e8s' : IDL.Nat64,\n 'total_supply_governance_tokens' : IDL.Nat64,\n 'not_dissolving_neurons_count' : IDL.Nat64,\n 'dissolved_neurons_e8s' : IDL.Nat64,\n 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,\n 'dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'dissolving_neurons_count' : IDL.Nat64,\n 'dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'timestamp_seconds' : IDL.Nat64,\n });\n const NeuronId = IDL.Record({ 'id' : IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ 'followees' : IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n 'permissions' : IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n 'start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'final_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'initial_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'reward_rate_transition_duration_seconds' : IDL.Opt(IDL.Nat64),\n 'round_duration_seconds' : IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n 'default_followees' : IDL.Opt(DefaultFollowees),\n 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64),\n 'max_followees_per_function' : IDL.Opt(IDL.Nat64),\n 'neuron_claimer_permissions' : IDL.Opt(NeuronPermissionList),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'max_neuron_age_for_age_bonus' : IDL.Opt(IDL.Nat64),\n 'initial_voting_period_seconds' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_dissolve_delay_to_vote_seconds' : IDL.Opt(IDL.Nat64),\n 'reject_cost_e8s' : IDL.Opt(IDL.Nat64),\n 'max_proposals_to_keep_per_action' : IDL.Opt(IDL.Nat32),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Opt(IDL.Nat64),\n 'max_number_of_neurons' : IDL.Opt(IDL.Nat64),\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'max_number_of_proposals_with_ballots' : IDL.Opt(IDL.Nat64),\n 'neuron_grantable_permissions' : IDL.Opt(NeuronPermissionList),\n 'voting_rewards_parameters' : IDL.Opt(VotingRewardsParameters),\n 'max_number_of_principals_per_neuron' : IDL.Opt(IDL.Nat64),\n });\n const Version = IDL.Record({\n 'archive_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'root_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'swap_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'ledger_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'governance_wasm_hash' : IDL.Vec(IDL.Nat8),\n });\n const ProposalId = IDL.Record({ 'id' : IDL.Nat64 });\n const RewardEvent = IDL.Record({\n 'actual_timestamp_seconds' : IDL.Nat64,\n 'distributed_e8s_equivalent' : IDL.Nat64,\n 'round' : IDL.Nat64,\n 'settled_proposals' : IDL.Vec(ProposalId),\n });\n const UpgradeInProgress = IDL.Record({\n 'mark_failed_at_seconds' : IDL.Nat64,\n 'checking_upgrade_lock' : IDL.Nat64,\n 'proposal_id' : IDL.Nat64,\n 'target_version' : IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Ballot = IDL.Record({\n 'vote' : IDL.Int32,\n 'cast_timestamp_seconds' : IDL.Nat64,\n 'voting_power' : IDL.Nat64,\n });\n const Tally = IDL.Record({\n 'no' : IDL.Nat64,\n 'yes' : IDL.Nat64,\n 'total' : IDL.Nat64,\n 'timestamp_seconds' : IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n 'new_canister_wasm' : IDL.Vec(IDL.Nat8),\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const ManageSnsMetadata = IDL.Record({\n 'url' : IDL.Opt(IDL.Text),\n 'logo' : IDL.Opt(IDL.Text),\n 'name' : IDL.Opt(IDL.Text),\n 'description' : IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'payload' : IDL.Vec(IDL.Nat8),\n });\n const Motion = IDL.Record({ 'motion_text' : IDL.Text });\n const Action = IDL.Variant({\n 'ManageNervousSystemParameters' : NervousSystemParameters,\n 'AddGenericNervousSystemFunction' : NervousSystemFunction,\n 'RemoveGenericNervousSystemFunction' : IDL.Nat64,\n 'UpgradeSnsToNextVersion' : IDL.Record({}),\n 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,\n 'Unspecified' : IDL.Record({}),\n 'ManageSnsMetadata' : ManageSnsMetadata,\n 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,\n 'Motion' : Motion,\n });\n const Proposal = IDL.Record({\n 'url' : IDL.Text,\n 'title' : IDL.Text,\n 'action' : IDL.Opt(Action),\n 'summary' : IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n 'current_deadline_timestamp_seconds' : IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n 'id' : IDL.Opt(ProposalId),\n 'payload_text_rendering' : IDL.Opt(IDL.Text),\n 'action' : IDL.Nat64,\n 'failure_reason' : IDL.Opt(GovernanceError),\n 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n 'reward_event_round' : IDL.Nat64,\n 'failed_timestamp_seconds' : IDL.Nat64,\n 'proposal_creation_timestamp_seconds' : IDL.Nat64,\n 'initial_voting_period_seconds' : IDL.Nat64,\n 'reject_cost_e8s' : IDL.Nat64,\n 'latest_tally' : IDL.Opt(Tally),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Nat64,\n 'decided_timestamp_seconds' : IDL.Nat64,\n 'proposal' : IDL.Opt(Proposal),\n 'proposer' : IDL.Opt(NeuronId),\n 'wait_for_quiet_state' : IDL.Opt(WaitForQuietState),\n 'is_eligible_for_rewards' : IDL.Bool,\n 'executed_timestamp_seconds' : IDL.Nat64,\n });\n const Split = IDL.Record({ 'memo' : IDL.Nat64, 'amount_e8s' : IDL.Nat64 });\n const Follow = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'followees' : IDL.Vec(NeuronId),\n });\n const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n 'owner' : IDL.Opt(IDL.Principal),\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const DisburseMaturity = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'percentage_to_disburse' : IDL.Nat32,\n });\n const IncreaseDissolveDelay = IDL.Record({\n 'additional_dissolve_delay_seconds' : IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n 'dissolve_timestamp_seconds' : IDL.Nat64,\n });\n const Operation = IDL.Variant({\n 'StopDissolving' : IDL.Record({}),\n 'StartDissolving' : IDL.Record({}),\n 'IncreaseDissolveDelay' : IncreaseDissolveDelay,\n 'SetDissolveTimestamp' : SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ 'operation' : IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n 'vote' : IDL.Int32,\n 'proposal' : IDL.Opt(ProposalId),\n });\n const MemoAndController = IDL.Record({\n 'controller' : IDL.Opt(IDL.Principal),\n 'memo' : IDL.Nat64,\n });\n const By = IDL.Variant({\n 'MemoAndController' : MemoAndController,\n 'NeuronId' : IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ 'by' : IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n 'permissions_to_remove' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n 'permissions_to_add' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });\n const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });\n const Disburse = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'amount' : IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n 'Split' : Split,\n 'Follow' : Follow,\n 'DisburseMaturity' : DisburseMaturity,\n 'Configure' : Configure,\n 'RegisterVote' : RegisterVote,\n 'MakeProposal' : Proposal,\n 'ClaimOrRefreshNeuron' : ClaimOrRefresh,\n 'RemoveNeuronPermissions' : RemoveNeuronPermissions,\n 'AddNeuronPermissions' : AddNeuronPermissions,\n 'MergeMaturity' : MergeMaturity,\n 'Disburse' : Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n 'command' : IDL.Opt(Command_2),\n 'timestamp' : IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n 'principal' : IDL.Opt(IDL.Principal),\n 'permission_type' : IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n 'DissolveDelaySeconds' : IDL.Nat64,\n 'WhenDissolvedTimestampSeconds' : IDL.Nat64,\n });\n const Neuron = IDL.Record({\n 'id' : IDL.Opt(NeuronId),\n 'permissions' : IDL.Vec(NeuronPermission),\n 'maturity_e8s_equivalent' : IDL.Nat64,\n 'cached_neuron_stake_e8s' : IDL.Nat64,\n 'created_timestamp_seconds' : IDL.Nat64,\n 'aging_since_timestamp_seconds' : IDL.Nat64,\n 'dissolve_state' : IDL.Opt(DissolveState),\n 'voting_power_percentage_multiplier' : IDL.Nat64,\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n 'neuron_fees_e8s' : IDL.Nat64,\n });\n const Governance = IDL.Record({\n 'root_canister_id' : IDL.Opt(IDL.Principal),\n 'id_to_nervous_system_functions' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction)\n ),\n 'metrics' : IDL.Opt(GovernanceCachedMetrics),\n 'mode' : IDL.Int32,\n 'parameters' : IDL.Opt(NervousSystemParameters),\n 'deployed_version' : IDL.Opt(Version),\n 'sns_initialization_parameters' : IDL.Text,\n 'latest_reward_event' : IDL.Opt(RewardEvent),\n 'pending_version' : IDL.Opt(UpgradeInProgress),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n 'sns_metadata' : IDL.Opt(ManageSnsMetadata),\n 'neurons' : IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n 'genesis_timestamp_seconds' : IDL.Nat64,\n });\n const GetMetadataResponse = IDL.Record({\n 'url' : IDL.Opt(IDL.Text),\n 'logo' : IDL.Opt(IDL.Text),\n 'name' : IDL.Opt(IDL.Text),\n 'description' : IDL.Opt(IDL.Text),\n });\n const GetNeuron = IDL.Record({ 'neuron_id' : IDL.Opt(NeuronId) });\n const Result = IDL.Variant({ 'Error' : GovernanceError, 'Neuron' : Neuron });\n const GetNeuronResponse = IDL.Record({ 'result' : IDL.Opt(Result) });\n const GetProposal = IDL.Record({ 'proposal_id' : IDL.Opt(ProposalId) });\n const Result_1 = IDL.Variant({\n 'Error' : GovernanceError,\n 'Proposal' : ProposalData,\n });\n const GetProposalResponse = IDL.Record({ 'result' : IDL.Opt(Result_1) });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'controller' : IDL.Principal,\n 'freezing_threshold' : IDL.Nat,\n 'controllers' : IDL.Vec(IDL.Principal),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType,\n 'freezing_threshold' : IDL.Nat,\n 'balance' : IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)),\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetRunningSnsVersionResponse = IDL.Record({\n 'deployed_version' : IDL.Opt(Version),\n 'pending_version' : IDL.Opt(UpgradeInProgress),\n });\n const GetSnsInitializationParametersResponse = IDL.Record({\n 'sns_initialization_parameters' : IDL.Text,\n });\n const ListNervousSystemFunctionsResponse = IDL.Record({\n 'reserved_ids' : IDL.Vec(IDL.Nat64),\n 'functions' : IDL.Vec(NervousSystemFunction),\n });\n const ListNeurons = IDL.Record({\n 'of_principal' : IDL.Opt(IDL.Principal),\n 'limit' : IDL.Nat32,\n 'start_page_at' : IDL.Opt(NeuronId),\n });\n const ListNeuronsResponse = IDL.Record({ 'neurons' : IDL.Vec(Neuron) });\n const ListProposals = IDL.Record({\n 'include_reward_status' : IDL.Vec(IDL.Int32),\n 'before_proposal' : IDL.Opt(ProposalId),\n 'limit' : IDL.Nat32,\n 'exclude_type' : IDL.Vec(IDL.Nat64),\n 'include_status' : IDL.Vec(IDL.Int32),\n });\n const ListProposalsResponse = IDL.Record({\n 'proposals' : IDL.Vec(ProposalData),\n });\n const Command = IDL.Variant({\n 'Split' : Split,\n 'Follow' : Follow,\n 'DisburseMaturity' : DisburseMaturity,\n 'ClaimOrRefresh' : ClaimOrRefresh,\n 'Configure' : Configure,\n 'RegisterVote' : RegisterVote,\n 'MakeProposal' : Proposal,\n 'RemoveNeuronPermissions' : RemoveNeuronPermissions,\n 'AddNeuronPermissions' : AddNeuronPermissions,\n 'MergeMaturity' : MergeMaturity,\n 'Disburse' : Disburse,\n });\n const ManageNeuron = IDL.Record({\n 'subaccount' : IDL.Vec(IDL.Nat8),\n 'command' : IDL.Opt(Command),\n });\n const SplitResponse = IDL.Record({ 'created_neuron_id' : IDL.Opt(NeuronId) });\n const DisburseMaturityResponse = IDL.Record({\n 'transfer_block_height' : IDL.Nat64,\n 'amount_disbursed_e8s' : IDL.Nat64,\n });\n const ClaimOrRefreshResponse = IDL.Record({\n 'refreshed_neuron_id' : IDL.Opt(NeuronId),\n });\n const MergeMaturityResponse = IDL.Record({\n 'merged_maturity_e8s' : IDL.Nat64,\n 'new_stake_e8s' : IDL.Nat64,\n });\n const DisburseResponse = IDL.Record({ 'transfer_block_height' : IDL.Nat64 });\n const Command_1 = IDL.Variant({\n 'Error' : GovernanceError,\n 'Split' : SplitResponse,\n 'Follow' : IDL.Record({}),\n 'DisburseMaturity' : DisburseMaturityResponse,\n 'ClaimOrRefresh' : ClaimOrRefreshResponse,\n 'Configure' : IDL.Record({}),\n 'RegisterVote' : IDL.Record({}),\n 'MakeProposal' : GetProposal,\n 'RemoveNeuronPermission' : IDL.Record({}),\n 'MergeMaturity' : MergeMaturityResponse,\n 'Disburse' : DisburseResponse,\n 'AddNeuronPermission' : IDL.Record({}),\n });\n const ManageNeuronResponse = IDL.Record({ 'command' : IDL.Opt(Command_1) });\n const SetMode = IDL.Record({ 'mode' : IDL.Int32 });\n return IDL.Service({\n 'get_build_metadata' : IDL.Func([], [IDL.Text], ['query']),\n 'get_metadata' : IDL.Func(\n [IDL.Record({})],\n [GetMetadataResponse],\n ['query'],\n ),\n 'get_nervous_system_parameters' : IDL.Func(\n [IDL.Null],\n [NervousSystemParameters],\n ['query'],\n ),\n 'get_neuron' : IDL.Func([GetNeuron], [GetNeuronResponse], ['query']),\n 'get_proposal' : IDL.Func([GetProposal], [GetProposalResponse], ['query']),\n 'get_root_canister_status' : IDL.Func(\n [IDL.Null],\n [CanisterStatusResultV2],\n [],\n ),\n 'get_running_sns_version' : IDL.Func(\n [IDL.Record({})],\n [GetRunningSnsVersionResponse],\n ['query'],\n ),\n 'get_sns_initialization_parameters' : IDL.Func(\n [IDL.Record({})],\n [GetSnsInitializationParametersResponse],\n ['query'],\n ),\n 'list_nervous_system_functions' : IDL.Func(\n [],\n [ListNervousSystemFunctionsResponse],\n ['query'],\n ),\n 'list_neurons' : IDL.Func([ListNeurons], [ListNeuronsResponse], ['query']),\n 'list_proposals' : IDL.Func(\n [ListProposals],\n [ListProposalsResponse],\n ['query'],\n ),\n 'manage_neuron' : IDL.Func([ManageNeuron], [ManageNeuronResponse], []),\n 'set_mode' : IDL.Func([SetMode], [IDL.Record({})], []),\n });\n};\nexport const init = ({ IDL }) => {\n const GenericNervousSystemFunction = IDL.Record({\n 'validator_canister_id' : IDL.Opt(IDL.Principal),\n 'target_canister_id' : IDL.Opt(IDL.Principal),\n 'validator_method_name' : IDL.Opt(IDL.Text),\n 'target_method_name' : IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n 'NativeNervousSystemFunction' : IDL.Record({}),\n 'GenericNervousSystemFunction' : GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n 'id' : IDL.Nat64,\n 'name' : IDL.Text,\n 'description' : IDL.Opt(IDL.Text),\n 'function_type' : IDL.Opt(FunctionType),\n });\n const GovernanceCachedMetrics = IDL.Record({\n 'not_dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'garbage_collectable_neurons_count' : IDL.Nat64,\n 'neurons_with_invalid_stake_count' : IDL.Nat64,\n 'not_dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64,\n 'dissolved_neurons_count' : IDL.Nat64,\n 'total_staked_e8s' : IDL.Nat64,\n 'total_supply_governance_tokens' : IDL.Nat64,\n 'not_dissolving_neurons_count' : IDL.Nat64,\n 'dissolved_neurons_e8s' : IDL.Nat64,\n 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,\n 'dissolving_neurons_count_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64)\n ),\n 'dissolving_neurons_count' : IDL.Nat64,\n 'dissolving_neurons_e8s_buckets' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64)\n ),\n 'timestamp_seconds' : IDL.Nat64,\n });\n const NeuronId = IDL.Record({ 'id' : IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ 'followees' : IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n 'permissions' : IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n 'start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'final_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'initial_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'reward_rate_transition_duration_seconds' : IDL.Opt(IDL.Nat64),\n 'round_duration_seconds' : IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n 'default_followees' : IDL.Opt(DefaultFollowees),\n 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64),\n 'max_followees_per_function' : IDL.Opt(IDL.Nat64),\n 'neuron_claimer_permissions' : IDL.Opt(NeuronPermissionList),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'max_neuron_age_for_age_bonus' : IDL.Opt(IDL.Nat64),\n 'initial_voting_period_seconds' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_dissolve_delay_to_vote_seconds' : IDL.Opt(IDL.Nat64),\n 'reject_cost_e8s' : IDL.Opt(IDL.Nat64),\n 'max_proposals_to_keep_per_action' : IDL.Opt(IDL.Nat32),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Opt(IDL.Nat64),\n 'max_number_of_neurons' : IDL.Opt(IDL.Nat64),\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'max_number_of_proposals_with_ballots' : IDL.Opt(IDL.Nat64),\n 'neuron_grantable_permissions' : IDL.Opt(NeuronPermissionList),\n 'voting_rewards_parameters' : IDL.Opt(VotingRewardsParameters),\n 'max_number_of_principals_per_neuron' : IDL.Opt(IDL.Nat64),\n });\n const Version = IDL.Record({\n 'archive_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'root_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'swap_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'ledger_wasm_hash' : IDL.Vec(IDL.Nat8),\n 'governance_wasm_hash' : IDL.Vec(IDL.Nat8),\n });\n const ProposalId = IDL.Record({ 'id' : IDL.Nat64 });\n const RewardEvent = IDL.Record({\n 'actual_timestamp_seconds' : IDL.Nat64,\n 'distributed_e8s_equivalent' : IDL.Nat64,\n 'round' : IDL.Nat64,\n 'settled_proposals' : IDL.Vec(ProposalId),\n });\n const UpgradeInProgress = IDL.Record({\n 'mark_failed_at_seconds' : IDL.Nat64,\n 'checking_upgrade_lock' : IDL.Nat64,\n 'proposal_id' : IDL.Nat64,\n 'target_version' : IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Ballot = IDL.Record({\n 'vote' : IDL.Int32,\n 'cast_timestamp_seconds' : IDL.Nat64,\n 'voting_power' : IDL.Nat64,\n });\n const Tally = IDL.Record({\n 'no' : IDL.Nat64,\n 'yes' : IDL.Nat64,\n 'total' : IDL.Nat64,\n 'timestamp_seconds' : IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n 'new_canister_wasm' : IDL.Vec(IDL.Nat8),\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const ManageSnsMetadata = IDL.Record({\n 'url' : IDL.Opt(IDL.Text),\n 'logo' : IDL.Opt(IDL.Text),\n 'name' : IDL.Opt(IDL.Text),\n 'description' : IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'payload' : IDL.Vec(IDL.Nat8),\n });\n const Motion = IDL.Record({ 'motion_text' : IDL.Text });\n const Action = IDL.Variant({\n 'ManageNervousSystemParameters' : NervousSystemParameters,\n 'AddGenericNervousSystemFunction' : NervousSystemFunction,\n 'RemoveGenericNervousSystemFunction' : IDL.Nat64,\n 'UpgradeSnsToNextVersion' : IDL.Record({}),\n 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,\n 'Unspecified' : IDL.Record({}),\n 'ManageSnsMetadata' : ManageSnsMetadata,\n 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,\n 'Motion' : Motion,\n });\n const Proposal = IDL.Record({\n 'url' : IDL.Text,\n 'title' : IDL.Text,\n 'action' : IDL.Opt(Action),\n 'summary' : IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n 'current_deadline_timestamp_seconds' : IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n 'id' : IDL.Opt(ProposalId),\n 'payload_text_rendering' : IDL.Opt(IDL.Text),\n 'action' : IDL.Nat64,\n 'failure_reason' : IDL.Opt(GovernanceError),\n 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n 'reward_event_round' : IDL.Nat64,\n 'failed_timestamp_seconds' : IDL.Nat64,\n 'proposal_creation_timestamp_seconds' : IDL.Nat64,\n 'initial_voting_period_seconds' : IDL.Nat64,\n 'reject_cost_e8s' : IDL.Nat64,\n 'latest_tally' : IDL.Opt(Tally),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Nat64,\n 'decided_timestamp_seconds' : IDL.Nat64,\n 'proposal' : IDL.Opt(Proposal),\n 'proposer' : IDL.Opt(NeuronId),\n 'wait_for_quiet_state' : IDL.Opt(WaitForQuietState),\n 'is_eligible_for_rewards' : IDL.Bool,\n 'executed_timestamp_seconds' : IDL.Nat64,\n });\n const Split = IDL.Record({ 'memo' : IDL.Nat64, 'amount_e8s' : IDL.Nat64 });\n const Follow = IDL.Record({\n 'function_id' : IDL.Nat64,\n 'followees' : IDL.Vec(NeuronId),\n });\n const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n 'owner' : IDL.Opt(IDL.Principal),\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const DisburseMaturity = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'percentage_to_disburse' : IDL.Nat32,\n });\n const IncreaseDissolveDelay = IDL.Record({\n 'additional_dissolve_delay_seconds' : IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n 'dissolve_timestamp_seconds' : IDL.Nat64,\n });\n const Operation = IDL.Variant({\n 'StopDissolving' : IDL.Record({}),\n 'StartDissolving' : IDL.Record({}),\n 'IncreaseDissolveDelay' : IncreaseDissolveDelay,\n 'SetDissolveTimestamp' : SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ 'operation' : IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n 'vote' : IDL.Int32,\n 'proposal' : IDL.Opt(ProposalId),\n });\n const MemoAndController = IDL.Record({\n 'controller' : IDL.Opt(IDL.Principal),\n 'memo' : IDL.Nat64,\n });\n const By = IDL.Variant({\n 'MemoAndController' : MemoAndController,\n 'NeuronId' : IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ 'by' : IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n 'permissions_to_remove' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n 'permissions_to_add' : IDL.Opt(NeuronPermissionList),\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });\n const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });\n const Disburse = IDL.Record({\n 'to_account' : IDL.Opt(Account),\n 'amount' : IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n 'Split' : Split,\n 'Follow' : Follow,\n 'DisburseMaturity' : DisburseMaturity,\n 'Configure' : Configure,\n 'RegisterVote' : RegisterVote,\n 'MakeProposal' : Proposal,\n 'ClaimOrRefreshNeuron' : ClaimOrRefresh,\n 'RemoveNeuronPermissions' : RemoveNeuronPermissions,\n 'AddNeuronPermissions' : AddNeuronPermissions,\n 'MergeMaturity' : MergeMaturity,\n 'Disburse' : Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n 'command' : IDL.Opt(Command_2),\n 'timestamp' : IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n 'principal' : IDL.Opt(IDL.Principal),\n 'permission_type' : IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n 'DissolveDelaySeconds' : IDL.Nat64,\n 'WhenDissolvedTimestampSeconds' : IDL.Nat64,\n });\n const Neuron = IDL.Record({\n 'id' : IDL.Opt(NeuronId),\n 'permissions' : IDL.Vec(NeuronPermission),\n 'maturity_e8s_equivalent' : IDL.Nat64,\n 'cached_neuron_stake_e8s' : IDL.Nat64,\n 'created_timestamp_seconds' : IDL.Nat64,\n 'aging_since_timestamp_seconds' : IDL.Nat64,\n 'dissolve_state' : IDL.Opt(DissolveState),\n 'voting_power_percentage_multiplier' : IDL.Nat64,\n 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n 'neuron_fees_e8s' : IDL.Nat64,\n });\n const Governance = IDL.Record({\n 'root_canister_id' : IDL.Opt(IDL.Principal),\n 'id_to_nervous_system_functions' : IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction)\n ),\n 'metrics' : IDL.Opt(GovernanceCachedMetrics),\n 'mode' : IDL.Int32,\n 'parameters' : IDL.Opt(NervousSystemParameters),\n 'deployed_version' : IDL.Opt(Version),\n 'sns_initialization_parameters' : IDL.Text,\n 'latest_reward_event' : IDL.Opt(RewardEvent),\n 'pending_version' : IDL.Opt(UpgradeInProgress),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n 'sns_metadata' : IDL.Opt(ManageSnsMetadata),\n 'neurons' : IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n 'genesis_timestamp_seconds' : IDL.Nat64,\n });\n return [Governance];\n};\n", "import type { ManageNeuron } from \"../../candid/sns_governance\";\nimport type { SnsNeuronPermissionsParams } from \"../types/governance.params\";\n\nexport const toAddPermissionsRequest = ({\n neuronId,\n permissions,\n principal,\n}: SnsNeuronPermissionsParams): ManageNeuron => ({\n subaccount: neuronId.id,\n command: [\n {\n AddNeuronPermissions: {\n permissions_to_add: [{ permissions: Int32Array.from(permissions) }],\n principal_id: [principal],\n },\n },\n ],\n});\n\nexport const toRemovePermissionsRequest = ({\n neuronId,\n permissions,\n principal,\n}: SnsNeuronPermissionsParams): ManageNeuron => ({\n subaccount: neuronId.id,\n command: [\n {\n RemoveNeuronPermissions: {\n permissions_to_remove: [{ permissions: Int32Array.from(permissions) }],\n principal_id: [principal],\n },\n },\n ],\n});\n", "import type { Principal } from \"@dfinity/principal\";\nimport type { QueryParams } from \"../types/query.params\";\n\nexport abstract class Canister<T> {\n protected constructor(\n private readonly id: Principal,\n protected readonly service: T,\n protected readonly certifiedService: T\n ) {}\n\n get canisterId(): Principal {\n return this.id;\n }\n\n protected caller = ({ certified = true }: QueryParams): T =>\n certified ? this.certifiedService : this.service;\n}\n", "import { createServices, toNullable } from \"@dfinity/utils\";\nimport type {\n Tokens,\n _SERVICE as SnsLedgerService,\n} from \"../candid/icrc1_ledger\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/icrc1_ledger.certified.idl\";\nimport { idlFactory } from \"../candid/icrc1_ledger.idl\";\nimport { Canister } from \"./services/canister\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type { BalanceParams } from \"./types/ledger.params\";\nimport type { SnsTokenMetadataResponse } from \"./types/ledger.responses\";\nimport type { QueryParams } from \"./types/query.params\";\n\nexport class SnsLedgerCanister extends Canister<SnsLedgerService> {\n static create(options: SnsCanisterOptions<SnsLedgerService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsLedgerService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsLedgerCanister(canisterId, service, certifiedService);\n }\n\n /**\n * The token metadata (name, symbol, etc.).\n */\n metadata = (params: QueryParams): Promise<SnsTokenMetadataResponse> =>\n this.caller(params).icrc1_metadata();\n\n /**\n * Returns the balance of the given account.\n *\n * @param {BalanceParams} params The parameters to get the balance of an account.\n * @returns {Promise<Tokens>} The balance of the given account.\n */\n balance = (params: BalanceParams): Promise<Tokens> =>\n this.caller({ certified: params.certified }).icrc1_balance_of({\n owner: params.owner,\n subaccount: toNullable(params.subaccount),\n });\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/icrc1_ledger.did */\nexport const idlFactory = ({ IDL }) => {\n const Value = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const InitArgs = IDL.Record({\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat64,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, Value)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat64)),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'trigger_threshold' : IDL.Nat64,\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'token_name' : IDL.Text,\n });\n const Tokens = IDL.Nat;\n const Timestamp = IDL.Nat64;\n const TransferArg = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(Tokens),\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'from_subaccount' : IDL.Opt(Subaccount),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : Tokens,\n });\n const BlockIndex = IDL.Nat;\n const TransferError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'BadBurn' : IDL.Record({ 'min_burn_amount' : Tokens }),\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : Tokens }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : IDL.Nat64 }),\n 'TooOld' : IDL.Null,\n 'InsufficientFunds' : IDL.Record({ 'balance' : Tokens }),\n });\n const TransferResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : TransferError,\n });\n return IDL.Service({\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], []),\n 'icrc1_decimals' : IDL.Func([], [IDL.Nat8], []),\n 'icrc1_fee' : IDL.Func([], [Tokens], []),\n 'icrc1_metadata' : IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, Value))], []),\n 'icrc1_minting_account' : IDL.Func([], [IDL.Opt(Account)], []),\n 'icrc1_name' : IDL.Func([], [IDL.Text], []),\n 'icrc1_supported_standards' : IDL.Func(\n [],\n [IDL.Vec(IDL.Record({ 'url' : IDL.Text, 'name' : IDL.Text }))],\n [],\n ),\n 'icrc1_symbol' : IDL.Func([], [IDL.Text], []),\n 'icrc1_total_supply' : IDL.Func([], [Tokens], []),\n 'icrc1_transfer' : IDL.Func([TransferArg], [TransferResult], []),\n });\n};\nexport const init = ({ IDL }) => {\n const Value = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const InitArgs = IDL.Record({\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat64,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, Value)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat64)),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'trigger_threshold' : IDL.Nat64,\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'token_name' : IDL.Text,\n });\n return [InitArgs];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/icrc1_ledger.did */\nexport const idlFactory = ({ IDL }) => {\n const Value = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const InitArgs = IDL.Record({\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat64,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, Value)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat64)),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'trigger_threshold' : IDL.Nat64,\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'token_name' : IDL.Text,\n });\n const Tokens = IDL.Nat;\n const Timestamp = IDL.Nat64;\n const TransferArg = IDL.Record({\n 'to' : Account,\n 'fee' : IDL.Opt(Tokens),\n 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'from_subaccount' : IDL.Opt(Subaccount),\n 'created_at_time' : IDL.Opt(Timestamp),\n 'amount' : Tokens,\n });\n const BlockIndex = IDL.Nat;\n const TransferError = IDL.Variant({\n 'GenericError' : IDL.Record({\n 'message' : IDL.Text,\n 'error_code' : IDL.Nat,\n }),\n 'TemporarilyUnavailable' : IDL.Null,\n 'BadBurn' : IDL.Record({ 'min_burn_amount' : Tokens }),\n 'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),\n 'BadFee' : IDL.Record({ 'expected_fee' : Tokens }),\n 'CreatedInFuture' : IDL.Record({ 'ledger_time' : IDL.Nat64 }),\n 'TooOld' : IDL.Null,\n 'InsufficientFunds' : IDL.Record({ 'balance' : Tokens }),\n });\n const TransferResult = IDL.Variant({\n 'Ok' : BlockIndex,\n 'Err' : TransferError,\n });\n return IDL.Service({\n 'icrc1_balance_of' : IDL.Func([Account], [Tokens], ['query']),\n 'icrc1_decimals' : IDL.Func([], [IDL.Nat8], ['query']),\n 'icrc1_fee' : IDL.Func([], [Tokens], ['query']),\n 'icrc1_metadata' : IDL.Func(\n [],\n [IDL.Vec(IDL.Tuple(IDL.Text, Value))],\n ['query'],\n ),\n 'icrc1_minting_account' : IDL.Func([], [IDL.Opt(Account)], ['query']),\n 'icrc1_name' : IDL.Func([], [IDL.Text], ['query']),\n 'icrc1_supported_standards' : IDL.Func(\n [],\n [IDL.Vec(IDL.Record({ 'url' : IDL.Text, 'name' : IDL.Text }))],\n ['query'],\n ),\n 'icrc1_symbol' : IDL.Func([], [IDL.Text], ['query']),\n 'icrc1_total_supply' : IDL.Func([], [Tokens], ['query']),\n 'icrc1_transfer' : IDL.Func([TransferArg], [TransferResult], []),\n });\n};\nexport const init = ({ IDL }) => {\n const Value = IDL.Variant({\n 'Int' : IDL.Int,\n 'Nat' : IDL.Nat,\n 'Blob' : IDL.Vec(IDL.Nat8),\n 'Text' : IDL.Text,\n });\n const Subaccount = IDL.Vec(IDL.Nat8);\n const Account = IDL.Record({\n 'owner' : IDL.Principal,\n 'subaccount' : IDL.Opt(Subaccount),\n });\n const InitArgs = IDL.Record({\n 'token_symbol' : IDL.Text,\n 'transfer_fee' : IDL.Nat64,\n 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, Value)),\n 'minting_account' : Account,\n 'initial_balances' : IDL.Vec(IDL.Tuple(Account, IDL.Nat64)),\n 'archive_options' : IDL.Record({\n 'num_blocks_to_archive' : IDL.Nat64,\n 'trigger_threshold' : IDL.Nat64,\n 'max_message_size_bytes' : IDL.Opt(IDL.Nat64),\n 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64),\n 'node_max_memory_size_bytes' : IDL.Opt(IDL.Nat64),\n 'controller_id' : IDL.Principal,\n }),\n 'token_name' : IDL.Text,\n });\n return [InitArgs];\n};\n", "import { createServices } from \"@dfinity/utils\";\nimport type {\n ListSnsCanistersResponse,\n _SERVICE as SnsRootService,\n} from \"../candid/sns_root\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/sns_root.certified.idl\";\nimport { idlFactory } from \"../candid/sns_root.idl\";\nimport { Canister } from \"./services/canister\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\n\nexport class SnsRootCanister extends Canister<SnsRootService> {\n static create(options: SnsCanisterOptions<SnsRootService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsRootService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsRootCanister(canisterId, service, certifiedService);\n }\n\n /**\n * List the canisters that are part of the Sns.\n *\n * Source code: https://github.com/dfinity/ic/blob/master/rs/sns/root/src/lib.rs\n *\n * @param {Object} params\n * @param {boolean} [params.certified=true] - Query or update calls\n *\n * @returns {ListSnsCanistersResponse} - A list of canisters ('root' | 'governance' | 'ledger' | 'dapps' | 'swap' | 'archives')\n */\n listSnsCanisters = async ({\n certified = true,\n }: {\n certified?: boolean;\n }): Promise<ListSnsCanistersResponse> => {\n return this.caller({ certified }).list_sns_canisters({});\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_root.did */\nexport const idlFactory = ({ IDL }) => {\n const SnsRootCanister = IDL.Record({\n 'dapp_canister_ids' : IDL.Vec(IDL.Principal),\n 'latest_ledger_archive_poll_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'archive_canister_ids' : IDL.Vec(IDL.Principal),\n 'governance_canister_id' : IDL.Opt(IDL.Principal),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n });\n const CanisterIdRecord = IDL.Record({ 'canister_id' : IDL.Principal });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const CanisterStatusResult = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType,\n 'memory_size' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetSnsCanistersSummaryRequest = IDL.Record({\n 'update_canister_list' : IDL.Opt(IDL.Bool),\n });\n const CanisterStatusType_1 = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'controller' : IDL.Principal,\n 'freezing_threshold' : IDL.Nat,\n 'controllers' : IDL.Vec(IDL.Principal),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType_1,\n 'freezing_threshold' : IDL.Nat,\n 'balance' : IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)),\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const CanisterSummary = IDL.Record({\n 'status' : IDL.Opt(CanisterStatusResultV2),\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const GetSnsCanistersSummaryResponse = IDL.Record({\n 'root' : IDL.Opt(CanisterSummary),\n 'swap' : IDL.Opt(CanisterSummary),\n 'ledger' : IDL.Opt(CanisterSummary),\n 'governance' : IDL.Opt(CanisterSummary),\n 'dapps' : IDL.Vec(CanisterSummary),\n 'archives' : IDL.Vec(CanisterSummary),\n });\n const ListSnsCanistersResponse = IDL.Record({\n 'root' : IDL.Opt(IDL.Principal),\n 'swap' : IDL.Opt(IDL.Principal),\n 'ledger' : IDL.Opt(IDL.Principal),\n 'governance' : IDL.Opt(IDL.Principal),\n 'dapps' : IDL.Vec(IDL.Principal),\n 'archives' : IDL.Vec(IDL.Principal),\n });\n const RegisterDappCanisterRequest = IDL.Record({\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersRequest = IDL.Record({\n 'controller_principal_ids' : IDL.Vec(IDL.Principal),\n });\n const CanisterCallError = IDL.Record({\n 'code' : IDL.Opt(IDL.Int32),\n 'description' : IDL.Text,\n });\n const FailedUpdate = IDL.Record({\n 'err' : IDL.Opt(CanisterCallError),\n 'dapp_canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n 'failed_updates' : IDL.Vec(FailedUpdate),\n });\n return IDL.Service({\n 'canister_status' : IDL.Func(\n [CanisterIdRecord],\n [CanisterStatusResult],\n [],\n ),\n 'get_build_metadata' : IDL.Func([], [IDL.Text], []),\n 'get_sns_canisters_summary' : IDL.Func(\n [GetSnsCanistersSummaryRequest],\n [GetSnsCanistersSummaryResponse],\n [],\n ),\n 'list_sns_canisters' : IDL.Func(\n [IDL.Record({})],\n [ListSnsCanistersResponse],\n [],\n ),\n 'register_dapp_canister' : IDL.Func(\n [RegisterDappCanisterRequest],\n [IDL.Record({})],\n [],\n ),\n 'set_dapp_controllers' : IDL.Func(\n [SetDappControllersRequest],\n [SetDappControllersResponse],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const SnsRootCanister = IDL.Record({\n 'dapp_canister_ids' : IDL.Vec(IDL.Principal),\n 'latest_ledger_archive_poll_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'archive_canister_ids' : IDL.Vec(IDL.Principal),\n 'governance_canister_id' : IDL.Opt(IDL.Principal),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n });\n return [SnsRootCanister];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_root.did */\nexport const idlFactory = ({ IDL }) => {\n const SnsRootCanister = IDL.Record({\n 'dapp_canister_ids' : IDL.Vec(IDL.Principal),\n 'latest_ledger_archive_poll_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'archive_canister_ids' : IDL.Vec(IDL.Principal),\n 'governance_canister_id' : IDL.Opt(IDL.Principal),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n });\n const CanisterIdRecord = IDL.Record({ 'canister_id' : IDL.Principal });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const CanisterStatusResult = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType,\n 'memory_size' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetSnsCanistersSummaryRequest = IDL.Record({\n 'update_canister_list' : IDL.Opt(IDL.Bool),\n });\n const CanisterStatusType_1 = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'controller' : IDL.Principal,\n 'freezing_threshold' : IDL.Nat,\n 'controllers' : IDL.Vec(IDL.Principal),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType_1,\n 'freezing_threshold' : IDL.Nat,\n 'balance' : IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)),\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const CanisterSummary = IDL.Record({\n 'status' : IDL.Opt(CanisterStatusResultV2),\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const GetSnsCanistersSummaryResponse = IDL.Record({\n 'root' : IDL.Opt(CanisterSummary),\n 'swap' : IDL.Opt(CanisterSummary),\n 'ledger' : IDL.Opt(CanisterSummary),\n 'governance' : IDL.Opt(CanisterSummary),\n 'dapps' : IDL.Vec(CanisterSummary),\n 'archives' : IDL.Vec(CanisterSummary),\n });\n const ListSnsCanistersResponse = IDL.Record({\n 'root' : IDL.Opt(IDL.Principal),\n 'swap' : IDL.Opt(IDL.Principal),\n 'ledger' : IDL.Opt(IDL.Principal),\n 'governance' : IDL.Opt(IDL.Principal),\n 'dapps' : IDL.Vec(IDL.Principal),\n 'archives' : IDL.Vec(IDL.Principal),\n });\n const RegisterDappCanisterRequest = IDL.Record({\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersRequest = IDL.Record({\n 'controller_principal_ids' : IDL.Vec(IDL.Principal),\n });\n const CanisterCallError = IDL.Record({\n 'code' : IDL.Opt(IDL.Int32),\n 'description' : IDL.Text,\n });\n const FailedUpdate = IDL.Record({\n 'err' : IDL.Opt(CanisterCallError),\n 'dapp_canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n 'failed_updates' : IDL.Vec(FailedUpdate),\n });\n return IDL.Service({\n 'canister_status' : IDL.Func(\n [CanisterIdRecord],\n [CanisterStatusResult],\n [],\n ),\n 'get_build_metadata' : IDL.Func([], [IDL.Text], ['query']),\n 'get_sns_canisters_summary' : IDL.Func(\n [GetSnsCanistersSummaryRequest],\n [GetSnsCanistersSummaryResponse],\n [],\n ),\n 'list_sns_canisters' : IDL.Func(\n [IDL.Record({})],\n [ListSnsCanistersResponse],\n ['query'],\n ),\n 'register_dapp_canister' : IDL.Func(\n [RegisterDappCanisterRequest],\n [IDL.Record({})],\n [],\n ),\n 'set_dapp_controllers' : IDL.Func(\n [SetDappControllersRequest],\n [SetDappControllersResponse],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const SnsRootCanister = IDL.Record({\n 'dapp_canister_ids' : IDL.Vec(IDL.Principal),\n 'latest_ledger_archive_poll_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'archive_canister_ids' : IDL.Vec(IDL.Principal),\n 'governance_canister_id' : IDL.Opt(IDL.Principal),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n });\n return [SnsRootCanister];\n};\n", "import type { Agent } from \"@dfinity/agent\";\nimport type { Principal } from \"@dfinity/principal\";\nimport { assertNonNullish, fromNullable } from \"@dfinity/utils\";\nimport type {\n ListSnsCanistersResponse,\n _SERVICE as SnsRootService,\n} from \"../candid/sns_root\";\nimport { SnsGovernanceCanister } from \"./governance.canister\";\nimport { SnsLedgerCanister } from \"./ledger.canister\";\nimport { SnsRootCanister } from \"./root.canister\";\nimport { SnsWrapper } from \"./sns.wrapper\";\nimport { SnsSwapCanister } from \"./swap.canister\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type { QueryParams } from \"./types/query.params\";\n\n/**\n * Options to discover and initialize all canisters of a Sns.\n */\nexport interface InitSnsCanistersOptions extends QueryParams {\n /** An agent that can be used to override the default agent. Useful to target another environment that mainnet. */\n agent?: Agent;\n /** The options that will be used to instantiate the actors of the root canister of the particular Sns. */\n rootOptions: Omit<SnsCanisterOptions<SnsRootService>, \"agent\">;\n}\n\nexport interface InitSnsWrapper {\n (options: InitSnsCanistersOptions): Promise<SnsWrapper>;\n}\n\n/**\n * Lookup for the canister ids of a Sns and initialize the wrapper to access its features.\n */\nexport const initSnsWrapper: InitSnsWrapper = async ({\n agent,\n rootOptions,\n certified = true,\n}: InitSnsCanistersOptions): Promise<SnsWrapper> => {\n const rootCanister: SnsRootCanister = SnsRootCanister.create({\n ...rootOptions,\n agent,\n });\n\n const { ledger, swap, governance }: ListSnsCanistersResponse =\n await rootCanister.listSnsCanisters({ certified });\n\n const governanceCanisterId: Principal | undefined = fromNullable(governance);\n const ledgerCanisterId: Principal | undefined = fromNullable(ledger);\n const swapCanisterId: Principal | undefined = fromNullable(swap);\n\n assertNonNullish(governanceCanisterId);\n assertNonNullish(ledgerCanisterId);\n assertNonNullish(swapCanisterId);\n\n return new SnsWrapper({\n root: rootCanister,\n governance: SnsGovernanceCanister.create({\n canisterId: governanceCanisterId,\n agent,\n }),\n ledger: SnsLedgerCanister.create({ canisterId: ledgerCanisterId, agent }),\n swap: SnsSwapCanister.create({ canisterId: swapCanisterId, agent }),\n certified,\n });\n};\n", "import type { Principal } from \"@dfinity/principal\";\nimport type { Tokens } from \"../candid/icrc1_ledger\";\nimport type { GetMetadataResponse, Neuron } from \"../candid/sns_governance\";\nimport type {\n BuyerState,\n GetBuyerStateRequest,\n GetStateResponse,\n RefreshBuyerTokensRequest,\n} from \"../candid/sns_swap\";\nimport type { SnsGovernanceCanister } from \"./governance.canister\";\nimport type { SnsLedgerCanister } from \"./ledger.canister\";\nimport type { SnsRootCanister } from \"./root.canister\";\nimport type { SnsSwapCanister } from \"./swap.canister\";\nimport type {\n SnsGetNeuronParams,\n SnsListNeuronsParams,\n SnsNeuronPermissionsParams,\n} from \"./types/governance.params\";\nimport type { BalanceParams } from \"./types/ledger.params\";\nimport type { SnsTokenMetadataResponse } from \"./types/ledger.responses\";\nimport type { QueryParams } from \"./types/query.params\";\n\ninterface SnsWrapperOptions {\n /** The wrapper for the \"root\" canister of the particular Sns */\n root: SnsRootCanister;\n /** The wrapper for the \"governance\" canister of the particular Sns */\n governance: SnsGovernanceCanister;\n /** The wrapper for the \"ledger\" canister of the particular Sns */\n ledger: SnsLedgerCanister;\n /** The wrapper for the \"swap\" canister of the particular Sns */\n swap: SnsSwapCanister;\n\n /** The wrapper has been instantiated and should perform query or update calls */\n certified: boolean;\n}\n\n/**\n * Sns wrapper - notably used by NNS-dapp - ease the access to a particular Sns.\n * It knows all the Sns' canisters, wrap and enhance their available features.\n * A wrapper either performs query or update calls.\n */\nexport class SnsWrapper {\n private readonly root: SnsRootCanister;\n private readonly governance: SnsGovernanceCanister;\n private readonly ledger: SnsLedgerCanister;\n private readonly swap: SnsSwapCanister;\n private readonly certified: boolean;\n\n /**\n * Constructor to instantiate a Sns\n */\n constructor({\n root,\n governance,\n ledger,\n swap,\n certified,\n }: SnsWrapperOptions) {\n this.root = root;\n this.governance = governance;\n this.ledger = ledger;\n this.swap = swap;\n this.certified = certified;\n }\n\n /**\n * Binds the list of canister ids of the Sns.\n */\n get canisterIds(): {\n rootCanisterId: Principal;\n ledgerCanisterId: Principal;\n governanceCanisterId: Principal;\n swapCanisterId: Principal;\n } {\n return {\n rootCanisterId: this.root.canisterId,\n ledgerCanisterId: this.ledger.canisterId,\n governanceCanisterId: this.governance.canisterId,\n swapCanisterId: this.swap.canisterId,\n };\n }\n\n listNeurons = (\n params: Omit<SnsListNeuronsParams, \"certified\">\n ): Promise<Neuron[]> => this.governance.listNeurons(this.mergeParams(params));\n\n metadata = (\n params: Omit<QueryParams, \"certified\">\n ): Promise<[GetMetadataResponse, SnsTokenMetadataResponse]> =>\n Promise.all([\n this.governance.metadata(this.mergeParams(params)),\n this.ledger.metadata(this.mergeParams(params)),\n ]);\n\n ledgerMetadata = (\n params: Omit<QueryParams, \"certified\">\n ): Promise<SnsTokenMetadataResponse> =>\n this.ledger.metadata(this.mergeParams(params));\n\n balance = (params: Omit<BalanceParams, \"certified\">): Promise<Tokens> =>\n this.ledger.balance(this.mergeParams(params));\n\n getNeuron = (\n params: Omit<SnsGetNeuronParams, \"certified\">\n ): Promise<Neuron> => this.governance.getNeuron(this.mergeParams(params));\n\n // Always certified\n addNeuronPermissions = (params: SnsNeuronPermissionsParams): Promise<void> =>\n this.governance.addNeuronPermissions(params);\n\n // Always certified\n removeNeuronPermissions = (\n params: SnsNeuronPermissionsParams\n ): Promise<void> => this.governance.removeNeuronPermissions(params);\n\n swapState = (\n params: Omit<QueryParams, \"certified\">\n ): Promise<GetStateResponse> => this.swap.state(this.mergeParams(params));\n\n // Always certified\n notifyParticipation = (params: RefreshBuyerTokensRequest): Promise<void> =>\n this.swap.notifyParticipation(params);\n\n getUserCommitment = (\n params: GetBuyerStateRequest\n ): Promise<BuyerState | undefined> =>\n this.swap.getUserCommitment(this.mergeParams(params));\n\n private mergeParams<T>(params: T): QueryParams & T {\n return {\n ...params,\n certified: this.certified,\n };\n }\n}\n", "import { createServices, fromNullable } from \"@dfinity/utils\";\nimport type {\n BuyerState,\n GetBuyerStateRequest,\n GetStateResponse,\n RefreshBuyerTokensRequest,\n _SERVICE as SnsSwapService,\n} from \"../candid/sns_swap\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/sns_swap.certified.idl\";\nimport { idlFactory } from \"../candid/sns_swap.idl\";\nimport { Canister } from \"./services/canister\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type { QueryParams } from \"./types/query.params\";\n\nexport class SnsSwapCanister extends Canister<SnsSwapService> {\n static create(options: SnsCanisterOptions<SnsSwapService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsSwapService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsSwapCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Get the state of the swap\n */\n state = (params: QueryParams): Promise<GetStateResponse> =>\n this.caller(params).get_state({});\n\n /**\n * Notify of the user participating in the swap\n */\n notifyParticipation = async (\n params: RefreshBuyerTokensRequest\n ): Promise<void> => {\n await this.caller({ certified: true }).refresh_buyer_tokens(params);\n };\n\n /**\n * Get user commitment\n */\n getUserCommitment = async (\n params: GetBuyerStateRequest & QueryParams\n ): Promise<BuyerState | undefined> => {\n const { buyer_state } = await this.caller({\n certified: params.certified,\n }).get_buyer_state({ principal_id: params.principal_id });\n return fromNullable(buyer_state);\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_swap.did */\nexport const idlFactory = ({ IDL }) => {\n const Init = IDL.Record({\n 'sns_root_canister_id' : IDL.Text,\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'nns_governance_canister_id' : IDL.Text,\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'sns_governance_canister_id' : IDL.Text,\n });\n const ErrorRefundIcpRequest = IDL.Record({\n 'icp_e8s' : IDL.Nat64,\n 'fee_override_e8s' : IDL.Nat64,\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Response = IDL.Record({\n 'governance_error' : IDL.Opt(GovernanceError),\n });\n const CanisterCallError = IDL.Record({\n 'code' : IDL.Opt(IDL.Int32),\n 'description' : IDL.Text,\n });\n const Possibility = IDL.Variant({\n 'Ok' : Response,\n 'Err' : CanisterCallError,\n });\n const SettleCommunityFundParticipationResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility),\n });\n const FailedUpdate = IDL.Record({\n 'err' : IDL.Opt(CanisterCallError),\n 'dapp_canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n 'failed_updates' : IDL.Vec(FailedUpdate),\n });\n const Possibility_1 = IDL.Variant({\n 'Ok' : SetDappControllersResponse,\n 'Err' : CanisterCallError,\n });\n const SetDappControllersCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_1),\n });\n const Possibility_2 = IDL.Variant({ 'Err' : CanisterCallError });\n const SetModeCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_2),\n });\n const SweepResult = IDL.Record({\n 'failure' : IDL.Nat32,\n 'skipped' : IDL.Nat32,\n 'success' : IDL.Nat32,\n });\n const FinalizeSwapResponse = IDL.Record({\n 'settle_community_fund_participation_result' : IDL.Opt(\n SettleCommunityFundParticipationResult\n ),\n 'set_dapp_controllers_result' : IDL.Opt(SetDappControllersCallResult),\n 'sns_governance_normal_mode_enabled' : IDL.Opt(SetModeCallResult),\n 'sweep_icp' : IDL.Opt(SweepResult),\n 'sweep_sns' : IDL.Opt(SweepResult),\n 'create_neuron' : IDL.Opt(SweepResult),\n });\n const GetBuyerStateRequest = IDL.Record({\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const TransferableAmount = IDL.Record({\n 'transfer_start_timestamp_seconds' : IDL.Nat64,\n 'amount_e8s' : IDL.Nat64,\n 'transfer_success_timestamp_seconds' : IDL.Nat64,\n });\n const BuyerState = IDL.Record({ 'icp' : IDL.Opt(TransferableAmount) });\n const GetBuyerStateResponse = IDL.Record({\n 'buyer_state' : IDL.Opt(BuyerState),\n });\n const GetBuyersTotalResponse = IDL.Record({ 'buyers_total' : IDL.Nat64 });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'controller' : IDL.Principal,\n 'freezing_threshold' : IDL.Nat,\n 'controllers' : IDL.Vec(IDL.Principal),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType,\n 'freezing_threshold' : IDL.Nat,\n 'balance' : IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)),\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const CfInvestment = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'nns_neuron_id' : IDL.Nat64,\n });\n const DirectInvestment = IDL.Record({ 'buyer_principal' : IDL.Text });\n const Investor = IDL.Variant({\n 'CommunityFund' : CfInvestment,\n 'Direct' : DirectInvestment,\n });\n const SnsNeuronRecipe = IDL.Record({\n 'sns' : IDL.Opt(TransferableAmount),\n 'investor' : IDL.Opt(Investor),\n });\n const CfNeuron = IDL.Record({\n 'nns_neuron_id' : IDL.Nat64,\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'cf_neurons' : IDL.Vec(CfNeuron),\n });\n const Params = IDL.Record({\n 'min_participant_icp_e8s' : IDL.Nat64,\n 'max_icp_e8s' : IDL.Nat64,\n 'swap_due_timestamp_seconds' : IDL.Nat64,\n 'min_participants' : IDL.Nat32,\n 'sns_token_e8s' : IDL.Nat64,\n 'max_participant_icp_e8s' : IDL.Nat64,\n 'min_icp_e8s' : IDL.Nat64,\n });\n const Swap = IDL.Record({\n 'neuron_recipes' : IDL.Vec(SnsNeuronRecipe),\n 'cf_participants' : IDL.Vec(CfParticipant),\n 'init' : IDL.Opt(Init),\n 'lifecycle' : IDL.Int32,\n 'buyers' : IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),\n 'params' : IDL.Opt(Params),\n 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),\n });\n const DerivedState = IDL.Record({\n 'sns_tokens_per_icp' : IDL.Float32,\n 'buyer_total_icp_e8s' : IDL.Nat64,\n });\n const GetStateResponse = IDL.Record({\n 'swap' : IDL.Opt(Swap),\n 'derived' : IDL.Opt(DerivedState),\n });\n const OpenRequest = IDL.Record({\n 'cf_participants' : IDL.Vec(CfParticipant),\n 'params' : IDL.Opt(Params),\n 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),\n });\n const RefreshBuyerTokensRequest = IDL.Record({ 'buyer' : IDL.Text });\n const RefreshBuyerTokensResponse = IDL.Record({\n 'icp_accepted_participation_e8s' : IDL.Nat64,\n 'icp_ledger_account_balance_e8s' : IDL.Nat64,\n });\n return IDL.Service({\n 'error_refund_icp' : IDL.Func(\n [ErrorRefundIcpRequest],\n [IDL.Record({})],\n [],\n ),\n 'finalize_swap' : IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),\n 'get_buyer_state' : IDL.Func(\n [GetBuyerStateRequest],\n [GetBuyerStateResponse],\n [],\n ),\n 'get_buyers_total' : IDL.Func(\n [IDL.Record({})],\n [GetBuyersTotalResponse],\n [],\n ),\n 'get_canister_status' : IDL.Func(\n [IDL.Record({})],\n [CanisterStatusResultV2],\n [],\n ),\n 'get_state' : IDL.Func([IDL.Record({})], [GetStateResponse], []),\n 'open' : IDL.Func([OpenRequest], [IDL.Record({})], []),\n 'refresh_buyer_tokens' : IDL.Func(\n [RefreshBuyerTokensRequest],\n [RefreshBuyerTokensResponse],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const Init = IDL.Record({\n 'sns_root_canister_id' : IDL.Text,\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'nns_governance_canister_id' : IDL.Text,\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'sns_governance_canister_id' : IDL.Text,\n });\n return [Init];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_swap.did */\nexport const idlFactory = ({ IDL }) => {\n const Init = IDL.Record({\n 'sns_root_canister_id' : IDL.Text,\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'nns_governance_canister_id' : IDL.Text,\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'sns_governance_canister_id' : IDL.Text,\n });\n const ErrorRefundIcpRequest = IDL.Record({\n 'icp_e8s' : IDL.Nat64,\n 'fee_override_e8s' : IDL.Nat64,\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Response = IDL.Record({\n 'governance_error' : IDL.Opt(GovernanceError),\n });\n const CanisterCallError = IDL.Record({\n 'code' : IDL.Opt(IDL.Int32),\n 'description' : IDL.Text,\n });\n const Possibility = IDL.Variant({\n 'Ok' : Response,\n 'Err' : CanisterCallError,\n });\n const SettleCommunityFundParticipationResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility),\n });\n const FailedUpdate = IDL.Record({\n 'err' : IDL.Opt(CanisterCallError),\n 'dapp_canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n 'failed_updates' : IDL.Vec(FailedUpdate),\n });\n const Possibility_1 = IDL.Variant({\n 'Ok' : SetDappControllersResponse,\n 'Err' : CanisterCallError,\n });\n const SetDappControllersCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_1),\n });\n const Possibility_2 = IDL.Variant({ 'Err' : CanisterCallError });\n const SetModeCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_2),\n });\n const SweepResult = IDL.Record({\n 'failure' : IDL.Nat32,\n 'skipped' : IDL.Nat32,\n 'success' : IDL.Nat32,\n });\n const FinalizeSwapResponse = IDL.Record({\n 'settle_community_fund_participation_result' : IDL.Opt(\n SettleCommunityFundParticipationResult\n ),\n 'set_dapp_controllers_result' : IDL.Opt(SetDappControllersCallResult),\n 'sns_governance_normal_mode_enabled' : IDL.Opt(SetModeCallResult),\n 'sweep_icp' : IDL.Opt(SweepResult),\n 'sweep_sns' : IDL.Opt(SweepResult),\n 'create_neuron' : IDL.Opt(SweepResult),\n });\n const GetBuyerStateRequest = IDL.Record({\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const TransferableAmount = IDL.Record({\n 'transfer_start_timestamp_seconds' : IDL.Nat64,\n 'amount_e8s' : IDL.Nat64,\n 'transfer_success_timestamp_seconds' : IDL.Nat64,\n });\n const BuyerState = IDL.Record({ 'icp' : IDL.Opt(TransferableAmount) });\n const GetBuyerStateResponse = IDL.Record({\n 'buyer_state' : IDL.Opt(BuyerState),\n });\n const GetBuyersTotalResponse = IDL.Record({ 'buyers_total' : IDL.Nat64 });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'controller' : IDL.Principal,\n 'freezing_threshold' : IDL.Nat,\n 'controllers' : IDL.Vec(IDL.Principal),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'controller' : IDL.Principal,\n 'status' : CanisterStatusType,\n 'freezing_threshold' : IDL.Nat,\n 'balance' : IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)),\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const CfInvestment = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'nns_neuron_id' : IDL.Nat64,\n });\n const DirectInvestment = IDL.Record({ 'buyer_principal' : IDL.Text });\n const Investor = IDL.Variant({\n 'CommunityFund' : CfInvestment,\n 'Direct' : DirectInvestment,\n });\n const SnsNeuronRecipe = IDL.Record({\n 'sns' : IDL.Opt(TransferableAmount),\n 'investor' : IDL.Opt(Investor),\n });\n const CfNeuron = IDL.Record({\n 'nns_neuron_id' : IDL.Nat64,\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'cf_neurons' : IDL.Vec(CfNeuron),\n });\n const Params = IDL.Record({\n 'min_participant_icp_e8s' : IDL.Nat64,\n 'max_icp_e8s' : IDL.Nat64,\n 'swap_due_timestamp_seconds' : IDL.Nat64,\n 'min_participants' : IDL.Nat32,\n 'sns_token_e8s' : IDL.Nat64,\n 'max_participant_icp_e8s' : IDL.Nat64,\n 'min_icp_e8s' : IDL.Nat64,\n });\n const Swap = IDL.Record({\n 'neuron_recipes' : IDL.Vec(SnsNeuronRecipe),\n 'cf_participants' : IDL.Vec(CfParticipant),\n 'init' : IDL.Opt(Init),\n 'lifecycle' : IDL.Int32,\n 'buyers' : IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),\n 'params' : IDL.Opt(Params),\n 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),\n });\n const DerivedState = IDL.Record({\n 'sns_tokens_per_icp' : IDL.Float32,\n 'buyer_total_icp_e8s' : IDL.Nat64,\n });\n const GetStateResponse = IDL.Record({\n 'swap' : IDL.Opt(Swap),\n 'derived' : IDL.Opt(DerivedState),\n });\n const OpenRequest = IDL.Record({\n 'cf_participants' : IDL.Vec(CfParticipant),\n 'params' : IDL.Opt(Params),\n 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),\n });\n const RefreshBuyerTokensRequest = IDL.Record({ 'buyer' : IDL.Text });\n const RefreshBuyerTokensResponse = IDL.Record({\n 'icp_accepted_participation_e8s' : IDL.Nat64,\n 'icp_ledger_account_balance_e8s' : IDL.Nat64,\n });\n return IDL.Service({\n 'error_refund_icp' : IDL.Func(\n [ErrorRefundIcpRequest],\n [IDL.Record({})],\n [],\n ),\n 'finalize_swap' : IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),\n 'get_buyer_state' : IDL.Func(\n [GetBuyerStateRequest],\n [GetBuyerStateResponse],\n ['query'],\n ),\n 'get_buyers_total' : IDL.Func(\n [IDL.Record({})],\n [GetBuyersTotalResponse],\n [],\n ),\n 'get_canister_status' : IDL.Func(\n [IDL.Record({})],\n [CanisterStatusResultV2],\n [],\n ),\n 'get_state' : IDL.Func([IDL.Record({})], [GetStateResponse], ['query']),\n 'open' : IDL.Func([OpenRequest], [IDL.Record({})], []),\n 'refresh_buyer_tokens' : IDL.Func(\n [RefreshBuyerTokensRequest],\n [RefreshBuyerTokensResponse],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const Init = IDL.Record({\n 'sns_root_canister_id' : IDL.Text,\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'nns_governance_canister_id' : IDL.Text,\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'sns_governance_canister_id' : IDL.Text,\n });\n return [Init];\n};\n", "import type { Principal } from \"@dfinity/principal\";\nimport type { Subaccount, Value } from \"../../candid/icrc1_ledger\";\n\n// Source: https://github.com/dfinity/icrc-1#standard-metadata-entries\nexport enum SnsMetadataResponseEntries {\n SYMBOL = \"icrc1:symbol\",\n NAME = \"icrc1:name\",\n DECIMALS = \"icrc1:decimals\",\n FEE = \"icrc1:fee\",\n}\n\nexport type SnsTokenMetadataResponse = [\n string | SnsMetadataResponseEntries,\n Value\n][];\n\nexport interface SnsAccount {\n owner: Principal;\n subaccount?: Subaccount;\n}\n", "import { Principal } from \"@dfinity/principal\";\nimport type { SnsAccount } from \"../types/ledger.responses\";\n\n// https://github.com/dfinity/ICRC-1/pull/55/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R236\nconst EXTRA_BYTES = parseInt(\"FF\", 16);\nconst MAX_ACCOUNT_BYTES_LENGTH = 32;\n\n/**\n * Removes leading zeros from a Uint8Array\n *\n * @param bytes Uint8Array\n * @returns Uint8Array\n */\nconst shrink = (bytes: Uint8Array): Uint8Array => {\n const shrinked = Array.from(bytes);\n while (shrinked[0] === 0) {\n shrinked.shift();\n }\n return Uint8Array.from(shrinked);\n};\n\n/**\n * Encodes an SNS account into a string.\n * Formatting Reference: https://github.com/dfinity/ICRC-1/pull/55/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R238\n *\n * @param snsAccount { owner: Principal, subaccount?: Uint8Array }\n * @returns string\n */\nexport const encodeSnsAccount = ({ owner, subaccount }: SnsAccount): string => {\n if (subaccount === undefined) {\n return owner.toText();\n }\n\n const subaccountBytes = shrink(subaccount);\n\n if (subaccountBytes.length === 0) {\n return owner.toText();\n }\n\n const bytes = Uint8Array.from([\n ...owner.toUint8Array(),\n ...subaccountBytes,\n subaccountBytes.length,\n EXTRA_BYTES,\n ]);\n\n return Principal.fromUint8Array(bytes).toText();\n};\n\n/**\n * Decodes a string into an SNS account.\n * Formatting Reference: https://github.com/dfinity/ICRC-1/pull/55/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R268\n *\n * @param snsAccountString string\n * @throws Error if the string is not a valid SNS account\n * @returns snsAccount { owner: Principal, subaccount?: Uint8Array }\n */\nexport const decodeSnsAccount = (accountString: string): SnsAccount => {\n const principal = Principal.fromText(accountString);\n\n const [ff, nonZeroLength, ...restReversed] = principal\n .toUint8Array()\n .reverse();\n\n if (ff !== EXTRA_BYTES) {\n return {\n owner: Principal.fromText(accountString),\n };\n }\n\n if (\n nonZeroLength > MAX_ACCOUNT_BYTES_LENGTH ||\n nonZeroLength === 0 ||\n nonZeroLength === undefined\n ) {\n throw new Error(\"Invalid account string\");\n }\n\n const subaccountBytesReversed = restReversed.slice(0, nonZeroLength);\n if (\n subaccountBytesReversed[0] === 0 ||\n subaccountBytesReversed.length !== nonZeroLength\n ) {\n throw new Error(\"Invalid account string\");\n }\n while (subaccountBytesReversed.length < MAX_ACCOUNT_BYTES_LENGTH) {\n subaccountBytesReversed.push(0);\n }\n const subaccount = Uint8Array.from(subaccountBytesReversed.reverse());\n\n const principalBytes = restReversed\n .reverse()\n .filter((_, i) => i < restReversed.length - nonZeroLength);\n\n return {\n owner: Principal.fromUint8Array(Uint8Array.from(principalBytes)),\n subaccount,\n };\n};\n"],
5
+ "mappings": "ubAAA,kVCCO,GAAK,IAAL,CAAK,GACV,wCAAqC,GAArC,qCAIA,oDAAkD,GAAlD,kDAMA,6CAA2C,GAA3C,2CAKA,2CAAyC,GAAzC,yCAGA,gCAA8B,GAA9B,8BAGA,oCAAkC,GAAlC,kCAGA,iCAA+B,GAA/B,+BAIA,0CAAwC,GAAxC,wCAIA,6CAA2C,GAA3C,2CAjCU,YCAL,GAAK,IAAL,CAAK,GACV,iBAAc,GAAd,cACA,YAAU,GAAV,UACA,SAAO,GAAP,OACA,cAAY,GAAZ,YACA,YAAU,GAAV,UALU,YCDL,GAAM,GAAN,aAAiC,MAAM,CAAC,ECC/C,MAAyD,0BCAlD,GAAM,IAAa,CAAC,CAAE,SAAU,CACrC,GAAM,GAA+B,EAAI,OAAO,CAC9C,sBAA0B,EAAI,IAAI,EAAI,SAAS,EAC/C,mBAAuB,EAAI,IAAI,EAAI,SAAS,EAC5C,sBAA0B,EAAI,IAAI,EAAI,IAAI,EAC1C,mBAAuB,EAAI,IAAI,EAAI,IAAI,CACz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KAAK,CAAK,EACjC,KAAO,EAAS,KAAO,GACrB,EAAS,MAAM,EAEjB,MAAO,YAAW,KAAK,CAAQ,CACjC,EASa,GAAmB,CAAC,CAAE,QAAO,gBAAqC,CAC7E,GAAI,IAAe,OACjB,MAAO,GAAM,OAAO,EAGtB,GAAM,GAAkB,GAAO,CAAU,EAEzC,GAAI,EAAgB,SAAW,EAC7B,MAAO,GAAM,OAAO,EAGtB,GAAM,GAAQ,WAAW,KAAK,CAC5B,GAAG,EAAM,aAAa,EACtB,GAAG,EACH,EAAgB,OAChB,EACF,CAAC,EAED,MAAO,aAAU,eAAe,CAAK,EAAE,OAAO,CAChD,EAUa,GAAmB,AAAC,GAAsC,CACrE,GAAM,GAAY,YAAU,SAAS,CAAa,EAE5C,CAAC,EAAI,KAAkB,GAAgB,EAC1C,aAAa,EACb,QAAQ,EAEX,GAAI,IAAO,GACT,MAAO,CACL,MAAO,YAAU,SAAS,CAAa,CACzC,EAGF,GACE,EAAgB,IAChB,IAAkB,GAClB,IAAkB,OAElB,KAAM,IAAI,OAAM,wBAAwB,EAG1C,GAAM,GAA0B,EAAa,MAAM,EAAG,CAAa,EACnE,GACE,EAAwB,KAAO,GAC/B,EAAwB,SAAW,EAEnC,KAAM,IAAI,OAAM,wBAAwB,EAE1C,KAAO,EAAwB,OAAS,IACtC,EAAwB,KAAK,CAAC,EAEhC,GAAM,GAAa,WAAW,KAAK,EAAwB,QAAQ,CAAC,EAE9D,EAAiB,EACpB,QAAQ,EACR,OAAO,CAAC,EAAG,IAAM,EAAI,EAAa,OAAS,CAAa,EAE3D,MAAO,CACL,MAAO,YAAU,eAAe,WAAW,KAAK,CAAc,CAAC,EAC/D,YACF,CACF",
6
6
  "names": []
7
7
  }
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as p}from"./chunk-ZVF3C5QU.js";import{a as O,b as e}from"./chunk-CGB4OZHY.js";import{a as E}from"./chunk-VRNOICZG.js";import{a as _}from"./chunk-UHK4OUPY.js";import{a as N}from"./chunk-GYFUURE5.js";import{a as I}from"./chunk-CIBAWOSU.js";import"./chunk-OZ3QVZ6V.js";var R=(t=>(t[t.NEURON_PERMISSION_TYPE_UNSPECIFIED=0]="NEURON_PERMISSION_TYPE_UNSPECIFIED",t[t.NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE=1]="NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE",t[t.NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS=2]="NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS",t[t.NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL=3]="NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL",t[t.NEURON_PERMISSION_TYPE_VOTE=4]="NEURON_PERMISSION_TYPE_VOTE",t[t.NEURON_PERMISSION_TYPE_DISBURSE=5]="NEURON_PERMISSION_TYPE_DISBURSE",t[t.NEURON_PERMISSION_TYPE_SPLIT=6]="NEURON_PERMISSION_TYPE_SPLIT",t[t.NEURON_PERMISSION_TYPE_MERGE_MATURITY=7]="NEURON_PERMISSION_TYPE_MERGE_MATURITY",t[t.NEURON_PERMISSION_TYPE_DISBURSE_MATURITY=8]="NEURON_PERMISSION_TYPE_DISBURSE_MATURITY",t))(R||{});var o=(a=>(a[a.Unspecified=0]="Unspecified",a[a.Pending=1]="Pending",a[a.Open=2]="Open",a[a.Committed=3]="Committed",a[a.Aborted=4]="Aborted",a))(o||{});var S=(r=>(r.SYMBOL="icrc1:symbol",r.NAME="icrc1:name",r.DECIMALS="icrc1:decimals",r.FEE="icrc1:fee",r))(S||{});export{e as SnsGovernanceCanister,O as SnsGovernanceError,E as SnsLedgerCanister,S as SnsMetadataResponseEntries,R as SnsNeuronPermissionType,_ as SnsRootCanister,I as SnsSwapCanister,o as SnsSwapLifecycle,N as SnsWrapper,p as initSnsWrapper};
1
+ import{a as O}from"./chunk-ZVF3C5QU.js";import{a as U,b as S}from"./chunk-CGB4OZHY.js";import{a as f}from"./chunk-VRNOICZG.js";import{a as I}from"./chunk-UHK4OUPY.js";import{a as N}from"./chunk-GYFUURE5.js";import{a as R}from"./chunk-CIBAWOSU.js";import"./chunk-OZ3QVZ6V.js";var d=(t=>(t[t.NEURON_PERMISSION_TYPE_UNSPECIFIED=0]="NEURON_PERMISSION_TYPE_UNSPECIFIED",t[t.NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE=1]="NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE",t[t.NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS=2]="NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS",t[t.NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL=3]="NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL",t[t.NEURON_PERMISSION_TYPE_VOTE=4]="NEURON_PERMISSION_TYPE_VOTE",t[t.NEURON_PERMISSION_TYPE_DISBURSE=5]="NEURON_PERMISSION_TYPE_DISBURSE",t[t.NEURON_PERMISSION_TYPE_SPLIT=6]="NEURON_PERMISSION_TYPE_SPLIT",t[t.NEURON_PERMISSION_TYPE_MERGE_MATURITY=7]="NEURON_PERMISSION_TYPE_MERGE_MATURITY",t[t.NEURON_PERMISSION_TYPE_DISBURSE_MATURITY=8]="NEURON_PERMISSION_TYPE_DISBURSE_MATURITY",t))(d||{});var m=(r=>(r[r.Unspecified=0]="Unspecified",r[r.Pending=1]="Pending",r[r.Open=2]="Open",r[r.Committed=3]="Committed",r[r.Aborted=4]="Aborted",r))(m||{});var i=(n=>(n.SYMBOL="icrc1:symbol",n.NAME="icrc1:name",n.DECIMALS="icrc1:decimals",n.FEE="icrc1:fee",n))(i||{});import{Principal as c}from"@dfinity/principal";var E=parseInt("FF",16),p=32,A=e=>{let a=Array.from(e);for(;a[0]===0;)a.shift();return Uint8Array.from(a)},B=({owner:e,subaccount:a})=>{if(a===void 0)return e.toText();let s=A(a);if(s.length===0)return e.toText();let o=Uint8Array.from([...e.toUint8Array(),...s,s.length,E]);return c.fromUint8Array(o).toText()},C=e=>{let a=c.fromText(e),[s,o,...n]=a.toUint8Array().reverse();if(s!==E)return{owner:c.fromText(e)};if(o>p||o===0||o===void 0)throw new Error("Invalid account string");let r=n.slice(0,o);if(r[0]===0||r.length!==o)throw new Error("Invalid account string");for(;r.length<p;)r.push(0);let _=Uint8Array.from(r.reverse()),u=n.reverse().filter((x,t)=>t<n.length-o);return{owner:c.fromUint8Array(Uint8Array.from(u)),subaccount:_}};export{S as SnsGovernanceCanister,U as SnsGovernanceError,f as SnsLedgerCanister,i as SnsMetadataResponseEntries,d as SnsNeuronPermissionType,I as SnsRootCanister,R as SnsSwapCanister,m as SnsSwapLifecycle,N as SnsWrapper,C as decodeSnsAccount,B as encodeSnsAccount,O as initSnsWrapper};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/enums/governance.enums.ts", "../../src/enums/swap.enums.ts", "../../src/types/ledger.responses.ts"],
4
- "sourcesContent": ["// Source: https://github.com/dfinity/ic/blob/1998263b426df0a22f0d0706695c0826f0ab4d7d/rs/sns/governance/proto/ic_sns_governance/pb/v1/governance.proto#L10\nexport enum SnsNeuronPermissionType {\n NEURON_PERMISSION_TYPE_UNSPECIFIED = 0,\n\n // The principal has permission to configure the neuron's dissolve state. This includes\n // start dissolving, stop dissolving, and increasing the dissolve delay for the neuron.\n NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE = 1,\n\n // The principal has permission to add additional principals to modify the neuron.\n // The nervous system parameter `NervousSystemParameters::neuron_grantable_permissions`\n // determines the maximum set of privileges that a principal can grant to another principal in\n // the given SNS.\n NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS = 2,\n\n // The principal has permission to submit proposals on behalf of the neuron.\n // Submitting proposals can change a neuron's stake and thus this\n // is potentially a balance changing operation.\n NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL = 3,\n\n // The principal has permission to vote and follow other neurons on behalf of the neuron.\n NEURON_PERMISSION_TYPE_VOTE = 4,\n\n // The principal has permission to disburse the neuron.\n NEURON_PERMISSION_TYPE_DISBURSE = 5,\n\n // The principal has permission to split the neuron.\n NEURON_PERMISSION_TYPE_SPLIT = 6,\n\n // The principal has permission to merge the neuron's maturity into\n // the neuron's stake.\n NEURON_PERMISSION_TYPE_MERGE_MATURITY = 7,\n\n // The principal has permission to disburse the neuron's maturity to a\n // given ledger account.\n NEURON_PERMISSION_TYPE_DISBURSE_MATURITY = 8,\n}\n", "// Source: https://github.com/dfinity/ic/blob/master/rs/sns/swap/gen/ic_sns_swap.pb.v1.rs - Lifecycle\nexport enum SnsSwapLifecycle {\n Unspecified = 0,\n Pending = 1,\n Open = 2,\n Committed = 3,\n Aborted = 4,\n}\n", "import type { Value } from \"../../candid/icrc1_ledger\";\n\n// Source: https://github.com/dfinity/icrc-1#standard-metadata-entries\nexport enum SnsMetadataResponseEntries {\n SYMBOL = \"icrc1:symbol\",\n NAME = \"icrc1:name\",\n DECIMALS = \"icrc1:decimals\",\n FEE = \"icrc1:fee\",\n}\n\nexport type SnsTokenMetadataResponse = [\n string | SnsMetadataResponseEntries,\n Value\n][];\n"],
5
- "mappings": "mRACO,GAAK,GAAL,CAAK,GACV,wCAAqC,GAArC,qCAIA,oDAAkD,GAAlD,kDAMA,6CAA2C,GAA3C,2CAKA,2CAAyC,GAAzC,yCAGA,gCAA8B,GAA9B,8BAGA,oCAAkC,GAAlC,kCAGA,iCAA+B,GAA/B,+BAIA,0CAAwC,GAAxC,wCAIA,6CAA2C,GAA3C,2CAjCU,WCAL,GAAK,GAAL,CAAK,GACV,iBAAc,GAAd,cACA,YAAU,GAAV,UACA,SAAO,GAAP,OACA,cAAY,GAAZ,YACA,YAAU,GAAV,UALU,WCEL,GAAK,GAAL,CAAK,GACV,UAAS,eACT,OAAO,aACP,WAAW,iBACX,MAAM,YAJI",
3
+ "sources": ["../../src/enums/governance.enums.ts", "../../src/enums/swap.enums.ts", "../../src/types/ledger.responses.ts", "../../src/utils/ledger.utils.ts"],
4
+ "sourcesContent": ["// Source: https://github.com/dfinity/ic/blob/1998263b426df0a22f0d0706695c0826f0ab4d7d/rs/sns/governance/proto/ic_sns_governance/pb/v1/governance.proto#L10\nexport enum SnsNeuronPermissionType {\n NEURON_PERMISSION_TYPE_UNSPECIFIED = 0,\n\n // The principal has permission to configure the neuron's dissolve state. This includes\n // start dissolving, stop dissolving, and increasing the dissolve delay for the neuron.\n NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE = 1,\n\n // The principal has permission to add additional principals to modify the neuron.\n // The nervous system parameter `NervousSystemParameters::neuron_grantable_permissions`\n // determines the maximum set of privileges that a principal can grant to another principal in\n // the given SNS.\n NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS = 2,\n\n // The principal has permission to submit proposals on behalf of the neuron.\n // Submitting proposals can change a neuron's stake and thus this\n // is potentially a balance changing operation.\n NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL = 3,\n\n // The principal has permission to vote and follow other neurons on behalf of the neuron.\n NEURON_PERMISSION_TYPE_VOTE = 4,\n\n // The principal has permission to disburse the neuron.\n NEURON_PERMISSION_TYPE_DISBURSE = 5,\n\n // The principal has permission to split the neuron.\n NEURON_PERMISSION_TYPE_SPLIT = 6,\n\n // The principal has permission to merge the neuron's maturity into\n // the neuron's stake.\n NEURON_PERMISSION_TYPE_MERGE_MATURITY = 7,\n\n // The principal has permission to disburse the neuron's maturity to a\n // given ledger account.\n NEURON_PERMISSION_TYPE_DISBURSE_MATURITY = 8,\n}\n", "// Source: https://github.com/dfinity/ic/blob/master/rs/sns/swap/gen/ic_sns_swap.pb.v1.rs - Lifecycle\nexport enum SnsSwapLifecycle {\n Unspecified = 0,\n Pending = 1,\n Open = 2,\n Committed = 3,\n Aborted = 4,\n}\n", "import type { Principal } from \"@dfinity/principal\";\nimport type { Subaccount, Value } from \"../../candid/icrc1_ledger\";\n\n// Source: https://github.com/dfinity/icrc-1#standard-metadata-entries\nexport enum SnsMetadataResponseEntries {\n SYMBOL = \"icrc1:symbol\",\n NAME = \"icrc1:name\",\n DECIMALS = \"icrc1:decimals\",\n FEE = \"icrc1:fee\",\n}\n\nexport type SnsTokenMetadataResponse = [\n string | SnsMetadataResponseEntries,\n Value\n][];\n\nexport interface SnsAccount {\n owner: Principal;\n subaccount?: Subaccount;\n}\n", "import { Principal } from \"@dfinity/principal\";\nimport type { SnsAccount } from \"../types/ledger.responses\";\n\n// https://github.com/dfinity/ICRC-1/pull/55/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R236\nconst EXTRA_BYTES = parseInt(\"FF\", 16);\nconst MAX_ACCOUNT_BYTES_LENGTH = 32;\n\n/**\n * Removes leading zeros from a Uint8Array\n *\n * @param bytes Uint8Array\n * @returns Uint8Array\n */\nconst shrink = (bytes: Uint8Array): Uint8Array => {\n const shrinked = Array.from(bytes);\n while (shrinked[0] === 0) {\n shrinked.shift();\n }\n return Uint8Array.from(shrinked);\n};\n\n/**\n * Encodes an SNS account into a string.\n * Formatting Reference: https://github.com/dfinity/ICRC-1/pull/55/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R238\n *\n * @param snsAccount { owner: Principal, subaccount?: Uint8Array }\n * @returns string\n */\nexport const encodeSnsAccount = ({ owner, subaccount }: SnsAccount): string => {\n if (subaccount === undefined) {\n return owner.toText();\n }\n\n const subaccountBytes = shrink(subaccount);\n\n if (subaccountBytes.length === 0) {\n return owner.toText();\n }\n\n const bytes = Uint8Array.from([\n ...owner.toUint8Array(),\n ...subaccountBytes,\n subaccountBytes.length,\n EXTRA_BYTES,\n ]);\n\n return Principal.fromUint8Array(bytes).toText();\n};\n\n/**\n * Decodes a string into an SNS account.\n * Formatting Reference: https://github.com/dfinity/ICRC-1/pull/55/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R268\n *\n * @param snsAccountString string\n * @throws Error if the string is not a valid SNS account\n * @returns snsAccount { owner: Principal, subaccount?: Uint8Array }\n */\nexport const decodeSnsAccount = (accountString: string): SnsAccount => {\n const principal = Principal.fromText(accountString);\n\n const [ff, nonZeroLength, ...restReversed] = principal\n .toUint8Array()\n .reverse();\n\n if (ff !== EXTRA_BYTES) {\n return {\n owner: Principal.fromText(accountString),\n };\n }\n\n if (\n nonZeroLength > MAX_ACCOUNT_BYTES_LENGTH ||\n nonZeroLength === 0 ||\n nonZeroLength === undefined\n ) {\n throw new Error(\"Invalid account string\");\n }\n\n const subaccountBytesReversed = restReversed.slice(0, nonZeroLength);\n if (\n subaccountBytesReversed[0] === 0 ||\n subaccountBytesReversed.length !== nonZeroLength\n ) {\n throw new Error(\"Invalid account string\");\n }\n while (subaccountBytesReversed.length < MAX_ACCOUNT_BYTES_LENGTH) {\n subaccountBytesReversed.push(0);\n }\n const subaccount = Uint8Array.from(subaccountBytesReversed.reverse());\n\n const principalBytes = restReversed\n .reverse()\n .filter((_, i) => i < restReversed.length - nonZeroLength);\n\n return {\n owner: Principal.fromUint8Array(Uint8Array.from(principalBytes)),\n subaccount,\n };\n};\n"],
5
+ "mappings": "mRACO,GAAK,GAAL,CAAK,GACV,wCAAqC,GAArC,qCAIA,oDAAkD,GAAlD,kDAMA,6CAA2C,GAA3C,2CAKA,2CAAyC,GAAzC,yCAGA,gCAA8B,GAA9B,8BAGA,oCAAkC,GAAlC,kCAGA,iCAA+B,GAA/B,+BAIA,0CAAwC,GAAxC,wCAIA,6CAA2C,GAA3C,2CAjCU,WCAL,GAAK,GAAL,CAAK,GACV,iBAAc,GAAd,cACA,YAAU,GAAV,UACA,SAAO,GAAP,OACA,cAAY,GAAZ,YACA,YAAU,GAAV,UALU,WCGL,GAAK,GAAL,CAAK,GACV,UAAS,eACT,OAAO,aACP,WAAW,iBACX,MAAM,YAJI,WCJZ,+CAIA,GAAM,GAAc,SAAS,KAAM,EAAE,EAC/B,EAA2B,GAQ3B,EAAS,AAAC,GAAkC,CAChD,GAAM,GAAW,MAAM,KAAK,CAAK,EACjC,KAAO,EAAS,KAAO,GACrB,EAAS,MAAM,EAEjB,MAAO,YAAW,KAAK,CAAQ,CACjC,EASa,EAAmB,CAAC,CAAE,QAAO,gBAAqC,CAC7E,GAAI,IAAe,OACjB,MAAO,GAAM,OAAO,EAGtB,GAAM,GAAkB,EAAO,CAAU,EAEzC,GAAI,EAAgB,SAAW,EAC7B,MAAO,GAAM,OAAO,EAGtB,GAAM,GAAQ,WAAW,KAAK,CAC5B,GAAG,EAAM,aAAa,EACtB,GAAG,EACH,EAAgB,OAChB,CACF,CAAC,EAED,MAAO,GAAU,eAAe,CAAK,EAAE,OAAO,CAChD,EAUa,EAAmB,AAAC,GAAsC,CACrE,GAAM,GAAY,EAAU,SAAS,CAAa,EAE5C,CAAC,EAAI,KAAkB,GAAgB,EAC1C,aAAa,EACb,QAAQ,EAEX,GAAI,IAAO,EACT,MAAO,CACL,MAAO,EAAU,SAAS,CAAa,CACzC,EAGF,GACE,EAAgB,GAChB,IAAkB,GAClB,IAAkB,OAElB,KAAM,IAAI,OAAM,wBAAwB,EAG1C,GAAM,GAA0B,EAAa,MAAM,EAAG,CAAa,EACnE,GACE,EAAwB,KAAO,GAC/B,EAAwB,SAAW,EAEnC,KAAM,IAAI,OAAM,wBAAwB,EAE1C,KAAO,EAAwB,OAAS,GACtC,EAAwB,KAAK,CAAC,EAEhC,GAAM,GAAa,WAAW,KAAK,EAAwB,QAAQ,CAAC,EAE9D,EAAiB,EACpB,QAAQ,EACR,OAAO,CAAC,EAAG,IAAM,EAAI,EAAa,OAAS,CAAa,EAE3D,MAAO,CACL,MAAO,EAAU,eAAe,WAAW,KAAK,CAAc,CAAC,EAC/D,YACF,CACF",
6
6
  "names": []
7
7
  }
@@ -14,3 +14,4 @@ export type { SnsCanisterOptions } from "./types/canister.options";
14
14
  export type { SnsGetNeuronParams, SnsListNeuronsParams, } from "./types/governance.params";
15
15
  export * from "./types/ledger.responses";
16
16
  export type { QueryParams } from "./types/query.params";
17
+ export * from "./utils/ledger.utils";
@@ -1,4 +1,5 @@
1
- import type { Value } from "../../candid/icrc1_ledger";
1
+ import type { Principal } from "@dfinity/principal";
2
+ import type { Subaccount, Value } from "../../candid/icrc1_ledger";
2
3
  export declare enum SnsMetadataResponseEntries {
3
4
  SYMBOL = "icrc1:symbol",
4
5
  NAME = "icrc1:name",
@@ -9,3 +10,7 @@ export declare type SnsTokenMetadataResponse = [
9
10
  string | SnsMetadataResponseEntries,
10
11
  Value
11
12
  ][];
13
+ export interface SnsAccount {
14
+ owner: Principal;
15
+ subaccount?: Subaccount;
16
+ }
@@ -0,0 +1,18 @@
1
+ import type { SnsAccount } from "../types/ledger.responses";
2
+ /**
3
+ * Encodes an SNS account into a string.
4
+ * Formatting Reference: https://github.com/dfinity/ICRC-1/pull/55/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R238
5
+ *
6
+ * @param snsAccount { owner: Principal, subaccount?: Uint8Array }
7
+ * @returns string
8
+ */
9
+ export declare const encodeSnsAccount: ({ owner, subaccount }: SnsAccount) => string;
10
+ /**
11
+ * Decodes a string into an SNS account.
12
+ * Formatting Reference: https://github.com/dfinity/ICRC-1/pull/55/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R268
13
+ *
14
+ * @param snsAccountString string
15
+ * @throws Error if the string is not a valid SNS account
16
+ * @returns snsAccount { owner: Principal, subaccount?: Uint8Array }
17
+ */
18
+ export declare const decodeSnsAccount: (accountString: string) => SnsAccount;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dfinity/sns",
3
- "version": "0.0.4-next-2022-09-25",
3
+ "version": "0.0.4",
4
4
  "description": "A library for interfacing with a Service Nervous System (SNS) project.",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/cjs/index.cjs.js",
@@ -37,6 +37,6 @@
37
37
  "sns"
38
38
  ],
39
39
  "peerDependencies": {
40
- "@dfinity/utils": "^0.0.3-next"
40
+ "@dfinity/utils": "^0.0.3"
41
41
  }
42
- }
42
+ }