Skip to content

Commit

Permalink
transactionJSON not transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNe0x1 committed Oct 7, 2024
1 parent ddc773d commit a6f57e9
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 27 deletions.
4 changes: 2 additions & 2 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script crossorigin src="https://cdn.jsdelivr.net/npm/@depay/web3-tokens@10"></script>
<script crossorigin src="https://cdn.jsdelivr.net/npm/@depay/worldcoin-precompiled@0.0.32"></script>
<script crossorigin src="https://cdn.jsdelivr.net/npm/qr-code-styling@1"></script>
<script src="dist/umd/index.js?v=49"></script>
<script src="dist/umd/index.js?v=50"></script>
<style>
.btn-primary {
color: #fff;
Expand All @@ -35,7 +35,7 @@

document.addEventListener("DOMContentLoaded", function() {
window.eruda.init()
console.log('v49')
console.log('v50')
});

window.getNonce = async(address)=>{
Expand Down
14 changes: 9 additions & 5 deletions dist/esm/index.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -6577,11 +6577,15 @@ class Worldapp {
sendTransaction(transaction) {
console.log('sendTransaction', transaction);
transaction = new Transaction(transaction);
console.log('after transaction wrapping transaction.sent', transaction.sent);
console.log('after transaction wrapping transaction.succeeded', transaction.succeeded);
console.log('after transaction wrapping transaction.failed', transaction.failed);

return new Promise(async(resolve, reject)=>{
await transaction.prepare({ wallet: this });
console.log('after prepare transaction', transaction);
transaction.nonce = (await this.transactionCount({ blockchain: 'worldchain', address: transaction.from })).toString();
console.log('transaction', transaction);
console.log('after nonce transaction', transaction);

MiniKit.subscribe(ResponseEvent.MiniAppSendTransaction, (payload)=> {
console.log('payload', payload);
Expand Down Expand Up @@ -6630,10 +6634,10 @@ class Worldapp {
console.log('After fetch', response);
if(response.ok) {
console.log('Before json');
response.json().then((transaction)=>{
console.log('After json', transaction);
if(_optionalChain$1([transaction, 'optionalAccess', _7 => _7.external_id])) {
transaction.id = _optionalChain$1([transaction, 'optionalAccess', _8 => _8.external_id]);
response.json().then((transactionJSON)=>{
console.log('After json', transactionJSON);
if(_optionalChain$1([transactionJSON, 'optionalAccess', _7 => _7.external_id])) {
transaction.id = _optionalChain$1([transactionJSON, 'optionalAccess', _8 => _8.external_id]);
transaction.url = Blockchains['worldchain'].explorerUrlFor({ transaction });
console.log('before transaction.sent', transaction.sent);
if (transaction.sent) { transaction.sent(transaction); }
Expand Down
14 changes: 9 additions & 5 deletions dist/esm/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions dist/umd/index.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -6581,11 +6581,15 @@
sendTransaction(transaction) {
console.log('sendTransaction', transaction);
transaction = new Transaction(transaction);
console.log('after transaction wrapping transaction.sent', transaction.sent);
console.log('after transaction wrapping transaction.succeeded', transaction.succeeded);
console.log('after transaction wrapping transaction.failed', transaction.failed);

return new Promise(async(resolve, reject)=>{
await transaction.prepare({ wallet: this });
console.log('after prepare transaction', transaction);
transaction.nonce = (await this.transactionCount({ blockchain: 'worldchain', address: transaction.from })).toString();
console.log('transaction', transaction);
console.log('after nonce transaction', transaction);

MiniKit.subscribe(ResponseEvent.MiniAppSendTransaction, (payload)=> {
console.log('payload', payload);
Expand Down Expand Up @@ -6634,10 +6638,10 @@
console.log('After fetch', response);
if(response.ok) {
console.log('Before json');
response.json().then((transaction)=>{
console.log('After json', transaction);
if(_optionalChain$1([transaction, 'optionalAccess', _7 => _7.external_id])) {
transaction.id = _optionalChain$1([transaction, 'optionalAccess', _8 => _8.external_id]);
response.json().then((transactionJSON)=>{
console.log('After json', transactionJSON);
if(_optionalChain$1([transactionJSON, 'optionalAccess', _7 => _7.external_id])) {
transaction.id = _optionalChain$1([transactionJSON, 'optionalAccess', _8 => _8.external_id]);
transaction.url = Blockchains__default['default']['worldchain'].explorerUrlFor({ transaction });
console.log('before transaction.sent', transaction.sent);
if (transaction.sent) { transaction.sent(transaction); }
Expand Down
14 changes: 9 additions & 5 deletions dist/umd/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions src/wallets/Worldapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@ export default class Worldapp {
sendTransaction(transaction) {
console.log('sendTransaction', transaction)
transaction = new Transaction(transaction)
console.log('after transaction wrapping transaction.sent', transaction.sent)
console.log('after transaction wrapping transaction.succeeded', transaction.succeeded)
console.log('after transaction wrapping transaction.failed', transaction.failed)

return new Promise(async(resolve, reject)=>{
await transaction.prepare({ wallet: this })
console.log('after prepare transaction', transaction)
transaction.nonce = (await this.transactionCount({ blockchain: 'worldchain', address: transaction.from })).toString()
console.log('transaction', transaction)
console.log('after nonce transaction', transaction)

MiniKit.subscribe(ResponseEvent.MiniAppSendTransaction, (payload)=> {
console.log('payload', payload)
Expand Down Expand Up @@ -95,10 +99,10 @@ export default class Worldapp {
console.log('After fetch', response)
if(response.ok) {
console.log('Before json')
response.json().then((transaction)=>{
console.log('After json', transaction)
if(transaction?.external_id) {
transaction.id = transaction?.external_id
response.json().then((transactionJSON)=>{
console.log('After json', transactionJSON)
if(transactionJSON?.external_id) {
transaction.id = transactionJSON?.external_id
transaction.url = Blockchains['worldchain'].explorerUrlFor({ transaction })
console.log('before transaction.sent', transaction.sent)
if (transaction.sent) { transaction.sent(transaction) }
Expand Down

0 comments on commit a6f57e9

Please sign in to comment.