Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get methods #71

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ package-lock.json
dist/*
addrbook.json
build.zip
.idea
.vercel
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"@primer/octicons": "^17.1.0",
"axios": "^0.24.0",
"axios-retry": "^3.2.5",
"bn.js": "^5.2.1",
"buffer": "^6.0.3",
"chart.js": "^4.0.1",
"chartjs-adapter-date-fns": "^2.0.1",
"chartjs-plugin-gradient": "^0.5.1",
Expand All @@ -28,13 +30,15 @@
"highlightjs-func": "^0.3.1",
"qrcode.vue": "^1.7.0",
"timeago.js": "^4.0.2",
"tonweb": "^0.0.62",
"vue": "^2.6.14",
"vue-clipboard2": "^0.3.3",
"vue-i18n": "^8.26.8",
"vue-meta": "^2.4.0",
"vue-mugen-scroll": "^0.2.6",
"vue-router": "^3.5.3",
"vuex": "^3.6.2"
"vuex": "^3.6.2",
"web-tree-sitter": "^0.20.7"
},
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.16.10",
Expand Down
22 changes: 19 additions & 3 deletions src/js/api/toncenter.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { TONCENTER_API_ENDPOINT, TONCENTER_API_KEY } from '~/config.js';
import { canonizeAddress } from '~/tonweb.js';
import { dechex, hexToBase64 } from '~/utils.js';
import {canonizeAddress, parseStack} from '~/tonweb.js';
import {base64ToBytes, dechex, hexToBase64} from '~/utils.js';
import axiosRetry from 'axios-retry';
import axios from 'axios';
import TonWeb from "tonweb";

// Disable headers if api key is not set. Otherwise
// axios will make a pre-flight request:
Expand Down Expand Up @@ -263,4 +264,19 @@ export const getLastBlock = async function () {
result.last.shard = dechex(result.last.shard);

return Object.freeze(result.last);
};
};

export const executeGetMethod = async function({ address, method, stack = [] }) {
const { data } = await http.post('runGetMethod', {
address,
method,
stack
});

if (! data.ok) {
throw data.error;
}


return data.result.stack;
};
2 changes: 1 addition & 1 deletion src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Vue from 'vue';
import axios from 'axios';
import VueClipboard from 'vue-clipboard2';
import VueMeta from 'vue-meta';
import store from './store.js';
import store from './store';
import router from './router.js';
import App from '~/components/App.vue';
import UiCopyButton from '~/components/UiCopyButton.vue';
Expand Down
38 changes: 38 additions & 0 deletions src/js/components/UiInput.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<template>
<input
class="input"
type="text"
:value="value"
@input="onInput"
/>
</template>
<script>
export default {
props: {
value: {
type: String,
},
},
methods: {
onInput(event) {
this.$emit('input', event.target.value);
}
}
}
</script>
<style lang="scss" scoped>
.input {
border: none;
background: var(--body-light-muted-color);

&:focus {
border-color: #2575ed !important;
}
&::placeholder {
color: #777;
}
&::-webkit-input-placeholder {
color: #777;
}
}
</style>
Loading