4.8.0 • Published 6 months ago

@bothy/aptas v4.8.0

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

@bothy/aptas

Extension_Winch + Dappetite

These are singletons. 1 can be installed per dapp....

This is so that it's easy to access the singleton with an import.

import { onMount, onDestroy } from 'svelte'
import * as Dappetite from '@bothy/aptas/Dappetite/index.js'	
import * as Extension_Winch from "@bothy/aptas/Extension_Winch/index.js"
import { request_ledger_info } from '@bothy/aptas/party/General/Ledger_Info.API'

import { Rise_stage_creator } from "@bothy/aptas/Extension_Winch/Stages/Rise.js"
import { Petra_stage_creator } from "@bothy/aptas/Extension_Winch/Stages/Petra.js"
import { Pontem_stage_creator } from "@bothy/aptas/Extension_Winch/Stages/Pontem.js"
import { Dev_stage } from "@bothy/aptas/Extension_Winch/Stages/Dev/index.js"

import { dev_wallet_extension } from "@bothy/aptas/Extension_Winch/Stages/Dev/extension.js"

window.dev_wallet = dev_wallet_extension ({
	account: {
		private_key: "0C1218C9ABC123C812359AB7689AB765C89EABCAD9E8CBE9F8CBE9DABC8F152C",
		public_key: "83918D60A9344D117F6EA231DA15ACEB43711124976E6EC4AC5BC7C4BC772ED5",
		// address: "991378D74FAC384404B971765BEF7525CCE26C8EFD84B9FF27D202E10D7FFBE5",
		address_legacy: "2F75DA076414103C721D195B0376C66897593B1F4E961671099A2DC9A24ADCFD"
	}
});

const env_mode = import.meta.env.VITE_DAPP_MODE;

let trucks_prepared = "nah";
onMount (async () => {
	
	////
	//
	//	Trucks
	//		The versies (roomies) truck is subscribed
	//		to the extension winch.
	//
	await Dappetite.make ({
		mode: (() => {
			return "teacher" // or "student"
		})(),
		net: async ({ nets }) => {
			const net_path = "https://api.devnet.aptoslabs.com/v1"
			const net_name = "devnet"
			
			const { enhanced } = await request_ledger_info ({ net_path })
			chain_id = enhanced.chain_id;
			
			return {
				name: "devnet",
				path: "https://api.devnet.aptoslabs.com/v1",
				chain_id: chain_id
			}
		}
	});
	await Extension_Winch.make ();
	await Extension_Winch.latch_wallets ({
		stages: [{
			name: "Petra",
			stage: Petra_stage_creator
		},{
			name: "Dev",
			stage: Dev_stage
		}]
	});
	
	trucks_prepared = "yup"
	//
	////
});

onDestroy (() => {
	Dappetite.destroy ()
	Extension_Winch.destroy ()
});
import * as Dappetite from '@bothy/aptas/Dappetite/index.js'
const dapp_network_net_path = Dappetite.freight ().dapp_network.net_path;
const dapp_network_net_name = Dappetite.freight ().dapp_network.net_name;
const dapp_network_chain_id = Dappetite.freight ().dapp_network.chain_id;
const dapp_mode = Dappetite.freight ().mode;

Dappetite Svelte Component

import Dappetite_Truck from '$lib/Singles/Dappetite/Truck.svelte'
let Dappetite_Freight = false

<Dappetite_Truck 
	on_change={ ({ pro_freight }) => { 
		Dappetite_Freight = pro_freight; 
	}} 
/>
{#if typeof Dappetite_Freight === "object"}

{/if}

Extension_Winch Svelte Component

import { writable } from 'svelte/store';
import EWR from '@bothy/aptas/Extension_Winch/Ride.svelte'
let EWF = writable (false);

<EWR 
	on_change={({ pro_freight }) => { 
		EWF.set (pro_freight); 
	}} 
/>
{#if typeof $EWF === "object"}

{/if}

mech

party

4.8.0

6 months ago

4.7.0

7 months ago

4.6.0

7 months ago

4.5.0

7 months ago

4.4.0

7 months ago

4.3.0

7 months ago

4.2.0

7 months ago

4.1.0

7 months ago

4.0.0

7 months ago

3.0.0

7 months ago

2.0.0

7 months ago

1.0.11

8 months ago

1.0.10

8 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago