diff --git a/content/_code-samples/xrpl4j/GetAccountInfo.java b/content/_code-samples/get-started/java/GetAccountInfo.java similarity index 100% rename from content/_code-samples/xrpl4j/GetAccountInfo.java rename to content/_code-samples/get-started/java/GetAccountInfo.java diff --git a/content/_code-samples/get-started/js/get-acct-info.js b/content/_code-samples/get-started/js/get-acct-info.js new file mode 100644 index 0000000000..8c90d5bfe3 --- /dev/null +++ b/content/_code-samples/get-started/js/get-acct-info.js @@ -0,0 +1,39 @@ +// Import the library +const xrpl = require("xrpl") + +// Wrap code in an async function so we can use await +async function main() { + + // Define the network client + const SERVER_URL = "https://s.altnet.rippletest.net:51234/" + const client = new xrpl.Client(SERVER_URL) + await client.connect() + + // Create a wallet and fund it with the Testnet faucet: + const test_wallet = new xrpl.Wallet() // TODO: change to define based on fundWallet result + const fund_result = await client.fundWallet(test_wallet) + console.log(fund_result) + + // Get info from the ledger about the address we just funded + const response = await client.request({ + "command": "account_info", + "account": test_wallet.address, + "ledger_index": "validated" + }) + console.log(response) + + // Listen to ledger close events + client.request({ + "command": "subscribe", + "streams": ["ledger"] + }) + client.on("ledgerClosed", async (ledger) => { + console.log(`Ledger #${ledger.ledger_index} validated with ${ledger.txn_count} transactions!`) + }) + + // Disconnect when done so Node.js can end the process + client.disconnect() +} + +// call the async function +main() diff --git a/content/_code-samples/xrpl-py/get-acct-info.py b/content/_code-samples/get-started/py/get-acct-info.py similarity index 100% rename from content/_code-samples/xrpl-py/get-acct-info.py rename to content/_code-samples/get-started/py/get-acct-info.py diff --git a/content/_code-samples/xrpl-py/prepare-payment.py b/content/_code-samples/get-started/py/prepare-payment.py similarity index 100% rename from content/_code-samples/xrpl-py/prepare-payment.py rename to content/_code-samples/get-started/py/prepare-payment.py diff --git a/content/_code-samples/rippleapi_quickstart/browser-demo.html b/content/_code-samples/rippleapi_quickstart/browser-demo.html deleted file mode 100644 index a2498e2ea3..0000000000 --- a/content/_code-samples/rippleapi_quickstart/browser-demo.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - diff --git a/content/_code-samples/rippleapi_quickstart/eslintrc b/content/_code-samples/rippleapi_quickstart/eslintrc deleted file mode 100644 index 261ca8d83d..0000000000 --- a/content/_code-samples/rippleapi_quickstart/eslintrc +++ /dev/null @@ -1,201 +0,0 @@ -# ESLint documentation can be found at http://eslint.org/docs/ -env: - browser: true - node: true - amd: false - mocha: true - jasmine: false - es6: true -rules: - no-alert: 2 - no-array-constructor: 2 - no-arrow-condition: 0 - no-bitwise: 0 - no-caller: 2 - no-case-declarations: 2 - no-catch-shadow: 2 - no-class-assign: 2 - no-cond-assign: [2, 'always'] - no-console: 0 - no-const-assign: 2 - no-constant-condition: 2 - no-continue: 0 - no-control-regex: 2 - no-debugger: 2 - no-delete-var: 2 - no-div-regex: 0 - no-dupe-class-members: 2 - no-dupe-keys: 2 - no-dupe-args: 2 - no-duplicate-case: 2 - no-else-return: 0 - no-empty: 2 - no-empty-character-class: 2 - no-empty-label: 2 - no-empty-pattern: 2 - no-eq-null: 2 - no-eval: 2 - no-ex-assign: 2 - no-extend-native: 2 - no-extra-bind: 2 - no-extra-boolean-cast: 2 - no-extra-parens: [2, 'functions'] - no-extra-semi: 2 - no-fallthrough: 2 - no-floating-decimal: 0 - no-func-assign: 2 - no-implicit-coercion: 2 - no-implied-eval: 2 - no-inline-comments: 0 - no-inner-declarations: [2, 'functions'] - no-invalid-regexp: 2 - no-invalid-this: 0 # this rule would cause problems with mocha test cases - no-irregular-whitespace: 2 - no-iterator: 2 - no-label-var: 2 - no-labels: 2 - no-lone-blocks: 2 - no-lonely-if: 2 - no-loop-func: 2 - no-mixed-requires: [0, false] - no-mixed-spaces-and-tabs: [2, false] - linebreak-style: [2, 'unix'] - no-multi-spaces: 2 - no-multi-str: 2 - no-multiple-empty-lines: [2, {max: 2}] - no-native-reassign: 2 - no-negated-condition: 0 - no-negated-in-lhs: 2 - no-nested-ternary: 0 - no-new: 2 - no-new-func: 2 - no-new-object: 2 - no-new-require: 0 - no-new-wrappers: 2 - no-obj-calls: 2 - no-octal: 2 - no-octal-escape: 2 - no-param-reassign: 2 - no-path-concat: 0 - no-plusplus: 0 - no-process-env: 0 - no-process-exit: 0 - no-proto: 2 - no-redeclare: 2 - no-regex-spaces: 2 - no-restricted-modules: 0 - no-restricted-syntax: 0 - no-return-assign: 2 - no-script-url: 2 - no-self-compare: 2 - no-sequences: 2 - no-shadow: 2 - no-shadow-restricted-names: 2 - no-spaced-func: 2 - no-sparse-arrays: 2 - no-sync: 0 - no-ternary: 0 - no-trailing-spaces: 2 - no-this-before-super: 2 - no-throw-literal: 2 - no-undef: 2 - no-undef-init: 2 - no-undefined: 0 - no-unexpected-multiline: 2 - no-underscore-dangle: 0 - no-unneeded-ternary: 0 - no-unreachable: 2 - no-unused-expressions: 2 - no-unused-vars: [2, {vars: 'all', args: 'all'}] - no-use-before-define: 2 - no-useless-call: 2 - no-useless-concat: 0 - no-void: 2 - no-var: 2 - no-warning-comments: [0, {terms: ['todo', 'fixme', 'xxx'], location: 'start'}] - no-with: 2 - no-magic-numbers: 0 - - array-bracket-spacing: [2, 'never'] - arrow-body-style: 0 - arrow-parens: [2, 'as-needed'] - arrow-spacing: 2 - accessor-pairs: 2 - block-scoped-var: 2 - block-spacing: 2 - brace-style: 2 - callback-return: 0 - camelcase: 0 - comma-dangle: 2 - comma-spacing: 2 - comma-style: 2 - complexity: [0, 11] - computed-property-spacing: 2 - consistent-return: 2 - consistent-this: [2, 'self'] - constructor-super: 2 - curly: [2, 'all'] - default-case: 0 - dot-location: [2, 'property'] - dot-notation: [2, {allowKeywords: true}] - eol-last: 2 - eqeqeq: 2 - func-names: 0 - func-style: [2, 'declaration'] - generator-star-spacing: 2 - global-require: 0 - guard-for-in: 0 - handle-callback-err: 2 - id-length: 0 - indent: [2, 2, {SwitchCase: 1}] - init-declarations: 0 - jsx-quotes: 0 - key-spacing: [2, {beforeColon: false, afterColon: true}] - lines-around-comment: 0 - max-depth: [0, 4] - max-len: [2, 80] - max-nested-callbacks: [0, 2] - max-params: [0, 4] - max-statements: [0, 10] - new-cap: 2 - new-parens: 2 - newline-after-var: 0 - object-curly-spacing: [2, 'never'] - object-shorthand: 0 - one-var: [2, 'never'] - operator-assignment: [0, 'always'] - operator-linebreak: 0 - padded-blocks: 0 - prefer-arrow-callback: 0 - prefer-const: 2 - prefer-spread: 2 - prefer-reflect: 0 - prefer-template: 0 - quote-props: 0 - quotes: [2, 'single'] - radix: 2 - id-match: 0 - require-jsdoc: 0 - require-yield: 0 - semi: 2 - semi-spacing: 2 - sort-vars: 0 - space-after-keywords: 2 - space-before-keywords: 2 - space-before-blocks: 2 - space-before-function-paren: [2, 'never'] - space-in-parens: 2 - space-infix-ops: 2 - space-return-throw-case: 2 - space-unary-ops: [2, {words: true, nonwords: false}] - spaced-comment: 2 - strict: [2, 'global'] - use-isnan: 2 - valid-jsdoc: 2 - valid-typeof: 2 - vars-on-top: 0 - wrap-iife: 0 - wrap-regex: 0 - yoda: [2, 'never'] -ecmaFeatures: - jsx: true diff --git a/content/_code-samples/rippleapi_quickstart/get-account-info.js b/content/_code-samples/rippleapi_quickstart/get-account-info.js deleted file mode 100644 index 22e61add29..0000000000 --- a/content/_code-samples/rippleapi_quickstart/get-account-info.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; -const RippleAPI = require('ripple-lib').RippleAPI; - -const api = new RippleAPI({ - server: 'wss://s1.ripple.com' // Public rippled server -}); -api.connect().then(() => { - /* begin custom code ------------------------------------ */ - const myAddress = 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn'; - - console.log('getting account info for', myAddress); - return api.getAccountInfo(myAddress); - -}).then(info => { - console.log(info); - console.log('getAccountInfo done'); - - /* end custom code -------------------------------------- */ -}).then(() => { - return api.disconnect(); -}).then(() => { - console.log('done and disconnected.'); -}).catch(console.error); diff --git a/content/_code-samples/rippleapi_quickstart/package.json b/content/_code-samples/rippleapi_quickstart/package.json deleted file mode 100644 index a5511207a1..0000000000 --- a/content/_code-samples/rippleapi_quickstart/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "my_ripple_experiment", - "version": "0.0.1", - "license": "MIT", - "private": true, - "//": "Change the license to something appropriate. You may want to use 'UNLICENSED' if you are just starting out.", - "dependencies": { - "ripple-lib": "*" - }, - "devDependencies": { - "eslint": "*" - } -} diff --git a/content/_code-samples/rippleapi_quickstart/ripple-0.17.7-min.js b/content/_code-samples/rippleapi_quickstart/ripple-0.17.7-min.js deleted file mode 100644 index bff5b5a3de..0000000000 --- a/content/_code-samples/rippleapi_quickstart/ripple-0.17.7-min.js +++ /dev/null @@ -1,23 +0,0 @@ -var ripple=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";e.exports={RippleAPI:n(1).RippleAPI,RippleAPIBroadcast:n(655).RippleAPIBroadcast}},function(e,t,n){(function(t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var n=0;nthis._ledgerVersion)?Promise.reject(new V.LedgerVersionError("ledgerVersion "+r+" is greater than server's most recent validated ledger: "+this._ledgerVersion)):a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"request",this).call(this,e,n)}}]),t}(u.Connection),W=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,t),u.validate.apiOptions(e);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));n._feeCushion=e.feeCushion||1.2;var o=e.server;return void 0!==o?(n.connection=new J(o,e),n.connection.on("ledgerClosed",function(e){n.emit("ledger",f.formatLedgerClose(e))}),n.connection.on("error",function(e,t,r){n.emit("error",e,t,r)}),n.connection.on("connected",function(){n.emit("connected")}),n.connection.on("disconnected",function(e){n.emit("disconnected",e)})):n.connection=new J(null,e),n}return o(t,e),t}(c);_.assign(W.prototype,{connect:h,disconnect:d,isConnected:m,getServerInfo:l,getFee:p,getLedgerVersion:g,getTransaction:v,getTransactions:y,getTrustlines:b,getBalances:w,getBalanceSheet:S,getPaths:x,getOrders:E,getOrderbook:A,getSettings:T,getAccountInfo:M,getPaymentChannel:P,getLedger:G,preparePayment:I,prepareTrustline:O,prepareOrder:R,prepareOrderCancellation:k,prepareEscrowCreation:N,prepareEscrowExecution:C,prepareEscrowCancellation:F,preparePaymentChannelCreate:L,preparePaymentChannelFund:B,preparePaymentChannelClaim:j,prepareSettings:q,sign:D,combine:z,submit:U,generateAddress:$,computeLedgerHash:H,signPaymentChannelClaim:X,verifyPaymentChannelClaim:K,errors:V}),W._PRIVATE={validate:u.validate,RangeSet:n(412).RangeSet,ledgerUtils:n(541),schemaValidator:n(434)},e.exports={RippleAPI:W}}).call(t,function(){return this}())},function(e,t,n){(function(e){"use strict";function t(e,t,n){e[t]||Object[r](e,t,{writable:!0,configurable:!0,value:n})}if(n(3),n(295),n(297),e._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");e._babelPolyfill=!0;var r="defineProperty";t(String.prototype,"padLeft","".padStart),t(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function(e){[][e]&&t(Array,e,Function.call.bind([][e]))})}).call(t,function(){return this}())},function(e,t,n){n(4),n(53),n(54),n(55),n(56),n(58),n(61),n(62),n(63),n(64),n(65),n(66),n(67),n(68),n(69),n(71),n(73),n(75),n(77),n(80),n(81),n(82),n(86),n(88),n(90),n(94),n(95),n(96),n(97),n(99),n(100),n(101),n(102),n(103),n(104),n(105),n(107),n(108),n(109),n(111),n(112),n(113),n(115),n(116),n(117),n(118),n(119),n(120),n(121),n(122),n(123),n(124),n(125),n(126),n(127),n(128),n(133),n(134),n(138),n(139),n(140),n(141),n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(154),n(155),n(156),n(157),n(158),n(159),n(161),n(162),n(168),n(169),n(171),n(172),n(173),n(177),n(178),n(179),n(180),n(181),n(183),n(184),n(185),n(186),n(189),n(191),n(192),n(193),n(195),n(197),n(199),n(200),n(201),n(203),n(204),n(205),n(206),n(212),n(215),n(216),n(218),n(219),n(222),n(223),n(226),n(227),n(228),n(229),n(230),n(231),n(232),n(233),n(234),n(235),n(236),n(237),n(238),n(239),n(240),n(241),n(242),n(243),n(244),n(246),n(247),n(248),n(249),n(250),n(251),n(253),n(254),n(255),n(256),n(257),n(258),n(259),n(260),n(262),n(263),n(265),n(266),n(267),n(268),n(271),n(272),n(273),n(274),n(275),n(276),n(277),n(278),n(280),n(281),n(282),n(283),n(284),n(285),n(286),n(287),n(288),n(289),n(290),n(293),n(294),e.exports=n(10)},function(e,t,n){"use strict";var r=n(5),i=n(6),o=n(7),s=n(9),a=n(19),c=n(23).KEY,u=n(8),f=n(24),h=n(25),d=n(20),l=n(26),p=n(27),m=n(28),g=n(30),v=n(43),y=n(46),b=n(13),w=n(33),S=n(17),x=n(18),E=n(47),A=n(50),T=n(52),M=n(12),P=n(31),I=T.f,O=M.f,R=A.f,k=r.Symbol,N=r.JSON,C=N&&N.stringify,F="prototype",L=l("_hidden"),B=l("toPrimitive"),j={}.propertyIsEnumerable,q=f("symbol-registry"),D=f("symbols"),z=f("op-symbols"),U=Object[F],V="function"==typeof k,$=r.QObject,H=!$||!$[F]||!$[F].findChild,X=o&&u(function(){return 7!=E(O({},"a",{get:function(){return O(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=I(U,t);r&&delete U[t],O(e,t,n),r&&e!==U&&O(U,t,r)}:O,K=function(e){var t=D[e]=E(k[F]);return t._k=e,t},G=V&&"symbol"==typeof k.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof k},J=function(e,t,n){return e===U&&J(z,t,n),b(e),t=S(t,!0),b(n),i(D,t)?(n.enumerable?(i(e,L)&&e[L][t]&&(e[L][t]=!1),n=E(n,{enumerable:x(0,!1)})):(i(e,L)||O(e,L,x(1,{})),e[L][t]=!0),X(e,t,n)):O(e,t,n)},W=function(e,t){b(e);for(var n,r=v(t=w(t)),i=0,o=r.length;o>i;)J(e,n=r[i++],t[n]);return e},Y=function(e,t){return void 0===t?E(e):W(E(e),t)},Z=function(e){var t=j.call(this,e=S(e,!0));return!(this===U&&i(D,e)&&!i(z,e))&&(!(t||!i(this,e)||!i(D,e)||i(this,L)&&this[L][e])||t)},Q=function(e,t){if(e=w(e),t=S(t,!0),e!==U||!i(D,t)||i(z,t)){var n=I(e,t);return!n||!i(D,t)||i(e,L)&&e[L][t]||(n.enumerable=!0),n}},ee=function(e){for(var t,n=R(w(e)),r=[],o=0;n.length>o;)i(D,t=n[o++])||t==L||t==c||r.push(t);return r},te=function(e){for(var t,n=e===U,r=R(n?z:w(e)),o=[],s=0;r.length>s;)!i(D,t=r[s++])||n&&!i(U,t)||o.push(D[t]);return o};V||(k=function(){if(this instanceof k)throw TypeError("Symbol is not a constructor!");var e=d(arguments.length>0?arguments[0]:void 0),t=function(n){this===U&&t.call(z,n),i(this,L)&&i(this[L],e)&&(this[L][e]=!1),X(this,e,x(1,n))};return o&&H&&X(U,e,{configurable:!0,set:t}),K(e)},a(k[F],"toString",function(){return this._k}),T.f=Q,M.f=J,n(51).f=A.f=ee,n(45).f=Z,n(44).f=te,o&&!n(29)&&a(U,"propertyIsEnumerable",Z,!0),p.f=function(e){return K(l(e))}),s(s.G+s.W+s.F*!V,{Symbol:k});for(var ne="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;ne.length>re;)l(ne[re++]);for(var ne=P(l.store),re=0;ne.length>re;)m(ne[re++]);s(s.S+s.F*!V,"Symbol",{"for":function(e){return i(q,e+="")?q[e]:q[e]=k(e)},keyFor:function(e){if(G(e))return g(q,e);throw TypeError(e+" is not a symbol!")},useSetter:function(){H=!0},useSimple:function(){H=!1}}),s(s.S+s.F*!V,"Object",{create:Y,defineProperty:J,defineProperties:W,getOwnPropertyDescriptor:Q,getOwnPropertyNames:ee,getOwnPropertySymbols:te}),N&&s(s.S+s.F*(!V||u(function(){var e=k();return"[null]"!=C([e])||"{}"!=C({a:e})||"{}"!=C(Object(e))})),"JSON",{stringify:function(e){if(void 0!==e&&!G(e)){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);return t=r[1],"function"==typeof t&&(n=t),!n&&y(t)||(t=function(e,t){if(n&&(t=n.call(this,e,t)),!G(t))return t}),r[1]=t,C.apply(N,r)}}}),k[F][B]||n(11)(k[F],B,k[F].valueOf),h(k,"Symbol"),h(Math,"Math",!0),h(r.JSON,"JSON",!0)},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){e.exports=!n(8)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t,n){var r=n(5),i=n(10),o=n(11),s=n(19),a=n(21),c="prototype",u=function(e,t,n){var f,h,d,l,p=e&u.F,m=e&u.G,g=e&u.S,v=e&u.P,y=e&u.B,b=m?r:g?r[t]||(r[t]={}):(r[t]||{})[c],w=m?i:i[t]||(i[t]={}),S=w[c]||(w[c]={});m&&(n=t);for(f in n)h=!p&&b&&void 0!==b[f],d=(h?b:n)[f],l=y&&h?a(d,r):v&&"function"==typeof d?a(Function.call,d):d,b&&s(b,f,d,e&u.U),w[f]!=d&&o(w,f,l),v&&S[f]!=d&&(S[f]=d)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t){var n=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(12),i=n(18);e.exports=n(7)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(13),i=n(15),o=n(17),s=Object.defineProperty;t.f=n(7)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return s(e,t,n)}catch(a){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(14);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports=!n(7)&&!n(8)(function(){return 7!=Object.defineProperty(n(16)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(14),i=n(5).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){var r=n(14);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(5),i=n(11),o=n(6),s=n(20)("src"),a="toString",c=Function[a],u=(""+c).split(a);n(10).inspectSource=function(e){return c.call(e)},(e.exports=function(e,t,n,a){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(c&&(o(n,s)||i(n,s,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:a?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,a,function(){return"function"==typeof this&&this[s]||c.call(this)})},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(22);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(20)("meta"),i=n(14),o=n(6),s=n(12).f,a=0,c=Object.isExtensible||function(){return!0},u=!n(8)(function(){return c(Object.preventExtensions({}))}),f=function(e){s(e,r,{value:{i:"O"+ ++a,w:{}}})},h=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!c(e))return"F";if(!t)return"E";f(e)}return e[r].i},d=function(e,t){if(!o(e,r)){if(!c(e))return!0;if(!t)return!1;f(e)}return e[r].w},l=function(e){return u&&p.NEED&&c(e)&&!o(e,r)&&f(e),e},p=e.exports={KEY:r,NEED:!1,fastKey:h,getWeak:d,onFreeze:l}},function(e,t,n){var r=n(5),i="__core-js_shared__",o=r[i]||(r[i]={});e.exports=function(e){return o[e]||(o[e]={})}},function(e,t,n){var r=n(12).f,i=n(6),o=n(26)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(24)("wks"),i=n(20),o=n(5).Symbol,s="function"==typeof o,a=e.exports=function(e){return r[e]||(r[e]=s&&o[e]||(s?o:i)("Symbol."+e))};a.store=r},function(e,t,n){t.f=n(26)},function(e,t,n){var r=n(5),i=n(10),o=n(29),s=n(27),a=n(12).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:s.f(e)})}},function(e,t){e.exports=!1},function(e,t,n){var r=n(31),i=n(33);e.exports=function(e,t){for(var n,o=i(e),s=r(o),a=s.length,c=0;a>c;)if(o[n=s[c++]]===t)return n}},function(e,t,n){var r=n(32),i=n(42);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(6),i=n(33),o=n(37)(!1),s=n(41)("IE_PROTO");e.exports=function(e,t){var n,a=i(e),c=0,u=[];for(n in a)n!=s&&r(a,n)&&u.push(n);for(;t.length>c;)r(a,n=t[c++])&&(~o(u,n)||u.push(n));return u}},function(e,t,n){var r=n(34),i=n(36);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(35);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(33),i=n(38),o=n(40);e.exports=function(e){return function(t,n,s){var a,c=r(t),u=i(c.length),f=o(s,u);if(e&&n!=n){for(;u>f;)if(a=c[f++],a!=a)return!0}else for(;u>f;f++)if((e||f in c)&&c[f]===n)return e||f||0;return!e&&-1}}},function(e,t,n){var r=n(39),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(39),i=Math.max,o=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(24)("keys"),i=n(20);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(31),i=n(44),o=n(45);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var s,a=n(e),c=o.f,u=0;a.length>u;)c.call(e,s=a[u++])&&t.push(s);return t}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(35);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(13),i=n(48),o=n(42),s=n(41)("IE_PROTO"),a=function(){},c="prototype",u=function(){var e,t=n(16)("iframe"),r=o.length,i=">";for(t.style.display="none",n(49).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(" -``` - -_jsDelivr_ - -```html - -``` - - - -Instead of using Node.js's "require" syntax, the browser version creates a global variable named `ripple`, which contains the `RippleAPI` class. - - - - -## Build a Browser-Compatible Version of RippleAPI - -You can also build a browser-compatible version of the code yourself. Use the following steps to build it from the source code. - - -### 1. Download a copy of the RippleAPI git repository - -If you have [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) installed, you can clone the repository and check out the **master** branch, which always has the latest official release: - -``` -git clone https://github.com/XRPLF/xrpl.js.git -cd ripple-lib -git checkout master -``` - -Alternatively, you can download an archive (`.zip` or `.tar.gz`) of a specific release from the [RippleAPI releases page](https://github.com/XRPLF/xrpl.js/releases) and extract it. - - -### 2. Install Yarn - -Use these instructions to [install Yarn](#install-yarn). - - -### 3. Install dependencies using Yarn - -``` -yarn -``` - - -### 4. Build with Yarn - -RippleAPI comes with the necessary dependencies and code to build it for the browser. Trigger the build script as follows: - -```sh -yarn run build -``` - -Output: - -```text -yarn run v1.22.4 -$ yarn build:schemas && yarn build:lib && yarn build:web -$ mkdir -p dist/npm/common && cp -r src/common/schemas dist/npm/common/ -$ tsc --build -$ webpack -Done in 10.29s. -``` - -This may take a while. At the end, the build process creates a new `build/` folder, which contains the files you want. - -The file `build/ripple-latest.js` is a direct export of RippleAPI (whatever version you built) ready to be used in browsers. The file ending in `build/ripple-latest-min.js` is the same thing, but with the content [minified](https://en.wikipedia.org/wiki/Minification_%28programming%29) for faster loading. - - - -## Demo RippleAPI in a Browser - -The following HTML file demonstrates basic usage of the browser version of RippleAPI to connect to a public `rippled` server and report information about that server. - -[**`browser-demo.html`**](https://github.com/XRPLF/xrpl-dev-portal/blob/master/content/_code-samples/rippleapi_quickstart/browser-demo.html "Source on GitHub") - -``` -{% include '_code-samples/rippleapi_quickstart/browser-demo.html' %} -``` - - - -You can also see and edit a similar, live browser demo on the [Get Started](get-started.html) page. +* [Send XRP](send-xrp.html). +* [Issue a Fungible Token](issue-a-fungible-token.html) +* [Set up secure signing](set-up-secure-signing.html) for your account. ## See Also - **Concepts:** - [XRP Ledger Overview](xrp-ledger-overview.html) - - [Software Ecosystem](software-ecosystem.html) + - [Client Libraries](client-libraries.html) - **Tutorials:** - [Send XRP](send-xrp.html) - **References:** - - [RippleAPI Reference](rippleapi-reference.html) - - [rippled API Conventions](api-conventions.html) + - [xrpl.js Reference](TODO: final link for new reference docs) + - [Public API Methods](public-rippled-methods.html) + - [API Conventions](api-conventions.html) - [base58 Encodings](base58-encodings.html) - - [rippled Transaction Formats](transaction-formats.html) + - [Transaction Formats](transaction-formats.html) + + +{% include '_snippets/rippled-api-links.md' %} +{% include '_snippets/tx-type-links.md' %} +{% include '_snippets/rippled_versions.md' %} diff --git a/content/tutorials/get-started/get-started-using-python.md b/content/tutorials/get-started/get-started-using-python.md index e8d7c7729c..e1641e0f85 100644 --- a/content/tutorials/get-started/get-started-using-python.md +++ b/content/tutorials/get-started/get-started-using-python.md @@ -59,7 +59,7 @@ Here are the basic steps you'll need to cover for almost any XRP Ledger project: To make queries and submit transactions, you need to establish a connection to the XRP Ledger. To do this with `xrpl-py`, use the [`xrp.clients` module](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.clients.html): -{{ include_code("_code-samples/xrpl-py/get-acct-info.py", start_with="# Define the network client", end_before="# Create a wallet using the testnet faucet:", language="py") }} +{{ include_code("_code-samples/get-started/py/get-acct-info.py", start_with="# Define the network client", end_before="# Create a wallet using the testnet faucet:", language="py") }} #### Connect to the production XRP Ledger @@ -92,7 +92,7 @@ To make it easy to create a wallet on the Testnet, `xrpl-py` provides the [`gene -{{ include_code("_code-samples/xrpl-py/get-acct-info.py", start_with="# Create a wallet using the testnet faucet:", end_before="# Create an account str from the wallet", language="py") }} +{{ include_code("_code-samples/get-started/py/get-acct-info.py", start_with="# Create a wallet using the testnet faucet:", end_before="# Create an account str from the wallet", language="py") }} This method returns a [`Wallet` instance](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.wallet.html#xrpl.wallet.Wallet): @@ -115,7 +115,7 @@ In this tutorial we only query details about the generated account from the XRP To prepare the transaction: -{{ include_code("_code-samples/xrpl-py/prepare-payment.py", start_with="# Prepare payment", end_before="# print prepared payment", language="py") }} +{{ include_code("_code-samples/get-started/py/prepare-payment.py", start_with="# Prepare payment", end_before="# print prepared payment", language="py") }} @@ -123,7 +123,7 @@ To prepare the transaction: To sign the transaction: -{{ include_code("_code-samples/xrpl-py/prepare-payment.py", start_with="# Sign the transaction", end_before="# Print signed tx", language="py") }} +{{ include_code("_code-samples/get-started/py/prepare-payment.py", start_with="# Sign the transaction", end_before="# Print signed tx", language="py") }} @@ -131,14 +131,14 @@ To sign the transaction: To send the transaction: -{{ include_code("_code-samples/xrpl-py/prepare-payment.py", start_with="# Submit and send the transaction", end_before="# Print tx response", language="py") }} +{{ include_code("_code-samples/get-started/py/prepare-payment.py", start_with="# Submit and send the transaction", end_before="# Print tx response", language="py") }} ##### Derive an X-address You can use `xrpl-py`'s [`xrpl.core.addresscodec`](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.core.addresscodec.html) module to derive an [X-address](https://xrpaddress.info/) from the `Wallet.classic_address` field: -{{ include_code("_code-samples/xrpl-py/get-acct-info.py", start_with="# Derive an x-address from the classic address:", end_before="# Look up info about your account", language="py") }} +{{ include_code("_code-samples/get-started/py/get-acct-info.py", start_with="# Derive an x-address from the classic address:", end_before="# Look up info about your account", language="py") }} The X-address format [packs the address and destination tag](https://github.com/XRPLF/XRPL-Standards/issues/6) into a more user-friendly value. @@ -150,7 +150,7 @@ You can query the XRP Ledger to get information about [a specific account](accou Here, we'll use `xrpl-py`'s [`xrpl.account`](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.account.html) module to look up information about the [wallet we generated](#2-generate-wallet) in the previous step. -{{ include_code("_code-samples/xrpl-py/get-acct-info.py", start_with="# Look up info about your account", language="py") }} +{{ include_code("_code-samples/get-started/py/get-acct-info.py", start_with="# Look up info about your account", language="py") }} @@ -164,7 +164,7 @@ Using these building blocks, we can create a simple Python app that: ```python -{% include '_code-samples/xrpl-py/get-acct-info.py' %} +{% include '_code-samples/get-started/py/get-acct-info.py' %} ``` To run the app, you can copy and paste the code into an editor or IDE and run it from there. Or you could download the file from the [XRP Ledger Dev Portal repo](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/xrpl-py) and run it locally: @@ -172,7 +172,7 @@ To run the app, you can copy and paste the code into an editor or IDE and run it ```sh git clone git@github.com:XRPLF/xrpl-dev-portal.git -cd xrpl-dev-portal/content/_code-samples/xrpl-py/get-acct-info.py +cd xrpl-dev-portal/content/_code-samples/get-started/py/get-acct-info.py python3 get-acct-info.py ```