diff --git a/Makefile b/Makefile index 1f1cb7279..5a1929ee8 100644 --- a/Makefile +++ b/Makefile @@ -32,4 +32,5 @@ install: codegen: npx @wharfkit/cli generate -u $(API_EOS_CHAIN) -f src/lib/wharf/contracts/system.ts eosio npx @wharfkit/cli generate -u $(API_EOS_CHAIN) -f src/lib/wharf/contracts/token.ts eosio.token + npx @wharfkit/cli generate -u $(API_EOS_CHAIN) -f src/lib/wharf/contracts/msig.ts eosio.msig npx @wharfkit/cli generate -u $(API_EOS_CHAIN) -f src/lib/wharf/contracts/delphioracle.ts delphioracle diff --git a/bun.lockb b/bun.lockb index 4467472f8..4159f1ecc 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index e4043456d..04ed151c6 100644 --- a/package.json +++ b/package.json @@ -49,11 +49,12 @@ "type": "module", "dependencies": { "@accuser/svelte-plausible-analytics": "^1.0.0", + "@coinbase/cbpay-js": "^2.4.0", "@fontsource/jetbrains-mono": "^5.1.0", "@tailwindcss/container-queries": "^0.1.1", "@wharfkit/account": "^1.2.0", "@wharfkit/account-creation-plugin-greymass": "^1.2.0", - "@wharfkit/account-creation-plugin-metamask": "^1.0.2", + "@wharfkit/account-creation-plugin-metamask": "^1.1.1", "@wharfkit/antelope": "^1.0.11", "@wharfkit/common": "^1.4.0", "@wharfkit/contract": "^1.1.5", @@ -62,7 +63,7 @@ "@wharfkit/session": "^1.4.0", "@wharfkit/transact-plugin-resource-provider": "^1.1.1", "@wharfkit/wallet-plugin-anchor": "^1.4.0", - "@wharfkit/wallet-plugin-metamask": "1.0.0-rc10", + "@wharfkit/wallet-plugin-metamask": "^1.1.1", "@wharfkit/wallet-plugin-privatekey": "^1.1.0", "@wharfkit/wallet-plugin-scatter": "^1.5.1", "@wharfkit/wallet-plugin-tokenpocket": "^1.5.1", diff --git a/src/lib/components/button/button.svelte b/src/lib/components/button/button.svelte index 36a180568..243588d90 100644 --- a/src/lib/components/button/button.svelte +++ b/src/lib/components/button/button.svelte @@ -18,16 +18,16 @@ } let { - class: className = '', meltAction, onclick, variant = 'primary', - active = false, + active, disabled = false, ...props }: ButtonProps = $props(); - const ariaRole = props.href ? 'link' : 'button'; + const ariaRole = props.href ? undefined : 'button'; // undefined because anchor tag with role=link gives a warning + const ariaCurrent = props['aria-current'] || active === false ? undefined : true; // removes aria-current if active===false const tag = props.href ? 'a' : 'button'; // Only use melt builder element if passed as a prop @@ -46,19 +46,19 @@ - {@render props.children()} + {@render props.children()} - diff --git a/src/lib/components/code.svelte b/src/lib/components/code.svelte index 6ac973516..730433c80 100644 --- a/src/lib/components/code.svelte +++ b/src/lib/components/code.svelte @@ -4,7 +4,7 @@ const codeStyles = 'bg-shark-900/40 text-xs text-white font-mono rounded-md px-2 py-1'; const preStyles = - 'bg-shark-900/20 text-sm text-white font-mono rounded-lg px-2 py-2 overflow-x-scroll'; + 'bg-shark-900/20 text-sm text-white font-mono rounded-lg px-2 py-2 overflow-x-auto'; diff --git a/src/lib/components/elements/action.svelte b/src/lib/components/elements/action.svelte new file mode 100644 index 000000000..7648c34f2 --- /dev/null +++ b/src/lib/components/elements/action.svelte @@ -0,0 +1,13 @@ + + +{#if props.data} + {JSON.stringify(props.data, null, 2)} +{/if} diff --git a/src/lib/components/elements/asset.svelte b/src/lib/components/elements/asset.svelte index b17fcd612..9be07b616 100644 --- a/src/lib/components/elements/asset.svelte +++ b/src/lib/components/elements/asset.svelte @@ -29,6 +29,7 @@ const currencyOptions: Intl.NumberFormatOptions = { style: 'currency', currency: asset?.symbol.name, + currencyDisplay: 'narrowSymbol', minimumFractionDigits: context.settings.data.advancedMode ? asset?.symbol.precision : undefined }; diff --git a/src/lib/components/input/asset.svelte b/src/lib/components/input/asset.svelte index f0c9d0e03..ccf6e0f7e 100644 --- a/src/lib/components/input/asset.svelte +++ b/src/lib/components/input/asset.svelte @@ -121,31 +121,17 @@ } -
- - - - {String(symbol.code)} - -
+ + {String(symbol.code)} + {#if debug}

Component State

diff --git a/src/lib/components/input/bytes.svelte b/src/lib/components/input/bytes.svelte index e86bcaa07..2abb7f011 100644 --- a/src/lib/components/input/bytes.svelte +++ b/src/lib/components/input/bytes.svelte @@ -155,27 +155,26 @@ } -
- + -
+ {#if debug}
diff --git a/src/lib/components/input/number.svelte b/src/lib/components/input/number.svelte index 936474285..a2fcabb64 100644 --- a/src/lib/components/input/number.svelte +++ b/src/lib/components/input/number.svelte @@ -40,33 +40,20 @@ {#if unit} -
- - - - {unit} - -
+ + {unit} + {:else} {/if} + {#if debug}

Component State

diff --git a/src/lib/components/input/publickey.svelte b/src/lib/components/input/publickey.svelte new file mode 100644 index 000000000..b4ca5a0fe --- /dev/null +++ b/src/lib/components/input/publickey.svelte @@ -0,0 +1,78 @@ + + + + +{#if debug} +

Component State

+
+input (string):   "{input}"
+Public Key:        {pubkey}
+    
+---
+
+Valid Input:       {satisfies}
+Valid Public Key:  {satisfiesPublicKeyMatch}
+
+{/if} diff --git a/src/lib/components/input/text.svelte b/src/lib/components/input/text.svelte index e7781a4bc..d1ff473c3 100644 --- a/src/lib/components/input/text.svelte +++ b/src/lib/components/input/text.svelte @@ -1,30 +1,20 @@ -
+
+ +
+ {@render props.children?.()} +
diff --git a/src/lib/components/navigation/pillgroup.svelte b/src/lib/components/navigation/pillgroup.svelte index bb80b98d7..0a665f760 100644 --- a/src/lib/components/navigation/pillgroup.svelte +++ b/src/lib/components/navigation/pillgroup.svelte @@ -1,5 +1,6 @@ {#each props.options as option}
  • -
  • diff --git a/src/lib/state/metamask.svelte.ts b/src/lib/state/metamask.svelte.ts index e645c923e..912369a42 100644 --- a/src/lib/state/metamask.svelte.ts +++ b/src/lib/state/metamask.svelte.ts @@ -9,7 +9,8 @@ export class MetaMaskState { public isInstalled = $state(false); public error = $state(null); public installedSnap = $state(null); - public publicKey = $state(null); + public publicKey = $state(null); // active + public ownerKey = $state(null); // owner public snapsDetected = $derived(this.snapProvider !== null); diff --git a/src/lib/state/network.svelte.ts b/src/lib/state/network.svelte.ts index 28f979c41..389469e44 100644 --- a/src/lib/state/network.svelte.ts +++ b/src/lib/state/network.svelte.ts @@ -6,6 +6,7 @@ import { snapOrigins } from '@wharfkit/wallet-plugin-metamask'; import { Types as DelphiOracleTypes } from '$lib/wharf/contracts/delphioracle'; import { Contract as DelphiOracleContract } from '$lib/wharf/contracts/delphioracle'; +import { Contract as MSIGContract } from '$lib/wharf/contracts/msig'; import { Contract as SystemContract, Types as SystemTypes } from '$lib/wharf/contracts/system'; import { Contract as TokenContract } from '$lib/wharf/contracts/token'; @@ -81,6 +82,7 @@ export class NetworkState { }); this.contracts = { + msig: new MSIGContract({ client: this.client }), token: new TokenContract({ client: this.client }), system: new SystemContract({ client: this.client }) }; diff --git a/src/lib/wharf/chains.ts b/src/lib/wharf/chains.ts index 14aee4f35..02290ad2d 100644 --- a/src/lib/wharf/chains.ts +++ b/src/lib/wharf/chains.ts @@ -2,11 +2,13 @@ import type { Asset } from '@wharfkit/antelope'; import type { ChainIndices } from '@wharfkit/common'; import { Contract as DelphiOracleContract } from '$lib/wharf/contracts/delphioracle'; +import { Contract as MSIGContract } from '$lib/wharf/contracts/msig'; import { Contract as SystemContract } from '$lib/wharf/contracts/system'; import { Contract as TokenContract } from '$lib/wharf/contracts/token'; export interface DefaultContracts { delphioracle?: DelphiOracleContract; + msig: MSIGContract; token: TokenContract; system: SystemContract; } diff --git a/src/lib/wharf/contracts/msig.ts b/src/lib/wharf/contracts/msig.ts new file mode 100644 index 000000000..2e9c5ea1e --- /dev/null +++ b/src/lib/wharf/contracts/msig.ts @@ -0,0 +1,264 @@ +import type {Action, BytesType, Checksum256Type, NameType, UInt16Type} from '@wharfkit/antelope' +import { + ABI, + Blob, + Bytes, + Checksum256, + Name, + Struct, + TimePoint, + TimePointSec, + UInt16, + UInt32, + UInt8, + VarUInt, +} from '@wharfkit/antelope' +import type {ActionOptions, ContractArgs, PartialBy, Table} from '@wharfkit/contract' +import {Contract as BaseContract} from '@wharfkit/contract' +export const abiBlob = Blob.from( + 'DmVvc2lvOjphY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JhcCBwcm9wb3NhbF9uYW1lfX0gcHJvcG9zYWwnCmljb246IGh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9lb3NuZXR3b3JrZm91bmRhdGlvbi9lb3Mtc3lzdGVtLWNvbnRyYWN0cy9tYWluL2NvbnRyYWN0cy9pY29ucy9tdWx0aXNpZy5wbmcjNGZiNDFkM2NmMDJkMGRkMmQzNWEyOTMwOGU5M2MyZDgyNmVjNzcwZDZiYjUyMGRiNjY4ZjUzMDc2NGJlNzE1MwotLS0KCnt7bGV2ZWwuYWN0b3J9fSByZXZva2VzIHRoZSBhcHByb3ZhbCBwcmV2aW91c2x5IHByb3ZpZGVkIGF0IHRoZWlyIHt7bGV2ZWwucGVybWlzc2lvbn19IHBlcm1pc3Npb24gbGV2ZWwgZnJvbSB0aGUge3twcm9wb3NhbF9uYW1lfX0gcHJvcG9zYWwgcHJvcG9zZWQgYnkge3twcm9wb3Nlcn19LgQAAMDRbHprNQNpNjQAABJvbGRfYXBwcm92YWxzX2luZm8AgMDRbHprNQNpNjQAAA5hcHByb3ZhbHNfaW5mbwAAAADgaPZ0A2k2NAAADGludmFsaWRhdGlvbgAAANFgWumtA2k2NAAACHByb3Bvc2FsAAAAAAA=' +) +export const abi = ABI.from(abiBlob) +export namespace Types { + @Struct.type('permission_level') + export class permission_level extends Struct { + @Struct.field(Name) + declare actor: Name + @Struct.field(Name) + declare permission: Name + } + @Struct.type('action') + export class action extends Struct { + @Struct.field(Name) + declare account: Name + @Struct.field(Name) + declare name: Name + @Struct.field(permission_level, {array: true}) + declare authorization: permission_level[] + @Struct.field(Bytes) + declare data: Bytes + } + @Struct.type('approval') + export class approval extends Struct { + @Struct.field(permission_level) + declare level: permission_level + @Struct.field(TimePoint) + declare time: TimePoint + } + @Struct.type('approvals_info') + export class approvals_info extends Struct { + @Struct.field(UInt8) + declare version: UInt8 + @Struct.field(Name) + declare proposal_name: Name + @Struct.field(approval, {array: true}) + declare requested_approvals: approval[] + @Struct.field(approval, {array: true}) + declare provided_approvals: approval[] + } + @Struct.type('approve') + export class approve extends Struct { + @Struct.field(Name) + declare proposer: Name + @Struct.field(Name) + declare proposal_name: Name + @Struct.field(permission_level) + declare level: permission_level + @Struct.field(Checksum256, {optional: true}) + declare proposal_hash?: Checksum256 + } + @Struct.type('cancel') + export class cancel extends Struct { + @Struct.field(Name) + declare proposer: Name + @Struct.field(Name) + declare proposal_name: Name + @Struct.field(Name) + declare canceler: Name + } + @Struct.type('exec') + export class exec extends Struct { + @Struct.field(Name) + declare proposer: Name + @Struct.field(Name) + declare proposal_name: Name + @Struct.field(Name) + declare executer: Name + } + @Struct.type('extension') + export class extension extends Struct { + @Struct.field(UInt16) + declare type: UInt16 + @Struct.field(Bytes) + declare data: Bytes + } + @Struct.type('invalidate') + export class invalidate extends Struct { + @Struct.field(Name) + declare account: Name + } + @Struct.type('invalidation') + export class invalidation extends Struct { + @Struct.field(Name) + declare account: Name + @Struct.field(TimePoint) + declare last_invalidation_time: TimePoint + } + @Struct.type('old_approvals_info') + export class old_approvals_info extends Struct { + @Struct.field(Name) + declare proposal_name: Name + @Struct.field(permission_level, {array: true}) + declare requested_approvals: permission_level[] + @Struct.field(permission_level, {array: true}) + declare provided_approvals: permission_level[] + } + @Struct.type('proposal') + export class proposal extends Struct { + @Struct.field(Name) + declare proposal_name: Name + @Struct.field(Bytes) + declare packed_transaction: Bytes + @Struct.field(TimePoint, {optional: true}) + declare earliest_exec_time?: TimePoint + } + @Struct.type('transaction_header') + export class transaction_header extends Struct { + @Struct.field(TimePointSec) + declare expiration: TimePointSec + @Struct.field(UInt16) + declare ref_block_num: UInt16 + @Struct.field(UInt32) + declare ref_block_prefix: UInt32 + @Struct.field(VarUInt) + declare max_net_usage_words: VarUInt + @Struct.field(UInt8) + declare max_cpu_usage_ms: UInt8 + @Struct.field(VarUInt) + declare delay_sec: VarUInt + } + @Struct.type('transaction') + export class transaction extends transaction_header { + @Struct.field(action, {array: true}) + declare context_free_actions: action[] + @Struct.field(action, {array: true}) + declare actions: action[] + @Struct.field(extension, {array: true}) + declare transaction_extensions: extension[] + } + @Struct.type('propose') + export class propose extends Struct { + @Struct.field(Name) + declare proposer: Name + @Struct.field(Name) + declare proposal_name: Name + @Struct.field(permission_level, {array: true}) + declare requested: permission_level[] + @Struct.field(transaction) + declare trx: transaction + } + @Struct.type('unapprove') + export class unapprove extends Struct { + @Struct.field(Name) + declare proposer: Name + @Struct.field(Name) + declare proposal_name: Name + @Struct.field(permission_level) + declare level: permission_level + } +} +export const TableMap = { + approvals: Types.old_approvals_info, + approvals2: Types.approvals_info, + invals: Types.invalidation, + proposal: Types.proposal, +} +export interface TableTypes { + approvals: Types.old_approvals_info + approvals2: Types.approvals_info + invals: Types.invalidation + proposal: Types.proposal +} +export type RowType = T extends keyof TableTypes ? TableTypes[T] : any +export type TableNames = keyof TableTypes +export namespace ActionParams { + export namespace Type { + export interface permission_level { + actor: NameType + permission: NameType + } + export interface transaction { + context_free_actions: Type.action[] + actions: Type.action[] + transaction_extensions: Type.extension[] + } + export interface action { + account: NameType + name: NameType + authorization: Type.permission_level[] + data: BytesType + } + export interface extension { + type: UInt16Type + data: BytesType + } + } + export interface approve { + proposer: NameType + proposal_name: NameType + level: Type.permission_level + proposal_hash?: Checksum256Type + } + export interface cancel { + proposer: NameType + proposal_name: NameType + canceler: NameType + } + export interface exec { + proposer: NameType + proposal_name: NameType + executer: NameType + } + export interface invalidate { + account: NameType + } + export interface propose { + proposer: NameType + proposal_name: NameType + requested: Type.permission_level[] + trx: Type.transaction + } + export interface unapprove { + proposer: NameType + proposal_name: NameType + level: Type.permission_level + } +} +export interface ActionNameParams { + approve: ActionParams.approve + cancel: ActionParams.cancel + exec: ActionParams.exec + invalidate: ActionParams.invalidate + propose: ActionParams.propose + unapprove: ActionParams.unapprove +} +export type ActionNames = keyof ActionNameParams +export class Contract extends BaseContract { + constructor(args: PartialBy) { + super({ + client: args.client, + abi: abi, + account: args.account || Name.from('eosio.msig'), + }) + } + action( + name: T, + data: ActionNameParams[T], + options?: ActionOptions + ): Action { + return super.action(name, data, options) + } + table(name: T, scope?: NameType): Table> { + return super.table(name, scope, TableMap[name]) + } +} diff --git a/src/routes/[network]/(account)/(send)/+layout.svelte b/src/routes/[network]/(account)/(send)/+layout.svelte index 176a6b54f..60176339b 100644 --- a/src/routes/[network]/(account)/(send)/+layout.svelte +++ b/src/routes/[network]/(account)/(send)/+layout.svelte @@ -1,25 +1,15 @@