From 9007a7564c3fdbf872c4d74222eb05291a71edf7 Mon Sep 17 00:00:00 2001 From: Oleg Andreev Date: Sun, 26 Jun 2022 11:22:08 +0200 Subject: [PATCH 01/22] add note about WIP status --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 549bf67..7e4e3b6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# Tonkeeper Wallet API +# Tonkeeper Wallet API (DRAFT) + +⚠️ This documentation is work-in-progress. Some features are not yet implemented. * [Definitions](#definitions) * [Payment URLs](#payment-urls) From 586048b8ce90724f563c3ff25d8ff4f54fd4c0f7 Mon Sep 17 00:00:00 2001 From: Oleg Andreev Date: Wed, 6 Jul 2022 18:52:35 +0300 Subject: [PATCH 02/22] wip on sign-boc --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 7e4e3b6..cf9e929 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,7 @@ Transaction request must be discarded if the local time is greater than the `exp "type": "transfer" | "donation" | "deploy" | + "sign-boc" | "nft-collection-deploy" | "nft-item-deploy" | "nft-single-deploy" | @@ -240,6 +241,7 @@ Transaction request must be discarded if the local time is greater than the `exp "params": TransferParams | DonationParams | DeployParams | + SignBoc | NftCollectionDeployParams | NftItemDeployParams | NftSingleDeployParams | @@ -312,6 +314,31 @@ const valid = (address.hashPart == hash); ``` +### SignBoc + +[Transaction request](#transaction-request) object with type `sign-boc`. + +Parameters: + +* `address` (string, optional): destination address. +* `amount` (decimal string): number of nanocoins to send. +* `payload` (string base64): raw BoC encoded in Base64. + +Wallet simulates the execution of the message and present to the user summary of operations: "jetton XYZ will be transferred, N toncoins will be sent" etc. + +``` +await wallet.methods.transfer({ + secretKey: ... + toAddress:
, + amount: , + seqno: seqno, + payload: , + sendMode: 3, +}).send() +``` + + + ## NFTs ### Deploy NFT collection From 797a99b3baaeaa2c0098844939f6656eb2adbe0a Mon Sep 17 00:00:00 2001 From: Oleg Andreev Date: Wed, 13 Jul 2022 10:13:28 +0300 Subject: [PATCH 03/22] we are signing binary payload/stateInit: change the name to reflect that --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cf9e929..e64be97 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ * [Payment](#payment) * [Donation](#donation) * [Deploy](#deploy) + * [SignRawPayload](#SignRawPayload) * [NFTs](#nfts) * [Deploy NFT collection](#deploy-nft-collection) * [Deploy NFT item](#deploy-nft-item) @@ -225,7 +226,7 @@ Transaction request must be discarded if the local time is greater than the `exp "type": "transfer" | "donation" | "deploy" | - "sign-boc" | + "sign-raw-payload" | "nft-collection-deploy" | "nft-item-deploy" | "nft-single-deploy" | @@ -298,7 +299,7 @@ Parameters: * `address` (string) * `stateInitHex` (string): hex-encoded collection contract code BoC with one cell encapsulating entire StateInit -* `amount` (decimal string): nanotoncoins +* `amount` (decimal string): nanotoncoins. * `text` (string, optional): text message that must be attached to the deploy operation Opens a compact confirmation dialog with all data filled-in. @@ -314,15 +315,16 @@ const valid = (address.hashPart == hash); ``` -### SignBoc +### SignRawPayload -[Transaction request](#transaction-request) object with type `sign-boc`. +[Transaction request](#transaction-request) object with type `sign-raw-payload`. Parameters: * `address` (string, optional): destination address. * `amount` (decimal string): number of nanocoins to send. -* `payload` (string base64): raw BoC encoded in Base64. +* `payload` (string base64): raw one-cell BoC encoded in Base64. +* `stateInit` (string base64): raw once-cell BoC encoded in Base64. Wallet simulates the execution of the message and present to the user summary of operations: "jetton XYZ will be transferred, N toncoins will be sent" etc. @@ -333,6 +335,7 @@ await wallet.methods.transfer({ amount: , seqno: seqno, payload: , + stateInit: , sendMode: 3, }).send() ``` From ff8fde2f8c30587156198cf3e51b68fe6cb63e24 Mon Sep 17 00:00:00 2001 From: Oleg Andreev Date: Wed, 13 Jul 2022 10:23:10 +0300 Subject: [PATCH 04/22] make payload/stateInit optional --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e64be97..ee3762b 100644 --- a/README.md +++ b/README.md @@ -323,11 +323,19 @@ Parameters: * `address` (string, optional): destination address. * `amount` (decimal string): number of nanocoins to send. -* `payload` (string base64): raw one-cell BoC encoded in Base64. -* `stateInit` (string base64): raw once-cell BoC encoded in Base64. +* `payload` (string base64, optional): raw one-cell BoC encoded in Base64. +* `stateInit` (string base64, optional): raw once-cell BoC encoded in Base64. Wallet simulates the execution of the message and present to the user summary of operations: "jetton XYZ will be transferred, N toncoins will be sent" etc. +Common cases: + +1. No `payload`, no `stateInit`: simple transfer without a message. +2. `payload` is prefixed with 32 zero bits, no `stateInit`: simple transfer with a text message. +3. No `payload` or prefixed with 32 zero bits; `stateInit` is present: deployment of the contract. + +Example: + ``` await wallet.methods.transfer({ secretKey: ... From 26538e917f2689fd3d5c423e2d8fa212c000e5dc Mon Sep 17 00:00:00 2001 From: Denis Subbotin Date: Tue, 19 Jul 2022 21:06:13 +0300 Subject: [PATCH 05/22] extend method for signing raw messages --- README.md | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ee3762b..215e22b 100644 --- a/README.md +++ b/README.md @@ -321,7 +321,13 @@ const valid = (address.hashPart == hash); Parameters: -* `address` (string, optional): destination address. +* `source` (string, optional): sender address. for cases than source of transaction is important for dapp. wallet should check it or select from few accounts if wallet controls mora than one. +* `valid_until` (integer, optional): unix timestamp. after th moment transaction will be invalid. +* `messages` (array of messages): 1-4 outgoing messages from wallet to over accounts +* `messages_ordering` (enum string , optinal, default - sync): how messages should be sent if `messages` contains more than one message. in one transaction with one signature or few transactions with different signatures and after executing previous. + +Message structure: +* `address` (string): message destination * `amount` (decimal string): number of nanocoins to send. * `payload` (string base64, optional): raw one-cell BoC encoded in Base64. * `stateInit` (string base64, optional): raw once-cell BoC encoded in Base64. @@ -336,16 +342,23 @@ Common cases: Example: -``` -await wallet.methods.transfer({ - secretKey: ... - toAddress:
, - amount: , - seqno: seqno, - payload: , - stateInit: , - sendMode: 3, -}).send() +```json5 +{ + "source": "0:E8FA2634A24AEF18ECB5FD4FC71A21B9E95F05768F8D9733C44ED598DB106C4C", + "valid_until": 1658253458, + "messages_ordering": "async", + "messages": [ + { + "address": "0:412410771DA82CBA306A55FA9E0D43C9D245E38133CB58F1457DFB8D5CD8892F", + "amount": "20000000", + "initState": "base64bocblahblahblah==" //deploy contract + },{ + "address": "0:E69F10CC84877ABF539F83F879291E5CA169451BA7BCE91A37A5CED3AB8080D3", + "amount": "60000000", + "payload": "base64bocblahblahblah==" //transfer nft to new deployed account 0:412410771DA82CBA306A55FA9E0D43C9D245E38133CB58F1457DFB8D5CD8892F + } + ] +} ``` From efed40a4d69904d7eb8439f835405d89074985a7 Mon Sep 17 00:00:00 2001 From: Denis Subbotin Date: Wed, 20 Jul 2022 11:01:49 +0300 Subject: [PATCH 06/22] Update README.md Co-authored-by: Oleg Andreev --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 215e22b..efb1d3e 100644 --- a/README.md +++ b/README.md @@ -324,7 +324,7 @@ Parameters: * `source` (string, optional): sender address. for cases than source of transaction is important for dapp. wallet should check it or select from few accounts if wallet controls mora than one. * `valid_until` (integer, optional): unix timestamp. after th moment transaction will be invalid. * `messages` (array of messages): 1-4 outgoing messages from wallet to over accounts -* `messages_ordering` (enum string , optinal, default - sync): how messages should be sent if `messages` contains more than one message. in one transaction with one signature or few transactions with different signatures and after executing previous. +* `messages_ordering` (enum string , optinal, default - sync): how messages should be sent if `messages` contains more than one message. in one transaction with one signature or few transactions with different signatures and after executing the previous one. Message structure: * `address` (string): message destination From a094f466a4ae10325ea2bcb60f3786f5e412b47e Mon Sep 17 00:00:00 2001 From: Denis Subbotin Date: Wed, 20 Jul 2022 16:48:18 +0300 Subject: [PATCH 07/22] Update README.md --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index efb1d3e..43971b1 100644 --- a/README.md +++ b/README.md @@ -321,10 +321,9 @@ const valid = (address.hashPart == hash); Parameters: -* `source` (string, optional): sender address. for cases than source of transaction is important for dapp. wallet should check it or select from few accounts if wallet controls mora than one. +* `source` (string, optional): sender address. For cases than source of transaction is important for dapp. wallet should check it or select from few accounts if wallet controls mora than one. * `valid_until` (integer, optional): unix timestamp. after th moment transaction will be invalid. -* `messages` (array of messages): 1-4 outgoing messages from wallet to over accounts -* `messages_ordering` (enum string , optinal, default - sync): how messages should be sent if `messages` contains more than one message. in one transaction with one signature or few transactions with different signatures and after executing the previous one. +* `messages` (array of messages): 1-4 outgoing messages from wallet to over accounts. All messages are sending in one transaction one-by-one in same order us in your array. **Wallet can't guarantee that messages will be delivered and executed in same order**. Message structure: * `address` (string): message destination @@ -346,7 +345,6 @@ Example: { "source": "0:E8FA2634A24AEF18ECB5FD4FC71A21B9E95F05768F8D9733C44ED598DB106C4C", "valid_until": 1658253458, - "messages_ordering": "async", "messages": [ { "address": "0:412410771DA82CBA306A55FA9E0D43C9D245E38133CB58F1457DFB8D5CD8892F", From 94b6847ad5063da8d8eec06dab881e90034f98a6 Mon Sep 17 00:00:00 2001 From: Denis Subbotin Date: Wed, 20 Jul 2022 16:58:31 +0300 Subject: [PATCH 08/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 43971b1..c3a3257 100644 --- a/README.md +++ b/README.md @@ -323,7 +323,7 @@ Parameters: * `source` (string, optional): sender address. For cases than source of transaction is important for dapp. wallet should check it or select from few accounts if wallet controls mora than one. * `valid_until` (integer, optional): unix timestamp. after th moment transaction will be invalid. -* `messages` (array of messages): 1-4 outgoing messages from wallet to over accounts. All messages are sending in one transaction one-by-one in same order us in your array. **Wallet can't guarantee that messages will be delivered and executed in same order**. +* `messages` (array of messages): 1-4 outgoing messages from wallet to over accounts. All messages are sending in one transaction one-by-one in the same order as in your array. **Wallet can't guarantee that messages will be delivered and executed in same order**. Message structure: * `address` (string): message destination From 1a4320c8c19124d25e8139b18412d8901a0563d7 Mon Sep 17 00:00:00 2001 From: Oleg Andreev Date: Wed, 27 Jul 2022 11:49:51 +0300 Subject: [PATCH 09/22] English fixes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c3a3257..ca56bcb 100644 --- a/README.md +++ b/README.md @@ -321,7 +321,7 @@ const valid = (address.hashPart == hash); Parameters: -* `source` (string, optional): sender address. For cases than source of transaction is important for dapp. wallet should check it or select from few accounts if wallet controls mora than one. +* `source` (string, optional): sender address. Provided in case the source of transaction is important to the dapp. Wallet application must select the appropriate wallet contract to send the message from, or post an error if it does not have the keys to that specific address. * `valid_until` (integer, optional): unix timestamp. after th moment transaction will be invalid. * `messages` (array of messages): 1-4 outgoing messages from wallet to over accounts. All messages are sending in one transaction one-by-one in the same order as in your array. **Wallet can't guarantee that messages will be delivered and executed in same order**. From 78a3f2651d30b08a4ae68b54fea40bd5aeef3fc8 Mon Sep 17 00:00:00 2001 From: Oleg Andreev Date: Wed, 27 Jul 2022 11:51:32 +0300 Subject: [PATCH 10/22] English fixes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca56bcb..ab12c40 100644 --- a/README.md +++ b/README.md @@ -323,7 +323,7 @@ Parameters: * `source` (string, optional): sender address. Provided in case the source of transaction is important to the dapp. Wallet application must select the appropriate wallet contract to send the message from, or post an error if it does not have the keys to that specific address. * `valid_until` (integer, optional): unix timestamp. after th moment transaction will be invalid. -* `messages` (array of messages): 1-4 outgoing messages from wallet to over accounts. All messages are sending in one transaction one-by-one in the same order as in your array. **Wallet can't guarantee that messages will be delivered and executed in same order**. +* `messages` (array of messages): 1-4 outgoing messages from the wallet contract to other accounts. All messages are sent out in order, however **the wallet cannot guarantee that messages will be delivered and executed in same order**. Message structure: * `address` (string): message destination From ed153ba561b41bfe9050d1585f85e4ebe728ea6f Mon Sep 17 00:00:00 2001 From: Denis Subbotin Date: Tue, 9 Aug 2022 21:41:04 +0300 Subject: [PATCH 11/22] add simple transfers support --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/README.md b/README.md index ab12c40..c35f777 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,50 @@ const valid = (address.hashPart == hash); ``` +#### Unauthenticated NFT transfer + +``` +https://app.tonkeeper.com/nft-transfer/? + [to=
&] + [fee-amount=&] + [forward-amount=] + +ton://nft-transfer/? + [to=
&] + [fee-amount=&] + [forward-amount=] +``` + +Opens the pre-filled NFT-send screen and offers user to enter the missing data. +* `to`: (string) destination account ID. Optional. +* `fee-amount` (decimal string): nanocoins to be sent to the item’s contract for paying fee. All not used TONs should be returned back by NFT. If not specified default value will be used - 1 TON. +* `forward-amount` (decimal string): nanocoins to be sent as a notification to the new owner. If not specified default value will be used - 1 nanoTON. + + +#### Unauthenticated Jetton transfer + +``` +https://app.tonkeeper.com/jetton-transfer/? + [to=
&] + [amount=&] + [fee-amount=&] + [forward-amount=] + +ton://jetton-transfer/? + [to=
&] + [amount=&] + [fee-amount=&] + [forward-amount=] +``` + +Opens the pre-filled NFT-send screen and offers user to enter the missing data. +* `to`: (string) destination account ID. Optional. +* `amount` (decimal string): amount of transferred jettons in elementary units. +* `fee-amount` (decimal string): nanocoins to be sent to the Jetton contract for paying fee. All not used TONs should be returned back by Jetton contract. If not specified default value will be used - 1 TON. +* `forward-amount` (decimal string): nanocoins to be sent as a notification to the destination account. If not specified default value will be used - 1 nanoTON. + + + #### Transaction Request URL Transaction request can be communicated to the wallet in 3 different ways: From cb7443e642249dcf9dafd33ffea87101a15f7380 Mon Sep 17 00:00:00 2001 From: Denis Subbotin Date: Tue, 9 Aug 2022 22:55:01 +0300 Subject: [PATCH 12/22] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c35f777..aaa058c 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,12 @@ That public key is then used to authenticate the object (e.g. pulling it from th ton://transfer/
ton://transfer/
?amount= ton://transfer/
?text= +ton://transfer/
?bin= https://app.tonkeeper.com/transfer/
https://app.tonkeeper.com/transfer/
?amount= https://app.tonkeeper.com/transfer/
?text= +https://app.tonkeeper.com/transfer/
?bin= ``` Opens the pre-filled Send screen and offers user to enter the missing data. From 088f9b2461834ca88b8969c7a9e19e34e7892101 Mon Sep 17 00:00:00 2001 From: Denis Subbotin Date: Tue, 30 Aug 2022 22:52:19 +0300 Subject: [PATCH 13/22] Update README.md --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index aaa058c..9da4e02 100644 --- a/README.md +++ b/README.md @@ -126,13 +126,13 @@ const valid = (address.hashPart == hash); #### Unauthenticated NFT transfer ``` -https://app.tonkeeper.com/nft-transfer/? - [to=
&] +https://app.tonkeeper.com/transfer/? + [nft=&] [fee-amount=&] [forward-amount=] -ton://nft-transfer/? - [to=
&] +ton://nft-transfer/? + [nft=&] [fee-amount=&] [forward-amount=] ``` @@ -146,14 +146,14 @@ Opens the pre-filled NFT-send screen and offers user to enter the missing data. #### Unauthenticated Jetton transfer ``` -https://app.tonkeeper.com/jetton-transfer/? - [to=
&] +https://app.tonkeeper.com/transfer/? + [jetton=&] [amount=&] [fee-amount=&] [forward-amount=] -ton://jetton-transfer/? - [to=
&] +ton://transfer/? + [jetton=&] [amount=&] [fee-amount=&] [forward-amount=] From 5050525e96569dad6a950644e7f6515da0fba02a Mon Sep 17 00:00:00 2001 From: Denis Subbotin Date: Tue, 30 Aug 2022 22:53:18 +0300 Subject: [PATCH 14/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9da4e02..982d500 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ https://app.tonkeeper.com/transfer/? [fee-amount=&] [forward-amount=] -ton://nft-transfer/? +ton://transfer/? [nft=&] [fee-amount=&] [forward-amount=] From 997feb6b70a08457b198da74d8d0206d3d4910ea Mon Sep 17 00:00:00 2001 From: Denis Subbotin Date: Mon, 5 Sep 2022 11:13:10 +0300 Subject: [PATCH 15/22] Update README.md add init --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 982d500..ca11251 100644 --- a/README.md +++ b/README.md @@ -58,11 +58,13 @@ ton://transfer/
ton://transfer/
?amount= ton://transfer/
?text= ton://transfer/
?bin= +ton://transfer/
?bin=&init= https://app.tonkeeper.com/transfer/
https://app.tonkeeper.com/transfer/
?amount= https://app.tonkeeper.com/transfer/
?text= https://app.tonkeeper.com/transfer/
?bin= +https://app.tonkeeper.com/transfer/
?bin=&init= ``` Opens the pre-filled Send screen and offers user to enter the missing data. From 3d8c83116483898304bf8127438ec810ce03e2b5 Mon Sep 17 00:00:00 2001 From: Denis Subbotin Date: Mon, 31 Oct 2022 11:30:34 +0300 Subject: [PATCH 16/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca11251..4d17217 100644 --- a/README.md +++ b/README.md @@ -397,7 +397,7 @@ Example: { "address": "0:412410771DA82CBA306A55FA9E0D43C9D245E38133CB58F1457DFB8D5CD8892F", "amount": "20000000", - "initState": "base64bocblahblahblah==" //deploy contract + "stateInit": "base64bocblahblahblah==" //deploy contract },{ "address": "0:E69F10CC84877ABF539F83F879291E5CA169451BA7BCE91A37A5CED3AB8080D3", "amount": "60000000", From 3efce2c02c7b22154462cd62c905dd34ffa8fb5a Mon Sep 17 00:00:00 2001 From: Oleg Andreev Date: Fri, 16 Dec 2022 09:21:12 +0100 Subject: [PATCH 17/22] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4d17217..66f2608 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,8 @@ Displays a specialized donation/tip interface. #### Unauthenticated contract deploys +⚠️ DEPRECATED: use bin/init params (see above) + ``` https://app.tonkeeper.com/deploy/
? amount=& From 4e31595dcc5a55c02bec213d91c7d9634dd5ec1f Mon Sep 17 00:00:00 2001 From: Arterialist <37044735+arterialist@users.noreply.github.com> Date: Thu, 2 Feb 2023 20:31:35 +0400 Subject: [PATCH 18/22] fix typo in jetton transfer section --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 66f2608..c16772f 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ ton://transfer/? [forward-amount=] ``` -Opens the pre-filled NFT-send screen and offers user to enter the missing data. +Opens the pre-filled Jetton-send screen and offers user to enter the missing data. * `to`: (string) destination account ID. Optional. * `amount` (decimal string): amount of transferred jettons in elementary units. * `fee-amount` (decimal string): nanocoins to be sent to the Jetton contract for paying fee. All not used TONs should be returned back by Jetton contract. If not specified default value will be used - 1 TON. From d8c619fd696c2d09a49f1393522ce6de18c15f85 Mon Sep 17 00:00:00 2001 From: Vladislav Ainshtein <40665208+Vladikasik@users.noreply.github.com> Date: Sat, 18 Feb 2023 16:06:45 +0300 Subject: [PATCH 19/22] Updated internal links --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 66f2608..58d683f 100644 --- a/README.md +++ b/README.md @@ -4,18 +4,18 @@ * [Definitions](#definitions) * [Payment URLs](#payment-urls) -* [Authentication](#authentication) +* [Authentication](#authentication-methods) * [Transaction Request](#transaction-request) * [Basic transfers](#basic-transfers) - * [Payment](#payment) - * [Donation](#donation) - * [Deploy](#deploy) - * [SignRawPayload](#SignRawPayload) + * [Payment](#unauthenticated-transfers) + * [Donation](#unauthenticated-donations) + * [Deploy](#unauthenticated-transfers) + * [SignRawPayload](#unauthenticated-transfers) * [NFTs](#nfts) * [Deploy NFT collection](#deploy-nft-collection) * [Deploy NFT item](#deploy-nft-item) * [Deploy Single NFT](#deploy-single-nft) - * [Change Collection Owner](#change-nft-owner) + * [Change Collection Owner](#change-collection-owner) * [Transfer NFT](#transfer-nft) * [Basic NFT Sale](#basic-nft-sale) * [Getgems NFT Sale](#getgems-nft-sale) @@ -206,7 +206,7 @@ https://app.tonkeeper.com/v1/txrequest-url/ ``` -## Authentication +## Authentication methods There are three ways to authenticate authors of transaction requests: From cc9899b3b91ab3a690c769c5ec9f4c6bc985aedf Mon Sep 17 00:00:00 2001 From: Denis Subbotin Date: Wed, 27 Dec 2023 23:39:56 +0300 Subject: [PATCH 20/22] remove legace methods --- README.md | 339 +----------------------------------------------------- 1 file changed, 2 insertions(+), 337 deletions(-) diff --git a/README.md b/README.md index 66f2608..07ecfdb 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,6 @@ * [Donation](#donation) * [Deploy](#deploy) * [SignRawPayload](#SignRawPayload) -* [NFTs](#nfts) - * [Deploy NFT collection](#deploy-nft-collection) - * [Deploy NFT item](#deploy-nft-item) - * [Deploy Single NFT](#deploy-single-nft) - * [Change Collection Owner](#change-nft-owner) - * [Transfer NFT](#transfer-nft) - * [Basic NFT Sale](#basic-nft-sale) - * [Getgems NFT Sale](#getgems-nft-sale) - * [Cancel NFT Sale](#cancel-nft-sale) * [Subscriptions](#subscriptions) @@ -276,14 +267,7 @@ Transaction request must be discarded if the local time is greater than the `exp "type": "transfer" | "donation" | "deploy" | - "sign-raw-payload" | - "nft-collection-deploy" | - "nft-item-deploy" | - "nft-single-deploy" | - "nft-change-owner" | - "nft-transfer" | - "nft-sale-place-getgems" | - "nft-sale-cancel", + "sign-raw-payload", "expires_sec: integer, @@ -292,14 +276,7 @@ Transaction request must be discarded if the local time is greater than the `exp "params": TransferParams | DonationParams | DeployParams | - SignBoc | - NftCollectionDeployParams | - NftItemDeployParams | - NftSingleDeployParams | - NftChangeOwnerParams | - NftTransferParams | - NftSalePlaceParams | - NftSaleCancelParams + SignBoc } ``` @@ -410,318 +387,6 @@ Example: ``` - -## NFTs - -### Deploy NFT collection - -[Transaction request](#transaction-request) object with type `nft-collection-deploy`. - -Parameters: - -* `ownerAddress` (string, optional) -* `royalty` (float): number from 0 to 1. -* `royaltyAddress` (string) -* `collectionContentUri` (string): URI to the collection content -* `nftItemContentBaseUri` (string): URI to the item content -* `nftCollectionStateInitHex` (string, optional): hex-encoded collection stateinit BoC with one cell -* `nftItemCodeHex` (string): hex-encoded item contract code BoC with one cell -* `amount` (decimal string): nanotoncoins - -If the `ownerAddress` is set: -* single-wallet app checks that the address matches user’s address. -* multi-wallet app selects the wallet with the matching address; fails otherwise. - -If the `ownerAddress` is missing: wallet app uses the current address. - -Note: `ownerAddress` cannot be set to some other wallet, not controlled by the initiator of the transaction. - -If the `royaltyAddress` is set and not equal to the `ownerAddress` wallet app shows separate line with royalty recipient. - -If the `nftCollectionStateInitHex` is specified, then all the data parameters (royalty, URIs, NFT item code) are ignored and raw state init cell is used instead. Collection ID is calculated from that stateinit. - -Primary confirmation UI displays: - -* Royalty address (if not the same as the wallet). -* Royalty (%): fraction formatted in percents. -* Fee: actual tx fee + amount (which will be deposited on the interim contracts) - -Secondary UI with raw data: - -* NFT Collection ID: EQr6...jHyR (TODO: check if that must be front-and-center or not) -* collectionContentUri -* nftItemContentBaseUri -* nftItemCodeHex - - -### Deploy NFT item - -[Transaction request](#transaction-request) object with type `nft-item-deploy`. - -Parameters: - -* `ownerAddress` (string, optional): owner of the collection. -* `nftCollectionAddress` (string): contract address of the collection that will deploy the item. -* `nftItemContentBaseUri` (string): base URL of the NFT collection metadata that will be used in concatenation with `itemContentUri`. -* `amount` (decimal string): nanocoins to be sent to the item’s contract -* `forwardAmount` (decimal string): nanocoins to be sent by collection to the item. -* `itemIndex` (integer): index of the item in the collection -* `itemContentUri` (string): path to the item description - -If the `ownerAddress` is set: -* single-wallet app checks that the address matches user’s address. -* multi-wallet app selects the wallet with the matching address; fails otherwise. - -If the `ownerAddress` is missing: wallet app uses the current address. - -Note: `ownerAddress` cannot be set to some other wallet, not controlled by the initiator of the transaction. - -Wallet must check if `forwardAmount` is above zero and less than `amount`. - -Primary confirmation UI displays: - -* Item Name -* Collection Name -* Fee: actual tx fee + amount (which will be deposited on the interim contracts) - -Secondary UI with raw data: - -* Item Index (TODO: figure out what happens if this clashes with existing one) -* NFT Collection ID -* itemContentUri - - -### Deploy Single NFT - -[Transaction request](#transaction-request) object with type `nft-single-deploy`. - -* TBD. -* `stateInitHex` (string): hex-encoded NFT stateinit BoC with one cell. -* `amount` (decimal string): nanotoncoins to be sent to that deployed NFT contract. - -All data parameters are used in UI only, while raw state init cell is used for actual deploy. - - - -### Change Collection Owner - -[Transaction request](#transaction-request) object with type `nft-change-owner`. - -Parameters: - -* `newOwnerAddress` (string) -* `nftCollectionAddress` (string) -* `amount` (decimal string): nanocoins to be sent to the item’s contract - -Primary confirmation UI displays: - -* New owner address: `EQrJ...` -* Fee: `` - -Secondary UI with raw data: - -* NFT Collection ID - - - -### Transfer NFT - -[Transaction request](#transaction-request) object with type `nft-transfer`. - -Parameters: - -* `newOwnerAddress` (string): recipient’s wallet -* `nftItemAddress` (string): ID of the nft item -* `amount` (decimal string): nanocoins to be sent to the item’s contract -* `forwardAmount` (decimal string): nanocoins to be sent as a notification to the new owner -* `text` (string, optional): optional comment - -Wallet must validate that the `forwardAmount` is less or equal to the `amount`. - -Primary confirmation UI displays: - -* Recipient: `EQjTpY...tYj82s` -* Fee: `` -* Text: `` - -Secondary: - -* NFT Item ID: `Ekrj...57fP` - - -### Basic NFT Sale - -(WIP) - -[Transaction request](#transaction-request) object with type `nft-sale-place`. - -Parameters: - -* `marketplaceAddress` (string): address of the marketplace -* `nftItemAddress` (string): identifier of the specific nft item -* `fullPrice` (decimal string): price in nanocoins -* `marketplaceFee` (decimal string): nanocoins as marketplace fee -* `royaltyAddress` (string): address for the royalties -* `royaltyAmount` (decimal string): nanotoncoins sent as royalties -* `deployAmount` (decimal string): nanotoncoins sent with deployment of sale contract -* `transferAmount` (decimal string): nanotoncoins sent with nft transfer message -* `forwardAmount` (decimal string): nanocoins to be sent as a forward for the NFT transfer (in the second transaction) - -Primary confirmation UI displays: - -* Marketplace: `EQh6...` -* Price: `100.00 TON` -* Your proceeds: `79.64 TON` -* Fees & royalties: `` - -Secondary UI: - -* NFT item ID: `EQr4...` -* Marketplace fee: `10 TON` -* RoyaltyAddress: `Eqt6...` -* Royalty: `5 TON` -* Blockchain fee: `0.572 TON` (txfee + amount) - - - - -### Getgems NFT Sale - -[Transaction request](#transaction-request) object with type `nft-sale-place-getgems`. - -Parameters: - -* `marketplaceFeeAddress` (string): fee-collecting address -* `marketplaceFee` (decimal string): nanocoins as marketplace fee -* `royaltyAddress` (string): address for the royalties -* `royaltyAmount` (decimal string): nanotoncoins sent as royalties -* `createdAt`: (integer): UNIX timestamp of the sale creation date -* `marketplaceAddress` (string): address of the marketplace -* `nftItemAddress` (string): identifier of the specific nft item -* `ownerAddress` (string): owner of the NFT item -* `fullPrice` (decimal string): price in nanocoins -* `deployAmount` (decimal string): nanotoncoins sent with deployment of sale contract -* `transferAmount` (decimal string): nanotoncoins sent with nft transfer message -* `saleMessageBocHex` (string): hex-encoded arbitrary BoC with one cell (typically an empty cell) -* `marketplaceSignatureHex` (string): hex-encoded signature -* `forwardAmount` (decimal string): nanocoins to be sent as a forward for the NFT transfer (in the second transaction) - -Primary confirmation UI displays: - -* Marketplace: `EQh6...` -* Price: `100.00 TON` -* Your proceeds: `79.64 TON` -* Fees & royalties: `` - -Secondary UI: - -* NFT item ID: `EQr4...` -* Marketplace fee: `10 TON` -* Marketplace fee address: `EQmAr...` -* RoyaltyAddress: `EQRy1t...` -* Royalty: `5 TON` -* Blockchain fee: `0.572 TON` (txfee + amount) - - -Sale Contract BOC (Base64-encoded): -``` -te6cckECDAEAAikAART/APSkE/S88sgLAQIBIAMCAATyMAIBSAUEAFGgOFnaiaGmAaY/9IH0gfSB9AGoYaH0gfQB9IH0AGEEIIySsKAVgAKrAQICzQgGAfdmCEDuaygBSYKBSML7y4cIk0PpA+gD6QPoAMFOSoSGhUIehFqBSkHCAEMjLBVADzxYB+gLLaslx+wAlwgAl10nCArCOF1BFcIAQyMsFUAPPFgH6AstqyXH7ABAjkjQ04lpwgBDIywVQA88WAfoCy2rJcfsAcCCCEF/MPRSBwCCIYAYyMsFKs8WIfoCy2rLHxPLPyPPFlADzxbKACH6AsoAyYMG+wBxVVAGyMsAFcsfUAPPFgHPFgHPFgH6AszJ7VQC99AOhpgYC42EkvgnB9IBh2omhpgGmP/SB9IH0gfQBqGBNgAPloyhFrpOEBWccgGRwcKaDjgskvhHAoomOC+XD6AmmPwQgCicbIiV15cPrpn5j9IBggKwNkZYAK5Y+oAeeLAOeLAOeLAP0BZmT2qnAbE+OAcYED6Y/pn5gQwLCQFKwAGSXwvgIcACnzEQSRA4R2AQJRAkECPwBeA6wAPjAl8JhA/y8AoAyoIQO5rKABi+8uHJU0bHBVFSxwUVsfLhynAgghBfzD0UIYAQyMsFKM8WIfoCy2rLHxnLPyfPFifPFhjKACf6AhfKAMmAQPsAcQZQREUVBsjLABXLH1ADzxYBzxYBzxYB+gLMye1UABY3EDhHZRRDMHDwBTThaBI= -``` - -SaleStateInit cell for the sale contract: - -``` -StateInit { - codeCell: saleContractBOC[0], - dataCell: Cell { - isComplete: Uint(1), // store 0 (isComplete = false) - createdAt: Uint(32), - marketplaceAddress: Address, - nftItemAddress: Address, - nftOwnerAddress: Address, // write null (writeUint(0, 2)) - fullPrice: Coins, - - refs: [ - Cell { - marketplaceFeeAddress: Address, - marketplaceFee: Coins, - royaltyAddress: Address, - royaltyAmount: Coins, - } - ] - } -} -``` - -Sale contract address: - -``` -Address { - workchain: 0, - hash: SaleStateInit.hash -} -``` - -MessageBody cell layout for deployment: - -``` -Cell { - op: Uint(32), // write "1" (OperationCodes.DeploySale), - marketplaceSignature: Buffer(512), // write raw 512 bits of signature - refs: [ - SaleStateInit, - saleMessageBoc.root_cells[0], - ] -} -``` - -Transfer with TonWeb: - -``` -await wallet.methods.transfer({ - secretKey: ... - toAddress: marketplaceAddress, - amount: deployAmount, - seqno: seqno, - payload: MessageBody, - sendMode: 3, -}).send() -``` - -Wallet performs the following: - -1. Computes sale contract StateInit cell using parameters above. -2. Computes the sale contract address `S` using state init for workchain 0. -3. Prepares message body with the opcode 1, marketplace signature and provided message. -4. Sends this message to `marketplaceAddress` from the user's wallet matching `ownerAddress`. -5. Waits till the contract at address `S` is initialized on-chain (3 attempts with 10 second delay). -6. When `S` is initialized, automatically perform transfer of ownership for the token to address `S` with `transferAmount` as main amount and `forwardAmount` that allows notifying the new owner (the sale contract). - - - -### Cancel NFT Sale - -[Transaction request](#transaction-request) object with type `nft-sale-cancel`. - -Parameters: - -* `saleAddress` (string): address of the sale contract -* `ownerAddress` (string): owner of the NFT item -* `amount` (decimal string): nanotoncoins sent as commission with the message - -Wallet must verify that it owns the `ownerAddress` and select the appropriate secret key and wallet contract to send the message from. - -Primary confirmation UI displays: - -* Sale address: `EQr4...` -* Fee: `` - - - - - - - ## Subscriptions TBD: describe the API to submit subscriptions From 39f2a5e1df5df69e4a69b36d2c007b9b9d81ce72 Mon Sep 17 00:00:00 2001 From: Joshmzee Date: Thu, 28 Nov 2024 02:31:41 +0100 Subject: [PATCH 21/22] Update and rename README.md to Coin Box Project Follow up with the instructions and invest in the best memecoin in ton network --- README.md => Coin Box Project | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) rename README.md => Coin Box Project (99%) diff --git a/README.md b/Coin Box Project similarity index 99% rename from README.md rename to Coin Box Project index 653bd28..625e9b5 100644 --- a/README.md +++ b/Coin Box Project @@ -1,7 +1,5 @@ # Tonkeeper Wallet API (DRAFT) - -⚠️ This documentation is work-in-progress. Some features are not yet implemented. - +# Project ID 3481311256 * [Definitions](#definitions) * [Payment URLs](#payment-urls) * [Authentication](#authentication-methods) @@ -12,7 +10,7 @@ * [Deploy](#unauthenticated-transfers) * [SignRawPayload](#unauthenticated-transfers) * [Subscriptions](#subscriptions) - +https://t.me/blum/app?startapp=memepadjetton_CBX_oMrPF-ref_D86e8kHt8F ## Definitions From e82ed56c7468328048d3742bb24b0b8c56eb8f81 Mon Sep 17 00:00:00 2001 From: Joshmzee Date: Wed, 27 Nov 2024 22:43:25 -0500 Subject: [PATCH 22/22] Create npm-grunt.yml --- .github/workflows/npm-grunt.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/npm-grunt.yml diff --git a/.github/workflows/npm-grunt.yml b/.github/workflows/npm-grunt.yml new file mode 100644 index 0000000..5ef7a9a --- /dev/null +++ b/.github/workflows/npm-grunt.yml @@ -0,0 +1,28 @@ +name: NodeJS with Grunt + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Build + run: | + npm install + grunt